From patchwork Sun Sep 1 11:13:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Daniel \\[REDACTED\\]" X-Patchwork-Id: 30508 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id DA6BC27BBEA; Sun, 1 Sep 2024 12:47:12 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6F1F827BBE2 for ; Sun, 1 Sep 2024 12:47:10 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1skj2f-0006Tg-EF; Sun, 01 Sep 2024 07:46:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1skilT-0003wj-HM for guix-patches@gnu.org; Sun, 01 Sep 2024 07:29:03 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1skilT-0008Kf-8f for guix-patches@gnu.org; Sun, 01 Sep 2024 07:29:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=JNzljCsdd8lArtLemjAVt2MQ67DvpL3uXm3NV2Ru29I=; b=Wo2AktYKSnVnLiGK2g9vI8VvyR8VtgfQJQMg38IEKKBecD5GJ9Vl4VFglDMiv3iQrqmWTfWyIN646cffFv4he8/Kb+2Oz/YzVT+F/EsdXsE01Q8e3VWf8JNHqLvD11Wpz1QVALQBqlbRJ3thOYvsEDWceChKEQQ9xyIZNkfAXX/xtzsGxEr0ZuSq/J7inIuhhkyZdKg/4LnbxbOx3/DwKJ23JST5kE109SwmAcEggHulCPC+X7L9BKGF373gvRMtnmqaQEPNtQgIMNH5dkRNAZcJBNnZMyERA+Hx9ReGqZe91IxHAS0Msvgh7scm0iT3pvE+S3H1LPz+lWClmjnQMQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1skimQ-0004Im-GC for guix-patches@gnu.org; Sun, 01 Sep 2024 07:30:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72926] [PATCH] gnu: Add Hare toolchain and ecostuff. Resent-From: "Daniel [REDACTED]" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 01 Sep 2024 11:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72926 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72926@debbugs.gnu.org Cc: "Daniel \[REDACTED\]" X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.172519020116506 (code B ref -1); Sun, 01 Sep 2024 11:30:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Sep 2024 11:30:01 +0000 Received: from localhost ([127.0.0.1]:34067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skimN-0004I5-7j for submit@debbugs.gnu.org; Sun, 01 Sep 2024 07:30:00 -0400 Received: from lists.gnu.org ([209.51.188.17]:55120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skiaI-0003wA-3E for submit@debbugs.gnu.org; Sun, 01 Sep 2024 07:17:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1skiXD-00031F-NI for guix-patches@gnu.org; Sun, 01 Sep 2024 07:14:19 -0400 Received: from latitanza.investici.org ([82.94.249.234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1skiXA-0006XU-Ly for guix-patches@gnu.org; Sun, 01 Sep 2024 07:14:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=privacyrequired.com; s=stigmate; t=1725189245; bh=JNzljCsdd8lArtLemjAVt2MQ67DvpL3uXm3NV2Ru29I=; h=From:To:Cc:Subject:Date:From; b=aEWz29Ud8bpKmRr75+56R+ZzgUlGgdOpYb6URP3Kj2crjQJQHHvw71PAj8OrTM5OY IjEoA9MgFCj5GO6PUvjQEvVhLE2XMR4mH8wHr08L/OtvXEOagqYQPW4slDA4Dw8vuc 0HYCX9L5Lt682i4RhTRhzNAdFO2G3waqeSvbmxac= Received: from mx3.investici.org (unknown [127.0.0.1]) by latitanza.investici.org (Postfix) with ESMTP id 4WxTmF0mhWzGp55; Sun, 1 Sep 2024 11:14:05 +0000 (UTC) Received: from [82.94.249.234] (mx3.investici.org [82.94.249.234]) (Authenticated sender: lightpug@krutt.org) by localhost (Postfix) with ESMTPSA id 4WxTmD6kCmzGp52; Sun, 1 Sep 2024 11:14:04 +0000 (UTC) Date: Sun, 1 Sep 2024 14:13:58 +0300 Message-ID: <20240901111400.27130-1-pjals@privacyrequired.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Received-SPF: pass client-ip=82.94.249.234; envelope-from=pjals@privacyrequired.com; helo=latitanza.investici.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 01 Sep 2024 07:29:58 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sun, 01 Sep 2024 07:46:41 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: "Daniel \[REDACTED\]" X-ACL-Warn: , "Daniel \[REDACTED\] via Guix-patches" X-Patchwork-Original-From: "Daniel \[REDACTED\] via Guix-patches" via From: "Daniel \\[REDACTED\\]" Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 base-commit: df14cacca9b95d69fdd3b6191e42df36af266bcd 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 # Copyright © 2024 Ashish SHUKLA # Copyright © 2024 Fabio Natali +# Copyright © 2024 Daniel [REDACTED] # # 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] +;;; +;;; 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 . + +(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] +;;; +;;; 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 . + +(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)))