Add chrpath package

  • Open
  • quality assurance status badge
Details
2 participants
  • daniel.maksymow
  • Maxime Devos
Owner
unassigned
Submitted by
daniel.maksymow
Severity
normal
D
D
daniel.maksymow wrote on 27 Aug 2022 12:40
(name . Guix Patches)(address . guix-patches@gnu.org)
NATslO3--3-2@tuta.io
Hello,

That's my first time when I am trying to apply patch to guix.

That's a package which is required by some software like bitbake. So I think it would be nice to have.

Best Regards,
Daniel
Attachment: file
From f32d1154938e989177d59b32c91c5482bb127b0d Mon Sep 17 00:00:00 2001
Message-Id: <f32d1154938e989177d59b32c91c5482bb127b0d.1661596588.git.daniel.maksymow@tuta.io>
From: Daniel Maksymow <daniel.maksymow@tuta.io>
Date: Sat, 27 Aug 2022 12:25:49 +0200
Subject: [PATCH] gnu: chrpath: Add new package
To: guix-patches@gnu.org

* gnu/packages/elf.scm: New package added.
---
gnu/packages/elf.scm | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)

Toggle diff (39 lines)
diff --git a/gnu/packages/elf.scm b/gnu/packages/elf.scm
index 8cc2ff3637..d1e878a6e6 100644
--- a/gnu/packages/elf.scm
+++ b/gnu/packages/elf.scm
@@ -31,7 +31,7 @@ (define-module (gnu packages elf)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
- #:use-module ((guix licenses) #:select (gpl3+ lgpl3+ lgpl2.0+))
+ #:use-module ((guix licenses) #:select (gpl3+ lgpl3+ lgpl2.0+ gpl2))
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
#:use-module (gnu packages compression)
@@ -282,3 +282,23 @@ (define-public patchelf
(properties
'((release-monitoring-url . "https://github.com/NixOS/patchelf/releases")))
(license gpl3+)))
+
+(define-public chrpath
+ (package
+ (name "chrpath")
+ (version "0.16")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://deb.debian.org/debian/pool/main/c/chrpath/chrpath_"
+ version ".orig.tar.gz"))
+ (sha256
+ (base32
+ "0yvfq891mcdkf8g18gjjkn2m5rvs8z4z4cl1vwdhx6f2p9a4q3dv"))))
+ (build-system gnu-build-system)
+ (home-page "https://directory.fsf.org/wiki/Chrpath")
+ (synopsis "Tool to edit the rpath of ELF binaries")
+ (description
+ "@code{chrpath} allows you to modify the dynamic library load path
+ (rpath and runpath) of compiled programs and libraries")
+ (license gpl2)))
--
2.37.0
D
D
daniel.maksymow wrote on 28 Aug 2022 18:10
Add new package chrpath
(name . 57453)(address . 57453@debbugs.gnu.org)
NA_D-Rr--3-2@tuta.io

Attachment: file
From f32d1154938e989177d59b32c91c5482bb127b0d Mon Sep 17 00:00:00 2001
Message-Id: <f32d1154938e989177d59b32c91c5482bb127b0d.1661596588.git.daniel.maksymow@tuta.io>
From: Daniel Maksymow <daniel.maksymow@tuta.io>
Date: Sat, 27 Aug 2022 12:25:49 +0200
Subject: [PATCH] gnu: chrpath: Add new package
To: guix-patches@gnu.org

* gnu/packages/elf.scm: New package added.
---
gnu/packages/elf.scm | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)

Toggle diff (39 lines)
diff --git a/gnu/packages/elf.scm b/gnu/packages/elf.scm
index 8cc2ff3637..d1e878a6e6 100644
--- a/gnu/packages/elf.scm
+++ b/gnu/packages/elf.scm
@@ -31,7 +31,7 @@ (define-module (gnu packages elf)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
- #:use-module ((guix licenses) #:select (gpl3+ lgpl3+ lgpl2.0+))
+ #:use-module ((guix licenses) #:select (gpl3+ lgpl3+ lgpl2.0+ gpl2))
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
#:use-module (gnu packages compression)
@@ -282,3 +282,23 @@ (define-public patchelf
(properties
'((release-monitoring-url . "https://github.com/NixOS/patchelf/releases")))
(license gpl3+)))
+
+(define-public chrpath
+ (package
+ (name "chrpath")
+ (version "0.16")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://deb.debian.org/debian/pool/main/c/chrpath/chrpath_"
+ version ".orig.tar.gz"))
+ (sha256
+ (base32
+ "0yvfq891mcdkf8g18gjjkn2m5rvs8z4z4cl1vwdhx6f2p9a4q3dv"))))
+ (build-system gnu-build-system)
+ (home-page "https://directory.fsf.org/wiki/Chrpath")
+ (synopsis "Tool to edit the rpath of ELF binaries")
+ (description
+ "@code{chrpath} allows you to modify the dynamic library load path
+ (rpath and runpath) of compiled programs and libraries")
+ (license gpl2)))
--
2.37.0
M
M
Maxime Devos wrote on 28 Aug 2022 18:33
Re: [bug#57453] Add chrpath package
fcddc0bc-9b60-155a-c64b-df6b1f040980@telenet.be
On 27-08-2022 12:40, damaxi via Guix-patches via wrote:
Toggle quote (9 lines)
> Hello,
>
> That's my first time when I am trying to apply patch to guix.
>
> That's a package which is required by some software like bitbake. So I
> think it would be nice to have.
>
> Best Regards,
> Daniel
Looking at the README, it appears to be a Debian project. As such, I do
not think the FSF directory entry can count as home page. The closest
thing to a home page I found is:
version-specific).
It also contains some binaries (generated Autotools files) and bundled
dependencies  (configure, config.guess, config.h.in, depcomp,
install-sh, missing, config.sub, acinclude.m4, aclocal.m4), try removing
them (in a snippet). That way, the problem of old Autotools not
supporting new architectures is avoided (it's sometimes encountered for
aarch64, powerpc and riscv64).
AFAICT no version of the GPL is specified anywhere. As such, by
condition (9) of the GPL 2,
Toggle quote (4 lines)
> [...] If the Program does not specify a version number of
> this License, you may choose any version ever published by the Free
> Software
> Foundation.
, so it appears to be gpl1+, not gpl2-only.
Geetings,
Maxime.
Attachment: OpenPGP_signature
D
D
daniel.maksymow wrote on 28 Aug 2022 21:16
WIP
(name . 57453)(address . 57453@debbugs.gnu.org)
NA_s_Lq--3-2@tuta.io
Hello,

Thank you for comments but there are few things:

- https://tracker.debian.org/pkg/chrpath - this link doesn't work that's why I prefer FSF one, I hadn't found any other link

- can you point out which are those:
(generated Autotools files) and bundled dependencies  (configure, config.guess, config.h.in, depcomp, install-sh, missing, config.sub, acinclude.m4, aclocal.m4) files?
I am not autotool expert but I see that removing some files like configure broke build, are you able to point what exactly files I have to remove: acinclude.m4, aclocal.m4 << loks fine.

- There is copyright file where GLP2 is specified

Best Regards,
Daniel
Attachment: file
M
M
Maxime Devos wrote on 29 Aug 2022 00:24
0019383e-9750-23b4-6170-5ecfadc84495@telenet.be
On 28-08-2022 21:16, daniel.maksymow--- via Guix-patches via wrote:
Toggle quote (7 lines)
> Hello,
>
> Thank you for comments but there are few things:
>
> - https://tracker.debian.org/pkg/chrpath <<- this link doesn't work
> that's why I prefer FSF one, I hadn't found any other link
>
I cannot reproduce locally. What kind of errors do you get?
Toggle quote (5 lines)
> - can you point out which are those:
> (generated Autotools files) and bundled
> dependencies  (configure, config.guess, config.h.in, depcomp,
> install-sh, missing, config.sub, acinclude.m4, aclocal.m4)
> files?
That's the list. These are those, I don't think I can go any more specific.
Toggle quote (3 lines)
> I am not autotool expert but I see that removing some files like
> configure broke build, are you able to point what exactly files I have
> to remove: acinclude.m4, aclocal.m4 << loks fine.
All of them. In the build error message, it will IIRC say something
about 'autoconf not found' or such, when you encounter such a thing, you
will need to add the autoconf package.
Toggle quote (1 lines)
> - There is copyright file where GLP2 is specified
In the copyright file I found
is not specified.
Greetings,
Maxime.
Attachment: file
Attachment: OpenPGP_signature
D
D
daniel.maksymow wrote on 11 Sep 2022 15:28
WIP
(name . 57453)(address . 57453@debbugs.gnu.org)
NBgj90x--3-2@tuta.io
Finally I found the time for building this package. I removed those generated flags and added
native-inputs autoconf automake. Looks like there is an error in configure.ac file

But during build I get this error:
./configure: line 4921: syntax error near unexpected token `$flag,'
./configure: line 4921: `    JAPHAR_GREP_CFLAGS($flag,  CFLAGS="$CFLAGS $flag" )'
error: in phase 'configure': uncaught exception:
%exception #<&invoke-error program: "/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash" arguments: ("./configure" "CONFIG_SHELL=/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash" "SHELL=/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash" "--prefix=/gnu/store/skdzrcbnmvafa5zk2i0jxw6sxl2b7hz9-chrpath-0.16" "--enable-fast-install" "--build=x86_64-unknown-linux-gnu") exit-status: 2 term-signal: #f stop-signal: #f>
phase `configure' failed after 1.5 seconds

I checked configure.ac file and I found this:
if eval "test x$GCC = xyes"; then
  for flag in \
      -W \
      -Wall \
      -Wcast-align \
      -Wcast-qual \
      -Wcomments \
      -Wmissing-declarations \
      -Wmissing-prototypes \
      -Wpointer-arith \
      -Wreturn-type \
      -Wstrict-prototypes
  do
    JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
  done
fi

Have you idea what can be wrong here?

Best Regards,
Daniel
Attachment: file
M
M
Maxime Devos wrote on 12 Sep 2022 16:22
Re: [bug#57453] WIP (chrpath)
d3da1c4b-1991-68f6-87c8-2f4eb0b074a2@telenet.be
On 11-09-2022 15:28, daniel.maksymow--- via Guix-patches via wrote:
Toggle quote (11 lines)
> Finally I found the time for building this package. I removed those
> generated flags and added
> native-inputs autoconf automake. Looks like there is an error in
> configure.ac file
>
> But during build I get this error:
> ./configure: line 4921: syntax error near unexpected token `$flag,'
> ./configure: line 4921: `    JAPHAR_GREP_CFLAGS($flag,  CFLAGS="$CFLAGS
> $flag" )' [...]
>
> Have you idea what can be wrong here?
I included too many files in the list of files to remove.
'acinclude.m4' is fine -- it doesn't appear to be generated, it looks
like source code. Tested with the following definition:
(define-public chrpath
(package
(name "chrpath")
(version "0.16")
(source (origin
(method url-fetch)
(uri (string-append
version ".orig.tar.gz"))
(sha256
(base32
"0yvfq891mcdkf8g18gjjkn2m5rvs8z4z4cl1vwdhx6f2p9a4q3dv"))
(modules '((guix build utils)))
(snippet
;; Remove generated Autotools files -- they are generated
;; and additionally don't support new architectures.
'(for-each delete-file
(find-files "."
"\\b(configure|config\\.sub|config.guess|Makefile\\.in|missing|depcomp|config\\.h\\.in|aclocal\\.m4|install-sh)$")))))
(build-system gnu-build-system)
(native-inputs (list autoconf automake))
(synopsis "Tool to edit the rpath of ELF binaries")
(description
"@code{chrpath} allows you to modify the dynamic library load path
(rpath and runpath) of compiled programs and libraries")
(license gpl1+))) ; condition (9) of the GPL 2 (no version is specified)
Also, one additional thing: you are using the '.orig.tar.gz' tarball,
but Debian often patches software. On
chrpath_0.16-2.diff.gz , fixing a MIPS-specific bug. Could you add it
go gnu/local.mk, gnu/packages/patches and the 'patches' field (using the
'search-pathes' procedure)?
(MIPS isn't a 'fully supported' system anymore according to (guix)GNU
Distribution, but assuming the patch applies cleanly, might as well make
it a tiny bit more supported.)
Greetings,
Maxime.
Attachment: OpenPGP_signature
M
M
Maxime Devos wrote on 17 Sep 2022 21:57
dc4fae4a-722b-f69a-091e-6f35047e2cae@telenet.be
On 17-09-2022 21:23, daniel.maksymow@tuta.io wrote:
Toggle quote (18 lines)
> Thank it works!
>
> Regarding patch, I tried the following lines:
>
>             (uri (list (string-append
>
> "https://deb.debian.org/debian/pool/main/c/chrpath/chrpath_
> <https://deb.debian.org/debian/pool/main/c/chrpath/chrpath_>"
>                         version ".orig.tar.gz")
>                        (string-append
>
> "http://deb.debian.org/debian/pool/main/c/chrpath/chrpath_
> <http://deb.debian.org/debian/pool/main/c/chrpath/chrpath_>"
>                         version  "-2.diff.gz")))
>             (patches (search-patches "chrpath_0.16-2.diff"))
>
> but it looks like the second uri is not downloading. However I saw a
> similar packages. Do you know what maybe wrong here?
The URL second downloads fine for me (tried out in a browser)
Taking the information at face value, I'm guessing temporarily did not
have Internet access or that the Debian servers were down for a moment.
As a general recommendation, when something doesn't work, I recommend
sending a copy of the error message, that would be helpful for
determining what's actually wrong.
I'm guessing you got the following error message:
[...]
guix build: error: chrpath_0.16.2.diff: patch not found
If so, you forgot to put the patch somewhere where it could be found by
Guix. For that, I refer to my earlier response about gnu/local.mk and
gnu/packages/patches.
Another possibility is that you got a 'hash mismatch' error. In that
case, the problem is that while the hash of the .orig.tar.gz is
presumably correct, it is virtually guaranteed to be different than the
hash of the .diff.gz -- all the 'uri' are supposed to be equivalent,
this is not a place to put URLs of patches (aside from some edge cases
like xvfb-run, which don't apply here).
In that case, the solution is to remove the .diff.gz URL as you are
already adding a local copy of the patch for 'search-patches' to find.
If it's something else, you need to share the error message.
Greetings,
Maxime.
Attachment: OpenPGP_signature
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 57453@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 57453
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch