From patchwork Thu May 16 21:01:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Massimo Zaniboni X-Patchwork-Id: 64495 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 B067A27BBEA; Thu, 16 May 2024 22:02:26 +0100 (BST) 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=ham 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 8DA6227BBE9 for ; Thu, 16 May 2024 22:02:25 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7iEk-0004mz-Kk; Thu, 16 May 2024 17:02:02 -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 1s7iEi-0004mT-D4 for guix-patches@gnu.org; Thu, 16 May 2024 17:02:00 -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 1s7iEi-0002Ii-2V for guix-patches@gnu.org; Thu, 16 May 2024 17:02:00 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s7iEk-00040z-EP for guix-patches@gnu.org; Thu, 16 May 2024 17:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69661] [PATCH vREVISION] 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: Thu, 16 May 2024 21:02: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 moreinfo To: 69661@debbugs.gnu.org Cc: Massimo Zaniboni Received: via spool by 69661-submit@debbugs.gnu.org id=B69661.171589332015425 (code B ref 69661); Thu, 16 May 2024 21:02:02 +0000 Received: (at 69661) by debbugs.gnu.org; 16 May 2024 21:02:00 +0000 Received: from localhost ([127.0.0.1]:50982 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7iEi-00040j-5n for submit@debbugs.gnu.org; Thu, 16 May 2024 17:02:00 -0400 Received: from mail.asterisell.com ([193.30.121.134]:53944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7iEe-00040a-LN for 69661@debbugs.gnu.org; Thu, 16 May 2024 17:01:59 -0400 From: Massimo Zaniboni DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dokmelody.org; s=mail; t=1715893307; bh=MCIo4gcBK7c+FashzBvapHjKjziXElEwS2Yvy+cXsTw=; h=From:To:Cc:Subject:Date; b=q+CFD1jbqbX8aVkksuF9Y1wYUxPg7VI7d4zQUeEG2H0F3PTAE2QnUkxy1vYeIjted mVSSLKy0DEoMtto7B5HwhmgEpTJU28fgjypRs4Tly1ZDM50J0TXWEb/BBnFlVLmjsJ OnGXvBC8Nh1EDNQhl/mgeUs6nS52QbsEZ0mouFOc= Date: Thu, 16 May 2024 23:01:16 +0200 Message-ID: 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 * gnu/packages/build-tools.scm (redo-apenwarr): New variable. Change-Id: Ied142a7dc3e9baf9babdeff046f350e647a7a5cc --- gnu/packages/build-tools.scm | 115 +++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) base-commit: 5a624adfd7b14c3717237d137bd0766c77f0f570 diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm index daaf450e70..5f575c8aff 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. ;;; @@ -464,6 +465,120 @@ (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 "DESTDIR=" + #$output) "PREFIX=/") + #: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 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")