diff mbox series

[bug#74290,v2,23/40] gnu: netdde: Support the 64bit Hurd.

Message ID 52cd8b7a905961b0ea70dcfcae561792a833e3ba.1731427612.git.janneke@gnu.org
State New
Headers show
Series Add support for x86_64-gnu, aka the 64bit Hurd. | expand

Commit Message

Janneke Nieuwenhuizen Nov. 12, 2024, 4:25 p.m. UTC
* gnu/packages/patches/netdde-csum.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/hurd.scm (netdde)[source]: Use it.
[arguments]: Do not assume x86, rather use actual ARCH in #:make-flags,
disable -Wstrict-prototypes and -Wint-conversion, and follow upstream's
"amd64" symlinking voodoo.

Change-Id: Ie825e56779dae2f489066569dc3c4405bac778c1
---
 gnu/local.mk                           |  1 +
 gnu/packages/hurd.scm                  | 22 ++++++++++++++++++++--
 gnu/packages/patches/netdde-csum.patch | 18 ++++++++++++++++++
 3 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/netdde-csum.patch
diff mbox series

Patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 8c4f052b75..073a95a556 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1818,6 +1818,7 @@  dist_patch_DATA =						\
   %D%/packages/patches/ncftp-reproducible.patch			\
   %D%/packages/patches/netcdf-date-time.patch			\
   %D%/packages/patches/netdde-build-fix.patch			\
+  %D%/packages/patches/netdde-csum.patch			\
   %D%/packages/patches/netpbm-CVE-2017-2586.patch		\
   %D%/packages/patches/netpbm-CVE-2017-2587.patch		\
   %D%/packages/patches/netsurf-message-timestamp.patch		\
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index f9d8b28b8c..973564ee33 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -573,7 +573,8 @@  (define-public netdde
                 (uri (git-reference
                       (url "https://git.savannah.gnu.org/git/hurd/incubator.git")
                       (commit commit)))
-                (patches (list (search-patch "netdde-build-fix.patch")))
+                (patches (search-patches "netdde-build-fix.patch"
+                                         "netdde-csum.patch"))
                 (sha256
                  (base32
                   "070fpmd4nvn3mp8dj9w4if63iwz7j2m0h6ywq888znw70wlrc6sh"))
@@ -586,7 +587,13 @@  (define-public netdde
                               (search-input-file %build-inputs "/bin/bash"))
                "PKGDIR=libdde_linux26"
                (string-append "CC=" ,(cc-for-target))
-               "ARCH=x86")
+               (let ((arch ,(match (or (%current-target-system)
+                                       (%current-system))
+                              ((? target-x86-32?)
+                               "x86")
+                              ((? target-x86-64?)
+                               "amd64"))))
+                 (string-append "ARCH=" arch)))
          #:configure-flags
          ,#~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
          #:phases
@@ -604,8 +611,19 @@  (define-public netdde
                  (("/bin/bash") (which "bash")))))
            (add-after 'patch-generated-file-shebangs 'build-libdde-linux26
              (lambda* (#:key make-flags #:allow-other-keys)
+               (when ,(target-hurd64?)
+                 (let ((dir "libdde_linux26/build/include"))
+                   (mkdir-p (string-append dir "/x86"))
+                   (format #t "symlink ~a -> ~a\n"
+                           (string-append dir "/x86/amd64") "x86")
+                   (symlink "x86" (string-append dir "/amd64"))
+                   (format #t "symlink ~a -> ~a\n"
+                           (string-append dir "/amd64/asm-x86_64") "asm-x86")
+                   (symlink "asm-x86" (string-append dir "/amd64/asm-x86_64"))))
                (with-directory-excursion "libdde_linux26"
                  (apply invoke "make"
+                        (string-append "WARNINGS=-Wno-strict-prototypes"
+                                       " -Wno-int-conversion")
                         (delete "PKGDIR=libdde_linux26" make-flags)))))
            (add-after 'build-libdde-linux26 'convert
              (lambda* (#:key make-flags #:allow-other-keys)
diff --git a/gnu/packages/patches/netdde-csum.patch b/gnu/packages/patches/netdde-csum.patch
new file mode 100644
index 0000000000..4fdd004898
--- /dev/null
+++ b/gnu/packages/patches/netdde-csum.patch
@@ -0,0 +1,18 @@ 
+Upstream-status: Taken from debian.
+
+<https://salsa.debian.org/hurd-team/netdde/raw/master/debian/patches/csum>.
+
+---
+ linux/drivers/net/vmxnet3/vmxnet3_drv.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/linux/drivers/net/vmxnet3/vmxnet3_drv.c
++++ b/linux/drivers/net/vmxnet3/vmxnet3_drv.c
+@@ -25,6 +25,7 @@
+  */
+ 
+ #include "vmxnet3_int.h"
++#include <net/ip6_checksum.h>
+ 
+ char vmxnet3_driver_name[] = "vmxnet3";
+ #define VMXNET3_DRIVER_DESC "VMware vmxnet3 virtual NIC driver"