Merge pull request #320589 from doronbehar/pkg/wiringPi

wiringpi: 2.61-1 -> 3.6
This commit is contained in:
Doron Behar 2024-06-18 07:48:21 +03:00 committed by GitHub
commit de68bb0a22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,50 +1,54 @@
{ lib {
, stdenv lib,
, symlinkJoin stdenv,
, fetchFromGitHub symlinkJoin,
, libxcrypt fetchFromGitHub,
libxcrypt,
}: }:
let let
version = "2.61-1"; version = "3.6";
mkSubProject = { subprj # The only mandatory argument srcAll = fetchFromGitHub {
, buildInputs ? []
, src ? fetchFromGitHub {
owner = "WiringPi"; owner = "WiringPi";
repo = "WiringPi"; repo = "WiringPi";
rev = version; rev = version;
sha256 = "sha256-VxAaPhaPXd9xYt663Ju6SLblqiSLizauhhuFqCqbO5M="; sha256 = "sha256-Hw81Ua9LTb/9l3Js1rx8TfCOF59MrrvH6AGsAsG1SoE=";
} };
}: stdenv.mkDerivation (finalAttrs: { mkSubProject =
pname = "wiringpi-${subprj}"; {
inherit version src; subprj, # The only mandatory argument
sourceRoot = "${src.name}/${subprj}"; buildInputs ? [ ],
inherit buildInputs; src ? srcAll,
# Remove (meant for other OSs) lines from Makefiles }:
preInstall = '' stdenv.mkDerivation (finalAttrs: {
sed -i "/chown root/d" Makefile pname = "wiringpi-${subprj}";
sed -i "/chmod/d" Makefile inherit version src;
''; sourceRoot = "${src.name}/${subprj}";
makeFlags = [ inherit buildInputs;
"DESTDIR=${placeholder "out"}" # Remove (meant for other OSs) lines from Makefiles
"PREFIX=/." preInstall = ''
# On NixOS we don't need to run ldconfig during build: sed -i "/chown root/d" Makefile
"LDCONFIG=echo" sed -i "/chmod/d" Makefile
]; '';
}); makeFlags = [
"DESTDIR=${placeholder "out"}"
"PREFIX=/."
# On NixOS we don't need to run ldconfig during build:
"LDCONFIG=echo"
];
});
passthru = { passthru = {
# Helps nix-update and probably nixpkgs-update find the src of this package
# automatically.
src = srcAll;
inherit mkSubProject; inherit mkSubProject;
wiringPi = mkSubProject { wiringPi = mkSubProject {
subprj = "wiringPi"; subprj = "wiringPi";
buildInputs = [ buildInputs = [ libxcrypt ];
libxcrypt
];
}; };
devLib = mkSubProject { devLib = mkSubProject {
subprj = "devLib"; subprj = "devLib";
buildInputs = [ buildInputs = [ passthru.wiringPi ];
passthru.wiringPi
];
}; };
wiringPiD = mkSubProject { wiringPiD = mkSubProject {
subprj = "wiringPiD"; subprj = "wiringPiD";