From patchwork Tue Mar 12 15:05:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Massimo Zaniboni X-Patchwork-Id: 61691 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 65CE627BBE2; Tue, 12 Mar 2024 16:27:57 +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 6EB1427BBE9 for ; Tue, 12 Mar 2024 16:27:55 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rk4yY-0002ZX-Uz; Tue, 12 Mar 2024 12:27:38 -0400 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 1rk4yO-0002Xi-Mr for guix-patches@gnu.org; Tue, 12 Mar 2024 12:27:29 -0400 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 1rk4yO-0001qT-ED for guix-patches@gnu.org; Tue, 12 Mar 2024 12:27:28 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rk4yw-0008WT-Uf for guix-patches@gnu.org; Tue, 12 Mar 2024 12:28:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69661] [PATCH v2] gnu: Add redo-apenwarr. References: <697dee67-e9a7-4479-bad9-65822bfcc162@dokmelody.org> In-Reply-To: <697dee67-e9a7-4479-bad9-65822bfcc162@dokmelody.org> Resent-From: Massimo Zaniboni Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 12 Mar 2024 16:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69661 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69661@debbugs.gnu.org Cc: Massimo Zaniboni Received: via spool by 69661-submit@debbugs.gnu.org id=B69661.171026085832712 (code B ref 69661); Tue, 12 Mar 2024 16:28:02 +0000 Received: (at 69661) by debbugs.gnu.org; 12 Mar 2024 16:27:38 +0000 Received: from localhost ([127.0.0.1]:43497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk4yX-0008VU-3f for submit@debbugs.gnu.org; Tue, 12 Mar 2024 12:27:38 -0400 Received: from mail.asterisell.com ([193.30.121.134]:40146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk3iV-0003QQ-Gg for 69661@debbugs.gnu.org; Tue, 12 Mar 2024 11:07:01 -0400 From: Massimo Zaniboni DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dokmelody.org; s=mail; t=1710255978; bh=kjkAH4fK5CyGvtFQiIxAqazxTw2RM8v5W/t9oUGIBiY=; h=From:To:Cc:Subject:Date; b=Se3o2icpJBqCyRJAdtHntgwCkInl3h0uHPt7c2iZ4DGsGaT7tUjxpKg3QlENI+1uV gZQl7bHhJEwGzrHgZs6SbfUQcrVTffe35diRpUxcxYcOhHTNRL93WcgjcM0zV4Zdv8 SQn7DZ45Oj9ncmmN3penyX3dgspw1ecsX3jmtKnc= Date: Tue, 12 Mar 2024 16:05:32 +0100 Message-ID: <01018827d399b901ecbb41165f568ebe0458a19e.1710255932.git.mzan@dokmelody.org> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 12 Mar 2024 12:27:27 -0400 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 * gnu/packages/build-tools.scm (redo-apenwarr): New variable. Change-Id: Ied142a7dc3e9baf9babdeff046f350e647a7a5cc --- gnu/packages/build-tools.scm | 128 +++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) base-commit: d79c88e8809d2079452fd276bf4d17eb16636ff9 diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm index 15d88de..11dd337 100644 --- a/gnu/packages/build-tools.scm +++ b/gnu/packages/build-tools.scm @@ -15,6 +15,7 @@ ;;; Copyright © 2021 qblade ;;; Copyright © 2021, 2023 Maxim Cournoyer ;;; Copyright © 2022, 2023 Juliana Sims +;;; Copyright © 2024 Massimo Zaniboni ;;; ;;; This file is part of GNU Guix. ;;; @@ -457,6 +458,133 @@ (define-public premake5 scripted definition of a software project and outputs @file{Makefile}s or other lower-level build files."))) +(define-public redo-apenwarr + (let ((origin-url "https://github.com/apenwarr/redo") + (origin-date "2021-07-27 20:48:36 -0700") + (origin-version "0.42d") + (origin-commit "7f00abc36be15f398fa3ecf9f4e5283509c34a00")) + + (package + (name "redo-apenwarr") + (version origin-version) + (source + (origin + (method git-fetch) + (uri (git-reference + (url origin-url) + (commit (string-append "redo-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0z78fmkb85k9hnpvh0pgi8cahljjgnr6j7mb614cykvpa3xsyl0p")))) + + (build-system gnu-build-system) + (arguments + (list + #:test-target "test" + #:make-flags #~(list (string-append "PREFIX=" + #$output "/out") "DESTDIR=/") + #:phases #~(modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'patch-shell-scripts + (lambda* _ + + ;; The building tool queries the Git repository, + ;; for retrieving info about the commit hash and date, + ;; but this information is not anymore present in the + ;; source code downloaded from Guix. + ;; So this information will be generated manually here, + ;; using the data specified in the `origin-*' params. + (substitute* '("redo/version/gitvars.pre") + (("\\$Format:%H\\$") + #$origin-commit) + (("\\$Format:%d\\$") + (format #f "(HEAD -> main, tag: redo-~a)" + #$origin-version)) + (("\\$Format:%ci\\$") + #$origin-date)) + + ;; redo-apenwarr can generate support scripts having + ;; shebangs headers. We will patch these scripts + ;; for using the `sh' in the store. + (substitute* '("bin/default.do" + "t/203-make/whichmake.do" + "redo/py.do" + "redoconf/link.od" + "redoconf/run.od" + "redoconf/link-shlib.od" + "redoconf/_compile.od" + "redoconf/compile.od" + "minimal/do") + (("#!/bin/sh") + (string-append "#!" + #$(file-append bash "/bin/sh")))) + + ;; Use `pwd' on the store. + (substitute* '("t/all.do" "t/105-sympath/all.do" + "t/110-compile/hello.o.do" + "minimal/do" "minimal/do.test" "do") + (("/bin/pwd") + #$(file-append coreutils "/bin/pwd")) + (("/bin/ls") + #$(file-append coreutils "/bin/ls"))) + + ;; Use `perl' on the store. + (substitute* '("t/200-shell/nonshelltest.do") + (("/usr/bin/env perl") + #$(file-append perl "/bin/perl"))) + + ;; Use `gcc' compiler, because Guix has no default `cc' compiler. + (substitute* '("docs/cookbook/hello/hello.do" + "t/110-compile/LD.do" + "t/110-compile/CC.do" + "t/110-compile/yellow.o.do" + "t/111-example/CC.do" + "t/111-example/hello.do") + (("^([ \t]*)cc " dummy starting-spaces) + (string-append starting-spaces + #$(file-append gcc "/bin/gcc") " "))) + + (substitute* '("t/110-compile/all.do" + "t/111-example/all.do") + ((" type cc ") + " type gcc ")) + + (substitute* '("docs/cookbook/c/flagtest.o.od") + (("^CC=\"\\$CC\"") + (string-append "CC=\"" + #$(file-append gcc "/bin/gcc") "\"")))))))) + + (inputs (list coreutils bash python-wrapper)) + (native-inputs (list ;Used from the building script, + ;; for checking the existences of coreutils on the path. + which + + ;; Required for generating the documentation + python-markdown + python-beautifulsoup4 + + ;; TODO it cannot generate some part of the the documentation, + ;; because the disabled package python-mkdocs requires + ;; the missing PyPI plugin python-mkdocs-exclude + + ;; Required only for the tests. + perl + git + gcc)) + + (synopsis + "Build tool where dependencies are parts of the building instructions") + (description + "@code{redo-apenwarr} is a build tool where each target file is produced by +a normal shell script, but with additional commands for specifying +its dependencies. In tools like @code{make}, dependencies are specified +upfront (i.e. bottom-up), while in @code{redo-apenwarr} they are +generated dynamically during build script execution (i.e. top-down). +Rebuilds are incremental, i.e. only target files with changed dependencies +will be rebuilt.") + (home-page "https://github.com/apenwarr/redo") + (license license:asl2.0)))) + (define-public scons (package (name "scons")