From patchwork Sun May 11 09:18:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cayetano Santos X-Patchwork-Id: 42520 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 95AB227BC4B; Sun, 11 May 2025 10:21:31 +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 D158327BC49 for ; Sun, 11 May 2025 10:21:30 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uE2ry-0000bW-Bk; Sun, 11 May 2025 05:21:14 -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 1uE2rv-0000aV-1c for guix-patches@gnu.org; Sun, 11 May 2025 05:21:12 -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 1uE2ru-0005Sd-Dz for guix-patches@gnu.org; Sun, 11 May 2025 05:21:10 -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:In-Reply-To:References:Subject; bh=yxX1xP0zAf9grP4ON3CaKIhurylx5j70LsiJcwOb0/I=; b=KFxlSVn1jfX3NMPe9Qm1DqG+7AkEjIbFsTTJ8tTJ7pOJpi/ieLKXYH2xTsPgDhlYhH/C/qY2ehARJRE5gctIFtLYBfy6ZEBjEF3CrUFBQN1pExs5bN/Uo02f9HRiQdj3/tau8DD+t3e9LVVGmbdbWv7DMkaMfXPW07gfL/O4VwsHeExkcf7cY6zTMgd6BngIpKRxDBDsyTcV/0jhgOhumqkYriwf9ErBMCOpSEAB/AuJivyTyJj4uR71nj5ekT0ig/FTgJxLPpjO7EnvZENCDcaLLOerdPmKgLnAN1NtDun5Et20ZV6FXWcswV3bwLWPFBxfJqm1lUX5ARKu3ulaNw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uE2rl-0004LE-Uo; Sun, 11 May 2025 05:21:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78233] [PATCH v2 1/2] gnu: Add nextpnr. References: In-Reply-To: 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 09:21: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.174695522916594 (code B ref 78233); Sun, 11 May 2025 09:21:01 +0000 Received: (at 78233) by debbugs.gnu.org; 11 May 2025 09:20:29 +0000 Received: from localhost ([127.0.0.1]:58077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uE2rF-0004Ja-7Q for submit@debbugs.gnu.org; Sun, 11 May 2025 05:20:29 -0400 Received: from confino.investici.org ([93.190.126.19]:45033) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uE2rC-0004JN-7U for 78233@debbugs.gnu.org; Sun, 11 May 2025 05:20:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inventati.org; s=stigmate; t=1746955224; bh=yxX1xP0zAf9grP4ON3CaKIhurylx5j70LsiJcwOb0/I=; h=From:To:Cc:Subject:Date:From; b=THLlVMwyBPKwxxwtCy4V8Df+AZ1wTdzBPdp/ATPAoSq2uPNrS9Lta2rA9PuV4G+er lVI9ruRX7LYZNBYaplEnMP24eCa71KGGL6jTWG5xSA4qxLVdtM+Yi10gIwQOUl88hj /1rb6z3tyH6M2zreIJ/Xx4xm1eYHyMBND5JfgewE= Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4ZwHJm4DdXz11Q5; Sun, 11 May 2025 09:20:24 +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 4ZwHJm1hVvz11PY; Sun, 11 May 2025 09:20:23 +0000 (UTC) Date: Sun, 11 May 2025 11:18:38 +0200 Message-ID: <6ea46fd8ccc0a8aa56e03a9e2f320ac3de37c7a4.1746955119.git.csantosb@inventati.org> X-Mailer: git-send-email 2.49.0 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 (nextpnt): New variable. Change-Id: Ic3476a6a4220ec20191897a6efb3d4aa347b51c2 --- gnu/packages/fpga.scm | 79 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) base-commit: 4fe484ee7e9d598a9d0a249c375b75a14b95d1b4 -- 2.49.0 diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm index 2298dde595..083faf7d7a 100644 --- a/gnu/packages/fpga.scm +++ b/gnu/packages/fpga.scm @@ -356,6 +356,85 @@ (define-public icestorm files.") (license license:isc)))) +(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)) + ;; TODO: Package next packages, not yet in Guix. + ;; Required to get missing oourafft, json11, python-console and + ;; QtPropertyBrowser. + (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-next ;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 nextpnr-ice40 (let* ((version "0.7") (tag (string-append "nextpnr-" version)))