wiringpi: format with nixfmt (RFC 166)

This commit is contained in:
Doron Behar 2024-06-17 21:18:54 +03:00
parent 5d8d521af2
commit 30cece054c

View File

@ -1,8 +1,9 @@
{ lib {
, stdenv lib,
, symlinkJoin stdenv,
, fetchFromGitHub symlinkJoin,
, libxcrypt fetchFromGitHub,
libxcrypt,
}: }:
let let
@ -13,26 +14,29 @@ let
rev = version; rev = version;
sha256 = "sha256-VxAaPhaPXd9xYt663Ju6SLblqiSLizauhhuFqCqbO5M="; sha256 = "sha256-VxAaPhaPXd9xYt663Ju6SLblqiSLizauhhuFqCqbO5M=";
}; };
mkSubProject = { subprj # The only mandatory argument mkSubProject =
, buildInputs ? [] {
, src ? srcAll subprj, # The only mandatory argument
}: stdenv.mkDerivation (finalAttrs: { buildInputs ? [ ],
pname = "wiringpi-${subprj}"; src ? srcAll,
inherit version src; }:
sourceRoot = "${src.name}/${subprj}"; stdenv.mkDerivation (finalAttrs: {
inherit buildInputs; pname = "wiringpi-${subprj}";
# Remove (meant for other OSs) lines from Makefiles inherit version src;
preInstall = '' sourceRoot = "${src.name}/${subprj}";
sed -i "/chown root/d" Makefile inherit buildInputs;
sed -i "/chmod/d" Makefile # Remove (meant for other OSs) lines from Makefiles
''; preInstall = ''
makeFlags = [ sed -i "/chown root/d" Makefile
"DESTDIR=${placeholder "out"}" sed -i "/chmod/d" Makefile
"PREFIX=/." '';
# On NixOS we don't need to run ldconfig during build: makeFlags = [
"LDCONFIG=echo" "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 # Helps nix-update and probably nixpkgs-update find the src of this package
# automatically. # automatically.
@ -40,15 +44,11 @@ let
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";