From patchwork Sat May 3 18:20:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cayetano Santos X-Patchwork-Id: 42277 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 44C8427BC4D; Sat, 3 May 2025 19:20:34 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7DA9A27BC49 for ; Sat, 3 May 2025 19:20:33 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uBHT6-0006Ot-TF; Sat, 03 May 2025 14:20:08 -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 1uBHT3-0006OJ-IU for guix-patches@gnu.org; Sat, 03 May 2025 14:20:06 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uBHT2-0002NX-Gd for guix-patches@gnu.org; Sat, 03 May 2025 14:20:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=gwbZahh5Het4T8WbC5cR1SWi/nxytf+8jpWuVxoZBKU=; b=MwQ+rC8DbmLXTZ43puX8X8medqW7y8RSh3PdolvmBK5da8sTZdMvQm/M71RVJHmmxoN0ZdCdS6QIiFfzAsGmh/N1V3QO0afAYH60YIF9O1PFnvpXbwdWcNgw9Ht0pcj1l/7SChurxmcApI1SbDJzm/68FGBsxDutf6sNZIYZfvFeSfvHgyR3Q33S+DuYVtRVkydiRGVkrl+Ce6m2jTSJgF+hx0YFMygmFxn0zmdvUMn0M1wBRrylglhwC14l3vWDMyOsjLVVo5/n8Yte6y385097byHvJE4tulUM+pJ3uY9dsFLraMJFecQfE6V8JHr7+fn1Q0C/QcoYFi0XCh7PCw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uBHSz-0006P4-TR; Sat, 03 May 2025 14:20:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78233] [PATCH 1/2] gnu: Add nextpnr. Resent-From: Cayetano Santos Original-Sender: "Debbugs-submit" Resent-CC: csantosb@inventati.org, ekaitz@elenq.tech, gabriel@erlikon.ch, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Sat, 03 May 2025 18:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78233 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78233@debbugs.gnu.org Cc: Cayetano Santos , Cayetano Santos , Ekaitz Zarraga , Gabriel Wicki , Maxim Cournoyer X-Debbugs-Original-Xcc: Cayetano Santos , Ekaitz Zarraga , Gabriel Wicki , Maxim Cournoyer Received: via spool by 78233-submit@debbugs.gnu.org id=B78233.174629639024574 (code B ref 78233); Sat, 03 May 2025 18:20:01 +0000 Received: (at 78233) by debbugs.gnu.org; 3 May 2025 18:19:50 +0000 Received: from localhost ([127.0.0.1]:43284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uBHSn-0006OH-Vt for submit@debbugs.gnu.org; Sat, 03 May 2025 14:19:50 -0400 Received: from confino.investici.org ([93.190.126.19]:57231) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uBHSi-0006Nr-B5 for 78233@debbugs.gnu.org; Sat, 03 May 2025 14:19:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inventati.org; s=stigmate; t=1746296382; bh=gwbZahh5Het4T8WbC5cR1SWi/nxytf+8jpWuVxoZBKU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vxt3sjQJqmebEmUkv55qNUUbvl8CrnI8LmwiK6wAYyZUj0aPhStoWf9l3KjVMkxdb PkPq1k0x/FgMYZOcnjQ7mO7oaJsTBEY6/EW/geYLHdH3cAYrg+2nU0gc8v/zj26ch3 qDZS1hApxnIhqGra2c8VFN1DNdU3Tq1C/S3KP7qA= Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4Zqbfk231Sz11JG; Sat, 3 May 2025 18:19:42 +0000 (UTC) Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19]) (Authenticated sender: cayetano.santos@inventati.org) by localhost (Postfix) with ESMTPSA id 4Zqbfj6hT5z11JF; Sat, 3 May 2025 18:19:41 +0000 (UTC) Date: Sat, 3 May 2025 20:20:05 +0200 Message-ID: <29af3cc1065ab7b7c02dc36d68fa845db37e22d1.1746294265.git.csantosb@inventati.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 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: , Reply-to: Cayetano Santos X-ACL-Warn: , Cayetano Santos via Guix-patches X-Patchwork-Original-From: Cayetano Santos via Guix-patches via From: Cayetano Santos Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/fpga.scm (nextpnr): New variable. Change-Id: Ic3476a6a4220ec20191897a6efb3d4aa347b51c2 --- gnu/packages/fpga.scm | 78 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm index 2298dde595..9dbd1a4564 100644 --- a/gnu/packages/fpga.scm +++ b/gnu/packages/fpga.scm @@ -178,6 +178,84 @@ (define-public iverilog ;; You have to accept both GPL2 and LGPL2.1+. (license (list license:gpl2 license:lgpl2.1+)))) +(define nextpnr + (package + (name "nextpnr") + (version "0.8") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/YosysHQ/nextpnr/") + (commit (string-append "nextpnr-" version)) + ;; Required to get oourafft, json11, python-console and + ;; QtPropertyBrowser, not packaged in Guix. + (recursive? #t))) + (file-name (git-file-name name version)) + (modules '((guix build utils))) + (snippet + ;; Remove bundled source code for which Guix has packages. + '(with-directory-excursion "3rdparty" + (for-each delete-file-recursively + '("googletest" "imgui" "pybind11" "qtimgui" + "sanitizers-cmake" "corrosion")))) + (sha256 + (base32 "0p53a2gl89hf3hfwdxs6pykxyrk82j4lqpwd1fqia2y0c9r2gjlm")))) + (build-system qt-build-system) + (arguments + (list + #:cmake cmake ;CMake 3.25 or higher is required + #:configure-flags + #~(list "-DBUILD_GUI=OFF" + "-DUSE_OPENMP=yes" + "-DBUILD_TESTS=ON" + (string-append "-DCURRENT_GIT_VERSION=nextpnr-" #$version) + "-DUSE_IPO=OFF") + #:phases + #~(modify-phases %standard-phases + ;; Remove references to unbundled code and link against external + ;; libraries instead. + (add-after 'unpack 'patch-source + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "CMakeLists.txt" + ;; Use the system sanitizers-cmake module. + (("\\$\\{CMAKE_SOURCE_DIR\\}/3rdparty/sanitizers-cmake/cmake") + (string-append #$(this-package-native-input "sanitizers-cmake") + "/share/sanitizers-cmake/cmake")) + ;; Use the system googletest module + (("^\\s+add_subdirectory\\(3rdparty/googletest.*") + "") + ;; Use the system corrosion module + (("^\\s+add_subdirectory\\(3rdparty/corrosion.*") + "") + ;; replace gtest_main by gtest + (("^(\\s+target_link_libraries.*)( gtest_main)" _ prefix suffix) + (string-append prefix " gtest"))) + ;; Use the system imgui module + (substitute* "gui/CMakeLists.txt" + (("\\$\\{CMAKE_SOURCE_DIR\\}(/3rdparty/imgui)") + (string-append #$(this-package-input "imgui") + "/include/imgui")) + (("\\$\\{CMAKE_SOURCE_DIR\\}(/3rdparty/qtimgui)") + (string-append #$(this-package-input "qtimgui") + "/include/qtimgui")) + (("^\\s+../3rdparty/(qt)?imgui.*") + ""))))))) + (native-inputs (list googletest sanitizers-cmake)) + (inputs (list boost + corrosion + eigen + imgui + pybind11 + python + qtbase-5 + qtimgui + qtwayland-5)) + (synopsis "Place-and-Route tool for FPGAs") + (description "Nextpnr is a portable FPGA place and route tool.") + (home-page "https://github.com/YosysHQ/nextpnr/") + (license license:asl2.0))) + (define-public yosys (package (name "yosys") From patchwork Sat May 3 18:20:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cayetano Santos X-Patchwork-Id: 42278 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D783227BC49; Sat, 3 May 2025 19:20:34 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D42E627BC4B for ; Sat, 3 May 2025 19:20:33 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uBHT5-0006Or-7d; Sat, 03 May 2025 14:20: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 1uBHT3-0006OK-Iu for guix-patches@gnu.org; Sat, 03 May 2025 14:20:05 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uBHT1-0002Ke-Ow for guix-patches@gnu.org; Sat, 03 May 2025 14:20:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=qjZktaLzdtVMFPSF6H4+vxMk6DyP5e0H5vEuAlHhO90=; b=iIvzr9j1qFe2CI/ApkkPOn22C4OsPRUsrbkhoJQS8BHetikaes/IlySXfH3IMd29hBJwVAjOBanyknMRc3aSr3V61HZZNsEHUwFtpY91DSbY1tJabEx8JjwcKpNB2JpKoewgBMrmn0C+BBp+JnxVsmldaILS3/oMyqciFiVb8NgCCCPVmQHBqUn8CBq4OnIIsZhzcdOZyMwTGY6Y5H3f8nIGRCgm0OrWitD5CJTyO67weF8IUAu1xJDT/F/lt4s+T5j4Dp+bpUQaz+EU+22oY4//0UjwcrKmG7D8/fA+exwzHfHPiZYIKPBWgs+UgBJg6RkIwziVjXrSD6HzU07oyQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uBHT0-0006PA-BV; Sat, 03 May 2025 14:20:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78233] [PATCH 2/2] gnu: nextpnr-ice40: Update to 0.8. Resent-From: Cayetano Santos Original-Sender: "Debbugs-submit" Resent-CC: csantosb@inventati.org, ekaitz@elenq.tech, gabriel@erlikon.ch, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Sat, 03 May 2025 18:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78233 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78233@debbugs.gnu.org Cc: Cayetano Santos , Cayetano Santos , Ekaitz Zarraga , Gabriel Wicki , Maxim Cournoyer X-Debbugs-Original-Xcc: Cayetano Santos , Ekaitz Zarraga , Gabriel Wicki , Maxim Cournoyer Received: via spool by 78233-submit@debbugs.gnu.org id=B78233.174629639124583 (code B ref 78233); Sat, 03 May 2025 18:20:02 +0000 Received: (at 78233) by debbugs.gnu.org; 3 May 2025 18:19:51 +0000 Received: from localhost ([127.0.0.1]:43286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uBHSo-0006OO-E1 for submit@debbugs.gnu.org; Sat, 03 May 2025 14:19:50 -0400 Received: from confino.investici.org ([93.190.126.19]:58359) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uBHSl-0006Nx-HY for 78233@debbugs.gnu.org; Sat, 03 May 2025 14:19:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inventati.org; s=stigmate; t=1746296386; bh=qjZktaLzdtVMFPSF6H4+vxMk6DyP5e0H5vEuAlHhO90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T0MGxKZdvRTMjmyhoA/oDbfkKXN4Sz45gigAbsiqD07wewIU/5o1QUuTmIQPG8g2y 8xTqxELaeMSh1ck333aOBPcoagB13UPEq5vINwQUT5iCj3QL06G4fo01PdXkSYk4cd XWeTf5ILXnLthlFKX5w2EnZkKRO3xfSg2Lk4JFMM= Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4Zqbfp4VW4z11JR; Sat, 3 May 2025 18:19:46 +0000 (UTC) Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19]) (Authenticated sender: cayetano.santos@inventati.org) by localhost (Postfix) with ESMTPSA id 4Zqbfp23pqz11JF; Sat, 3 May 2025 18:19:46 +0000 (UTC) Date: Sat, 3 May 2025 20:20:06 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 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: , Reply-to: Cayetano Santos X-ACL-Warn: , Cayetano Santos via Guix-patches X-Patchwork-Original-From: Cayetano Santos via Guix-patches via From: Cayetano Santos Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/fpga.scm (nextpnr-ice40): Update to 0.8. Change-Id: I8d1c3528679f38ec4593f90aec0f1c4321dc7e44 --- gnu/packages/fpga.scm | 138 +++++++++++++----------------------------- 1 file changed, 41 insertions(+), 97 deletions(-) diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm index 9dbd1a4564..e5c3313487 100644 --- a/gnu/packages/fpga.scm +++ b/gnu/packages/fpga.scm @@ -256,6 +256,47 @@ (define nextpnr (home-page "https://github.com/YosysHQ/nextpnr/") (license license:asl2.0))) +(define-public nextpnr-ice40 + (package + (inherit nextpnr) + (name "nextpnr-ice40") + (arguments + (substitute-keyword-arguments (package-arguments nextpnr) + ;; tests + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + ;; get icestorm/examples + (add-after 'compress-documentation 'get-icestorm + (lambda* (#:key inputs #:allow-other-keys) + (copy-recursively + #$(origin (inherit (package-source icestorm))) + "icestorm"))) + ;; run all icestorm/examples as tests + (add-after 'get-icestorm 'tests-icestorm-examples + (lambda* _ + (let ((dir (opendir "icestorm/examples"))) + (do ((entry (readdir dir) + (readdir dir))) + ((eof-object? entry)) + (when (not (member entry '("." ".."))) + (setenv "PATH" + (string-append (string-append #$output "/bin") + ":" + (getenv "PATH"))) + (invoke "make" "-C" + (string-append "icestorm/examples/" entry)))) + (closedir dir)))))) + ((#:configure-flags original-flags #~(list)) + #~(append #$original-flags + `("-DARCH=ice40" + ,(string-append "-DICESTORM_INSTALL_PREFIX=" + #$(this-package-input "icestorm"))))))) + (propagated-inputs (modify-inputs (package-propagated-inputs nextpnr) + (prepend icestorm))) + ;; tests + (native-inputs (modify-inputs (package-native-inputs nextpnr) + (prepend yosys))))) + (define-public yosys (package (name "yosys") @@ -434,103 +475,6 @@ (define-public icestorm files.") (license license:isc)))) -(define-public nextpnr-ice40 - (let* ((version "0.7") - (tag (string-append "nextpnr-" version))) - (package - (name "nextpnr-ice40") - (version version) - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/YosysHQ/nextpnr") - (commit tag) - (recursive? #t))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "0sbhqscgmlk4q2207rsqsw99qx4fyrxx1hsd669lrk42gmk3s9lm")) - (modules '((guix build utils))) - (snippet - #~(begin - ;; Remove bundled source code for which Guix has packages. - ;; Note the bundled copies of json11 and python-console contain - ;; modifications, while QtPropertyBrowser appears to be - ;; abandoned and without an official source. - ;; fpga-interchange-schema is used only by the - ;; "fpga_interchange" architecture target, which this package - ;; doesn't build. - (with-directory-excursion "3rdparty" - (for-each delete-file-recursively - '("googletest" "imgui" "pybind11" "qtimgui" - "sanitizers-cmake"))) - - ;; Remove references to unbundled code and link against external - ;; libraries instead. - (substitute* "CMakeLists.txt" - (("^\\s+add_subdirectory\\(3rdparty/googletest.*") "") - (("^(\\s+target_link_libraries.*)( gtest_main\\))" - _ prefix suffix) - (string-append prefix " gtest" suffix))) - (substitute* "gui/CMakeLists.txt" - (("^\\s+../3rdparty/(qt)?imgui.*") "") - (("^(target_link_libraries.*)\\)" _ prefix) - (string-append prefix " imgui qt_imgui_widgets)"))))))) - (native-inputs - (list googletest sanitizers-cmake)) - (inputs - (list boost - eigen - icestorm - imgui-1.86 - pybind11 - python - qtbase-5 - qtwayland-5 - qtimgui - yosys)) - (build-system qt-build-system) - (arguments - (list - #:configure-flags - #~(list "-DARCH=ice40" - "-DBUILD_GUI=ON" - "-DBUILD_TESTS=ON" - (string-append "-DCURRENT_GIT_VERSION=" #$tag) - (string-append "-DICESTORM_INSTALL_PREFIX=" - #$(this-package-input "icestorm")) - "-DUSE_IPO=OFF") - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'patch-source - (lambda* (#:key inputs #:allow-other-keys) - (substitute* "CMakeLists.txt" - ;; Use the system sanitizers-cmake module. - (("\\$\\{CMAKE_SOURCE_DIR\\}/3rdparty/sanitizers-cmake/cmake") - (string-append - #$(this-package-native-input "sanitizers-cmake") - "/share/sanitizers-cmake/cmake"))) - (substitute* "gui/CMakeLists.txt" - ;; Compile with system imgui and qtimgui headers. - (("^(target_include_directories.*)../3rdparty/imgui(.*)$" - _ prefix suffix) - (string-append prefix - (search-input-directory inputs - "include/imgui") - suffix)) - (("^(target_include_directories.*)../3rdparty/qtimgui/(.*)$" - _ prefix suffix) - (string-append prefix - (search-input-directory inputs - "include/qtimgui") - suffix)))))))) - (synopsis "Place-and-Route tool for FPGAs") - (description "Nextpnr aims to be a vendor neutral, timing driven, FOSS -FPGA place and route tool.") - (home-page "https://github.com/YosysHQ/nextpnr") - (license license:expat)))) - (define-public gtkwave (package (name "gtkwave")