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
, symlinkJoin
, fetchFromGitHub
, libxcrypt
{
lib,
stdenv,
symlinkJoin,
fetchFromGitHub,
libxcrypt,
}:
let
@ -13,26 +14,29 @@ let
rev = version;
sha256 = "sha256-VxAaPhaPXd9xYt663Ju6SLblqiSLizauhhuFqCqbO5M=";
};
mkSubProject = { subprj # The only mandatory argument
, buildInputs ? []
, src ? srcAll
}: stdenv.mkDerivation (finalAttrs: {
pname = "wiringpi-${subprj}";
inherit version src;
sourceRoot = "${src.name}/${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"
];
});
mkSubProject =
{
subprj, # The only mandatory argument
buildInputs ? [ ],
src ? srcAll,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "wiringpi-${subprj}";
inherit version src;
sourceRoot = "${src.name}/${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 = {
# Helps nix-update and probably nixpkgs-update find the src of this package
# automatically.
@ -40,15 +44,11 @@ let
inherit mkSubProject;
wiringPi = mkSubProject {
subprj = "wiringPi";
buildInputs = [
libxcrypt
];
buildInputs = [ libxcrypt ];
};
devLib = mkSubProject {
subprj = "devLib";
buildInputs = [
passthru.wiringPi
];
buildInputs = [ passthru.wiringPi ];
};
wiringPiD = mkSubProject {
subprj = "wiringPiD";