unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#27915] libnl additions
@ 2017-08-02 13:32 Dave Love
  2017-08-17 21:54 ` bug#27915: " Marius Bakke
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Love @ 2017-08-02 13:32 UTC (permalink / raw)
  To: 27915

[-- Attachment #1: Type: text/plain, Size: 237 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0003-gnu-libnl-Add-doc-output.patch --]
[-- Type: text/x-diff, Size: 1986 bytes --]

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(-)

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0004-gnu-libnl-Add-python2-and-python3-outputs.patch --]
[-- Type: text/x-diff, Size: 2909 bytes --]

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(-)

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#27915: libnl additions
  2017-08-02 13:32 [bug#27915] libnl additions Dave Love
@ 2017-08-17 21:54 ` Marius Bakke
  2017-08-23 10:15   ` [bug#27915] " Dave Love
  0 siblings, 1 reply; 5+ messages in thread
From: Marius Bakke @ 2017-08-17 21:54 UTC (permalink / raw)
  To: Dave Love, 27915-done

[-- Attachment #1: Type: text/plain, Size: 2978 bytes --]

Dave Love <fx@gnu.org> writes:

> 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!

> 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.  

> 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).

> [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.

> +           (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.

> +                    (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!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#27915] libnl additions
  2017-08-17 21:54 ` bug#27915: " Marius Bakke
@ 2017-08-23 10:15   ` Dave Love
  2017-08-24 18:11     ` Marius Bakke
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Love @ 2017-08-23 10:15 UTC (permalink / raw)
  To: Marius Bakke; +Cc: 27915-done

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?

> 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.)

>> +           (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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#27915] libnl additions
  2017-08-23 10:15   ` [bug#27915] " Dave Love
@ 2017-08-24 18:11     ` Marius Bakke
  2017-09-01 10:49       ` Dave Love
  0 siblings, 1 reply; 5+ messages in thread
From: Marius Bakke @ 2017-08-24 18:11 UTC (permalink / raw)
  To: Dave Love; +Cc: 27915-done

[-- Attachment #1: Type: text/plain, Size: 3013 bytes --]

Dave Love <fx@gnu.org> writes:

> 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).

>>> [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!

>>> +           (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. :-)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#27915] libnl additions
  2017-08-24 18:11     ` Marius Bakke
@ 2017-09-01 10:49       ` Dave Love
  0 siblings, 0 replies; 5+ messages in thread
From: Dave Love @ 2017-09-01 10:49 UTC (permalink / raw)
  To: Marius Bakke; +Cc: 27915-done

Marius Bakke <mbakke@fastmail.com> writes:

> Documentation updates greatly appreciated!

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-09-01 10:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-02 13:32 [bug#27915] libnl additions Dave Love
2017-08-17 21:54 ` bug#27915: " Marius Bakke
2017-08-23 10:15   ` [bug#27915] " Dave Love
2017-08-24 18:11     ` Marius Bakke
2017-09-01 10:49       ` Dave Love

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).