libnl additions

  • Done
  • quality assurance status badge
Details
2 participants
  • Dave Love
  • Marius Bakke
Owner
unassigned
Submitted by
Dave Love
Severity
normal
D
D
Dave Love wrote on 2 Aug 2017 15:32
(address . guix-patches@gnu.org)
87r2wu5c4i.fsf@i-ulialbion.it.manchester.ac.uk
These put the extra bits from what I previously did as libnl3 into
libnl. I don't know whether the handling of the Python interface is the
right way to do it, but I don't think the Python is important anyway --
Debian doesn't ship it.
From d4986401bfcb2eacd7c7f437a50ca85d752cc904 Mon Sep 17 00:00:00 2001
From: Dave Love <fx@gnu.org>
Date: Wed, 2 Aug 2017 12:09:02 +0100
Subject: [PATCH 3/4] gnu: libnl: Add "doc" output.

* gnu/packages/linux.scm (libnl)[native-inputs, outputs]: Add doc source.
[arguments]: New field.
---
gnu/packages/linux.scm | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)

Toggle diff (38 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index a189458ad..3902560a8 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1463,7 +1463,30 @@ transparently through a bridge.")
(base32
"1r3lw3hjvqxi5zqyq2w1qadm3gisd9nlf71dkl4yplacmssnhm3h"))))
(build-system gnu-build-system)
- (native-inputs `(("flex" ,flex) ("bison" ,bison)))
+ (native-inputs
+ `(("flex" ,flex) ("bison" ,bison)
+ ("libnl3-doc"
+ ,(origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/thom311/libnl/releases/download/libnl"
+ (string-join (string-split version #\.) "_")
+ "/libnl-doc-" version ".tar.gz"))
+ (sha256
+ (base32 "0srab805yj8wb13l64qjyp3mdbqapxg5vk46v3zlhhzpmxqw8j7r"))))))
+ (outputs '("out" "doc"))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'install-doc
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((dest (format #f "~a/share/doc"
+ (assoc-ref outputs "doc"))))
+ (mkdir-p dest)
+ (with-directory-excursion dest
+ (and
+ (zero? (system* "tar" "xf" (assoc-ref inputs "libnl3-doc")))
+ (zero? (system "mv *libnl-doc* libnl3"))))))))))
(home-page "http://www.infradead.org/~tgr/libnl/")
(synopsis "NetLink protocol library suite")
(description
--
2.11.0
From e64186082735f533bf172fcad491eaabed2928f0 Mon Sep 17 00:00:00 2001
From: Dave Love <fx@gnu.org>
Date: Wed, 2 Aug 2017 13:39:28 +0100
Subject: [PATCH 4/4] gnu: libnl: Add "python2" and "python3" outputs.

* gnu/packages/linux.scm (libnl)[native-inputs]: Extend.
[outputs]: Add python2, python3.
[install-python]: New phase.
---
gnu/packages/linux.scm | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)

Toggle diff (57 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 3902560a8..dd9c34999 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -101,6 +101,7 @@
#:use-module (gnu packages xorg)
#:use-module (gnu packages groff)
#:use-module (gnu packages selinux)
+ #:use-module (gnu packages swig)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
@@ -1464,7 +1465,12 @@ transparently through a bridge.")
"1r3lw3hjvqxi5zqyq2w1qadm3gisd9nlf71dkl4yplacmssnhm3h"))))
(build-system gnu-build-system)
(native-inputs
- `(("flex" ,flex) ("bison" ,bison)
+ `(("flex" ,flex)
+ ("bison" ,bison)
+ ("python-2" ,python-2)
+ ("python-3" ,python-3)
+ ("swig" ,swig)
+ ("pkg-config" ,pkg-config)
("libnl3-doc"
,(origin
(method url-fetch)
@@ -1474,10 +1480,27 @@ transparently through a bridge.")
"/libnl-doc-" version ".tar.gz"))
(sha256
(base32 "0srab805yj8wb13l64qjyp3mdbqapxg5vk46v3zlhhzpmxqw8j7r"))))))
- (outputs '("out" "doc"))
+ (outputs '("out" "doc" "python2" "python3"))
(arguments
`(#:phases
(modify-phases %standard-phases
+ (add-after 'install 'install-python
+ (lambda* (#:key outputs #:allow-other-keys)
+ (define (python-inst python)
+ (let ((ldflags (format #f "LDFLAGS=-Wl,-rpath=~a/lib"
+ (assoc-ref %outputs "out")))
+ (pyout (assoc-ref %outputs python)))
+ (and
+ ;; The rpm spec quoth "build twice, otherwise capi.py is
+ ;; not copied to the build directory"
+ (zero? (system (format #f "~a ~a setup.py build"
+ ldflags python pyout)))
+ (zero?
+ (system (format #f "~a ~a setup.py install --prefix=~a"
+ ldflags python pyout)))
+ (zero? (system* python "setup.py" "clean")))))
+ (with-directory-excursion "./python"
+ (for-each python-inst '("python2" "python3")))))
(add-after 'install 'install-doc
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((dest (format #f "~a/share/doc"
--
2.11.0
M
M
Marius Bakke wrote on 17 Aug 2017 23:54
87d17tzwpd.fsf@fastmail.com
Dave Love <fx@gnu.org> writes:

Toggle quote (5 lines)
> These put the extra bits from what I previously did as libnl3 into
> libnl. I don't know whether the handling of the Python interface is the
> right way to do it, but I don't think the Python is important anyway --
> Debian doesn't ship it.

Hello Dave,

Sorry for the delay, these fell through the cracks a bit. To save these
patches from bitrot, I went ahead and applied them with some changes,
detailed below. Hope I didn't mess anything up!

Toggle quote (8 lines)
> From d4986401bfcb2eacd7c7f437a50ca85d752cc904 Mon Sep 17 00:00:00 2001
> From: Dave Love <fx@gnu.org>
> Date: Wed, 2 Aug 2017 12:09:02 +0100
> Subject: [PATCH 3/4] gnu: libnl: Add "doc" output.
>
> * gnu/packages/linux.scm (libnl)[native-inputs, outputs]: Add doc source.
> [arguments]: New field.

I ended up rewriting the install-doc phase so that it extracts directly
to the "doc" output, and adjusted the commit message slightly.

Toggle quote (7 lines)
> From e64186082735f533bf172fcad491eaabed2928f0 Mon Sep 17 00:00:00 2001
> From: Dave Love <fx@gnu.org>
> Date: Wed, 2 Aug 2017 13:39:28 +0100
> Subject: [PATCH 4/4] gnu: libnl: Add "python2" and "python3" outputs.
>
> * gnu/packages/linux.scm (libnl)[native-inputs]: Extend.

Please mention all changed inputs here (e.g. for grepping purposes).

Toggle quote (9 lines)
> [outputs]: Add python2, python3.
> [install-python]: New phase.
> (native-inputs
> - `(("flex" ,flex) ("bison" ,bison)
> + `(("flex" ,flex)
> + ("bison" ,bison)
> + ("python-2" ,python-2)
> + ("python-3" ,python-3)

The Pythons here need to be regular inputs since they are referenced.

Toggle quote (10 lines)
> + (add-after 'install 'install-python
> + (lambda* (#:key outputs #:allow-other-keys)
> + (define (python-inst python)
> + (let ((ldflags (format #f "LDFLAGS=-Wl,-rpath=~a/lib"
> + (assoc-ref %outputs "out")))
> + (pyout (assoc-ref %outputs python)))
> + (and
> + ;; The rpm spec quoth "build twice, otherwise capi.py is
> + ;; not copied to the build directory"

I went ahead and removed this comment since we are not an RPM derived
distro, and always run "setup.py build" before "install" anyway.

Toggle quote (9 lines)
> + (zero? (system (format #f "~a ~a setup.py build"
> + ldflags python pyout)))
> + (zero?
> + (system (format #f "~a ~a setup.py install --prefix=~a"
> + ldflags python pyout)))
> + (zero? (system* python "setup.py" "clean")))))
> + (with-directory-excursion "./python"
> + (for-each python-inst '("python2" "python3")))))

(for-each ...) does not check (or preserve) the return value, so I
changed this to use (every ...) from SRFI-1.

Thanks for the patches!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlmWEK4ACgkQoqBt8qM6
VPrI+ggAi4t6J1278Pz7/j9KJEXtUM1ByttTauQPqw4GHeAxy6eSoDuyUBA9C5p+
MXEMXaswNPg2KBffVc/tLHh6oxuODECnJLozd7Ozmc8TOlXxqHKPlRgndQed0hai
4ZVa/+CihEua1PqC9+2s1Hju4Zx4TDPA02b3gLP86e2eiz/pO5LTpoO4Gm8zooAi
jwsfNg3i4piMzDC5sumwa6rij86Llnkfp2Ci6C5v5ltPR5hshDHr0i36LjOk/GmP
x9CZOe1BlZ4TTgmgHEoVwpMxiNywi3c3+KaGO/3Ge9wlI5ZTL8vpR+1QoMcL62/k
3LQbzZrf1PMdgkUjoipGeO+eq0qIyA==
=KKFO
-----END PGP SIGNATURE-----

Closed
D
D
Dave Love wrote on 23 Aug 2017 12:15
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 27915-done@debbugs.gnu.org)
87pobmh9o3.fsf@albion.it.manchester.ac.uk
Marius Bakke <mbakke@fastmail.com> writes:

Toggle quote (2 lines)
> Sorry for the delay, these fell through the cracks a bit.

No worries; thanks. I don't mean to argue below, just explain.
Apologies if this re-opens the issue -- I can't remember what debbugs does.

Toggle quote (6 lines)
>> * gnu/packages/linux.scm (libnl)[native-inputs, outputs]: Add doc source.
>> [arguments]: New field.
>
> I ended up rewriting the install-doc phase so that it extracts directly
> to the "doc" output, and adjusted the commit message slightly.

I wondered about that, but just did it as in rpm. For info, are there
policy or technical reasons for it?

Toggle quote (13 lines)
> Please mention all changed inputs here (e.g. for grepping purposes).
>
>> [outputs]: Add python2, python3.
>> [install-python]: New phase.
>> (native-inputs
>> - `(("flex" ,flex) ("bison" ,bison)
>> + `(("flex" ,flex)
>> + ("bison" ,bison)
>> + ("python-2" ,python-2)
>> + ("python-3" ,python-3)
>
> The Pythons here need to be regular inputs since they are referenced.

I think the documentation could do with clarification in this area; I'll
make a bug report about what's unclear to me. (For what it's worth, I
thought regular inputs would propagate to "out", and it wouldn't be
important to depend on Python for the Python outputs.)

Toggle quote (13 lines)
>> + (add-after 'install 'install-python
>> + (lambda* (#:key outputs #:allow-other-keys)
>> + (define (python-inst python)
>> + (let ((ldflags (format #f "LDFLAGS=-Wl,-rpath=~a/lib"
>> + (assoc-ref %outputs "out")))
>> + (pyout (assoc-ref %outputs python)))
>> + (and
>> + ;; The rpm spec quoth "build twice, otherwise capi.py is
>> + ;; not copied to the build directory"
>
> I went ahead and removed this comment since we are not an RPM derived
> distro, and always run "setup.py build" before "install" anyway.

[I just meant to note an apparent deficiency documented elsewhere that
might be relevant before the install step, e.g. in tests; I do the same
for rpm if I'm looking at an existing dpkg.] It's probably worth
specifying using build before install in the manual if that's required.
Closed
M
M
Marius Bakke wrote on 24 Aug 2017 20:11
(name . Dave Love)(address . fx@gnu.org)(address . 27915-done@debbugs.gnu.org)
87mv6o25vs.fsf@fastmail.com
Dave Love <fx@gnu.org> writes:

Toggle quote (16 lines)
> Marius Bakke <mbakke@fastmail.com> writes:
>
>> Sorry for the delay, these fell through the cracks a bit.
>
> No worries; thanks. I don't mean to argue below, just explain.
> Apologies if this re-opens the issue -- I can't remember what debbugs does.
>
>>> * gnu/packages/linux.scm (libnl)[native-inputs, outputs]: Add doc source.
>>> [arguments]: New field.
>>
>> I ended up rewriting the install-doc phase so that it extracts directly
>> to the "doc" output, and adjusted the commit message slightly.
>
> I wondered about that, but just did it as in rpm. For info, are there
> policy or technical reasons for it?

I did it mainly to avoid the double copy. Don't think there is any
policy or clear-cut technical reason (but avoiding I/O is good).

Toggle quote (16 lines)
>>> [outputs]: Add python2, python3.
>>> [install-python]: New phase.
>>> (native-inputs
>>> - `(("flex" ,flex) ("bison" ,bison)
>>> + `(("flex" ,flex)
>>> + ("bison" ,bison)
>>> + ("python-2" ,python-2)
>>> + ("python-3" ,python-3)
>>
>> The Pythons here need to be regular inputs since they are referenced.
>
> I think the documentation could do with clarification in this area; I'll
> make a bug report about what's unclear to me. (For what it's worth, I
> thought regular inputs would propagate to "out", and it wouldn't be
> important to depend on Python for the Python outputs.)

I was not sure where the references came from, just checked with `guix
gc -R /gnu/store/...libnl-python2`. Looking closer, capi.so sems to be
linked against the various Pythons.

Documentation updates greatly appreciated!

Toggle quote (18 lines)
>>> + (add-after 'install 'install-python
>>> + (lambda* (#:key outputs #:allow-other-keys)
>>> + (define (python-inst python)
>>> + (let ((ldflags (format #f "LDFLAGS=-Wl,-rpath=~a/lib"
>>> + (assoc-ref %outputs "out")))
>>> + (pyout (assoc-ref %outputs python)))
>>> + (and
>>> + ;; The rpm spec quoth "build twice, otherwise capi.py is
>>> + ;; not copied to the build directory"
>>
>> I went ahead and removed this comment since we are not an RPM derived
>> distro, and always run "setup.py build" before "install" anyway.
>
> [I just meant to note an apparent deficiency documented elsewhere that
> might be relevant before the install step, e.g. in tests; I do the same
> for rpm if I'm looking at an existing dpkg.] It's probably worth
> specifying using build before install in the manual if that's required.

Right. Maybe removing the comment entirely was a bit rash. I just
found it confusing, since we don't explicitly build it twice, but
eventually noticed that capi.py was "built" in the install step.

Anyway I'm sure the comment will reappear soon enough if this deficiency
indeed becomes apparent. Thanks for following up. :-)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlmfFrgACgkQoqBt8qM6
VPrmuggAtE5Mxx68jf3Nw4arm+vndIckMOUYkWoEeZxb3QQ2ND27pd3t+63YH/i8
jVr3X3WwrYBddAA49cxtkFnObsU7fDVTsg/NTVeUx2ILi0m0ovZ4ufHzxNzoqhM2
ShryiBWRqaH2aekVzqDrqmn3A1GssONVwPPXTnlf6Fyhcs5lhOGEa5YfHAXAEqnD
i1DqdhFskDLkaKNimk/xnbin1JFUXy3SBu9FNEH1OROQjolIYM2u89s1xqPPqALf
ti+KttDGkn4tjwajw+G7+EW+B1yn5CaccRqVpv0+ZuSUaURwLzRzBj/7bndMYdYt
7okYOy0j0r0XI7k9Rd999tZNy0k6og==
=iGs0
-----END PGP SIGNATURE-----

Closed
D
D
Dave Love wrote on 1 Sep 2017 12:49
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 27915-done@debbugs.gnu.org)
87h8wmzobd.fsf@albion.it.manchester.ac.uk
Marius Bakke <mbakke@fastmail.com> writes:

Toggle quote (2 lines)
> Documentation updates greatly appreciated!

Of course, once it's clear. Thanks for the explanations.
Closed
?