From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KPIDGblqvGPYBgAAbAwnHQ (envelope-from ) for ; Mon, 09 Jan 2023 20:27:53 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id yA/YGLlqvGOPIgEAauVa8A (envelope-from ) for ; Mon, 09 Jan 2023 20:27:53 +0100 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 E7EB9EDDA for ; Mon, 9 Jan 2023 20:27:52 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pExng-0007G6-5j; Mon, 09 Jan 2023 14:27:16 -0500 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 1pExnW-0007AP-UO for guix-patches@gnu.org; Mon, 09 Jan 2023 14:27:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pExnU-0003CI-2x for guix-patches@gnu.org; Mon, 09 Jan 2023 14:27:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pExnT-0007GJ-V2 for guix-patches@gnu.org; Mon, 09 Jan 2023 14:27:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60695] [PATCH 8/9] gnu: nextpnr-ice40: Remove bundled software. Resent-From: Simon South Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 Jan 2023 19:27:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60695 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60695@debbugs.gnu.org Received: via spool by 60695-submit@debbugs.gnu.org id=B60695.167329237727768 (code B ref 60695); Mon, 09 Jan 2023 19:27:03 +0000 Received: (at 60695) by debbugs.gnu.org; 9 Jan 2023 19:26:17 +0000 Received: from localhost ([127.0.0.1]:38216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pExmi-0007Di-A5 for submit@debbugs.gnu.org; Mon, 09 Jan 2023 14:26:16 -0500 Received: from mailout.easymail.ca ([64.68.200.34]:33216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pExme-0007Cc-Pk for 60695@debbugs.gnu.org; Mon, 09 Jan 2023 14:26:14 -0500 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 99C85E7EE8 for <60695@debbugs.gnu.org>; Mon, 9 Jan 2023 19:26:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at emo08-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo08-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DffWi6y6losw for <60695@debbugs.gnu.org>; Mon, 9 Jan 2023 19:26:07 +0000 (UTC) Received: from localhost.localdomain (23-233-96-72.cpe.pppoe.ca [23.233.96.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 48B02E7E7D for <60695@debbugs.gnu.org>; Mon, 9 Jan 2023 19:26:07 +0000 (UTC) From: Simon South Date: Mon, 9 Jan 2023 14:26:02 -0500 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1673292473; a=rsa-sha256; cv=none; b=BwojHdWZERnBWDGrSCjlo5rOyfi416JjFX3ER9D5BpblSGO8cbMp5vrVoDCkM/DkDatuq1 HEKKCRdrk8pZwcN9BFd1Ge+cEH+ztAyzMta4X1qxsF9zQxLcOD2jmDC0017CJYT8eFjHA7 qtL2m5p+YYO+fj0AeyZ9bRnYQHs7ouEwSB7BiM6QYGtRyzYMIWY1eW7aQ1YM+RykhjPPzc /PLUre1cL8DC8oC9+O7hkBQj7bbbCw4PXQV1dYun/SOouaRK6qJJgxh9ULsKWpmL6/MboV O6nN279M5BBXF9knJ/GWib160QkPDvbFCN+T0CEqeQZM/uv6EIbgv8mHa0hh0g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673292473; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: 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; bh=YkqoPnO4E5Wp2+hnOI9OIAeSCZkSzfEnFD7SKgeyRJw=; b=lfODJc1YguipYeRJ8MXpkuisXVfq60WkP19PAALi7Gb9/W4xSGq16MwYIciqGHwRB0EttJ gpK4u5akV0gH+NjyLdBYuOCT4W1b6ZvZbJ8uAJ9DFi5QH38zLUYY9pVMz1SQfU8kFYMpFF q4fEmNknu7lOuH3xrC28DqR+/1SeGyFwV8AkXrQCL50ciLVWL108Zzk1p3v0no6RBNmH/E ikgzN6BObp2kO0cn6CP9P7tJtevdQ5GaZEANlQ3QkvbFPrTk/XwyuLOFbwysJO3ERmL20c jq+1nDSYebb5hSmW7zs+tGQwbUjouXq42dVclO4g9SOyRVSiHMYjTn3aOszhKQ== X-Migadu-Spam-Score: -2.28 X-Spam-Score: -2.28 X-Migadu-Queue-Id: E7EB9EDDA X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-TUID: 9K9zq0povXwx * gnu/packages/fpga.scm (nextpnr-ice40)[source]: Add modules, snippet. [native-inputs]: Add googletest, sanitizers-cmake. [inputs]: Add imgui-1.86, pybind11, qtimgui. [arguments]: Add "patch-source" phase; reformat gently. --- gnu/packages/fpga.scm | 70 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 62 insertions(+), 8 deletions(-) diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm index 7649b2bbd6..3cb96a1cd1 100644 --- a/gnu/packages/fpga.scm +++ b/gnu/packages/fpga.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2021 Andrew Miloradovsky ;;; Copyright © 2022 Christian Gelinek ;;; Copyright © 2022 jgart +;;; Copyright © 2023 Simon South ;;; ;;; This file is part of GNU Guix. ;;; @@ -36,10 +37,12 @@ (define-module (gnu packages fpga) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages base) + #:use-module (gnu packages cmake) #:use-module (gnu packages compression) #:use-module (gnu packages elf) #:use-module (gnu packages pkg-config) #:use-module (gnu packages tcl) + #:use-module (gnu packages toolkits) #:use-module (gnu packages readline) #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) @@ -289,23 +292,74 @@ (define-public nextpnr-ice40 (file-name (git-file-name name version)) (sha256 (base32 - "1llkrh8rk1a1xxzx54apbg49ny2jqzzl2rmbkb8188idipq568ws")))) + "1llkrh8rk1a1xxzx54apbg49ny2jqzzl2rmbkb8188idipq568ws")) + (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. + (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 + qtimgui yosys)) (build-system cmake-build-system) (arguments - (list #:configure-flags #~(list "-DARCH=ice40" - "-DBUILD_TESTS=ON" - (string-append "-DCURRENT_GIT_VERSION=" - #$(string-take commit 8)) - (string-append "-DICEBOX_ROOT=" - #$icestorm - "/share/icebox")))) + (list + #:configure-flags + #~(list "-DARCH=ice40" + "-DBUILD_TESTS=ON" + (string-append "-DCURRENT_GIT_VERSION=" + #$(string-take commit 8)) + (string-append "-DICEBOX_ROOT=" #$icestorm "/share/icebox")) + #: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 #$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.") -- 2.38.1