mach

A work-in-progress implementation of make(1)

git clone https://git.8pit.net/mach.git

 1(use-modules (guix packages)
 2             (guix git-download)
 3             (guix licenses)
 4             (guix gexp)
 5             (guix utils)
 6             (guix build-system haskell)
 7             (guix build-system trivial)
 8             (gnu packages commencement)
 9             (gnu packages haskell)
10             (gnu packages haskell-apps)
11             (gnu packages haskell-check)
12             (gnu packages build-tools))
13
14;; Hack to access the unexported license constructor.
15;;
16;; Taken from: https://gitlab.com/nonguix/nonguix/-/blob/master/nonguix/licenses.scm
17(define license (@@ (guix licenses) license))
18
19(define cc-by-nc-sa4.0
20  (license "CC-BY-NC-SA 4.0"
21           "http://creativecommons.org/licenses/by-nc-sa/4.0"
22           "Attribution-NonCommercial-ShareAlike 4.0 International"))
23
24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25
26;; Build pdpmake from git for POSIX compliance fixes which are not
27;; contained in the latest releases and cause mach test failures.
28(define pdpmake-git
29  (let ((commit "d5214d453662c484378dd7254520c2fb27571057"))
30    (package
31      (inherit pdpmake)
32      (source (origin
33                (method git-fetch)
34                (uri (git-reference
35                       (url "https://github.com/rmyorston/pdpmake.git")
36                       (commit commit)))
37                (file-name (git-file-name "pdpmake" commit))
38                (sha256 (base32 "1vrkb7as8hbbn1w4pdmcz88gwacr7j45pdqr7dlkyy54pxd39nhg")))))))
39
40;; Provides a symlink from /bin/cc to the C compiler for the current
41;; target. Needed for portable cc(1) invocations in the golden tests.
42(define cc-symlink
43  (package
44    (name "cc-symlink")
45    (version "1.0")
46    (source #f)
47    (build-system trivial-build-system)
48    (arguments
49      `(#:modules ((guix build utils))
50        #:builder
51        ,#~(begin
52             (use-modules (guix build utils))
53             (let ((bindir (string-append #$output "/bin")))
54               (mkdir-p bindir)
55               (symlink (string-append #$gcc-toolchain "/bin/gcc")
56                        (string-append bindir "/cc"))))))
57    (inputs (list gcc-toolchain))
58    (synopsis "Provides a cc(1) symlink to gcc(1)")
59    (description "")
60    (home-page "")
61    (license cc0)))
62
63(package
64  (name "mach")
65  (version "0.1.0.0")
66  (source (local-file "." "git-checkout"
67                      #:recursive? #t))
68  (build-system haskell-build-system)
69  (inputs
70    (list
71      ghc-9.2
72      cc-symlink))
73  (native-inputs
74    (list
75      pdpmake-git
76      gcc-toolchain
77      ghc-tasty
78      ghc-tasty-hunit
79      ghc-tasty-golden))
80  (synopsis "A WiP POSIX Make implementation")
81  (description "")
82  (home-page "https://github.com/nmeum/mach")
83  (license (list cc-by-nc-sa4.0)))