wiringpi: init at 2.61-1

This commit is contained in:
Doron Behar 2022-08-25 16:22:09 +03:00
parent 248cf8aca4
commit e2dc10aa74
2 changed files with 80 additions and 0 deletions

View File

@ -0,0 +1,78 @@
{ lib
, stdenv
, symlinkJoin
, fetchFromGitHub
}:
let
version = "2.61-1";
mkSubProject = { subprj # The only mandatory argument
, buildInputs ? []
, src ? fetchFromGitHub {
owner = "WiringPi";
repo = "WiringPi";
rev = version;
sha256 = "sha256-VxAaPhaPXd9xYt663Ju6SLblqiSLizauhhuFqCqbO5M=";
}
}: stdenv.mkDerivation rec {
pname = "wiringpi-${subprj}";
inherit version src;
sourceRoot = "source/${subprj}";
inherit buildInputs;
# Remove (meant for other OSs) lines from Makefiles
preInstall = ''
sed -i "/chown root/d" Makefile
sed -i "/chmod/d" Makefile
'';
makeFlags = [
"DESTDIR=${placeholder "out"}"
"PREFIX=/."
# On NixOS we don't need to run ldconfig during build:
"LDCONFIG=echo"
];
};
passthru = {
inherit mkSubProject;
wiringPi = mkSubProject {
subprj = "wiringPi";
};
devLib = mkSubProject {
subprj = "devLib";
buildInputs = [
passthru.wiringPi
];
};
wiringPiD = mkSubProject {
subprj = "wiringPiD";
buildInputs = [
passthru.wiringPi
passthru.devLib
];
};
gpio = mkSubProject {
subprj = "gpio";
buildInputs = [
passthru.wiringPi
passthru.devLib
];
};
};
in
symlinkJoin {
name = "wiringpi-${version}";
inherit passthru;
paths = [
passthru.wiringPi
passthru.devLib
passthru.wiringPiD
passthru.gpio
];
meta = with lib; {
description = "Gordon's Arduino wiring-like WiringPi Library for the Raspberry Pi (Unofficial Mirror for WiringPi bindings)";
homepage = "https://github.com/WiringPi/WiringPi";
license = licenses.lgpl3Plus;
maintainers = with maintainers; [ doronbehar ];
platforms = platforms.linux;
};
}

View File

@ -11985,6 +11985,8 @@ with pkgs;
wireguard-tools = callPackage ../tools/networking/wireguard-tools { };
wiringpi = callPackage ../os-specific/linux/wiringpi { };
wg-friendly-peer-names = callPackage ../tools/networking/wg-friendly-peer-names { };
wg-netmanager = callPackage ../tools/networking/wg-netmanager {