me
/
guix
Archived
1
0
Fork 0

gnu: dtc: Update to 1.7.0.

Enable the python bindings and switch to the meson build system that handles
the python bindings better than the Makefile build system here.

* gnu/packages/patches/dtc-meson-cell-overflow.patch: New file
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/bootloaders.scm (dtc): Update to 1.7.0.
[build-system]: Switch to the meson-build-system.
[arguments]: Remove #:make-flags. Add a new 'preparations phase. Do not edit
the Makefile in the 'patch-pkg-config phase. Remove the 'configure phase.

Change-Id: Ie61c920829ab3a8c32f4924c694dba6bda807711
Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
master
Mathieu Othacehe 2023-12-24 16:59:57 +01:00
parent ccce23bd81
commit 51735eac1c
No known key found for this signature in database
GPG Key ID: 8354763531769CA6
3 changed files with 71 additions and 20 deletions

View File

@ -1092,6 +1092,7 @@ dist_patch_DATA = \
%D%/packages/patches/doxygen-hurd.patch \ %D%/packages/patches/doxygen-hurd.patch \
%D%/packages/patches/dstat-fix-crash-when-specifying-delay.patch \ %D%/packages/patches/dstat-fix-crash-when-specifying-delay.patch \
%D%/packages/patches/dstat-skip-devices-without-io.patch \ %D%/packages/patches/dstat-skip-devices-without-io.patch \
%D%/packages/patches/dtc-meson-cell-overflow.patch \
%D%/packages/patches/dune-common-skip-failing-tests.patch \ %D%/packages/patches/dune-common-skip-failing-tests.patch \
%D%/packages/patches/dune-grid-add-missing-include-cassert.patch \ %D%/packages/patches/dune-grid-add-missing-include-cassert.patch \
%D%/packages/patches/dune-istl-fix-solver-playground.patch \ %D%/packages/patches/dune-istl-fix-solver-playground.patch \

View File

@ -55,9 +55,12 @@
#:use-module (gnu packages man) #:use-module (gnu packages man)
#:use-module (gnu packages mtools) #:use-module (gnu packages mtools)
#:use-module (gnu packages ncurses) #:use-module (gnu packages ncurses)
#:use-module (gnu packages ninja)
#:use-module (gnu packages package-management)
#:use-module (gnu packages perl) #:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config) #:use-module (gnu packages pkg-config)
#:use-module (gnu packages python) #:use-module (gnu packages python)
#:use-module (gnu packages python-build)
#:use-module (gnu packages python-crypto) #:use-module (gnu packages python-crypto)
#:use-module (gnu packages texinfo) #:use-module (gnu packages texinfo)
#:use-module (gnu packages tls) #:use-module (gnu packages tls)
@ -71,6 +74,7 @@
#:use-module (gnu packages python-web) #:use-module (gnu packages python-web)
#:use-module (gnu packages python-xyz) #:use-module (gnu packages python-xyz)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (guix build-system meson)
#:use-module (guix build-system pyproject) #:use-module (guix build-system pyproject)
#:use-module (guix build-system trivial) #:use-module (guix build-system trivial)
#:use-module (guix download) #:use-module (guix download)
@ -631,7 +635,7 @@ The SUBDIR argument defaults to \"efi/Guix\", as it is also the case for
(define-public dtc (define-public dtc
(package (package
(name "dtc") (name "dtc")
(version "1.6.1") (version "1.7.0")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append (uri (string-append
@ -639,42 +643,56 @@ The SUBDIR argument defaults to \"efi/Guix\", as it is also the case for
"dtc-" version ".tar.gz")) "dtc-" version ".tar.gz"))
(sha256 (sha256
(base32 (base32
"0xm38h31jb29xfh2sfyk48d8wdfq4b8lmb412zx9vjr35izjb9iq")))) "0cij9399snpn672pdbda8qbxljdkfg068kvv3g5811rz6yslx124"))
(build-system gnu-build-system) (patches
(search-patches "dtc-meson-cell-overflow.patch"))))
(build-system meson-build-system)
(arguments (arguments
(list (list
#:modules `(,@%gnu-build-system-modules (srfi srfi-26)) #:modules '((guix build meson-build-system)
#:make-flags (guix build utils)
#~(list (string-append "CC=" #$(cc-for-target)) (srfi srfi-26))
;; /bin/fdt{get,overlay,put} need help finding libfdt.so.1.
(string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
(string-append "PREFIX=" #$output)
(string-append "SETUP_PREFIX=" #$output)
"INSTALL=install")
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'unpack 'patch-pkg-config (add-after 'unpack 'preparations
(lambda _ (lambda _
(substitute* '("Makefile" ;; The version string is usually derived via setuptools-scm, but
"tests/run_tests.sh") ;; without the git metadata available this fails.
(("pkg-config") (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version)
#$(pkg-config-for-target)))))
(delete 'configure) ;no configure script ;; Needed by setup.py.
(add-before 'build 'install-doc (setenv "DESTDIR" "/")
;; Native gcc needed by run_test.sh.
(setenv "CC" "gcc")
;; /bin/fdt{get,overlay,put} need help finding libfdt.so.1.
(setenv "LDFLAGS"
(string-append "-Wl,-rpath=" #$output "/lib"))))
(add-after 'unpack 'install-doc
(lambda _ (lambda _
(with-directory-excursion "Documentation" (with-directory-excursion "Documentation"
(for-each (cut install-file <> (string-append (for-each (cut install-file <> (string-append
#$output "/share/doc/dtc/")) #$output "/share/doc/dtc/"))
'("dts-format.txt" '("dts-format.txt"
"dt-object-internal.txt" "dt-object-internal.txt"
"manual.txt")))))))) "manual.txt")))))
(add-after 'unpack 'patch-pkg-config
(lambda _
(substitute* '("tests/run_tests.sh")
(("pkg-config")
#$(pkg-config-for-target))))))))
(native-inputs (native-inputs
(append (append
(list bison (list bison
flex flex
libyaml libyaml
ninja
pkg-config pkg-config
swig) python
python-setuptools-scm
swig
which)
(if (member (%current-system) (package-supported-systems valgrind)) (if (member (%current-system) (package-supported-systems valgrind))
(list valgrind) (list valgrind)
'()))) '())))

View File

@ -0,0 +1,32 @@
Taken from upstream:
https://git.kernel.org/pub/scm/utils/dtc/dtc.git/commit/?id=32174a66efa4ad19fc6a2a6422e4af2ae4f055cb
From 32174a66efa4ad19fc6a2a6422e4af2ae4f055cb Mon Sep 17 00:00:00 2001
From: David Gibson <david@gibson.dropbear.id.au>
Date: Tue, 28 Feb 2023 10:33:58 +1100
Subject: [PATCH] meson: Fix cell overflow tests when running from meson
Because meson always builds out-of-tree we need to reference things in the
original source tree via $SRCDIR from run_tests.sh. We forgot a couple of
cases for the cell overflow tests. Fix them.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
tests/run_tests.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 91350ad3..f899d8cb 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -519,8 +519,8 @@ libfdt_tests () {
check_tests "$SRCDIR/phandle-args-overflow.dts" clocks_property
## https://github.com/dgibson/dtc/issues/74
- run_dtc_test -I dts -O dtb -o cell-overflow-results.test.dtb cell-overflow-results.dts
- run_dtc_test -I dts -O dtb -o cell-overflow.test.dtb cell-overflow.dts
+ run_dtc_test -I dts -O dtb -o cell-overflow-results.test.dtb "$SRCDIR/cell-overflow-results.dts"
+ run_dtc_test -I dts -O dtb -o cell-overflow.test.dtb "$SRCDIR/cell-overflow.dts"
run_test dtbs_equal_ordered cell-overflow.test.dtb cell-overflow-results.test.dtb
# check full tests