From patchwork Mon Dec 25 09:09:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 58052 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 542E727BBE9; Mon, 25 Dec 2023 09:10:09 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CCF4027BBE2 for ; Mon, 25 Dec 2023 09:10:06 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rHgyE-0003Az-LZ; Mon, 25 Dec 2023 04:09:58 -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 1rHgyC-0003Ak-LN for guix-patches@gnu.org; Mon, 25 Dec 2023 04:09:56 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rHgyC-0000k0-DC for guix-patches@gnu.org; Mon, 25 Dec 2023 04:09:56 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rHgyI-0003ee-O5; Mon, 25 Dec 2023 04:10:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68023] [PATCH 01/13] gnu: dtc: Update to 1.7.0. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Mon, 25 Dec 2023 09:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68023 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68023@debbugs.gnu.org Cc: me@bonfacemunyoki.com, Mathieu Othacehe , me@tobias.gr, lars@6xq.net, efraim@flashner.co.il, leo@famulari.name, vagrant@debian.org, jgart@dismail.de, marius@gnu.org, Efraim Flashner , Vagrant Cascadian X-Debbugs-Original-Xcc: Efraim Flashner , Vagrant Cascadian Received: via spool by 68023-submit@debbugs.gnu.org id=B68023.170349539714001 (code B ref 68023); Mon, 25 Dec 2023 09:10:02 +0000 Received: (at 68023) by debbugs.gnu.org; 25 Dec 2023 09:09:57 +0000 Received: from localhost ([127.0.0.1]:53910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rHgyC-0003dj-4l for submit@debbugs.gnu.org; Mon, 25 Dec 2023 04:09:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50844) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rHgy8-0003dL-In for 68023@debbugs.gnu.org; Mon, 25 Dec 2023 04:09:54 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rHgxw-0000fD-QL; Mon, 25 Dec 2023 04:09:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=dJJilAOUepRxcrwwFjHHLGfYZvv1T/moin2rKH1ajXs=; b=TGXgLrZAASjU5AInrQII pbvwJGyL08W0lGXWNinzgfxeela9dK6+X5ekAn6pu+J5Siaon2BRN4R6Y8qrzZhe4WeW+x8uLfrlO OpbNn61xoh4gaL9adzfe4msQXLAMlo2ECcrlJH8WI5vfNr1rg/v6QUWo1jYtRDhoeLb0STXuqJhPR 5EVNVGcu9r0QFrnrwXCC56ddfg+LHprEdULJKYqQ9lY1FKthbGzk4mYjn0VEddt5EYb5KvlIlxShP qrfgjj00jkd/R/QFKPiFYQRf0BQT6l+QMacXGO5zETsm0EeLIlfCZTEB6nbRRlbscQdpP7bOMXq6I bVGttdhlxGQ3xw==; From: Mathieu Othacehe Date: Mon, 25 Dec 2023 10:09:17 +0100 Message-ID: <9946d80edc86aa465acc39b9c51094c65c2c5bf1.1703494195.git.othacehe@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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 --- gnu/local.mk | 1 + gnu/packages/bootloaders.scm | 57 ++++++++++++------- .../patches/dtc-meson-cell-overflow.patch | 32 +++++++++++ 3 files changed, 70 insertions(+), 20 deletions(-) create mode 100644 gnu/packages/patches/dtc-meson-cell-overflow.patch diff --git a/gnu/local.mk b/gnu/local.mk index a472c62acb..91a34983c8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1093,6 +1093,7 @@ dist_patch_DATA = \ %D%/packages/patches/doxygen-hurd.patch \ %D%/packages/patches/dstat-fix-crash-when-specifying-delay.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-grid-add-missing-include-cassert.patch \ %D%/packages/patches/dune-istl-fix-solver-playground.patch \ diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index bd8b621e35..f8ba93ce01 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -55,6 +55,8 @@ (define-module (gnu packages bootloaders) #:use-module (gnu packages man) #:use-module (gnu packages mtools) #: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 pkg-config) #:use-module (gnu packages python) @@ -71,6 +73,7 @@ (define-module (gnu packages bootloaders) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) #:use-module (guix build-system gnu) + #:use-module (guix build-system meson) #:use-module (guix build-system pyproject) #:use-module (guix build-system trivial) #:use-module (guix download) @@ -631,7 +634,7 @@ (define-public syslinux (define-public dtc (package (name "dtc") - (version "1.6.1") + (version "1.7.0") (source (origin (method url-fetch) (uri (string-append @@ -639,42 +642,56 @@ (define-public dtc "dtc-" version ".tar.gz")) (sha256 (base32 - "0xm38h31jb29xfh2sfyk48d8wdfq4b8lmb412zx9vjr35izjb9iq")))) - (build-system gnu-build-system) + "0cij9399snpn672pdbda8qbxljdkfg068kvv3g5811rz6yslx124")) + (patches + (search-patches "dtc-meson-cell-overflow.patch")))) + (build-system meson-build-system) (arguments (list - #:modules `(,@%gnu-build-system-modules (srfi srfi-26)) - #:make-flags - #~(list (string-append "CC=" #$(cc-for-target)) - ;; /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") + #:modules '((guix build meson-build-system) + (guix build utils) + (srfi srfi-26)) #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'patch-pkg-config + (add-after 'unpack 'preparations (lambda _ - (substitute* '("Makefile" - "tests/run_tests.sh") - (("pkg-config") - #$(pkg-config-for-target))))) - (delete 'configure) ;no configure script - (add-before 'build 'install-doc + ;; The version string is usually derived via setuptools-scm, but + ;; without the git metadata available this fails. + (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version) + + ;; Needed by setup.py. + (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 _ (with-directory-excursion "Documentation" (for-each (cut install-file <> (string-append #$output "/share/doc/dtc/")) '("dts-format.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 (append (list bison flex libyaml + ninja pkg-config - swig) + python + python-setuptools-scm + swig + which) (if (member (%current-system) (package-supported-systems valgrind)) (list valgrind) '()))) diff --git a/gnu/packages/patches/dtc-meson-cell-overflow.patch b/gnu/packages/patches/dtc-meson-cell-overflow.patch new file mode 100644 index 0000000000..1c319312f7 --- /dev/null +++ b/gnu/packages/patches/dtc-meson-cell-overflow.patch @@ -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 +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 +--- + 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