From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id X2zMI9p2J2Eo3AAAgWs5BA (envelope-from ) for ; Thu, 26 Aug 2021 13:11:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id OM3CHtp2J2EUVgAAbx9fmQ (envelope-from ) for ; Thu, 26 Aug 2021 11:11:22 +0000 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 2CADB11461 for ; Thu, 26 Aug 2021 13:11:22 +0200 (CEST) Received: from localhost ([::1]:37394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJDI0-0005JG-Lx for larch@yhetil.org; Thu, 26 Aug 2021 07:11:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJDHk-0005GQ-Iq for guix-patches@gnu.org; Thu, 26 Aug 2021 07:11:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36956) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJDHi-0001MH-3I for guix-patches@gnu.org; Thu, 26 Aug 2021 07:11:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mJDHh-0001Du-Ue for guix-patches@gnu.org; Thu, 26 Aug 2021 07:11:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50157] [PATCH v2 1/2] build-system: linux-module: Support source-directory. References: <20210821220053.31441-1-leo.prikler@student.tugraz.at> In-Reply-To: <20210821220053.31441-1-leo.prikler@student.tugraz.at> Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 26 Aug 2021 11:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50157 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50157@debbugs.gnu.org Cc: maximedevos@telenet.be, efraim@flashner.co.il Received: via spool by 50157-submit@debbugs.gnu.org id=B50157.16299762564675 (code B ref 50157); Thu, 26 Aug 2021 11:11:01 +0000 Received: (at 50157) by debbugs.gnu.org; 26 Aug 2021 11:10:56 +0000 Received: from localhost ([127.0.0.1]:48499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJDHb-0001DK-Ow for submit@debbugs.gnu.org; Thu, 26 Aug 2021 07:10:56 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:8478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJDHZ-0001DB-Uw for 50157@debbugs.gnu.org; Thu, 26 Aug 2021 07:10:55 -0400 Received: from localhost.localdomain (194-118-34-199.adsl.highway.telekom.at [194.118.34.199]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4GwKs62b0Cz1LZWB; Thu, 26 Aug 2021 13:10:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4GwKs62b0Cz1LZWB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1629976250; bh=xPqcyspfjmWUi3voxvSui17aL5Sm8k62LvHvmmG6qwY=; h=From:To:Cc:Subject:Date:From; b=TywMdG6uRjyhmTLAzHekjd1wUm2yFc9y64rJkfrqzBduzEMaXdg40rsK6u2HdihK0 s9xHAZIY68DFn4N7HAC4OCXkSQrq9RjPTrfukhCj2+nBK7i1Czs0OFhJHO2uaxaDGT IWwPfaf9NSUAgRW0zMtChksXDfYWEWV5xsJ5TBQ0= From: Leo Prikler Date: Thu, 26 Aug 2021 13:10:34 +0200 Message-Id: <20210826111035.20464-1-leo.prikler@student.tugraz.at> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1629976282; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=xPqcyspfjmWUi3voxvSui17aL5Sm8k62LvHvmmG6qwY=; b=ZqLFSYyxXm84zP02R30Dc5pl5v5v/W9lWx9+rcMVWGl1CTP3oP8Q2CRAGyqmHy7Fx6Q2N1 YvieX0NmBSiJdJCE2z+4p5pt65OToAHSemXGcyEBXIQhAleFFOo11afoauM2q2Wtml1X26 YtBWSiqW4Ojaat2l1PibhoUr08pA/D+icwb9Wak3UjTFKziMTXwBKX6IhJguaXA3OpKc30 qIGe+/NzCaDekvMWhbp97Dxi8TNDxiIe6coMMmntzkMWG90BmcGSOgYKYomSi8BAd74LoM h2S54vr4NkxKy4UKWl7Lq0E02zQGgWM4mnylgL61n1iP407porE3Gn9/P+0XDQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629976282; a=rsa-sha256; cv=none; b=iuzdIyif0bvJBnJGg5EwpDeWzh2NNeMm5tKsGDbyHvnOKk0NMkBzfg12BnW1GSf2RhrOZ4 nX2ok/F3813l5H5/wEIMvnKC3glNFi/W9i8znlFCdPC4gZsOkPZkY1BXlNH0E3qC1r0Exd M2ygGceIUTONuEblWyrHFw4jw5xGOh3p+lOMIVGlKuB9zogYBpr3hLYS3r77Cxy8bYDG+1 bTup3Qg6xvcCuaxbxZxj6iky+MIucWDu50IJe5gmjEDuQfAjY6o9aLSMKexrmnKNsKo5cb 2ndWEM0WnySvuGtgVDZC03sUaMYmjPZWRvBrLpR8EfVPHKsNLKDg8Cwt3JrwhQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=TywMdG6u; dmarc=fail reason="SPF not aligned (relaxed)" header.from=student.tugraz.at (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 3.67 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=TywMdG6u; dmarc=fail reason="SPF not aligned (relaxed)" header.from=student.tugraz.at (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 2CADB11461 X-Spam-Score: 3.67 X-Migadu-Scanner: scn0.migadu.com X-TUID: wOvDQe934ODU As with guile-build-system, the module to be build need not necessarily live at the root of the build tree. * guix/build/linux-module-build-system.scm (build, install): Add source-directory argument and append it to "M" variable when invoking make. * guix/build-system/linux-module.scm (linux-module-build): Add source-directory argument. --- guix/build-system/linux-module.scm | 4 +++- guix/build/linux-module-build-system.scm | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/guix/build-system/linux-module.scm b/guix/build-system/linux-module.scm index fc3d959ce7..33bc8c95df 100644 --- a/guix/build-system/linux-module.scm +++ b/guix/build-system/linux-module.scm @@ -158,6 +158,7 @@ (outputs '("out")) (make-flags ''()) (system (%current-system)) + (source-directory ".") (guile #f) (substitutable? #t) (imported-modules @@ -175,7 +176,8 @@ ((source) source) (source - source)) + source)) + #:source-directory ,source-directory #:search-paths ',(map search-path-specification->sexp search-paths) #:phases ,phases diff --git a/guix/build/linux-module-build-system.scm b/guix/build/linux-module-build-system.scm index d51d76f94b..729ab6154f 100644 --- a/guix/build/linux-module-build-system.scm +++ b/guix/build/linux-module-build-system.scm @@ -49,16 +49,17 @@ ; TODO: kernel ".config". #t) -(define* (build #:key inputs make-flags #:allow-other-keys) +(define* (build #:key inputs make-flags (source-directory ".") #:allow-other-keys) (apply invoke "make" "-C" (string-append (assoc-ref inputs "linux-module-builder") "/lib/modules/build") - (string-append "M=" (getcwd)) + (string-append "M=" (getcwd) "/" source-directory) (or make-flags '()))) ;; This block was copied from make-linux-libre--only took the "modules_install" ;; part. -(define* (install #:key make-flags inputs native-inputs outputs +(define* (install #:key make-flags (source-directory ".") + inputs native-inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (moddir (string-append out "/lib/modules"))) @@ -67,7 +68,7 @@ (apply invoke "make" "-C" (string-append (assoc-ref inputs "linux-module-builder") "/lib/modules/build") - (string-append "M=" (getcwd)) + (string-append "M=" (getcwd) "/" source-directory) ;; Disable depmod because the Guix system's module directory ;; is an union of potentially multiple packages. It is not ;; possible to use depmod to usefully calculate a dependency -- 2.33.0