From 5d8d521af2d682b4703c49a8e0b327f08b40e15e Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 17 Jun 2024 21:18:16 +0300 Subject: [PATCH 1/3] wiringpi: help nix-update find the src position --- pkgs/os-specific/linux/wiringpi/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/os-specific/linux/wiringpi/default.nix b/pkgs/os-specific/linux/wiringpi/default.nix index bc80e2a33543..b79fae4cbc44 100644 --- a/pkgs/os-specific/linux/wiringpi/default.nix +++ b/pkgs/os-specific/linux/wiringpi/default.nix @@ -7,14 +7,15 @@ let version = "2.61-1"; - mkSubProject = { subprj # The only mandatory argument - , buildInputs ? [] - , src ? fetchFromGitHub { + srcAll = fetchFromGitHub { owner = "WiringPi"; repo = "WiringPi"; rev = version; sha256 = "sha256-VxAaPhaPXd9xYt663Ju6SLblqiSLizauhhuFqCqbO5M="; - } + }; + mkSubProject = { subprj # The only mandatory argument + , buildInputs ? [] + , src ? srcAll }: stdenv.mkDerivation (finalAttrs: { pname = "wiringpi-${subprj}"; inherit version src; @@ -33,6 +34,9 @@ let ]; }); passthru = { + # Helps nix-update and probably nixpkgs-update find the src of this package + # automatically. + src = srcAll; inherit mkSubProject; wiringPi = mkSubProject { subprj = "wiringPi"; From 30cece054c61327ef340fd0bda16262261843652 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 17 Jun 2024 21:18:54 +0300 Subject: [PATCH 2/3] wiringpi: format with nixfmt (RFC 166) --- pkgs/os-specific/linux/wiringpi/default.nix | 62 ++++++++++----------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/pkgs/os-specific/linux/wiringpi/default.nix b/pkgs/os-specific/linux/wiringpi/default.nix index b79fae4cbc44..d65d1450fc9d 100644 --- a/pkgs/os-specific/linux/wiringpi/default.nix +++ b/pkgs/os-specific/linux/wiringpi/default.nix @@ -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"; From f841416d21b3c3102b11eacba496adca88b1acdc Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 17 Jun 2024 21:19:03 +0300 Subject: [PATCH 3/3] wiringpi: 2.61-1 -> 3.6 Diff: https://github.com/WiringPi/WiringPi/compare/2.61-1...3.6 --- pkgs/os-specific/linux/wiringpi/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/wiringpi/default.nix b/pkgs/os-specific/linux/wiringpi/default.nix index d65d1450fc9d..a8eb74217a4f 100644 --- a/pkgs/os-specific/linux/wiringpi/default.nix +++ b/pkgs/os-specific/linux/wiringpi/default.nix @@ -7,12 +7,12 @@ }: let - version = "2.61-1"; + version = "3.6"; srcAll = fetchFromGitHub { owner = "WiringPi"; repo = "WiringPi"; rev = version; - sha256 = "sha256-VxAaPhaPXd9xYt663Ju6SLblqiSLizauhhuFqCqbO5M="; + sha256 = "sha256-Hw81Ua9LTb/9l3Js1rx8TfCOF59MrrvH6AGsAsG1SoE="; }; mkSubProject = {