From patchwork Wed Mar 19 10:21:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cayetano Santos X-Patchwork-Id: 40426 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 E24FC27BBEA; Wed, 19 Mar 2025 10:25:57 +0000 (GMT) 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 BD56127BBE2 for ; Wed, 19 Mar 2025 10:25:56 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tuqbu-0000sP-2o; Wed, 19 Mar 2025 06:25:22 -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 1tuqbh-0000oS-JC for guix-patches@gnu.org; Wed, 19 Mar 2025 06:25: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 1tuqbe-0004Lh-QE for guix-patches@gnu.org; Wed, 19 Mar 2025 06:25:03 -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:Date:From:To:Subject; bh=Xa0QBAdvBrengEunl/qB92QSPkuGAa3HRvfq+OgVmU0=; b=V3zwYoeN4kUrl3+2n19CvMZa4u3GKetSyFCpiAbBul4fPmCxPTrntkVzfIvqqi/m4cvipICGYchTmZiXsH9NjiPX+22IKTrXliEWuxH0Kqt7Z1aKIzAamY1YtCqrxQW68zHBu4i5GkEAA8e7OzwRp8SUxVv4W5GES2d+usl0i+lFYcr0KcBxjKldCLuWb7eKPKXVxikTWlWB/IrNkUbtMGb/XciDBJgYBfI8OkzaJbOHLTbZHKiPxwd5N5fv6qrwGfwwFRyuuXivX6Wz2hfKAwCniYyfrUqP+17pRE/tGk7V0EzCSJSnDfAAHZLvWJuV/D4sUlfmbDiv2aMHc6yYeg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tuqbe-0001AV-Hy for guix-patches@gnu.org; Wed, 19 Mar 2025 06:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77114] [PATCH] gnu: nextpnr: split devices. Resent-From: Cayetano Santos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 19 Mar 2025 10:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 77114 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77114@debbugs.gnu.org Cc: Cayetano Santos X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17423798534391 (code B ref -1); Wed, 19 Mar 2025 10:25:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Mar 2025 10:24:13 +0000 Received: from localhost ([127.0.0.1]:48534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tuqaq-00018l-6V for submit@debbugs.gnu.org; Wed, 19 Mar 2025 06:24:12 -0400 Received: from lists.gnu.org ([2001:470:142::17]:37912) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tuqan-00018Q-BI for submit@debbugs.gnu.org; Wed, 19 Mar 2025 06:24:09 -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 1tuqac-0000YT-S9 for guix-patches@gnu.org; Wed, 19 Mar 2025 06:23:59 -0400 Received: from latitanza.investici.org ([82.94.249.234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tuqaZ-00046u-M7 for guix-patches@gnu.org; Wed, 19 Mar 2025 06:23:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inventati.org; s=stigmate; t=1742379823; bh=Xa0QBAdvBrengEunl/qB92QSPkuGAa3HRvfq+OgVmU0=; h=From:To:Cc:Subject:Date:From; b=UR1A7xEyQsNwvptalRVXZYBXb+OCj59VnZgjvAeHxAJEIkyzKBO/Da00SvIrnU7E2 y2DjgxP214Y4agZQ1dUG1linHY56/l4euLsMikWkjDvE1aoTIIsDsv4FHfp3flTnmU 9pOvV1RjJwrsVbg5yVdq+LCEVlp8Rv71oeHHMfIA= Received: from mx3.investici.org (unknown [127.0.0.1]) by latitanza.investici.org (Postfix) with ESMTP id 4ZHlDH5sBrzGp3X; Wed, 19 Mar 2025 10:23:43 +0000 (UTC) Received: from [82.94.249.234] (mx3.investici.org [82.94.249.234]) (Authenticated sender: cayetano.santos@inventati.org) by localhost (Postfix) with ESMTPSA id 4ZHlDH4jdxzGp3M; Wed, 19 Mar 2025 10:23:43 +0000 (UTC) Date: Wed, 19 Mar 2025 11:21:35 +0100 Message-ID: <5782da67491e120246497cabfba264b0346e4a54.1742379695.git.csantosb@inventati.org> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 Received-SPF: pass client-ip=82.94.249.234; envelope-from=csantosb@inventati.org; helo=latitanza.investici.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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): split-devices. Change-Id: I681dfa90a0ace3b507f3b56f3ac7d90227345606 --- - update package definitions to current guix standards - prepare for new devices - split common package for all devices, from ice40 device package gnu/packages/fpga.scm | 183 ++++++++++++++++++++++-------------------- 1 file changed, 96 insertions(+), 87 deletions(-) base-commit: fd19785a9a7f111c6a97da25187c3351e7e8f3fd -- 2.48.1 diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm index c09fe9bc76..88a7a58aa2 100644 --- a/gnu/packages/fpga.scm +++ b/gnu/packages/fpga.scm @@ -313,102 +313,111 @@ (define-public icestorm Includes the actual FTDI connector.") (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. +(define nextpnr + (package + (name "nextpnr") + (version "0.7") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/YosysHQ/nextpnr/") + (commit (string-append "nextpnr-" version)) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0sbhqscgmlk4q2207rsqsw99qx4fyrxx1hsd669lrk42gmk3s9lm")))) + (build-system cmake-build-system) + (arguments + (list + #:out-of-source? #t + #:configure-flags + #~(list "-DBUILD_GUI=ON" "-DUSE_OPENMP=yes" "-DBUILD_TESTS=ON" + (string-append "-DCURRENT_GIT_VERSION=nextpnr-" + #$version) "-DUSE_IPO=OFF") + #:phases + #~(modify-phases %standard-phases + ;; 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. + (add-after 'unpack 'remove-deps + (lambda _ (with-directory-excursion "3rdparty" (for-each delete-file-recursively '("googletest" "imgui" "pybind11" "qtimgui" - "sanitizers-cmake"))) - + "sanitizers-cmake" "corrosion"))))) + (add-after 'remove-deps 'patch-source + (lambda* (#:key inputs #:allow-other-keys) ;; 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))) + ;; 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.*") + "") + (("^(\\s+target_link_libraries.*)( gtest_main\\))" _ prefix + suffix) + (string-append prefix " gtest" suffix)) + ;; Use the system corrosion module. + (("^\\s+add_subdirectory\\(3rdparty/corrosion.*") + "")) (substitute* "gui/CMakeLists.txt" - (("^\\s+../3rdparty/(qt)?imgui.*") "") + ;; 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))) + (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 + (string-append prefix " imgui qt_imgui_widgets)")))))))) + (native-inputs (list googletest sanitizers-cmake)) + (inputs (list boost + eigen + corrosion + imgui + pybind11 + python + qtbase-5 + qtwayland-5 + qtimgui + yosys)) + (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)))) + (home-page "https://github.com/YosysHQ/nextpnr/") + (license license:isc))) + +(define-public nextpnr-ice40 + (package + (inherit nextpnr) + (name "nextpnr-ice40") + (arguments + (substitute-keyword-arguments (package-arguments nextpnr) + ((#:configure-flags flags + ''()) + #~(cons "-DARCH=ice40" + (cons (string-append "-DICESTORM_INSTALL_PREFIX=" + #$(this-package-input "icestorm")) + #$flags))))) + (propagated-inputs (modify-inputs (package-propagated-inputs nextpnr) + (prepend icestorm))))) (define-public gtkwave (package