Hi,
I was looking through the lists because I have a patch that does exactly
what you describe here. I guess this goes to core updates, so this
version is on top of it. WDYT?
Happy hacking!
Miguel
ludo@gnu.org (Ludovic Courtès) writes:
Toggle quote (16 lines)
> Hi,
>
> Commit 98341757c8c45fca8d2b53f9972f5c6a32cf2c95, which was meant to fix
> this bug¹, actually failed to do so:
>
> $ head -1 $(./pre-inst-env guix build libtool)/share/libtool/build-aux/ltmain.sh
> #!/gnu/store/k7029k5va68lkapbzcycdzj7m5bjb4b8-bash-4.4.12/bin/sh
> $ git describe
> v0.12.0-3136-g7312c62d3
>
> I think the problem is that we’re patching ltmain.in when we should
> really be patching the final file, after the ‘patch-shebangs’ phase.
>
> Ludo’.
>
> ¹ <http://bugs.gnu.org/25304>
From 145273418d3131bcf3b73d416d19f641645cf3f8 Mon Sep 17 00:00:00 2001
<rosen644835@gmail.com>
* gnu/packages/autotools.scm (libtool)[restore-build-aux-shebang]: New
phase after install.
[restore-ltmain-shebang]: Remove phase, it is now performed by the phase
restore-build-aux-shebang.
---
gnu/packages/autotools.scm | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
Toggle diff (31 lines)
diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm
index 96f2925180..c9e1c9bcf1 100644
--- a/gnu/packages/autotools.scm
+++ b/gnu/packages/autotools.scm
@@ -444,11 +444,19 @@ Makefile, simplifying the entire process for the developer.")
(("/bin/sh")
(string-append bash "/bin/sh")))
#t)))
- (add-after 'patch-source-shebangs 'restore-ltmain-shebang
- (lambda* (#:key inputs #:allow-other-keys)
- (substitute* "build-aux/ltmain.in"
- (("^#!.*/bin/sh$") "#!/bin/sh"))
- #t)))))
+ ;; These files may be copied into source trees by libtoolize,
+ ;; therefore they must not point to store file names that would be
+ ;; leaked with tarballs generated by make dist.
+ (add-after 'install 'restore-build-aux-shebang
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (dir (string-append out "/share/libtool/build-aux")))
+ (for-each (lambda (file)
+ (format #t "restoring shebang on `~a'~%" file)
+ (substitute* file
+ (("^#!.*/bin/sh") "#!/bin/sh")))
+ (find-files dir ".*"))
+ #t))))))
(synopsis "Generic shared library support tools")
(description
--
2.29.2
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEEiIeExBRZrMuD5+hMY0xuiXn6vsIFAl+upvQACgkQY0xuiXn6
vsJ6Xwv9FvnDwhtr63aPHozMYIOWtLuYZaj531dqkbC3vuZjGv9kM+i2qyRA0PPc
80aIWjB3viuQ5/4yLqD23fCNqkkgDKsFWGFPwKv9Lva1iaFurgskwIdsWDBQkp68
Jn0W+hJrMxqEg41PGXGOjnicVBb349M5ruuc65AtqboOFlx7/ETPcZouKd0oWUn4
89CZEIhjbcKf/DbXe1ouUrZMUKoEbpSU1rMVbtz+14fN2leqWfNFKVHNEnHTP3ho
VwMQvLwNwzKa2h4ynoDtjq4w/1Ewg/RzyExRRb2EJUFv37KMB4whE+Qj3TfGMaIa
5mY8N8tc6P8wmuQwr0Y5EE5gykJczjM55+1LsctCFDVTbAuJZZNfhmyQdUeDBJ3B
s7QwvYTAddFlEwgpPGUSgTTSb1VlGj95qg9YP2QQFTtT1D0jtIh6gE/LqEeOMHkp
aARwBxlEqqLJqQtWnJLQ1rh9Flg+KJYb0+MWC+3H4b+BLAJ7DckGHWHxl99AiYIm
B9fHHT7d
=Gnea
-----END PGP SIGNATURE-----