Message ID | 87bkhvef98.fsf@jpoiret.xyz |
---|---|
State | New |
Headers | show |
Series | bug#63793: [PATCH] gnu: sbsigntools: Update to 0.9.5. | expand |
Hi Josselin, On 6/4/23 05:41, Josselin Poiret wrote: > Thanks for your patch! Pushed as > f72f3a909a41dce5dc4512c30d4cd0673bc6560f with the following best > practices modifications (importantly, note cc-for-target and > search-input-file for bash). Thanks for merging! What is the difference between this > - (lambda _ > - (substitute* "lib/ccan.git/tools/create-ccan-tree" > - (("#!/bin/bash") > - (string-append "#!" > - #$(this-package-native-input "bash") > - "/bin/bash"))))) and this? > + (lambda* (#:key inputs native-inputs #:allow-other-keys) > + (substitute* "lib/ccan.git/tools/create-ccan-tree" > + (("#!/bin/bash") > + (string-append "#!" > + (search-input-file (or native-inputs inputs) > + "/bin/bash")))))) I meant to search for bash as a native input but I guess they are different.
Hi kiasoc5, kiasoc5 <kiasoc5@disroot.org> writes: > What is the difference between this > >> - (lambda _ >> - (substitute* "lib/ccan.git/tools/create-ccan-tree" >> - (("#!/bin/bash") >> - (string-append "#!" >> - #$(this-package-native-input "bash") >> - "/bin/bash"))))) > > and this? > >> + (lambda* (#:key inputs native-inputs #:allow-other-keys) >> + (substitute* "lib/ccan.git/tools/create-ccan-tree" >> + (("#!/bin/bash") >> + (string-append "#!" >> + (search-input-file (or native-inputs inputs) >> + "/bin/bash")))))) > > I meant to search for bash as a native input but I guess they are different. In general, the first method doesn't compose well with package transformations that replace inputs, since it will still refer to the original bash input. The bottom one will always search for a /bin/bash binary among all the inputs, so will pick up a new one if the input is replaced. Also, in general, inside phases, if you're building natively, native-inputs is always #f and inputs also contains the native inputs, hence the need for that (or ...) form. HTH,
diff --git a/gnu/packages/efi.scm b/gnu/packages/efi.scm index 50d52c4d65..499745eba1 100644 --- a/gnu/packages/efi.scm +++ b/gnu/packages/efi.scm @@ -114,28 +114,29 @@ (define-public sbsigntools (base32 "060n6w0dx1mrilhdv482ncckanqz6pdv53piimiki0bm15d2fcp4")))) (build-system gnu-build-system) (arguments - (list #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'patch-more-shebangs - (lambda _ - (substitute* "lib/ccan.git/tools/create-ccan-tree" - (("#!/bin/bash") - (string-append "#!" - #$(this-package-native-input "bash") - "/bin/bash"))))) - (add-after 'unpack 'patch - (lambda _ - (substitute* '("configure.ac" - "tests/Makefile.am") - (("/usr/include/efi") - (string-append #$(this-package-input "gnu-efi") - "/include/efi")) - (("/usr/lib/gnuefi") - (string-append #$(this-package-input "gnu-efi") - "/lib"))))) - (add-after 'unpack 'setenv - (lambda _ - (setenv "CC" "gcc")))))) + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-more-shebangs + (lambda* (#:key inputs native-inputs #:allow-other-keys) + (substitute* "lib/ccan.git/tools/create-ccan-tree" + (("#!/bin/bash") + (string-append "#!" + (search-input-file (or native-inputs inputs) + "/bin/bash")))))) + (add-after 'unpack 'patch + (lambda _ + (substitute* '("configure.ac" + "tests/Makefile.am") + (("/usr/include/efi") + (string-append #$(this-package-input "gnu-efi") + "/include/efi")) + (("/usr/lib/gnuefi") + (string-append #$(this-package-input "gnu-efi") + "/lib"))))) + (add-after 'unpack 'setenv + (lambda _ + (setenv "CC" #$(cc-for-target))))))) (native-inputs (list autoconf automake