From 4bc4341fbdca98e4ae99c8379a38e68674a2b634 Mon Sep 17 00:00:00 2001 From: Nathan Christopher McRae Date: Tue, 27 Oct 2026 21:26:07 -0700 Subject: [PATCH] Add wiringpi package --- nathanmcrae/packages.scm | 62 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/nathanmcrae/packages.scm b/nathanmcrae/packages.scm index fac2beb..a193253 100644 --- a/nathanmcrae/packages.scm +++ b/nathanmcrae/packages.scm @@ -1,6 +1,7 @@ (define-module (nathanmcrae packages) #:use-module (gnu packages) #:use-module (gnu packages commencement) + #:use-module (gnu packages crypto) #:use-module (gnu packages curl) #:use-module (gnu packages golang) #:use-module (gnu packages golang-build) @@ -74,3 +75,64 @@ not permute arguments. It is intended as a replacement for Go's flag package.") (description "passphrase2pgp generates, in OpenPGP format, an EdDSA signing key and Curve25519 encryption subkey entirely from a passphrase, essentially allowing you to store a backup of your PGP keys in your brain. At any time you can re-run the tool and re-enter the passphrase to reproduce the original keys.") (license unlicense) (home-page "https://github.com/skeeto/passphrase2pgp"))) + +(define-public wiringpi + (package + (name "wiringpi") + (version "3.18") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/WiringPi/WiringPi.git") + (commit "3.18"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0556n8f8j0920b4l7jamwx2j7c6h13b2fm3hny1islclgngf8c7g")))) + (native-inputs (list libxcrypt)) + (propagated-inputs (list libxcrypt)) + (native-search-paths + (list (search-path-specification + (variable "LIBRARY_PATH") + (files (list "include"))) + (search-path-specification + (variable "LD_LIBRARY_PATH") + (files (list "lib"))))) + (build-system gnu-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (delete 'check) + (delete 'install) + (replace 'build + (lambda* (#:key tests? ints outputs #:allow-other-keys) + (use-modules (ice-9 ftw)) + (let* ((out-dir (assoc-ref outputs "out")) + (versioned-so (string-append "libwiringPi.so." + #$version)) + (versioned-so-path (string-append out-dir "/lib/" versioned-so)) + (so-path (string-append out-dir "/lib/libwiringPi.so"))) + (with-directory-excursion "wiringPi" + ; Otherwise the makefile will default to using cc + (setenv "CC" "gcc") + (invoke "make") + ; TODO: move to install phase + (install-file (string-append "libwiringPi.so." + #$version) + (string-append out-dir "/lib")) + (invoke "ln" versioned-so-path so-path) + (for-each (lambda (file) + (display file) + (install-file file + (string-append out-dir "/include"))) + (find-files "." "\\.h$")) + + (install-file "wiringPi.h" + (string-append out-dir "/include"))))))))) + (home-page "https://github.com/WiringPi/WiringPi") + (synopsis "The arguably fastest GPIO Library for the Raspberry Pi") + (description + "The WiringPi Library is a highly performant GPIO access library for Raspberry Pi boards. This library is written in C and is designed to provide fast and efficient control of the GPIO pins by directly accessing the hardware registers using DMA.") + (license lgpl3)))