From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id KPKSFjvmZWQJIQEASxT56A (envelope-from ) for ; Thu, 18 May 2023 10:47:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id SJSFFjvmZWTILAEAauVa8A (envelope-from ) for ; Thu, 18 May 2023 10:47:55 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E1CC312DFF for ; Thu, 18 May 2023 10:47:54 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzZHv-0004Z8-Su; Thu, 18 May 2023 04:47:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzZHt-0004XY-HG for guix-patches@gnu.org; Thu, 18 May 2023 04:47:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pzZHt-0006ZQ-98 for guix-patches@gnu.org; Thu, 18 May 2023 04:47:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pzZHt-0002mF-57 for guix-patches@gnu.org; Thu, 18 May 2023 04:47:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63527] [PATCH v3 3/7] gnu: Add rumpkernel. Resent-From: Janneke Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 18 May 2023 08:47:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63527 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63527@debbugs.gnu.org Received: via spool by 63527-submit@debbugs.gnu.org id=B63527.168439961210609 (code B ref 63527); Thu, 18 May 2023 08:47:05 +0000 Received: (at 63527) by debbugs.gnu.org; 18 May 2023 08:46:52 +0000 Received: from localhost ([127.0.0.1]:52000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzZHf-0002l1-TI for submit@debbugs.gnu.org; Thu, 18 May 2023 04:46:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzZHP-0002j4-LL for 63527@debbugs.gnu.org; Thu, 18 May 2023 04:46:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzZH0-0006UH-VT; Thu, 18 May 2023 04:46:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=rDUwo9jyM14qcCRHiJja2XQuusOMr2fbjILphkyXf9w=; b=qPEsLqMS1cLL0VcekeH+ obRI9psnFz0LFIRGesbdvipywkD33Npo61fxK/qiwxVIARlPCU05Sohy/QqvA2OGIl2RGp5ZvQHvo nrFMHL1hNssCLbkd27aoG79jsHlt7Z99pLPC+t1CnbRK18L/w7yGoOM7mZH6InvtJs4a5aDZ4A6hb Zk6cYzrybICCFRfE+9mB9Rexlqrrdic864zHtl17W7BBrenaYelkj4qjZJeRgBdUdF4vVq9oTH/f9 vuNE/HiBB7en0Wr7ZH1TvRxSxhsqMWfelDRuY5TQtq+WBfTQsJTdFSzNykgOkZd0G2EjoYkaPmHAa zhFdqfaUAP3vng==; Received: from 2a02-a462-da03-1-2701-7f81-a736-4607.fixed6.kpn.net ([2a02:a462:da03:1:2701:7f81:a736:4607] helo=drakenpad.fritz.box) by fencepost.gnu.org with esmtpa (Exim 4.90_1) (envelope-from ) id 1pzZH0-0005TJ-Co; Thu, 18 May 2023 04:46:10 -0400 From: Janneke Nieuwenhuizen Date: Thu, 18 May 2023 10:46:01 +0200 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684399675; a=rsa-sha256; cv=none; b=o0xtcqAt2lv2fqkUyAbvn/Cd0+4jgowJVIaWxmnM27Jkk2iUU8qKZMdW9oJCLBxipaK0LQ tgJoGrIPdIc0MUc5nIig1lKi4Jg48OuXXoHJgbi5FF3Hg39ZeNPlbWJ2x11sAWCRqkqff5 yuj63upzDsy1kvJXzUojZfBebgAnb/pMiA7uM5snPRtO+J/FJFyUZUNdynCOezS4l3sFNo MLSBMSbQ5CwNjrkqvX5rRbiGyUGEujbn2cWXCV4url+8Gi+/tt7rso4swHScdQDnPc2L3b gSjHb6XzgnFLDncjENHW/pDw2koySm7AjL3XnLr/yC56b08NGGBjp0AGK6qNvw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=qPEsLqMS; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1684399675; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=rDUwo9jyM14qcCRHiJja2XQuusOMr2fbjILphkyXf9w=; b=hE4Ij3/1O6cASSv49AGBnqe9e2K50WvI++YmnzR2x4Y2OX3cCdKh92F4U5W0ZsuUntCtms dvMjiUvK885ZIGlVeipH0Rmrs4taB5BCJDbuWD25mv544BkyHle9TJkKIjm1BTV5VskCn9 uiaUkYVcUv56siWLO7NN03QB6nQSeYhHXhBJP5gl+zmRRNP1b1MOMfn7Tagc5Aoba369ac IRtzBm+uaFLmL5KbV9wITkk2GwKoytFDQwmhhXeJQGXHqLQmtskWYS6YwYefPQd57+em9U nsfB+tyj21uyPItRI1gNIXEqsYMizz9B10TNwzgFtpRCy8vibQjNieuvxlkJGQ== X-Migadu-Spam-Score: -2.11 X-Spam-Score: -2.11 X-Migadu-Queue-Id: E1CC312DFF X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=qPEsLqMS; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-TUID: QX/XcioBB3BB This uses the Debian Salsa rumpkernel package git as upstream as that is where delopment happens. Once things have stabalized upstream may change to the NetBSD git from where Debian takes their snapshots. * gnu/packages/hurd.scm (rumpkernel): New variable. --- gnu/packages/hurd.scm | 206 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm index da94b05272..c7ea86b266 100644 --- a/gnu/packages/hurd.scm +++ b/gnu/packages/hurd.scm @@ -662,3 +662,209 @@ (define-public netdde ;; Some drivers are dually licensed with the options being GPLv2 or one ;; of MPL/Expat/BSD-3 (dependent on the driver). (license gpl2)))) + +(define-public rumpkernel + (let ((commit "ec2ab9612be4dc48a316a21a0c96d3388478a064") + (revision "2")) + (package + (name "rumpkernel") + (version (git-version "0-20211031" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://salsa.debian.org/hurd-team/rumpkernel.git") + (commit commit))) + (sha256 + (base32 + "1ypjg3jyzhh3gnanmk6fh76dwl5ml78n311nbi0hw7f7hygzn7vk")) + (file-name (git-file-name name commit)))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f + #:modules '((srfi srfi-26) + (ice-9 match) + (ice-9 rdelim) + (guix build utils) + (guix build gnu-build-system)) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'apply-patches + (lambda* (#:key target #:allow-other-keys) + (let* ((patch-directory "debian/patches/") + (series (string-append patch-directory "series")) + (text (with-input-from-file series read-string)) + (lines (string-split (string-trim-right text) #\newline)) + (patches (filter (negate (cute string-prefix? "#" <>)) + lines)) + (patch-files (map + (cute string-append patch-directory <>) + patches))) + (for-each + (cute invoke "patch" "--force" "-p1" "-i" <>) + patch-files) + ;; Somewhere in the build.sh/make process MIG is not being + ;; exported, apparently. + (when target + (substitute* "pci-userspace/src-gnu/Makefile.inc" + (("MIG=mig") + (string-append "MIG=" target "-mig"))))))) + (add-before 'configure 'setenv + (lambda* (#:key build target #:allow-other-keys) + (define (noisy-setenv name value) + (setenv name value) + (format (current-error-port) "set ~a=~s\n" name value)) + (noisy-setenv "HOST_CC" "gcc") + (when target + (noisy-setenv "MIG" (string-append target "-mig"))) + (let ((target (or target build))) + (noisy-setenv "TARGET_AR" (string-append target "-ar")) + (noisy-setenv "TARGET_CC" (string-append target "-gcc")) + (noisy-setenv "TARGET_CXX" (string-append target "-g++")) + (noisy-setenv "TARGET_LD" (string-append target "-ld")) + (noisy-setenv "TARGET_MIG" (string-append target "-mig")) + (noisy-setenv "TARGET_NM" (string-append target "-nm"))) + (setenv "PAWD" "pwd") + (for-each + (cute noisy-setenv <> "") + '("_GCC_CRTENDS" + "_GCC_CRTEND" + "_GCC_CRTBEGINS" + "_GCC_CRTBEGIN" + "_GCC_CRTI" + "_GCC_CRTN")) + (noisy-setenv "BSDOBJDIR=" (string-append (getcwd) "/obj")))) + (replace 'configure + (lambda args + (let ((configure (assoc-ref %standard-phases 'configure))) + (with-directory-excursion "buildrump.sh/src/lib/librumpuser" + (apply configure args))))) + (replace 'build + (lambda* (#:key parallel-build? #:allow-other-keys) + (let* ((jobs (if parallel-build? (parallel-job-count) 1)) + (host-cpu (match #$(or (%current-target-system + (%current-system))) + ("i586-pc-gnu" "i386") + ("i686-linux" "i386") + ("x86_64-linux" "amd64"))) + (toprump (string-append + (getcwd) + "/buildrump.sh/src/sys/rump")) + (rump-make (string-append + (getcwd) + "/buildrump.sh/src/obj/tooldir/bin/nbmake-" + host-cpu))) + (mkdir "obj") + (with-directory-excursion "buildrump.sh/src" + (invoke + "sh" "build.sh" + "-V" "TOOLS_BUILDRUMP=yes" + "-V" "MKBINUTILS=no" + "-V" "MKGDB=no" + "-V" "MKGROFF=no" + "-V" (string-append "TOPRUMP=" toprump) + "-V" "BUILDRUMP_CPPFLAGS=-Wno-error=stringop-overread" + "-V" "RUMPUSER_EXTERNAL_DPLIBS=pthread" + "-V" (string-append + "CPPFLAGS=" + " -I../../obj/destdir." host-cpu "/usr/include" + " -D_FILE_OFFSET_BITS=64" + " -DRUMP_REGISTER_T=int" + " -DRUMPUSER_CONFIG=yes" + " -DNO_PCI_MSI_MSIX=yes" + " -DNUSB_DMA=1") + "-V" (string-append + "CWARNFLAGS=" + " -Wno-error=maybe-uninitialized" + " -Wno-error=address-of-packed-member" + " -Wno-error=unused-variable" + " -Wno-error=stack-protector" + " -Wno-error=array-parameter" + " -Wno-error=array-bounds" + " -Wno-error=stringop-overflow") + "-V" "LIBCRTBEGIN=" + "-V" "LIBCRTEND=" + "-V" "LIBCRT0=" + "-V" "LIBCRTI=" + "-V" "_GCC_CRTENDS=" + "-V" "_GCC_CRTEND=" + "-V" "_GCC_CRTBEGINS=" + "-V" "_GCC_CRTBEGIN=" + "-V" "_GCC_CRTI=" + "-V" "_GCC_CRTN=" + "-U" + "-u" + "-T" "./obj/tooldir" + "-m" host-cpu + "-j" (number->string jobs) + "tools" + "rump")) + (with-directory-excursion "buildrump.sh/src/lib/librumpuser" + (setenv "RUMPRUN" "true") + (invoke rump-make "dependall")) + (with-directory-excursion "pci-userspace/src-gnu" + (invoke rump-make "dependall"))))) + (replace 'install + (lambda _ + (define (install-file file target) + (let ((dest (string-append target (basename file)))) + (format (current-output-port) "`~a' -> `~a'~%" file dest) + (mkdir-p (dirname dest)) + (if (file-exists? dest) + (format (current-error-port) + "warning: skipping: ~a\n" file) + (let ((stat (lstat file))) + (case (stat:type stat) + ((symlink) + (let ((target (readlink file))) + (symlink target dest))) + (else + (copy-file file dest))))))) + (let ((header (string-append #$output "/include/rump")) + (lib (string-append #$output "/lib/"))) + (mkdir-p header) + (copy-recursively "buildrump.sh/src/sys/rump/include/rump" + header) + (mkdir-p lib) + (for-each + (cute install-file <> lib) + (append (find-files "buildrump.sh/src" "librump.*[.](a|so.*)") + (find-files "obj" "librump.*[.](a|so.*)"))))))))) + (inputs + (list gnumach-headers libpciaccess-0.17)) + (native-inputs + (list + autoconf + automake + libgcrypt + (if (%current-target-system) + (let* ((cross-base (resolve-interface '(gnu packages cross-base))) + (cross-mig (module-ref cross-base 'cross-mig))) + (cross-mig (%current-target-system))) + mig) + zlib)) + (supported-systems %hurd-systems) + (home-page "https://wiki.netbsd.org/rumpkernel") + (synopsis "NetBSD as rumpkernel for the GNU/Hurd") + (description + "This package provides NetBSD as rumpkernel for the GNU/Hurd, so that +the Hurd may be installed on iron. Using this rumpkernel package, the hurd +package's rumpdisk can be built which provides the pci.arbiter and rumpdisk +servers.") + (license (list + asl2.0 + boost1.0 + bsd-2 + bsd-3 + bsd-4 + cddl1.0 + expat + gpl1 + gpl2+ + gpl3+ + isc + lgpl2.0+ + public-domain + (@ (guix licenses) zlib) + (non-copyleft "file://src/lib/libc/hash/hashhl.c" + "See debian/copyright in the distribution.")))))) -- 2.39.2