gnu: nextpnr-ice40: Update to 0.5.

* gnu/packages/fpga.scm (nextpnr-ice40): Update to 0.5.
[arguments]<#:configure-flags>: Add "-DBUILD_GUI", "-DUSE_IPO"; update
"-DCURRENT_GIT_VERSION"; rename "-DICEBOX_ROOT" to
"-DICESTORM_INSTALL_PREFIX".

Signed-off-by: Danny Milosavljevic <dannym@friendly-machines.com>
This commit is contained in:
Simon South 2023-01-27 15:34:34 -05:00 committed by Danny Milosavljevic
parent 58ca09f554
commit 8c1348e4f2
No known key found for this signature in database
GPG key ID: E71A35542C30BAA5

View file

@ -285,45 +285,48 @@ Includes the actual FTDI connector.")
(license license:isc)))) (license license:isc))))
(define-public nextpnr-ice40 (define-public nextpnr-ice40
(let [(commit "fbe486df459909065d6852a7495a212dfd2accef") (let* ((version "0.5")
(revision "1")] (tag (string-append "nextpnr-" version)))
(package (package
(name "nextpnr-ice40") (name "nextpnr-ice40")
(version (git-version "0.0.0" revision commit)) (version version)
(source (source
(origin (origin
(method git-fetch) (method git-fetch)
(uri (git-reference (uri (git-reference
(url "https://github.com/YosysHQ/nextpnr") (url "https://github.com/YosysHQ/nextpnr")
(commit commit) (commit tag)
(recursive? #t))) (recursive? #t)))
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"1llkrh8rk1a1xxzx54apbg49ny2jqzzl2rmbkb8188idipq568ws")) "119iqxxzbxq2qy8x20awf9gr0nf3y1yjmk36adsg89ly3rb9gwzk"))
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
#~(begin #~(begin
;; Remove bundled source code for which Guix has packages. ;; Remove bundled source code for which Guix has packages.
;; Note the bundled copies of json11 and python-console contain ;; Note the bundled copies of json11 and python-console contain
;; modifications, while QtPropertyBrowser appears to be ;; modifications, while QtPropertyBrowser appears to be
;; abandoned and without an official source. ;; abandoned and without an official source.
(with-directory-excursion "3rdparty" ;; fpga-interchange-schema is used only by the
(for-each delete-file-recursively ;; "fpga_interchange" architecture target, which this package
'("googletest" "imgui" "pybind11" "qtimgui" ;; doesn't build.
"sanitizers-cmake"))) (with-directory-excursion "3rdparty"
(for-each delete-file-recursively
'("googletest" "imgui" "pybind11" "qtimgui"
"sanitizers-cmake")))
;; Remove references to unbundled code and link against ;; Remove references to unbundled code and link against external
;; external libraries instead. ;; libraries instead.
(substitute* "CMakeLists.txt" (substitute* "CMakeLists.txt"
(("^\\s+add_subdirectory\\(3rdparty/googletest.*") "") (("^\\s+add_subdirectory\\(3rdparty/googletest.*") "")
(("^(\\s+target_link_libraries.*)( gtest_main\\))" (("^(\\s+target_link_libraries.*)( gtest_main\\))"
_ prefix suffix) _ prefix suffix)
(string-append prefix " gtest" suffix))) (string-append prefix " gtest" suffix)))
(substitute* "gui/CMakeLists.txt" (substitute* "gui/CMakeLists.txt"
(("^\\s+../3rdparty/(qt)?imgui.*") "") (("^\\s+../3rdparty/(qt)?imgui.*") "")
(("^(target_link_libraries.*)\\)" _ prefix) (("^(target_link_libraries.*)\\)" _ prefix)
(string-append prefix " imgui qt_imgui_widgets)"))))))) (string-append prefix " imgui qt_imgui_widgets)")))))))
(native-inputs (native-inputs
(list googletest sanitizers-cmake)) (list googletest sanitizers-cmake))
(inputs (inputs
@ -341,12 +344,12 @@ Includes the actual FTDI connector.")
(list (list
#:configure-flags #:configure-flags
#~(list "-DARCH=ice40" #~(list "-DARCH=ice40"
"-DBUILD_GUI=ON"
"-DBUILD_TESTS=ON" "-DBUILD_TESTS=ON"
(string-append "-DCURRENT_GIT_VERSION=" (string-append "-DCURRENT_GIT_VERSION=" #$tag)
#$(string-take commit 8)) (string-append "-DICESTORM_INSTALL_PREFIX="
(string-append "-DICEBOX_ROOT=" #$(this-package-input "icestorm"))
#$(this-package-input "icestorm") "-DUSE_IPO=OFF")
"/share/icebox"))
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'unpack 'patch-source (add-after 'unpack 'patch-source
@ -372,8 +375,8 @@ Includes the actual FTDI connector.")
"include/qtimgui") "include/qtimgui")
suffix)))))))) suffix))))))))
(synopsis "Place-and-Route tool for FPGAs") (synopsis "Place-and-Route tool for FPGAs")
(description "Nextpnr aims to be a vendor neutral, timing driven, (description "Nextpnr aims to be a vendor neutral, timing driven, FOSS
FOSS FPGA place and route tool.") FPGA place and route tool.")
(home-page "https://github.com/YosysHQ/nextpnr") (home-page "https://github.com/YosysHQ/nextpnr")
(license license:expat)))) (license license:expat))))