GNU bug report logs - #41753
[PATCH] gnu: Add tup.

Previous Next

Package: guix-patches;

Reported by: Jakub Kądziołka <kuba <at> kadziolka.net>

Date: Sun, 7 Jun 2020 19:08:02 UTC

Severity: normal

Tags: patch

Done: Jakub Kądziołka <kuba <at> kadziolka.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41753 in the body.
You can then email your comments to 41753 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#41753; Package guix-patches. (Sun, 07 Jun 2020 19:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 07 Jun 2020 19:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add tup.
Date: Sun,  7 Jun 2020 21:07:11 +0200
* gnu/packages/build-tools.scm (tup): New variable.
* gnu/packages/patches/tup-unbundle-dependencies.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register new file.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/build-tools.scm                  | 79 +++++++++++++++++++
 .../patches/tup-unbundle-dependencies.patch   | 74 +++++++++++++++++
 3 files changed, 154 insertions(+)
 create mode 100644 gnu/packages/patches/tup-unbundle-dependencies.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index ae8a2275f7..27657b89e6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1542,6 +1542,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/ttf2eot-cstddef.patch			\
   %D%/packages/patches/ttfautohint-source-date-epoch.patch	\
   %D%/packages/patches/tomb-fix-errors-on-open.patch		\
+  %D%/packages/patches/tup-unbundle-dependencies.patch		\
   %D%/packages/patches/tuxpaint-stamps-path.patch		\
   %D%/packages/patches/twinkle-bcg729.patch			\
   %D%/packages/patches/u-boot-riscv64-fix-extlinux.patch	\
diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm
index 9ff32b22f9..38bd906278 100644
--- a/gnu/packages/build-tools.scm
+++ b/gnu/packages/build-tools.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2019 Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
 ;;; Copyright © 2020 Leo Prikler <leo.prikler <at> student.tugraz.at>
 ;;; Copyright © 2020 Yuval Kogman <nothingmuch <at> woobling.org>
+;;; Copyright © 2020 Jakub Kądziołka <kuba <at> kadziolka.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,12 +37,16 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages linux)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages package-management)
+  #:use-module (gnu packages pcre)
+  #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages ninja)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python))
@@ -276,6 +281,80 @@ other lower-level build files.")
 scripted definition of a software project and outputs @file{Makefile}s or
 other lower-level build files.")))
 
+(define-public tup
+  (package
+    (name "tup")
+    (version "0.7.8")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://gittup.org/tup/releases/tup-v"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "1z8d5mmddiw3ckdvy88bi48aa5bm0hrid6g9c9hp2ynmpzywmp2h"))
+              (patches (search-patches "tup-unbundle-dependencies.patch"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  ;; NOTE: Tup uses a slightly modified Lua, so it cannot be
+                  ;; unbundled.  See: src/lula/tup-lua.patch
+                  (delete-file-recursively "src/pcre")
+                  (delete-file-recursively "src/sqlite3")
+                  #t))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; There is a bootstrap script, but it doesn't do what you think - it
+         ;; builds tup.
+         (delete 'bootstrap)
+         (replace 'configure
+           (lambda _
+             (substitute* "src/tup/link.sh"
+               (("`git describe`") ,version))
+             (with-output-to-file "tup.config"
+               (lambda _
+                 (format #t "CONFIG_TUP_USE_SYSTEM_SQLITE=y~%")))
+             #t))
+         (delete 'check)
+         (replace 'build
+           (lambda _
+             ;; Based on bootstrap-nofuse.sh, but with a detour to patch-shebang.
+             (invoke "./build.sh")
+             (invoke "./build/tup" "init")
+             (invoke "./build/tup" "generate" "--verbose" "build-nofuse.sh")
+             (patch-shebang "build-nofuse.sh")
+             (invoke "./build-nofuse.sh")))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((outdir (assoc-ref outputs "out"))
+                    (ftdetect (string-append outdir
+                                             "/share/vim/vimfiles/ftdetect")))
+               (install-file "tup" (string-append outdir "/bin"))
+               (install-file "tup.1" (string-append outdir "/share/man/man1"))
+               (install-file "contrib/syntax/tup.vim"
+                             (string-append outdir "/share/vim/vimfiles/syntax"))
+               (mkdir-p ftdetect)
+               (with-output-to-file (string-append ftdetect "/tup.vim")
+                 (lambda _
+                   (display "au BufNewFile,BufRead Tupfile,*.tup setf tup")))
+               #t))))))
+    (inputs
+     `(("fuse" ,fuse)
+       ("pcre" ,pcre)
+       ("pcre" ,pcre "bin") ; pcre-config
+       ("sqlite" ,sqlite)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (home-page "http://gittup.org/tup/")
+    (synopsis "Fast build system that's hard to get wrong")
+    (description "Tup is a generic build system based on a directed acyclic
+graphs of commands to be executed.  Tup instruments your build to detect the
+exact dependencies of the commands, allowing you to take advantage of ideal
+parallelism during incremental builds, and detecting any situations where
+a build worked by accident.")
+    (license license:gpl2)))
+
 (define-public osc
   (package
     (name "osc")
diff --git a/gnu/packages/patches/tup-unbundle-dependencies.patch b/gnu/packages/patches/tup-unbundle-dependencies.patch
new file mode 100644
index 0000000000..be6aeef9c3
--- /dev/null
+++ b/gnu/packages/patches/tup-unbundle-dependencies.patch
@@ -0,0 +1,74 @@
+From 895a7d4e8200f9430414a5fe47756efb67d2e5d0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= <kuba <at> kadziolka.net>
+Date: Sun, 7 Jun 2020 15:14:42 +0200
+Subject: [PATCH] Unbundle dependencies
+
+---
+ build.sh        | 10 ++++------
+ src/tup/db.c    |  2 +-
+ src/tup/tupid.h |  2 +-
+ 3 files changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/build.sh b/build.sh
+index 2937116d..eab650f7 100755
+--- a/build.sh
++++ b/build.sh
+@@ -16,7 +16,7 @@ else
+ 	echo "Error: invalid TUP_SERVER \"$server\"" 1>&2
+ 	exit 1
+ fi
+-LDFLAGS="$LDFLAGS -lm"
++LDFLAGS="$LDFLAGS -lm -lsqlite3 `pcre-config --libs`"
+ : ${CC:=gcc}
+ case "$os" in
+ 	Linux)
+@@ -65,17 +65,15 @@ mkdir luabuiltin
+ 
+ CFLAGS="$CFLAGS -DTUP_SERVER=\"$server\""
+ CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
++CFLAGS="$CFLAGS `pcre-config --cflags`"
+ 
+-for i in ../src/tup/*.c ../src/tup/tup/main.c ../src/tup/monitor/null.c ../src/tup/flock/fcntl.c ../src/inih/ini.c ../src/pcre/*.c $plat_files; do
++for i in ../src/tup/*.c ../src/tup/tup/main.c ../src/tup/monitor/null.c ../src/tup/flock/fcntl.c ../src/inih/ini.c $plat_files; do
+ 	echo "  bootstrap CC $CFLAGS $i"
+ 	# Put -I. first so we find our new luabuiltin.h file, not one built
+ 	# by a previous 'tup upd'.
+-	$CC $CFLAGS -c $i -I. -I../src -I../src/pcre $plat_cflags
++	$CC $CFLAGS -c $i -I. -I../src $plat_cflags
+ done
+ 
+-echo "  bootstrap CC $CFLAGS ../src/sqlite3/sqlite3.c"
+-$CC $CFLAGS -c ../src/sqlite3/sqlite3.c -DSQLITE_TEMP_STORE=2 -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION $plat_cflags
+-
+ echo "  bootstrap LD tup $LDFLAGS"
+ echo "const char *tup_version(void) {return \"$label\";}" | $CC -x c -c - -o tup_version.o
+ $CC *.o -o tup -lpthread $plat_ldflags $LDFLAGS
+diff --git a/src/tup/db.c b/src/tup/db.c
+index 55ee3edd..9bdf7a80 100644
+--- a/src/tup/db.c
++++ b/src/tup/db.c
+@@ -46,7 +46,7 @@
+ #include <errno.h>
+ #include <ctype.h>
+ #include <sys/stat.h>
+-#include "sqlite3/sqlite3.h"
++#include <sqlite3.h>
+ 
+ #define DB_VERSION 17
+ #define PARSER_VERSION 12
+diff --git a/src/tup/tupid.h b/src/tup/tupid.h
+index 7b36ae46..19aed438 100644
+--- a/src/tup/tupid.h
++++ b/src/tup/tupid.h
+@@ -21,7 +21,7 @@
+ #ifndef tup_tupid_h
+ #define tup_tupid_h
+ 
+-#include "sqlite3/sqlite3.h"
++#include <sqlite3.h>
+ 
+ typedef sqlite3_int64 tupid_t;
+ 
+-- 
+2.26.2
+
-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#41753; Package guix-patches. (Sun, 14 Jun 2020 20:59:01 GMT) Full text and rfc822 format available.

Message #8 received at 41753 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Jakub Kądziołka <kuba <at> kadziolka.net>
Cc: 41753 <at> debbugs.gnu.org
Subject: Re: [bug#41753] [PATCH] gnu: Add tup.
Date: Sun, 14 Jun 2020 22:58:07 +0200
Hi,

Jakub Kądziołka <kuba <at> kadziolka.net> skribis:

> * gnu/packages/build-tools.scm (tup): New variable.
> * gnu/packages/patches/tup-unbundle-dependencies.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Register new file.

[...]

> --- /dev/null
> +++ b/gnu/packages/patches/tup-unbundle-dependencies.patch
> @@ -0,0 +1,74 @@
> +From 895a7d4e8200f9430414a5fe47756efb67d2e5d0 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= <kuba <at> kadziolka.net>
> +Date: Sun, 7 Jun 2020 15:14:42 +0200
> +Subject: [PATCH] Unbundle dependencies
> +
> +---
> + build.sh        | 10 ++++------
> + src/tup/db.c    |  2 +-
> + src/tup/tupid.h |  2 +-
> + 3 files changed, 6 insertions(+), 8 deletions(-)

Nitpick: I’d remove the whole Git header and just keep the subject.

Otherwise LGTM!

Thanks,
Ludo’.




Reply sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
You have taken responsibility. (Sun, 14 Jun 2020 22:16:01 GMT) Full text and rfc822 format available.

Notification sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
bug acknowledged by developer. (Sun, 14 Jun 2020 22:16:02 GMT) Full text and rfc822 format available.

Message #13 received at 41753-done <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 41753-done <at> debbugs.gnu.org
Subject: Re: [bug#41753] [PATCH] gnu: Add tup.
Date: Mon, 15 Jun 2020 00:15:37 +0200
[Message part 1 (text/plain, inline)]
On Sun, Jun 14, 2020 at 10:58:07PM +0200, Ludovic Courtès wrote:
> Hi,
> 
> Jakub Kądziołka <kuba <at> kadziolka.net> skribis:
> 
> > * gnu/packages/build-tools.scm (tup): New variable.
> > * gnu/packages/patches/tup-unbundle-dependencies.patch: New file.
> > * gnu/local.mk (dist_patch_DATA): Register new file.
> 
> [...]
> 
> > --- /dev/null
> > +++ b/gnu/packages/patches/tup-unbundle-dependencies.patch
> > @@ -0,0 +1,74 @@
> > +From 895a7d4e8200f9430414a5fe47756efb67d2e5d0 Mon Sep 17 00:00:00 2001
> > +From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= <kuba <at> kadziolka.net>
> > +Date: Sun, 7 Jun 2020 15:14:42 +0200
> > +Subject: [PATCH] Unbundle dependencies
> > +
> > +---
> > + build.sh        | 10 ++++------
> > + src/tup/db.c    |  2 +-
> > + src/tup/tupid.h |  2 +-
> > + 3 files changed, 6 insertions(+), 8 deletions(-)
> 
> Nitpick: I’d remove the whole Git header and just keep the subject.
> 
> Otherwise LGTM!

Thanks for the review! I have pushed a revised patch as commit
2c1d1b7599a3738cdbdcaa281d56fa47b0b4c025.

Regards,
Jakub Kądziołka
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 13 Jul 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 280 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.