gnu: add premake5.
[jackhill/guix/guix.git] / gnu / packages / build-tools.scm
index a694a7d..8cfd26f 100644 (file)
@@ -1,13 +1,14 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Corentin Bocquillon <corentin@nybble.fr>
-;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
 ;;; Copyright © 2018 Tomáš Čech <sleep_walker@gnu.org>
 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
-;;; Copyright © 2019 Brett Gilio <brettg@posteo.net>
+;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
 ;;; Copyright © 2019 Jonathan Brielmaier <jonathan.brielmaier@web.de>
+;;; Copyright © 2020 Leo Prikler <leo.prikler@student.tugraz.at>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -80,7 +81,7 @@ makes a few sacrifices to acquire fast full and incremental build times.")
 (define-public bear
   (package
     (name "bear")
-    (version "2.3.13")
+    (version "2.4.3")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -89,7 +90,7 @@ makes a few sacrifices to acquire fast full and incremental build times.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0imvvs22gyr1v6ydgp5yn2nq8fb8llmz0ra1m733ikjaczl3jm7z"))))
+                "19fk4flfykbzhb89ppmzqf0zlrkbjm6ajl9fsayndj9km5ys0041"))))
     (build-system cmake-build-system)
     (inputs
      `(("python" ,python-wrapper)))
@@ -102,8 +103,8 @@ generate such a compilation database.")
     (license license:gpl3+)))
 
 (define-public gn
-  (let ((commit "1ab6fa2cab7ec64840db720a56018ca8939329f9")
-        (revision "1530"))          ;as returned by `git describe`, used below
+  (let ((commit "6e5ba2e7210823cf7ccce3eb2a23336a4e7f1349")
+        (revision "1666"))          ;as returned by `git describe`, used below
     (package
       (name "gn")
       (version (git-version "0.0" revision commit))
@@ -113,17 +114,15 @@ generate such a compilation database.")
                 (uri (git-reference (url home-page) (commit commit)))
                 (sha256
                  (base32
-                  "06h974d1lag3wwsz6s5asmpv0njmf671ag4la2fpnbh494m97lfk"))
+                  "157ax65sixjm0i1j89wvny48v1mbsl4pbvv5vqinjc6r0fryaf2r"))
                 (file-name (git-file-name name version))))
       (build-system gnu-build-system)
       (arguments
-       `(#:tests? #f                    ;FIXME: How to run?
-         #:phases (modify-phases %standard-phases
+       `(#:phases (modify-phases %standard-phases
                     (add-before 'configure 'set-build-environment
                       (lambda _
                         (setenv "CC" "gcc") (setenv "CXX" "g++")
                         (setenv "AR" "ar")
-                        (setenv "LDFLAGS" "-pthread")
                         #t))
                     (replace 'configure
                       (lambda _
@@ -143,6 +142,14 @@ generate such a compilation database.")
                       (lambda _
                         (invoke "ninja" "-C" "out" "gn"
                                 "-j" (number->string (parallel-job-count)))))
+                    (replace 'check
+                      (lambda* (#:key (tests? #t) #:allow-other-keys)
+                        (if tests?
+                            (lambda ()
+                              (invoke "ninja" "-C" "out" "gn_unittests"
+                                      "-j" (number->string (parallel-job-count)))
+                              (invoke "./out/gn_unittests"))
+                            (format #t "test suite not run~%"))))
                     (replace 'install
                       (lambda* (#:key outputs #:allow-other-keys)
                         (let ((out (assoc-ref outputs "out")))
@@ -239,6 +246,31 @@ other lower-level build files.")
     (home-page "https://premake.github.io")
     (license license:bsd-3)))
 
+(define-public premake5
+  (package
+    (inherit premake4)
+    (version "5.0.0-alpha14")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/premake/premake-core/"
+                                  "releases/download/v" version
+                                  "/premake-" version "-src.zip"))
+              (sha256
+               (base32
+                "0236s7bjvxf7x1l5faywmfzjywflpx42ngyhkn0mqqjnh54a97vw"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments premake4)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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 osc
   (package
     (name "osc")