From 9556d469f3be74a0ea0ada9e4879c25a32858a3e Mon Sep 17 00:00:00 2001 From: ng0 Date: Mon, 15 Aug 2016 00:26:40 +0000 Subject: [PATCH 1/2] gnu: Add tup. * gnu/packages/tup.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. --- gnu/local.mk | 2 ++ gnu/packages/tup.scm | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 gnu/packages/tup.scm diff --git a/gnu/local.mk b/gnu/local.mk index b8c5378..bc4b968 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -5,6 +5,7 @@ # Copyright © 2013, 2014, 2015, 2016 Mark H Weaver # Copyright © 2016 Chris Marusich # Copyright © 2016 Kei Kebreau +# Coypright © 2016 ng0 # # This file is part of GNU Guix. # @@ -343,6 +344,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/tmux.scm \ %D%/packages/tor.scm \ %D%/packages/tre.scm \ + %D%/packages/tup.scm \ %D%/packages/tv.scm \ %D%/packages/unrtf.scm \ %D%/packages/upnp.scm \ diff --git a/gnu/packages/tup.scm b/gnu/packages/tup.scm new file mode 100644 index 0000000..66ce099 --- /dev/null +++ b/gnu/packages/tup.scm @@ -0,0 +1,83 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2016 ng0 +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages tup) + #:use-module (gnu packages) + #:use-module (gnu packages linux) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages version-control) + #:use-module (gnu packages perl) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu)) + +(define-public tup + (package + (name "tup") + (version "0.7.4") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/gittup/" + name "/archive/v" version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "044h9kbcg1sfwpn13j1grw79kwysqhyn3w3g6yy8ap4j32v10gz2")))) + (build-system gnu-build-system) + (arguments + ;; tup requires fusermount to have suid, which we cannot provide in build env, + ;; we bootstrap it and use tup generate. This also means that no tests are run. + `(#:tests? #f + #:modules ((guix build gnu-build-system) + (guix build utils)) + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (zero? (system* "./build.sh")) + (zero? (system* "./build/tup" "generate" "script.sh")))) + (replace 'build + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "script.sh" + (("`git describe`") (string-append "v" ,version))) + (zero? (system* "./script.sh")) + #t)) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (man (string-append out "/share/man/man1"))) + (install-file "tup" bin) + (install-file "tup.1" man)) + #t))))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("perl" ,perl))) + (inputs + `(("fuse" ,fuse))) + (synopsis "A file-based build system") + (description + "Tup is a file-based build system for Linux, OSX, and Windows. It inputs a list +of file changes and a directed acyclic graph (DAG), then processes the DAG to +execute the appropriate commands required to update dependent files. Updates are +performed with very little overhead since tup implements powerful build +algorithms to avoid doing unnecessary work. This means you can stay focused on +your project rather than on your build system.") + (home-page "http://gittup.org/tup/") + (license license:gpl2))) -- 2.9.3