~ruther/guix-local

cbee75d29e7faf7db5a58572fed12bf93ead662c — Lilah Tascheter 8 months ago 029c575
gnu: hare: Use hare-build-system.

* gnu/packages/hare.scm
  (hare-supported-systems,target->hare-arch): Remove in favor of
  equivalent definitions in (gnu build-system hare).

  (harec,hare,hare-update)[supported-systems]: Update to
  %hare-supported-systems imported from (gnu build-system hare).

  (hare-update)[build-system]: Switch to hare-build-system.
  [arguments]<make-flags>: Remove. Now handled by hare-build-system.
  <phases>: Don't delete configure, and genrules before build.

Change-Id: Idc0e00815e737029aef7af72e04b6d6c572b0fb9
Signed-off-by: jgart <jgart@dismail.de>
1 files changed, 14 insertions(+), 31 deletions(-)

M gnu/packages/hare.scm
M gnu/packages/hare.scm => gnu/packages/hare.scm +14 -31
@@ 25,27 25,17 @@
  #:use-module (gnu packages less)
  #:use-module (gnu packages man)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system hare)
  #:use-module (guix deprecation)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix search-paths)
  #:use-module (guix utils)
  #:export (hare-supported-systems
            target->hare-arch))
  #:re-export (%hare-supported-systems target->hare-arch))

(define hare-supported-systems
  '("x86_64-linux" "aarch64-linux" "riscv64-linux"))

(define* (target->hare-arch #:optional (target (or (%current-target-system)
                                                   (%current-system))))
  ;; Only error on supported systems, so we don't break guix pull.
  (if (member (%current-system) hare-supported-systems)
      (cond ((target-x86-64? target) "x86_64")
            ((target-aarch64? target) "aarch64")
            ((target-riscv64? target) "riscv64")
            (else (error "unsupported hare target" target)))
      ""))
(define-deprecated/public-alias hare-supported-systems %hare-supported-systems)

(define (cross-target? target) ; only has to work for supported arches
  (and target (not (if (%current-target-system)


@@ 101,7 91,7 @@
                (replace 'configure
                  (lambda _ (copy-file #$hare-config "config.mk"))))))
    (native-inputs (list qbe))
    (supported-systems hare-supported-systems)
    (supported-systems %hare-supported-systems)
    (home-page "https://harelang.org")
    (synopsis "Harelang bootstrap compiler")
    (description "@code{harec} is a bootstrap compiler written in C for the Hare


@@ 163,7 153,7 @@ package.")
                             (tc "riscv64-linux-gnu")
                             (tc "x86_64-linux-gnu")))))
    (native-inputs (list harec qbe scdoc))
    (supported-systems hare-supported-systems)
    (supported-systems %hare-supported-systems)
    (search-paths (list (search-path-specification
                          (variable "HAREPATH")
                          (files '("share/hare")))))


@@ 189,21 179,14 @@ static typing, manual memory management, and a minimal runtime.")
              (sha256
                (base32
                  "0hpcgiyg458v353g3wm2iaz2kszhc2n2rc40lnvxbg9q6i232m76"))))
    (build-system gnu-build-system)
    (arguments
      (list #:make-flags #~(list (string-append "PREFIX=" #$output))
            #:phases
            #~(modify-phases %standard-phases
                (delete 'configure)
                (replace 'build
                  (lambda _
                    ;; genrules is invoked during build, so we can't just set
                    ;; make-flags to cross-compile all.
                    (invoke "make" "hare-update-genrules")
                    (invoke "make" "hare-update"
                      (format #f "HAREFLAGS=-a ~a" #$(target->hare-arch))))))))
    (native-inputs (list hare))
    (supported-systems hare-supported-systems)
    (build-system hare-build-system)
    (arguments (list #:phases
                     #~(modify-phases %standard-phases
                         (add-before 'build 'build-rules
                           ;; genrules is invoked during build, so we have to
                           ;; build it natively separately
                           (lambda _ (invoke "make" "hare-update-genrules"))))))
    (supported-systems %hare-supported-systems)
    (home-page "https://harelang.org")
    (synopsis "Harelang interversion updater tool")
    (description "@code{hare-update} updates Harelang source files to newer