unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#69661] [PATCH] gnu: Add redo-apenwarr
@ 2024-03-09  0:00 Massimo Zaniboni
       [not found] ` <3c9427f3-3857-4b54-9ad7-b8d970d734e7@protonmail.com>
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Massimo Zaniboni @ 2024-03-09  0:00 UTC (permalink / raw)
  To: 69661

Change-Id: Ied142a7dc3e9baf9babdeff046f350e647a7a5cc
---
  gnu/packages/build-tools.scm | 110 +++++++++++++++++++++++++++++++++++
  1 file changed, 110 insertions(+)

diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm
index 15d88de..54de681 100644
--- a/gnu/packages/build-tools.scm
+++ b/gnu/packages/build-tools.scm
@@ -15,6 +15,7 @@
  ;;; Copyright © 2021 qblade <qblade@protonmail.com>
  ;;; Copyright © 2021, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  ;;; Copyright © 2022, 2023 Juliana Sims <juli@incana.org>
+;;; Copyright © 2024 Massimo Zaniboni <mzan@dokmelody.org>
  ;;;
  ;;; This file is part of GNU Guix.
  ;;;
@@ -457,6 +458,115 @@ (define-public premake5
  scripted definition of a software project and outputs @file{Makefile}s or
  other lower-level build files.")))

+(define-public redo-apenwarr
+  (package
+    (name "redo-apenwarr")
+    (version "0.42d")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/apenwarr/redo")
+             (commit (string-append "redo-" version))))
+       (sha256
+        (base32 "0z78fmkb85k9hnpvh0pgi8cahljjgnr6j7mb614cykvpa3xsyl0p"))))
+
+    (build-system gnu-build-system)
+    (arguments
+     `(#:test-target "test"
+       #:parallel-build? #f
+       #:parallel-tests? #f
+       #:make-flags (list (string-append "PREFIX="
+                                         (assoc-ref %outputs "out"))
+                          "DESTDIR=/")
+       #:phases (modify-phases %standard-phases
+                  (delete 'configure)
+                  (add-before 'build 'patch-shell-scripts
+                    (lambda* (#:key inputs outputs #:allow-other-keys)
+
+                      (patch-shebang "minimal/do")
+
+                      ;; In Guix build phase there is no anymore a Git 
repo,
+                      ;; hence the Git tool cannot be anymore called.
+                      ;; So the content of the file is manually generated.
+                      (let* ((repo-version "0.42d")
+                             (repo-commit
+                              "7f00abc36be15f398fa3ecf9f4e5283509c34a00")
+                             (repo-date "2021-07-27 20:48:36 -0700")
+                             (repo-head (format #f
+                                         "(HEAD -> main, tag: redo-~a)"
+                                         repo-version)))
+
+                        (substitute* '("redo/version/gitvars.pre")
+                          (("\\$Format:%H\\$")
+                           repo-commit)
+                          (("\\$Format:%d\\$")
+                           repo-head)
+                          (("\\$Format:%ci\\$")
+                           repo-date)))
+
+                      ;; Redo scripts can inject shebangs headers to 
generated scripts.
+                      (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")
+                         (format #f "#!~a"
+                                 (which "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")
+                         (which "pwd"))
+                        (("/bin/ls")
+                         (which "ls")))
+
+                      ;; Use `perl' on the store.
+                      (substitute* '("t/200-shell/nonshelltest.do")
+                        (("/usr/bin/env perl")
+                         (format #f "~a"
+                                 (which "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 "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\"")
+                         "CC=\"gcc\"")))))))
+
+    (inputs (list python-wrapper python-markdown python-beautifulsoup4))
+
+    (native-inputs
+     ;; Used for the tests.
+     (list which perl git gcc))
+
+    (synopsis
+     "Build tool where dependencies are part of the building instructions")
+    (description
+     "Redo-apenwarr is a build tool where each artifact is produced by 
a shell
+script having optional annotations for specifying its dependencies.")
+    (home-page "https://github.com/apenwarr/redo")
+    (license license:asl2.0)))
+
  (define-public scons
    (package
      (name "scons")

base-commit: d79c88e8809d2079452fd276bf4d17eb16636ff9
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-05-16 21:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-09  0:00 [bug#69661] [PATCH] gnu: Add redo-apenwarr Massimo Zaniboni
     [not found] ` <3c9427f3-3857-4b54-9ad7-b8d970d734e7@protonmail.com>
2024-03-10 19:54   ` Skyler Ferris via Guix-patches via
2024-03-12 15:39     ` Massimo Zaniboni
2024-03-13  1:52       ` Skyler Ferris via Guix-patches via
2024-03-15  2:19         ` Skyler Ferris via Guix-patches via
2024-03-12 15:05 ` [bug#69661] [PATCH v2] " Massimo Zaniboni
2024-05-16 21:01 ` [bug#69661] [PATCH vREVISION] " Massimo Zaniboni
2024-05-16 21:11   ` Massimo Zaniboni

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).