[PATCH] gnu: Add Hare toolchain and ecostuff.

  • Open
  • quality assurance status badge
Details
2 participants
  • jgart
  • Daniel [REDACTED]
Owner
unassigned
Submitted by
Daniel [REDACTED]
Severity
normal
D
D
Daniel [REDACTED] wrote on 1 Sep 13:13 +0200
(address . guix-patches@gnu.org)(name . Daniel [REDACTED])(address . pjals@privacyrequired.com)
20240901111400.27130-1-pjals@privacyrequired.com
* 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

Toggle diff (250 lines)
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 <david.elsing@posteo.net>
# Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
# Copyright © 2024 Fabio Natali <me@fabionatali.com>
+# Copyright © 2024 Daniel [REDACTED] <pjals@privacyrequired.com>
#
# 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] <pjals@privacyrequired.com>
+;;;
+;;; 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] <pjals@privacyrequired.com>
+;;;
+;;; 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
D
D
Daniel [REDACTED] wrote on 1 Sep 16:44 +0200
[PATCH] gnu: Fix Hare license.
(address . guix-patches@gnu.org)(name . Daniel [REDACTED])(address . pjals@privacyrequired.com)
20240901144428.11520-1-pjals@privacyrequired.com
* gnu/packages/hare.scm (hare): Fix license.

Change-Id: Icd3a21909588faf5e29386e652c5757009bbbf62
---
gnu/packages/hare.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (16 lines)
diff --git a/gnu/packages/hare.scm b/gnu/packages/hare.scm
index b31f0c4777..baecd7ca6b 100644
--- a/gnu/packages/hare.scm
+++ b/gnu/packages/hare.scm
@@ -124,4 +124,5 @@ (define-public hare
harec Hare compiler.")
(home-page "https://git.sr.ht/~sircmpwn/hare")
- (license l:gpl3)))
+ (license (list l:mpl2.0 ; stdlib
+ l:gpl3)))) ; everything else

base-commit: df14cacca9b95d69fdd3b6191e42df36af266bcd
prerequisite-patch-id: 4d650567dcfdf4ddb01b3f57da37ef05af8f15d6
--
2.45.2
J
J
jgart wrote 5 hours ago
Re: [PATCH 2/2] gnu: Add hare.
d554eb5af5c326750c89429fb75c42e8b4339772@dismail.de
Hi Daniel,

I saw that you listed these patches as being redacted.

Could you give the Guix reviewers some more information and context around that?

Thanks,

jgart
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 72926@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 72926
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch