+(define-public premake5
+ (package
+ (inherit premake4)
+ (version "5.0.0-alpha15")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/premake/premake-core/"
+ "releases/download/v" version
+ "/premake-" version "-src.zip"))
+ (sha256
+ (base32
+ "0lyxfyqxyhjqsb3kmx1fyrxinb26i68hb7w7rg8lajczrgkmc3w8"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments premake4)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (replace 'enter-source
+ (lambda _ (chdir "build/gmake2.unix") #t))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (install-file "../../bin/release/premake5"
+ (string-append (assoc-ref outputs "out") "/bin"))
+ #t))))))
+ (description "@code{premake5} is a command line utility that reads a
+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.9")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://gittup.org/tup/releases/tup-v"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0gnd2598xqgwihdkfkx7qn0q6p4n7npam1fy83mp7s04zwj99syc"))
+ (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)))
+