git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #30086 from TealG/axoloti-1.0.12

axoloti: init at 1.0.12-1

commitf9991c909499f98d69b22cadffd39336b29118ad authorJörg Thalheim <Mic92@users.noreply.github.com> dateWed 4 Oct 2017, 16:19 (9 years ago) parent407b79ded35c07
5 files changed+178
lib/maintainers.nix+1 pkgs/applications/audio/axoloti/default.nix+101 pkgs/applications/audio/axoloti/dfu-util.nix+31 pkgs/applications/audio/axoloti/libusb1.nix+38 pkgs/top-level/all-packages.nix+7
lib/maintainers.nix+1
@@ -591,6 +591,7 @@
591591 taku0 = "Takuo Yonezawa <mxxouy6x3m_github@tatapa.org>";
592592 tari = "Peter Marheine <peter@taricorp.net>";
593593 tavyc = "Octavian Cerna <octavian.cerna@gmail.com>";
594+ TealG = "Teal Gaure <~@Teal.Gr>";
594595 teh = "Tom Hunger <tehunger@gmail.com>";
595596 telotortium = "Robert Irelan <rirelan@gmail.com>";
596597 teto = "Matthieu Coudron <mcoudron@hotmail.com>";
pkgs/applications/audio/axoloti/default.nixnew file+101
@@ -0,0 +1,101 @@
1+{ stdenv, fetchFromGitHub, fetchurl, makeWrapper, unzip
2+, gnumake, gcc-arm-embedded, dfu-util-axoloti, jdk, ant, libfaketime }:
3+
4+stdenv.mkDerivation rec {
5+ version = "1.0.12-1";
6+ name = "axoloti-${version}";
7+
8+ src = fetchFromGitHub {
9+ owner = "axoloti";
10+ repo = "axoloti";
11+ rev = "${version}";
12+ sha256 = "13njmv8zac0kaaxgkv4y4zfjcclafn9cw0m8lj2k4926wnwjmf50";
13+ };
14+
15+ chibi_version = "2.6.9";
16+ chibi_name = "ChibiOS_${chibi_version}";
17+
18+ chibios = fetchurl {
19+ url = "mirror://sourceforge/project/chibios/ChibiOS_RT%20stable/Version%20${chibi_version}/${chibi_name}.zip";
20+ sha256 = "0lb5s8pkj80mqhsy47mmq0lqk34s2a2m3xagzihalvabwd0frhlj";
21+ };
22+
23+ buildInputs = [ makeWrapper unzip gcc-arm-embedded dfu-util-axoloti jdk ant libfaketime ];
24+
25+ patchPhase = ''
26+ unzip ${chibios}
27+ mv ${chibi_name} chibios
28+ (cd chibios/ext; unzip -q -o fatfs-0.9-patched.zip)
29+
30+ # Remove source of non-determinism in ChibiOS
31+ substituteInPlace "chibios/os/various/shell.c" \
32+ --replace "#ifdef __DATE__" "#if 0"
33+
34+ # Hardcode full path to compiler tools
35+ for f in "firmware/Makefile.patch" \
36+ "firmware/Makefile" \
37+ "firmware/flasher/Makefile" \
38+ "firmware/mounter/Makefile"; do
39+ substituteInPlace "$f" \
40+ --replace "arm-none-eabi-" "${gcc-arm-embedded}/bin/arm-none-eabi-"
41+ done
42+
43+ # Hardcode path to "make"
44+ for f in "firmware/compile_firmware_linux.sh" \
45+ "firmware/compile_patch_linux.sh"; do
46+ substituteInPlace "$f" \
47+ --replace "make" "${gnumake}/bin/make"
48+ done
49+
50+ # Hardcode dfu-util path
51+ substituteInPlace "platform_linux/upload_fw_dfu.sh" \
52+ --replace "/bin/dfu-util" ""
53+ substituteInPlace "platform_linux/upload_fw_dfu.sh" \
54+ --replace "./dfu-util" "${dfu-util-axoloti}/bin/dfu-util"
55+
56+ # Fix build version
57+ substituteInPlace "build.xml" \
58+ --replace "(git missing)" "${version}"
59+
60+ # Remove build time
61+ substituteInPlace "build.xml" \
62+ --replace "<tstamp>" ""
63+ substituteInPlace "build.xml" \
64+ --replace \
65+ '<format property="build.time" pattern="dd/MM/yyyy HH:mm:ss z"/>' \
66+ '<property name="build.time" value=""/>'
67+ substituteInPlace "build.xml" \
68+ --replace "</tstamp>" ""
69+ substituteInPlace "build.xml" \
70+ --replace \
71+ '{line.separator}</echo>' \
72+ '{line.separator}</echo> <touch file="src/main/java/axoloti/Version.java" millis="0" />'
73+ '';
74+
75+ buildPhase = ''
76+ find . -exec touch -d '1970-01-01 00:00' {} \;
77+ (cd platform_linux; sh compile_firmware.sh)
78+ faketime "1970-01-01 00:00:00" ant -Dbuild.runtime=true
79+ '';
80+
81+ installPhase = ''
82+ mkdir -p $out/bin $out/share/axoloti
83+
84+ cp -r doc firmware chibios platform_linux CMSIS *.txt $out/share/axoloti/
85+ install -vD dist/Axoloti.jar $out/share/axoloti/
86+
87+ makeWrapper ${jdk}/bin/java $out/bin/axoloti --add-flags "-Daxoloti_release=$out/share/axoloti -Daxoloti_runtime=$out/share/axoloti -jar $out/share/axoloti/Axoloti.jar"
88+ '';
89+
90+ meta = with stdenv.lib; {
91+ homepage = http://www.axoloti.com;
92+ description = ''
93+ Sketching embedded digital audio algorithms.
94+
95+ To fix permissions of the Axoloti USB device node, add a similar udev rule to <literal>services.udev.extraRules</literal>:
96+ <literal>SUBSYSTEM=="usb", ATTR{idVendor}=="16c0", ATTR{idProduct}=="0442", OWNER="someuser", GROUP="somegroup"</literal>
97+ '';
98+ license = licenses.gpl3;
99+ maintainers = with lib.maintainers; [ TealG ];
100+ };
101+}
pkgs/applications/audio/axoloti/dfu-util.nixnew file+31
@@ -0,0 +1,31 @@
1+{ stdenv, fetchurl, pkgconfig, libusb1-axoloti }:
2+
3+stdenv.mkDerivation rec {
4+ name="dfu-util-${version}";
5+ version = "0.8";
6+
7+ nativeBuildInputs = [ pkgconfig ];
8+ buildInputs = [ libusb1-axoloti ];
9+
10+ src = fetchurl {
11+ url = "http://dfu-util.sourceforge.net/releases/${name}.tar.gz";
12+ sha256 = "0n7h08avlzin04j93m6hkq9id6hxjiiix7ff9gc2n89aw6dxxjsm";
13+ };
14+
15+ meta = with stdenv.lib; {
16+ description = "Device firmware update (DFU) USB programmer";
17+ longDescription = ''
18+ dfu-util is a program that implements the host (PC) side of the USB
19+ DFU 1.0 and 1.1 (Universal Serial Bus Device Firmware Upgrade) protocol.
20+
21+ DFU is intended to download and upload firmware to devices connected over
22+ USB. It ranges from small devices like micro-controller boards up to mobile
23+ phones. With dfu-util you are able to download firmware to your device or
24+ upload firmware from it.
25+ '';
26+ homepage = http://dfu-util.gnumonks.org/;
27+ license = licenses.gpl2Plus;
28+ platforms = platforms.unix;
29+ maintainers = [ ];
30+ };
31+}
pkgs/applications/audio/axoloti/libusb1.nixnew file+38
@@ -0,0 +1,38 @@
1+{ stdenv, fetchurl, pkgconfig, systemd ? null, libobjc, IOKit, fetchpatch }:
2+
3+stdenv.mkDerivation rec {
4+ name = "libusb-1.0.19";
5+
6+ src = fetchurl {
7+ url = "mirror://sourceforge/libusb/${name}.tar.bz2";
8+ sha256 = "0h38p9rxfpg9vkrbyb120i1diq57qcln82h5fr7hvy82c20jql3c";
9+ };
10+
11+ outputs = [ "out" "dev" ]; # get rid of propagating systemd closure
12+
13+ buildInputs = [ pkgconfig ];
14+ propagatedBuildInputs =
15+ stdenv.lib.optional stdenv.isLinux systemd ++
16+ stdenv.lib.optionals stdenv.isDarwin [ libobjc IOKit ];
17+
18+ patches = [
19+ (fetchpatch {
20+ name = "libusb.stdfu.patch";
21+ url = "https://raw.githubusercontent.com/axoloti/axoloti/1.0.12/platform_linux/src/libusb.stdfu.patch";
22+ sha256 = "194j7j61i4q6x0ihm9ms8dxd4vliw20n2rj6cm9h17qzdl9xr33d";
23+ })
24+ ];
25+
26+ NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";
27+
28+ preFixup = stdenv.lib.optionalString stdenv.isLinux ''
29+ sed 's,-ludev,-L${systemd.lib}/lib -ludev,' -i $out/lib/libusb-1.0.la
30+ '';
31+
32+ meta = {
33+ homepage = http://www.libusb.info;
34+ description = "User-space USB library";
35+ platforms = stdenv.lib.platforms.unix;
36+ maintainers = [ ];
37+ };
38+}
pkgs/top-level/all-packages.nix+7
@@ -677,6 +677,13 @@ with pkgs;
677677 libssl = openssl;
678678 };
679679
680+ axoloti = callPackage ../applications/audio/axoloti { };
681+ dfu-util-axoloti = callPackage ../applications/audio/axoloti/dfu-util.nix { };
682+ libusb1-axoloti = callPackage ../applications/audio/axoloti/libusb1.nix {
683+ inherit (darwin) libobjc;
684+ inherit (darwin.apple_sdk.frameworks) IOKit;
685+ };
686+
680687 azureus = callPackage ../tools/networking/p2p/azureus { };
681688
682689 backblaze-b2 = callPackage ../development/tools/backblaze-b2 { };