nixpkgs/pkgs/os-specific/linux/wiringpi/default.nix
Doron Behar 8ace65ff3d
treewide: use finalAttrs in all packages I maintain (#255902)
* mpd-touch-screen-gui: use finalAttrs in mkDerivation; reformat

* musescore: use finalAttrs in mkDerivation

* syncthingtray: use stdenv.mkDerivation with a function; reformat

* ocrfeeder: use finalAttrs in mkDerivation; reformat

* castget: use finalAttrs in mkDerivation

* gnome-network-displays: use finalAttrs in mkDerivation

* mailreaders: use finalAttrs in mkDerivation

* mswatch: use finalAttrs in mkDerivation

* uhd: use finalAttrs in mkDerivation

* maxima: use finalAttrs in mkDerivation

* qalculate-gtk: use finalAttrs in mkDerivation

* qalculate-qt: use finalAttrs in mkDerivation

* wxmaxima: use finalAttrs in mkDerivation

* lammps: use finalAttrs in mkDerivation

* mlterm: use finalAttrs in mkDerivation

* video-trimmer: use finalAttrs in mkDerivation

* nerdfonts: use finalAttrs in mkDerivation

* gnomeExtensions.easyScreenCast: use finalAttrs in mkDerivation

* octave: use finalAttrs in mkDerivation; reformat

* comedilib: use finalAttrs in mkDerivation

* cpp-utilities: use finalAttrs in mkDerivation

* libsForQt5.kpeoplevcard: use finalAttrs in mkDerivation; reformat

* liberio: use finalAttrs in mkDerivation

* libqalculate: use finalAttrs in mkDerivation; reformat

* libwtk-sdl2: use finalAttrs in mkDerivation

* libsForQt5.pulseaudio-qt: use finalAttrs in mkDerivation; reformat

* qrupdate: use finalAttrs in mkDerivation; reformat

* libsForQt5.qtforkawesome: use finalAttrs in mkDerivation; reformat

* libsForQt5.qtutilities: use finalAttrs in mkDerivation; reformat

* sqlitecpp: use finalAttrs in mkDerivation; reformat

* tweeny: use finalAttrs in mkDerivation

* volk: use finalAttrs in mkDerivation

* wiringpi: use finalAttrs in mkDerivation

* snzip: use finalAttrs in mkDerivation; reformat

* bpm-tools: use finalAttrs in mkDerivation; reformat

* sacd: use finalAttrs in mkDerivation

* gtk-gnutella: use finalAttrs in mkDerivation; reformat

* sile: use finalAttrs in mkDerivation

* pplatex: use finalAttrs in mkDerivation; reformat
2023-09-21 11:31:17 +03:00

85 lines
1.9 KiB
Nix

{ lib
, stdenv
, symlinkJoin
, fetchFromGitHub
, libxcrypt
}:
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 (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 = {
inherit mkSubProject;
wiringPi = mkSubProject {
subprj = "wiringPi";
buildInputs = [
libxcrypt
];
};
devLib = mkSubProject {
subprj = "devLib";
buildInputs = [
passthru.wiringPi
];
};
wiringPiD = mkSubProject {
subprj = "wiringPiD";
buildInputs = [
libxcrypt
passthru.wiringPi
passthru.devLib
];
};
gpio = mkSubProject {
subprj = "gpio";
buildInputs = [
libxcrypt
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;
};
}