Add ksoloti
This commit is contained in:
parent
aef0a15dc8
commit
f632cd79ae
6 changed files with 129 additions and 2 deletions
|
|
@ -2,12 +2,15 @@
|
|||
|
||||
final: prev:
|
||||
let
|
||||
inherit (prev) callPackage system;
|
||||
inherit (prev) callPackage system pkgsCross darwin;
|
||||
poetry2nix = callPackage inputs.poetry2nix { };
|
||||
in
|
||||
{
|
||||
ariang = callPackage ./ariang { };
|
||||
asterisk-sounds-de = callPackage ./asterisk-sounds-de { };
|
||||
ksoloti = callPackage ./ksoloti {
|
||||
gcc-arm-embedded = pkgsCross.arm-embedded.buildPackages.gcc;
|
||||
};
|
||||
docker-machine-driver-hetzner = callPackage ./docker-machine-driver-hetzner {
|
||||
inherit (inputs.gomod2nix.legacyPackages.${system}) buildGoApplication;
|
||||
};
|
||||
|
|
|
|||
110
pkgs/ksoloti/default.nix
Normal file
110
pkgs/ksoloti/default.nix
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
{ lib
|
||||
, pkgs
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, gnumake
|
||||
, gcc-arm-embedded
|
||||
, jdk
|
||||
, libfaketime
|
||||
, ant
|
||||
, makeWrapper
|
||||
, dfu-util
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "1.1.0beta";
|
||||
pname = "ksoloti";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ksoloti";
|
||||
repo = "ksoloti";
|
||||
rev = version;
|
||||
sha256 = "sha256-RRwar0X2gI0LyM/pNhnlLet06MzrG4z4lm3kCmzWwBc=";
|
||||
};
|
||||
|
||||
buildInputs = [ jdk libfaketime ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
ant
|
||||
gcc-arm-embedded
|
||||
gnumake
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
dfu-util
|
||||
gcc-arm-embedded
|
||||
];
|
||||
|
||||
/*
|
||||
# Hardcode dfu-util path
|
||||
substituteInPlace "platform_linux/upload_fw_dfu.sh" \
|
||||
--replace-fail "/bin/dfu-util" ""
|
||||
substituteInPlace "platform_linux/upload_fw_dfu.sh" \
|
||||
--replace-fail "./dfu-util" "${dfu-util-ksoloti}/bin/dfu-util"
|
||||
|
||||
*/
|
||||
patchPhase = ''
|
||||
# Hardcode path to "make"
|
||||
for f in "firmware/compile_firmware_linux.sh" \
|
||||
"firmware/compile_patch_linux.sh"; do
|
||||
substituteInPlace "$f" \
|
||||
--replace "make" "${gnumake}/bin/make"
|
||||
done
|
||||
|
||||
# Fix build version
|
||||
substituteInPlace "build.xml" \
|
||||
--replace-fail "(git missing)" "${version}"
|
||||
# Remove build time
|
||||
substituteInPlace "build.xml" \
|
||||
--replace-fail "<tstamp>" ""
|
||||
substituteInPlace "build.xml" \
|
||||
--replace-fail \
|
||||
'<format property="build.time" pattern="d MMM yyyy, HH:mm:ss"/>' \
|
||||
'<property name="build.time" value=""/>'
|
||||
substituteInPlace "build.xml" \
|
||||
--replace-fail "</tstamp>" ""
|
||||
substituteInPlace "build.xml" \
|
||||
--replace-fail \
|
||||
'{line.separator}</echo>' \
|
||||
'{line.separator}</echo> <touch file="src/main/java/axoloti/Version.java" millis="0" />'
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
(
|
||||
find . -exec touch -d '1970-01-01 00:00' {} \;
|
||||
(cd platform_linux; PATH="${pkgs.gcc-arm-embedded}/bin:$PATH" sh compile_firmware.sh BOARD_AXOLOTI_CORE)
|
||||
faketime "1970-01-01 00:00:00" ant -Dbuild.runtime=true
|
||||
)
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin $out/share/ksoloti
|
||||
|
||||
cp -r doc firmware chibios platform_linux CMSIS *.txt $out/share/ksoloti/
|
||||
install -vD dist/Ksoloti.jar $out/share/ksoloti/
|
||||
|
||||
patchShebangs $out/share/ksoloti/platform_linux/*.sh
|
||||
|
||||
rm $out/share/ksoloti/platform_linux/bin/dfu-util
|
||||
ln -s ${dfu-util}/bin/dfu-util $out/share/ksoloti/platform_linux/bin/dfu-util
|
||||
|
||||
makeWrapper ${jdk}/bin/java $out/bin/ksoloti --add-flags "-Dksoloti_release=$out/share/ksoloti -Dksoloti_runtime=$out/share/ksoloti -jar $out/share/ksoloti/Ksoloti.jar" --prefix PATH : ${
|
||||
lib.makeBinPath [
|
||||
pkgs.gcc-arm-embedded
|
||||
]
|
||||
}
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "http://ksoloti.github.io";
|
||||
description = ''
|
||||
Sketching embedded digital audio algorithms.
|
||||
|
||||
To fix permissions of the Ksoloti USB device node, add a similar udev rule to <literal>services.udev.extraRules</literal>:
|
||||
<literal>SUBSYSTEM=="usb", ATTR{idVendor}=="16c0", ATTR{idProduct}=="0442", OWNER="someuser", GROUP="somegroup"</literal>
|
||||
'';
|
||||
license = licenses.gpl3;
|
||||
maintainers = with maintainers; [ ];
|
||||
};
|
||||
}
|
||||
5
pkgs/ksoloti/module.nix
Normal file
5
pkgs/ksoloti/module.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
services.udev.extraRules = ''
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="16c0", ATTR{idProduct}=="0442", OWNER="jalr", GROUP="users"
|
||||
'';
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
{
|
||||
imports = [
|
||||
./asterisk-sounds-de/module.nix
|
||||
./ksoloti/module.nix
|
||||
./myintercom-doorbell/module.nix
|
||||
./pretix-banktool/module.nix
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue