From ddd8bb104ae45983217ab3ae40109a9aca5f4155 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sat, 2 Sep 2023 15:43:18 -0400 Subject: [PATCH] gnu: libusb-compat: Add libusb to RUNPATH. This avoids the error: teensy_loader_cli: error while loading libusb-1.0.so.0 from libusb-0.1.so.4: libusb-1.0.so.0: cannot open shared object file: No such file or directory e.g. when running teensy_loader_cli, which uses libusb-compat. * gnu/packages/libusb.scm (libusb-compat) [arguments] : New LDFLAGS variable. --- gnu/packages/libusb.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm index 5ebae9fe1c..1d514c11b7 100644 --- a/gnu/packages/libusb.scm +++ b/gnu/packages/libusb.scm @@ -102,7 +102,11 @@ (define-public libusb-compat (build-system gnu-build-system) (arguments (list #:configure-flags - #~(list "--disable-static"))) + #~(list "--disable-static" + ;; Extending the RUNPATH is necessary, otherwise loading + ;; the libusb-1.0.so.0 library fails. + (string-append "LDFLAGS=-Wl,-rpath=" + #$(this-package-input "libusb") "/lib")))) (native-inputs (list autoconf automake libtool pkg-config)) (inputs