Subject: bug#72926: closed ()

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 04 Jan 2025 01:00:03 +0000

Your bug report

#72926: [PATCH] gnu: Add Hare toolchain and ecostuff.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
72926: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72926
GNU Bug Tracking System
Contact [email-masked] with problems

From: "jgart" <[email-masked]>
To: [email-masked]
Date: Sat, 04 Jan 2025 00:58:44 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Closing since redacted. Feel free to reopen if interested in working more on hare.

all best,

jgart

Subject: [PATCH] gnu: Add Hare toolchain and ecostuff.
From: "Daniel [REDACTED]" <[email-masked]>
To: [email-masked]
Cc: "Daniel \[REDACTED\]" <[email-masked]>
Date: Sun, 1 Sep 2024 14:13:58 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/hare.scm: New file.
* gnu/packages/hare-xyz.scm: New file.
* gnu/local.mk: Add these.
* gnu/packages/hare.scm (%hare-build-arguments): New variable.
(%hare-toolchain-build-arguments): New varible.
(%hare-toolchain-version): New variable.
(hare): New variable.
(harec): New variable.
* gnu/packages/hare-xyz.scm (hare-json): New variable.
(hare-ssh): New variable.

Change-Id: I3a9b3f9ca8e174b98b17319f383e63a267d64e27
---
 gnu/local.mk              |   3 +
 gnu/packages/hare-xyz.scm |  86 ++++++++++++++++++++++++++
 gnu/packages/hare.scm     | 127 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 216 insertions(+)
 create mode 100644 gnu/packages/hare-xyz.scm
 create mode 100644 gnu/packages/hare.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 8f0ff23251..286740d5fa 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -67,6 +67,7 @@
 # Copyright © 2024 David Elsing <[email-masked]>
 # Copyright © 2024 Ashish SHUKLA <[email-masked]>
 # Copyright © 2024 Fabio Natali <[email-masked]>
+# Copyright © 2024 Daniel [REDACTED] <[email-masked]>
 #
 # This file is part of GNU Guix.
 #
@@ -351,6 +352,8 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/haskell-crypto.scm		\
   %D%/packages/haskell-web.scm			\
   %D%/packages/haskell-xyz.scm			\
+  %D%/packages/hare.scm				\
+  %D%/packages/hare-xyz.scm				\
   %D%/packages/haxe.scm				\
   %D%/packages/heads.scm			\
   %D%/packages/hexedit.scm			\
diff --git a/gnu/packages/hare-xyz.scm b/gnu/packages/hare-xyz.scm
new file mode 100644
index 0000000000..aaac6f5ead
--- /dev/null
+++ b/gnu/packages/hare-xyz.scm
@@ -0,0 +1,86 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2024 Daniel [REDACTED] <[email-masked]>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages hare-xyz)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages hare)
+
+  #:use-module (guix build-system gnu)
+  #:use-module (guix gexp)
+  #:use-module (guix git-download)
+  #:use-module (guix packages)
+  #:use-module ((guix licenses) #:prefix l:))
+
+(define-public hare-json
+  (package
+    (name "hare-json")
+
+    ;; This most probably isn't a coincidence. ddevault versions his libraries
+    ;; alongside the rest of Hare. Don't ask me why!
+    (version %hare-toolchain-version)
+
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://git.sr.ht/~sircmpwn/hare-json")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0sni7j4x5s727cv1x3n40q310dbljswrz55skdb9fs6vclf361cs"))))
+
+    (build-system gnu-build-system)
+    (arguments
+     %hare-build-arguments)
+
+    (native-inputs (list hare))
+
+    (synopsis "JSON support for Hare")
+    (description "hare-ssh is a library providing JSON support for Hare.")
+    (home-page "https://git.sr.ht/~sircmpwn/hare-json")
+
+    (license l:mpl2.0)))
+
+
+(define-public hare-ssh
+  (package
+    (name "hare-ssh")
+
+    (version %hare-toolchain-version)
+
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://git.sr.ht/~sircmpwn/hare-ssh")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0mnlwwi3vl2hw0v7srkh5j08hdgvfwqzbdi3yps3rjikf8rzz0cj"))))
+
+    (build-system gnu-build-system)
+    (arguments
+     %hare-build-arguments)
+
+    (native-inputs (list hare))
+
+    (synopsis "SSH library for Hare")
+    (description "hare-ssh is a SSH library for Hare.")
+    (home-page "https://git.sr.ht/~sircmpwn/hare-ssh")
+
+    (license l:mpl2.0)))
diff --git a/gnu/packages/hare.scm b/gnu/packages/hare.scm
new file mode 100644
index 0000000000..b31f0c4777
--- /dev/null
+++ b/gnu/packages/hare.scm
@@ -0,0 +1,127 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2024 Daniel [REDACTED] <[email-masked]>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages hare)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages c)
+  #:use-module (gnu packages commencement)
+  #:use-module (gnu packages man)
+
+  #:use-module (guix build-system gnu)
+  #:use-module (guix gexp)
+  #:use-module (guix git-download)
+  #:use-module (guix packages)
+  #:use-module (guix utils)
+  #:use-module ((guix licenses) #:prefix l:))
+
+;;; Might want to make a hare-build-system, but this mess works well enough.
+(define-public %hare-toolchain-version "0.24.2")
+(define %hare-phases
+  `(modify-phases %standard-phases
+     (delete 'configure)
+     (replace 'install
+       (lambda* (#:key outputs #:allow-other-keys)
+         (invoke "make" "install")))))
+
+(define %hare-common-build-arguments
+  `(#:make-flags (list (string-append "CC=" ,(cc-for-target))
+                       "XDG_CACHE_HOME=/tmp/")))
+(define-public %hare-build-arguments
+  (append %hare-common-build-arguments
+          `(#:phases (modify-phases %standard-phases
+                       (add-before 'configure 'set-prefix
+                         (lambda* (#:key outputs #:allow-other-keys)
+                           (let ((out (assoc-ref outputs "out")))
+                             (substitute* "Makefile" (("/usr/local") out)))))
+                       (delete 'configure)
+                       (replace 'install
+                         (lambda* (#:key outputs #:allow-other-keys)
+                           (invoke "make" "install")))))))
+(define-public %hare-toolchain-build-arguments
+  (append %hare-common-build-arguments
+          `(#:phases (modify-phases %standard-phases
+                       (add-before 'configure 'set-platform
+                         (lambda* (#:key outputs #:allow-other-keys)
+                           (let ((out (assoc-ref outputs "out")))
+                             (rename-file "./configs/linux.mk" "./config.mk")
+                             (substitute* "./config.mk" (("/usr/local") out)))))
+                       (delete 'configure)
+                       (replace 'install
+                         (lambda* (#:key outputs #:allow-other-keys)
+                           (invoke "make" "install")))))))
+
+(define-public harec
+  (package
+    (name "harec")
+    (version %hare-toolchain-version)
+
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://git.sr.ht/~sircmpwn/harec")
+             (commit "0.24.2")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1alqc6ycfq8saijb4l5sv294sj2h522ffr3gnln8xzrbyrs029b0"))))
+
+    (build-system gnu-build-system)
+    (arguments
+     %hare-toolchain-build-arguments)
+
+    (inputs (list qbe))
+    (native-inputs (list qbe gcc-toolchain))
+
+    (synopsis "The Hare compiler")
+    (description "harec is a bootstrap compiler for Hare written in C11 for
+POSIX-compatible systems.")
+    (home-page "https://git.sr.ht/~sircmpwn/harec")
+
+    (license l:gpl3)))
+
+(define-public hare
+  (package
+    (name "hare")
+    (version %hare-toolchain-version)
+
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://git.sr.ht/~sircmpwn/hare")
+             (commit "0.24.2")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "15zac3h9bi9hjmgzslw4zx1vniabxnkq7z0z5pwlry05in85qngb"))))
+
+    (build-system gnu-build-system)
+    (arguments
+     (append %hare-toolchain-build-arguments
+             '(#:tests? #f)))
+
+    (propagated-inputs (list qbe harec binutils))
+    (native-inputs (list harec qbe scdoc))
+
+    (synopsis "The Hare compiler frontend")
+    (description
+     "Hare is a systems programming language.  This is the frontend for the
+harec Hare compiler.")
+    (home-page "https://git.sr.ht/~sircmpwn/hare")
+
+    (license l:gpl3)))

base-commit: df14cacca9b95d69fdd3b6191e42df36af266bcd
-- 
2.45.2