diff options
author | lassulus <lassulus@lassul.us> | 2020-10-18 19:25:11 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2020-10-18 19:25:11 +0200 |
commit | 5b29d7a435092aafcea15f588effbb6f45a6a56e (patch) | |
tree | 07340bc138d7bdea55bbb33e50fc2fa1b5387a57 /tv/5pkgs/rpi/WiringPi | |
parent | 9626d3cda953929e903b5a06595e98972cb08ffc (diff) | |
parent | b034f63f7a2e4361b32c33c0e1a980eecf1a5aa6 (diff) |
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'tv/5pkgs/rpi/WiringPi')
-rw-r--r-- | tv/5pkgs/rpi/WiringPi/default.nix | 61 | ||||
-rw-r--r-- | tv/5pkgs/rpi/WiringPi/src.json | 6 |
2 files changed, 67 insertions, 0 deletions
diff --git a/tv/5pkgs/rpi/WiringPi/default.nix b/tv/5pkgs/rpi/WiringPi/default.nix new file mode 100644 index 000000000..61c43556d --- /dev/null +++ b/tv/5pkgs/rpi/WiringPi/default.nix @@ -0,0 +1,61 @@ +{ fetchFromGitHub, runCommand, stdenv }: + +let + generic = name: extraAttrs: + stdenv.mkDerivation ({ + pname = "WiringPi-${name}"; + version = "2020-09-14"; + + src = fetchFromGitHub (stdenv.lib.importJSON ./src.json); + + buildPhase = '' + runHook postBuild + + make -C ${name} all + + runHook preBuild + ''; + + installPhase = '' + runHook preInstall + + export DESTDIR=$out + export PREFIX= + export LDCONFIG=true + + make -C ${name} install + + runHook postInstall + ''; + } // extraAttrs); + + fakeutils = runCommand "fakeutils-1.0" {} /* sh */ '' + mkdir -p $out/bin + for name in chown chmod; do + touch $out/bin/$name + chmod +x $out/bin/$name + done + ''; +in + +rec { + wiringPi = generic "wiringPi" {}; + wiringPiDev = generic "devLib" { + buildInputs = [ + wiringPi + ]; + }; + gpio = generic "gpio" { + preInstall = '' + # fakeutils cannot be buildInputs because they have to override existing + # executables and therefore need to be prepended to the search path. + PATH=${fakeutils}/bin:$PATH + + mkdir -p $out/bin + ''; + buildInputs = [ + wiringPi + wiringPiDev + ]; + }; +} diff --git a/tv/5pkgs/rpi/WiringPi/src.json b/tv/5pkgs/rpi/WiringPi/src.json new file mode 100644 index 000000000..edf4e8272 --- /dev/null +++ b/tv/5pkgs/rpi/WiringPi/src.json @@ -0,0 +1,6 @@ +{ + "owner": "WiringPi", + "repo": "WiringPi", + "rev": "5c6bab7d4279e8c0cc890984eaa1a69ff3af1c99", + "sha256": "1jlx7lb3ybwv06b2dpmsr718d0xj85awl1dgdqc607k50kk25mjb" +} |