From e8c4814739120172051d008df1d9e8222540ed00 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 13 Jun 2025 10:00:56 +0300 Subject: [PATCH 1/4] lgpio: no with lib.licenses; in meta --- pkgs/by-name/lg/lgpio/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/lg/lgpio/package.nix b/pkgs/by-name/lg/lgpio/package.nix index a472ceff3136..f9283d7aec50 100644 --- a/pkgs/by-name/lg/lgpio/package.nix +++ b/pkgs/by-name/lg/lgpio/package.nix @@ -64,7 +64,7 @@ mkDerivation rec { meta = { description = "Linux C libraries and Python modules for manipulating GPIO"; homepage = "https://github.com/joan2937/lg"; - license = with lib.licenses; [ unlicense ]; + license = lib.licenses.unlicense; maintainers = with lib.maintainers; [ doronbehar ]; platforms = lib.platforms.linux; }; From 01b703a6012382865da373fa052ce99d56f1e32f Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 13 Jun 2025 10:01:52 +0300 Subject: [PATCH 2/4] pigpio: no with lib.licenses; in meta --- pkgs/by-name/pi/pigpio/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/pi/pigpio/package.nix b/pkgs/by-name/pi/pigpio/package.nix index ddde61ca0b7b..56f4c6bcdccf 100644 --- a/pkgs/by-name/pi/pigpio/package.nix +++ b/pkgs/by-name/pi/pigpio/package.nix @@ -28,7 +28,7 @@ mkDerivation rec { meta = { description = "C library for the Raspberry which allows control of the General Purpose Input Outputs (GPIO)"; homepage = "https://github.com/joan2937/pigpio"; - license = with lib.licenses; [ unlicense ]; + license = lib.licenses.unlicense; maintainers = with lib.maintainers; [ doronbehar ]; platforms = lib.platforms.linux; }; From 740c292864faadd847db750f5b3639891926960b Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 13 Jun 2025 10:03:32 +0300 Subject: [PATCH 3/4] piscope: small FHS substitution changes --- pkgs/by-name/pi/piscope/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/pi/piscope/package.nix b/pkgs/by-name/pi/piscope/package.nix index 9873ada380eb..5f064722f4b2 100644 --- a/pkgs/by-name/pi/piscope/package.nix +++ b/pkgs/by-name/pi/piscope/package.nix @@ -23,9 +23,9 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-VDrx/RLSpMhyD64PmdeWVacb9LleHakcy7D6zFxeyhw="; }; # Fix FHS paths - postConfigure = '' + postPatch = '' substituteInPlace piscope.c \ - --replace /usr/share/piscope $out/share/piscope + --replace-fail /usr/share/piscope $out/share/piscope ''; nativeBuildInputs = [ From 0bdfa8921f176a2e6198924ec25cc52c7fc0ca7e Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 13 Jun 2025 10:12:11 +0300 Subject: [PATCH 4/4] lgpio: document pyProject options & use lib.optionalString --- pkgs/by-name/lg/lgpio/package.nix | 41 ++++++++++++++----------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/pkgs/by-name/lg/lgpio/package.nix b/pkgs/by-name/lg/lgpio/package.nix index f9283d7aec50..185dd2f0b869 100644 --- a/pkgs/by-name/lg/lgpio/package.nix +++ b/pkgs/by-name/lg/lgpio/package.nix @@ -6,7 +6,14 @@ # If we build the python packages, these two are not null buildPythonPackage ? null, lgpioWithoutPython ? null, - # When building a python Packages, this specifies the python subproject + # When building a python Packages, this specifies the python subproject - a + # folder in the repository. The current options are: + # + # - + # - PY_LGPIO + # - PY_RGPIO + # + # Where an empty value means 'build the non python project'. pyProject ? "", }: @@ -28,30 +35,18 @@ mkDerivation rec { swig ]; - preConfigure = - if pyProject != "" then - '' - cd ${pyProject} - '' - else - ""; + preConfigure = lib.optionalString (pyProject != "") '' + cd ${pyProject} + ''; # Emulate ldconfig when building the C API - postConfigure = - if pyProject == "" then - '' - substituteInPlace Makefile \ - --replace ldconfig 'echo ldconfig' - '' - else - ""; + postConfigure = lib.optionalString (pyProject == "") '' + substituteInPlace Makefile \ + --replace ldconfig 'echo ldconfig' + ''; - preBuild = - if pyProject == "PY_LGPIO" then - '' - swig -python lgpio.i - '' - else - ""; + preBuild = lib.optionalString (pyProject == "PY_LGPIO") '' + swig -python lgpio.i + ''; buildInputs = [ lgpioWithoutPython