From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id kLNGBx473V7jCAAA0tVLHw (envelope-from ) for ; Sun, 07 Jun 2020 19:08:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id AFEfAx473V7JegAA1q6Kng (envelope-from ) for ; Sun, 07 Jun 2020 19:08:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2BBEC9407C7 for ; Sun, 7 Jun 2020 19:08:13 +0000 (UTC) Received: from localhost ([::1]:45636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ji0eQ-00058b-G5 for larch@yhetil.org; Sun, 07 Jun 2020 15:08:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ji0eI-00058R-Q3 for guix-patches@gnu.org; Sun, 07 Jun 2020 15:08:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43341) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ji0eI-0006Pi-GL for guix-patches@gnu.org; Sun, 07 Jun 2020 15:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ji0eI-0008UB-BB for guix-patches@gnu.org; Sun, 07 Jun 2020 15:08:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41753] [PATCH] gnu: Add tup. Resent-From: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 07 Jun 2020 19:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41753 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41753@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159155686232589 (code B ref -1); Sun, 07 Jun 2020 19:08:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Jun 2020 19:07:42 +0000 Received: from localhost ([127.0.0.1]:54887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ji0dt-0008TT-I5 for submit@debbugs.gnu.org; Sun, 07 Jun 2020 15:07:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:47954) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ji0dm-0008TF-88 for submit@debbugs.gnu.org; Sun, 07 Jun 2020 15:07:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ji0dm-00055i-3t for guix-patches@gnu.org; Sun, 07 Jun 2020 15:07:30 -0400 Received: from pat.zlotemysli.pl ([37.59.186.212]:47156) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ji0dh-0006Mp-TQ for guix-patches@gnu.org; Sun, 07 Jun 2020 15:07:29 -0400 Received: (qmail 25611 invoked by uid 1009); 7 Jun 2020 21:07:17 +0200 Received: from 188.123.215.55 (kuba@kadziolka.net@188.123.215.55) by pat.zlotemysli.pl (envelope-from , uid 1002) with qmail-scanner-2.08st (clamdscan: 0.98.6/25835. spamassassin: 3.4.0. perlscan: 2.08st. Clear:RC:1(188.123.215.55):. Processed in 0.056907 secs); 07 Jun 2020 19:07:17 -0000 Received: from unknown (HELO localhost.localdomain) (kuba@kadziolka.net@188.123.215.55) by pat.zlotemysli.pl with AES256-SHA encrypted SMTP; 7 Jun 2020 21:07:17 +0200 From: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Date: Sun, 7 Jun 2020 21:07:11 +0200 Message-Id: <20200607190711.20988-1-kuba@kadziolka.net> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: none client-ip=37.59.186.212; envelope-from=kuba@kadziolka.net; helo=pat.zlotemysli.pl X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/07 15:07:17 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -0.01 X-TUID: XrNiTbhOyGts * 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 ;;; Copyright © 2020 Leo Prikler ;;; Copyright © 2020 Yuval Kogman +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; 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?= +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 + #include + #include +-#include "sqlite3/sqlite3.h" ++#include + + #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 + + typedef sqlite3_int64 tupid_t; + +-- +2.26.2 + -- 2.26.2