gnu: nextpnr: Update to 0.8-0.d796cc7.

* gnu/packages/fpga.scm (nextpnr): Update to 0.8-0.d796cc7.

Change-Id: I6d0082eb22e2a51e3db648dd6c3228b635fb8d7c
Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
Modified-by: Maxim Cournoyer <maxim@guixotic.coop>
This commit is contained in:
Cayetano Santos 2025-08-15 09:20:05 +02:00 committed by Maxim Cournoyer
parent e28ab6a6fe
commit 3d7081fd40
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -419,115 +419,112 @@ files.")
license:bsd-2))))) ;for lz4-derived sources license:bsd-2))))) ;for lz4-derived sources
(define-public nextpnr (define-public nextpnr
(package ;; Necessary for compatibility with latest apycula.
(name "nextpnr") ;; TODO: Remove with release 0.9.
(version "0.8") (let ((commit "d796cc720b60ccc18580c686d93c8751fe461532")
(source (revision "0"))
(origin (package
(method git-fetch) (name "nextpnr")
(uri (git-reference (version (git-version "0.8" revision commit))
(url "https://github.com/YosysHQ/nextpnr/") (source
(commit (string-append "nextpnr-" version)) (origin
;; XXX: Fetch some bundled libraries such as QtPropertyBrowser, (method git-fetch)
;; json11 and python-console, which have custom modifications or (uri (git-reference
;; no longer have their original upstream. (url "https://github.com/YosysHQ/nextpnr/")
(recursive? #t))) (commit commit)
(file-name (git-file-name name version)) ;; XXX: Fetch some bundled libraries such as QtPropertyBrowser,
(modules '((guix build utils) ;; json11 and python-console, which have custom modifications or
(ice-9 ftw) ;; no longer have their original upstream.
(srfi srfi-26))) (recursive? #t)))
(snippet (file-name (git-file-name name version))
'(begin (modules '((guix build utils)
;; XXX: 'delete-all-but' is copied from the turbovnc package. (ice-9 ftw)
(define (delete-all-but directory . preserve) (srfi srfi-26)))
(define (directory? x) (snippet
(and=> (stat x #f) '(begin
(compose (cut eq? 'directory <>) stat:type))) ;; XXX: 'delete-all-but' is copied from the turbovnc package.
(with-directory-excursion directory (define (delete-all-but directory . preserve)
(let* ((pred (with-directory-excursion directory
(negate (cut member <> (append '("." "..") preserve)))) (let* ((pred (negate (cut member <>
(items (scandir "." pred))) (cons* "." ".." preserve))))
(for-each (lambda (item) (items (scandir "." pred)))
(if (directory? item) (for-each (cut delete-file-recursively <>) items))))
(delete-file-recursively item) (delete-all-but "3rdparty"
(delete-file item))) ;; The following sources have all been patched, so
items)))) ;; cannot easily be unbundled.
(delete-all-but "3rdparty" "QtPropertyBrowser"
;; The following sources have all been patched, so "json11"
;; cannot easily be unbundled. "python-console"
"QtPropertyBrowser" "oourafft")))
"json11" (patches (search-patches "nextpnr-gtest.patch"
"python-console" "nextpnr-imgui.patch"))
"oourafft"))) (sha256
(patches (search-patches "nextpnr-gtest.patch" (base32 "1arj25vad76wg6b5yaaky4cby5zp9v92pdd4y3l0kxi7wvxhmmya"))))
"nextpnr-imgui.patch")) (build-system qt-build-system)
(sha256 (arguments
(base32 "0p53a2gl89hf3hfwdxs6pykxyrk82j4lqpwd1fqia2y0c9r2gjlm")))) (list
(build-system qt-build-system) #:cmake cmake ;CMake 3.25 or higher is required.
(arguments #:configure-flags
(list ;; TODO: enable more architectures?
#:cmake cmake ;CMake 3.25 or higher is required. #~(list "-DARCH=generic;ice40;ecp5;himbaechel"
#:configure-flags "-DBUILD_GUI=ON"
;; TODO: enable more architectures? "-DUSE_OPENMP=ON"
#~(list "-DARCH=generic;ice40;ecp5;himbaechel" "-DBUILD_TESTS=ON"
"-DBUILD_GUI=ON" "-DHIMBAECHEL_UARCH=ng-ultra"
"-DUSE_OPENMP=ON" "-DHIMBAECHEL_NGULTRA_DEVICES=ng-ultra"
"-DBUILD_TESTS=ON" "-DHIMBAECHEL_PRJBEYOND_DB=/tmp/prjbeyond-db"
"-DHIMBAECHEL_UARCH=ng-ultra" (string-append "-DCURRENT_GIT_VERSION=nextpnr-" #$version)
"-DHIMBAECHEL_NGULTRA_DEVICES=ng-ultra" (string-append "-DICESTORM_INSTALL_PREFIX="
"-DHIMBAECHEL_PRJBEYOND_DB=/tmp/prjbeyond-db" #$(this-package-input "icestorm"))
(string-append "-DCURRENT_GIT_VERSION=nextpnr-" #$version) (string-append "-DTRELLIS_INSTALL_PREFIX="
(string-append "-DICESTORM_INSTALL_PREFIX=" #$(this-package-input "prjtrellis"))
#$(this-package-input "icestorm")) "-DUSE_IPO=OFF")
(string-append "-DTRELLIS_INSTALL_PREFIX=" #:phases
#$(this-package-input "prjtrellis")) #~(modify-phases %standard-phases
"-DUSE_IPO=OFF") ;; Required by himbaechel architecture, ng-ultra support.
#:phases (add-after 'unpack 'get-prjbeyond-db
#~(modify-phases %standard-phases (lambda _
;; Required by himbaechel architecture, ng-ultra support. (copy-recursively
(add-after 'unpack 'get-prjbeyond-db #$(origin
(lambda _ (method git-fetch)
(copy-recursively (uri (git-reference
#$(origin (url "https://github.com/yosyshq-GmbH/prjbeyond-db/")
(method git-fetch) ;; We take latest commit, as indicated in nextpnrs
(uri (git-reference ;; README.md file
(url "https://github.com/yosyshq-GmbH/prjbeyond-db/") (commit "06d3b424dd0e52d678087c891c022544238fb9e3")))
;; We take latest commit, as indicated in nextpnrs (sha256
;; README.md file (base32
(commit "06d3b424dd0e52d678087c891c022544238fb9e3"))) "17dd3cgms2fy6xvz7magdmvv92km4cqh2kz9dyjrvz5y8caqav4y")))
(sha256 "/tmp/prjbeyond-db")))
(base32 (add-after 'unpack 'unbundle-sanitizers-cmake
"17dd3cgms2fy6xvz7magdmvv92km4cqh2kz9dyjrvz5y8caqav4y"))) (lambda _
"/tmp/prjbeyond-db"))) (substitute* "CMakeLists.txt"
(add-after 'unpack 'unbundle-sanitizers-cmake ;; Use the system sanitizers-cmake module. This is made
(lambda _ ;; necessary 'sanitizers-cmake' installing a FindPackage
(substitute* "CMakeLists.txt" ;; module but no CMake config file.
;; Use the system sanitizers-cmake module. This is made (("\\$\\{CMAKE_SOURCE_DIR}/3rdparty/sanitizers-cmake/cmake")
;; necessary 'sanitizers-cmake' installing a FindPackage (string-append
;; module but no CMake config file. #$(this-package-native-input "sanitizers-cmake")
(("\\$\\{CMAKE_SOURCE_DIR}/3rdparty/sanitizers-cmake/cmake") "/share/sanitizers-cmake/cmake"))))))))
(string-append (native-inputs
#$(this-package-native-input "sanitizers-cmake") (list googletest
"/share/sanitizers-cmake/cmake")))))))) sanitizers-cmake))
(native-inputs (inputs
(list googletest (list boost
sanitizers-cmake)) corrosion
(inputs eigen
(list boost icestorm
corrosion prjtrellis
eigen pybind11
icestorm python
prjtrellis qtbase-5
pybind11 qtwayland-5
python qtimgui
qtbase-5 yosys))
qtwayland-5 (synopsis "Place-and-Route tool for FPGAs")
qtimgui (description "Nextpnr is a portable FPGA place and route tool.")
yosys)) (home-page "https://github.com/YosysHQ/nextpnr/")
(synopsis "Place-and-Route tool for FPGAs") (license license:isc))))
(description "Nextpnr is a portable FPGA place and route tool.")
(home-page "https://github.com/YosysHQ/nextpnr/")
(license license:isc)))
(define-public nextpnr-ice40 (define-public nextpnr-ice40
(deprecated-package "nextpnr-ice40" nextpnr)) (deprecated-package "nextpnr-ice40" nextpnr))