From 690ac4fc2d64c896292454ae47e38233239b615e Mon Sep 17 00:00:00 2001 From: Cayetano Santos Date: Thu, 12 Jun 2025 09:34:27 +0200 Subject: [PATCH] gnu: openfpgaloader: Include udev rules. * gnu/packages/fpga.scm (openfpgaloader): Include udev rules. [argument]: Add install-rules phase. [description]: Add instructions for use. [home-page]: Add missed / . Change-Id: Iecb1eebd03b08131e341a106f46d85b21b02fe22 --- gnu/packages/fpga.scm | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm index d0238ccd96e2614278e644255a80c239403565ac..626a10c9483486fcf4241b8702c423b154076eb6 100644 --- a/gnu/packages/fpga.scm +++ b/gnu/packages/fpga.scm @@ -829,11 +829,27 @@ hardware designs in Verilog.") libusb zlib)) (arguments - `(#:tests? #f)) ; No tests exist + (list #:tests? #f ;no test suite + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'install-rules + (lambda _ + (install-file + "../source/99-openfpgaloader.rules" + (string-append #$output "/lib/udev/rules.d/"))))))) (synopsis "Utility for programming FPGA") (description "This package provides a program to transfer a bitstream -to an FPGA.") - (home-page "https://trabucayre.github.io/openFPGALoader") +to an FPGA. To use @code{openfpgaloader} without root privileges it is +necessary to install the necessary udev rules. This can be done by extending +@code{udev-service-type} in the @code{operating-system} configuration file with +this package, as in: +@lisp +(udev-rules-service 'openfpgaloader openfpgaloader #:groups '(\"plugdev\") +@end lisp +Additionally, the @samp{plugdev} group should be registered in the +@code{supplementary-groups} field of your @code{user-account} declaration. Refer +to @samp{info \"(guix) Base Services\"} for examples.") + (home-page "https://trabucayre.github.io/openFPGALoader/") (license license:asl2.0))) (define-public python-hdlmake