add libnl3

  • Done
  • quality assurance status badge
Details
3 participants
  • Dave Love
  • Ludovic Courtès
  • Marius Bakke
Owner
unassigned
Submitted by
Dave Love
Severity
normal
D
D
Dave Love wrote on 1 Aug 2017 22:29
(address . guix-patches@gnu.org)
87y3r3821h.fsf@i-ulialbion.it.manchester.ac.uk
This is the first step in openfabrics support. I've also done
libibverbs, but need to check that. Let me know if someone else is
working on openfabrics.
From 8eb82c832622761e9a50a860f33addc3c15caf13 Mon Sep 17 00:00:00 2001
From: Dave Love <fx@gnu.org>
Date: Tue, 01 Aug 2017 21:22:26 +0100
Subject: [PATCH 52/69] gnu: Add libnl3.

* gnu/packages/linux.scm (libnl3): New variable.
---
gnu/packages/linux.scm | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 75 insertions(+)

Toggle diff (85 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 93a6a583a..6914e60a8 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4195,3 +4195,78 @@ tool, to understand the type of environment a process runs in, and for
comparing system environments.")
(home-page "http://github.com/jamesodhunt/procenv/")
(license license:gpl3+)))
+
+;; Fixme: Is this the right way/a good way to deal with the Python bits?
+(define-public libnl3
+ (begin
+ (use-modules (gnu packages swig))
+ (package
+ (name "libnl3")
+ (version "3.3.0")
+ (build-system gnu-build-system)
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/thom311/libnl/releases/download/libnl"
+ (string-join (string-split version #\.) "_")
+ "/libnl-" version ".tar.gz"))
+ (sha256
+ (base32 "1r3lw3hjvqxi5zqyq2w1qadm3gisd9nlf71dkl4yplacmssnhm3h"))))
+ (native-inputs
+ `(("flex" ,flex)
+ ("bison" ,bison)
+ ("python-2" ,python-2)
+ ("python-3" ,python-3)
+ ("swig" ,swig)
+ ("pkg-config" ,pkg-config)
+ ("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"))
+ (arguments
+ `(#:configure-flags
+ `(,(format #f "LDFLAGS=-Wl,-rpath=~a/lib" (assoc-ref %outputs "out")))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'install-python
+ (let ((out (assoc-ref %outputs "out")))
+ (lambda* (#:key outputs #:allow-other-keys)
+ (define (python-inst python)
+ (let ((ldflags (format #f "LDFLAGS=-Wl,-rpath=~a/lib" out)))
+ (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 out)))
+ (zero?
+ (system (format #f "~a ~a setup.py install --prefix=~a"
+ ldflags python out)))
+ (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"
+ (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 "Convenience library for Linux netlink sockets")
+ (description
+ "The libnl suite is a collection of libraries providing APIs to netlink
+protocol based Linux kernel interfaces.
+
+Netlink is an IPC mechanism primarly between the kernel and user space
+processes. It was designed to be a more flexible successor to ioctl to
+provide mainly networking related kernel configuration and monitoring
+interfaces.")
+ (license license:lgpl2.1))))
--
2.11.0
M
M
Marius Bakke wrote on 1 Aug 2017 23:07
87shhbvvxs.fsf@fastmail.com
Dave Love <fx@gnu.org> writes:

Toggle quote (4 lines)
> This is the first step in openfabrics support. I've also done
> libibverbs, but need to check that. Let me know if someone else is
> working on openfabrics.

Hi Dave,

We already have the netlink bindings under the name 'libnl', but it
probably doesn't install the Python bits. Can you adjust this patch to
improve the existing package?

We also have libibverbs in 'rdma-core'. I haven't tested the
functionality of it, though.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlmA7ZAACgkQoqBt8qM6
VPrFXQf+MCKOWEYKf7JcGbJyX8TuCQ8ezFEnO85cQgDq5VYtIcbtaTpLhrM+ujhH
eTVVzf6Z8LDdME2KzPOEf8cLOOTKaviDhZAf3asr06It8KUGZy21ahgW7b3AWSGk
67PMmsevIS/F8eRsYhBqW81wil4iIkXLZk2nxpizZWOnO4QlhnPVwbeKvip/5u7v
wXcizSpXqUQahmQBHj4nUCNmnPnDKKl7HXB2R4l2xl399HPB0tOPfxNLNf7oys4r
VSHOP6LWhysBf15hj9UOhYrMdzQOO9cWoSw8bOEgDvp3KA5f0nEXuQh02eOPEQ2I
Sk/eEKcD/gCEs6dcxVZsssb8UvnqFw==
=/d5y
-----END PGP SIGNATURE-----

D
D
Dave Love wrote on 2 Aug 2017 11:28
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 27912@debbugs.gnu.org)
87h8xq8giu.fsf@i-ulialbion.it.manchester.ac.uk
Marius Bakke <mbakke@fastmail.com> writes:

Toggle quote (9 lines)
> Hi Dave,
>
> We already have the netlink bindings under the name 'libnl', but it
> probably doesn't install the Python bits. Can you adjust this patch to
> improve the existing package?
>
> We also have libibverbs in 'rdma-core'. I haven't tested the
> functionality of it, though.

Oops -- thanks! I'm puzzled how I missed libnl, in particular. I don't
know whether the Python support is really worth it, but it's in the
Fedora rpm, and I'll try to fit it in.

I'd expect rdma-core in linux.scm not to be the userspace components,
but then I'm also puzzled why I didn't find verbs with --search and it
was on Ludo's todo list. I'll look at psm support and libfabrics when I
have a chance.
L
L
Ludovic Courtès wrote on 8 Sep 2017 18:02
control message for bug #27912
(address . control@debbugs.gnu.org)
87bmml89gr.fsf@gnu.org
tags 27912 fixed
close 27912
?