From patchwork Sun May 11 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: 42529 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 DFEDF27BC4B; Sun, 11 May 2025 19:22:36 +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 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 E063E27BC49 for ; Sun, 11 May 2025 19:22:35 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uEBJc-000740-IJ; Sun, 11 May 2025 14:22:20 -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 1uEBJO-00070y-T5 for guix-patches@gnu.org; Sun, 11 May 2025 14:22:14 -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 1uEBJM-0002yi-3y for guix-patches@gnu.org; Sun, 11 May 2025 14:22:06 -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=UYjtpogI4LpFUlx1V5YwN29/QIhbKNnKwaM5dPHDiVI=; b=V7npw5tlYOTowyxK9HxyqsSCj6SOBRp6ThMVAB1bh3bOZ3ZHskgzjYznP+eZieoQVVdjYuljenbDXQDDUyx44fE76tKEN6TZgq7qbeEZ5BZ5H62/XNQTTtinq4YkweNzvWfDObtfE2oFihoqHBu0FnsTLu5+4+3iIcwf5nIEEaeDtgP10BU3wnz8Bv0/om5oTj+mObeXtmVU6BuiDi2vysYk8KBrZtlHBdFv1+ZZinkvNfIxW/rmiwEJhtSTtM2ds6EdoEZ2By8fV2zxm8hvi6DN1w5YiV5tjncrDOfVn4iVRuevchJomrJeaqx1r5LgcA5qFQKygHVZOOiuEzSRXw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uEBJK-0003Y6-Py; Sun, 11 May 2025 14:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78233] [PATCH v3 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: Sun, 11 May 2025 18:22: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.174698770313554 (code B ref 78233); Sun, 11 May 2025 18:22:02 +0000 Received: (at 78233) by debbugs.gnu.org; 11 May 2025 18:21:43 +0000 Received: from localhost ([127.0.0.1]:41457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uEBIx-0003Vu-7l for submit@debbugs.gnu.org; Sun, 11 May 2025 14:21:42 -0400 Received: from devianza.investici.org ([2c0f:f930:0:4::108]:28833) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uEBIo-0003V0-UX for 78233@debbugs.gnu.org; Sun, 11 May 2025 14:21:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inventati.org; s=stigmate; t=1746987689; bh=UYjtpogI4LpFUlx1V5YwN29/QIhbKNnKwaM5dPHDiVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D02ObL85iaTkOEyzWeWzmvot/z/pmkmwqRTVgDuO0jGEYS0Q4zDj1dfUH6Wbg1fbL hOOdC1Nv+n0WH8rCx1Hv6ROWB9CM5RdDf1Ca4kkLfLrpYlYgvuowfAdOmbIUlXL0/y VF/d6BgCv1DyGBX6jtR/4zaOXloX59DreyUTy5FU= Received: from mx2.investici.org (unknown [127.0.0.1]) by devianza.investici.org (Postfix) with ESMTP id 4ZwWK56STCz6xcs; Sun, 11 May 2025 18:21:29 +0000 (UTC) Received: from [198.167.222.108] (mx2.investici.org [198.167.222.108]) (Authenticated sender: cayetano.santos@inventati.org) by localhost (Postfix) with ESMTPSA id 4ZwWK5499qz6xcj; Sun, 11 May 2025 18:21:29 +0000 (UTC) Date: Sun, 11 May 2025 20:20:06 +0200 Message-ID: <226885befb8187c848659e2a0c8c4fc9ca001d7b.1746987606.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-ice40): Update to 0.8. Change-Id: I8d1c3528679f38ec4593f90aec0f1c4321dc7e44 --- gnu/packages/fpga.scm | 128 +++++++++++------------------------------- 1 file changed, 33 insertions(+), 95 deletions(-) 2.49.0 diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm index 519807e847..4d05420d66 100644 --- a/gnu/packages/fpga.scm +++ b/gnu/packages/fpga.scm @@ -447,102 +447,39 @@ (define nextpnr (license license:asl2.0))) (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)))) + (package + (inherit nextpnr) + (name "nextpnr-ice40") + (arguments + (substitute-keyword-arguments (package-arguments nextpnr) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-after 'unpack 'get-icestorm + (lambda _ + (copy-recursively #$(package-source icestorm) "icestorm"))) + ;; Run examples included in icestorm backend. + (add-after 'compress-documentation 'run-icestorm-examples + (lambda _ + (let* ((examples "../source/icestorm/examples/") + (dir (opendir examples)) + (path-env (getenv "PATH"))) + (setenv "PATH" (string-append #$output "/bin" ":" path-env)) + (do ((entry (readdir dir) (readdir dir))) + ((eof-object? entry)) + (unless (member entry '("." "..")) + (invoke "make" "-C" (string-append 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))) + (native-inputs + (modify-inputs (package-native-inputs nextpnr) + (prepend yosys))))) (define-public gtkwave (package --