[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#60695] [PATCH 8/9] gnu: nextpnr-ice40: Remove bundled software.
From: |
Simon South |
Subject: |
[bug#60695] [PATCH 8/9] gnu: nextpnr-ice40: Remove bundled software. |
Date: |
Mon, 9 Jan 2023 14:26:02 -0500 |
* 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 <andrew@interpretmath.pw>
;;; Copyright © 2022 Christian Gelinek <cgelinek@radlogic.com.au>
;;; Copyright © 2022 jgart <jgart@dismail.de>
+;;; Copyright © 2023 Simon South <simon@simonsouth.net>
;;;
;;; 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
- [bug#60695] [PATCH 0/9] gnu: nextpnr-ice40: Update to 0.5., Simon South, 2023/01/09
- [bug#60695] [PATCH 5/9] gnu: nextpnr-ice40: Use gexps., Simon South, 2023/01/09
- [bug#60695] [PATCH 6/9] gnu: nextpnr-ice40: Enable tests., Simon South, 2023/01/09
- [bug#60695] [PATCH 9/9] gnu: nextpnr-ice40: Update to 0.5., Simon South, 2023/01/09
- [bug#60695] [PATCH 1/9] gnu: Add implot., Simon South, 2023/01/09
- [bug#60695] [PATCH 3/9] gnu: Add sanitizers-cmake., Simon South, 2023/01/09
- [bug#60695] [PATCH 2/9] gnu: Add qtimgui., Simon South, 2023/01/09
- [bug#60695] [PATCH 7/9] gnu: nextpnr-ice40: Fix generated version string., Simon South, 2023/01/09
- [bug#60695] [PATCH 4/9] gnu: nextpnr-ice40: Use HTTPS for source URL., Simon South, 2023/01/09
- [bug#60695] [PATCH 8/9] gnu: nextpnr-ice40: Remove bundled software.,
Simon South <=
- [bug#60695] [PATCH v2 0/9] gnu: nextpnr-ice40: Update to 0.5., Simon South, 2023/01/27
- [bug#60695] [PATCH v2 2/9] gnu: Add qtimgui., Simon South, 2023/01/27
- [bug#60695] [PATCH v2 5/9] gnu: nextpnr-ice40: Use gexps., Simon South, 2023/01/27
- [bug#60695] [PATCH v2 3/9] gnu: Add sanitizers-cmake., Simon South, 2023/01/27
- [bug#60695] [PATCH v2 4/9] gnu: nextpnr-ice40: Use HTTPS for source URL., Simon South, 2023/01/27
- [bug#60695] [PATCH v2 7/9] gnu: nextpnr-ice40: Fix generated version string., Simon South, 2023/01/27
- [bug#60695] [PATCH v2 1/9] gnu: Add implot., Simon South, 2023/01/27
- [bug#60695] [PATCH v2 6/9] gnu: nextpnr-ice40: Enable tests., Simon South, 2023/01/27
- [bug#60695] [PATCH v2 9/9] gnu: nextpnr-ice40: Update to 0.5., Simon South, 2023/01/27
- [bug#60695] [PATCH v2 8/9] gnu: nextpnr-ice40: Remove bundled software., Simon South, 2023/01/27