nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 makeWrapper,
6 autoPatchelfHook,
7 dpkg,
8 alsa-lib,
9 curl,
10 avahi,
11 jack2,
12 libxcb,
13 libX11,
14 libXcursor,
15 libXext,
16 libXi,
17 libXinerama,
18 libXrandr,
19 libXrender,
20 libXxf86vm,
21 libglvnd,
22 zenity,
23}:
24
25let
26 runLibDeps = [
27 curl
28 avahi
29 jack2
30 libxcb
31 libX11
32 libXcursor
33 libXext
34 libXi
35 libXinerama
36 libXrandr
37 libXrender
38 libXxf86vm
39 libglvnd
40 ];
41
42 runBinDeps = [
43 zenity
44 ];
45in
46
47stdenv.mkDerivation rec {
48 pname = "touchosc";
49 version = "1.4.5.238";
50
51 suffix =
52 {
53 aarch64-linux = "linux-arm64";
54 armv7l-linux = "linux-armhf";
55 x86_64-linux = "linux-x64";
56 }
57 .${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
58
59 src = fetchurl {
60 url = "https://hexler.net/pub/${pname}/${pname}-${version}-${suffix}.deb";
61 hash =
62 {
63 aarch64-linux = "sha256-ITuIQfBw5LIN3sc11G78Pd5Ca4KDqxPhc9ArpGKBNzo=";
64 armv7l-linux = "sha256-DF7jTVp5Xieop6Q/EVznQmDlFFA5qaizXAoNwCXs/Hc=";
65 x86_64-linux = "sha256-6KpdwGXbyYwT0VhwPS9yP0c6HXUjKkGGmvZDiwQvlBw=";
66 }
67 .${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
68 };
69
70 strictDeps = true;
71
72 nativeBuildInputs = [
73 makeWrapper
74 autoPatchelfHook
75 dpkg
76 ];
77
78 buildInputs = [
79 (lib.getLib stdenv.cc.cc)
80 alsa-lib
81 ];
82
83 dontConfigure = true;
84 dontBuild = true;
85
86 installPhase = ''
87 runHook preInstall
88
89 mkdir -p $out
90 cp -r usr/share $out/share
91
92 mkdir -p $out/bin
93 cp opt/touchosc/TouchOSC $out/bin/TouchOSC
94
95 wrapProgram $out/bin/TouchOSC \
96 --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath runLibDeps} \
97 --prefix PATH : ${lib.makeBinPath runBinDeps}
98
99 runHook postInstall
100 '';
101
102 passthru.updateScript = ./update.sh;
103
104 meta = {
105 homepage = "https://hexler.net/touchosc";
106 description = "Next generation modular control surface";
107 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
108 license = lib.licenses.unfree;
109 maintainers = [ ];
110 platforms = [
111 "aarch64-linux"
112 "armv7l-linux"
113 "x86_64-linux"
114 ];
115 mainProgram = "TouchOSC";
116 };
117}