From patchwork Tue May 24 01:21:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Antero Mejr X-Patchwork-Id: 39591 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 7504127BBEA; Tue, 24 May 2022 02:24:29 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 4AED827BBE9 for ; Tue, 24 May 2022 02:24:28 +0100 (BST) Received: from localhost ([::1]:50324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntJHf-0002Ut-GI for patchwork@mira.cbaines.net; Mon, 23 May 2022 21:24:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntJHH-0002Ko-AO for guix-patches@gnu.org; Mon, 23 May 2022 21:24:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ntJHH-00065X-1T for guix-patches@gnu.org; Mon, 23 May 2022 21:24:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ntJHG-0001dn-UH for guix-patches@gnu.org; Mon, 23 May 2022 21:24:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55606] [PATCH 2/2] gnu: Add hare. Resent-From: Antero Mejr Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 24 May 2022 01:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55606 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55606@debbugs.gnu.org Cc: Antero Mejr X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16533554046242 (code B ref -1); Tue, 24 May 2022 01:24:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 May 2022 01:23:24 +0000 Received: from localhost ([127.0.0.1]:50505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntJGa-0001cY-Hp for submit@debbugs.gnu.org; Mon, 23 May 2022 21:23:24 -0400 Received: from lists.gnu.org ([209.51.188.17]:49730) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntJGX-0001cP-3N for submit@debbugs.gnu.org; Mon, 23 May 2022 21:23:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntJGW-0002In-U0 for guix-patches@gnu.org; Mon, 23 May 2022 21:23:16 -0400 Received: from mout-p-103.mailbox.org ([2001:67c:2050:0:465::103]:35994) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1ntJGU-00062s-OY for guix-patches@gnu.org; Mon, 23 May 2022 21:23:16 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4L6bzy4RXVz9sr0 for ; Tue, 24 May 2022 03:23:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1653355390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CLQh98odlV6anGWnxgdJf22OGSDYTNPTDbRXk82ZmTE=; b=jXPZxO/rHKkBThhoRmFzAZWnJePZL2+WA98SVM+PZKj38rUfVJiaRuTGMeAlwMExtFXgDA 7XKdGvErmZYGZVM4ZWJcxX8w/v/Dp/CFJkN8AxO3E8cK7HDRTI0zJWmByDFQfRh8NIgRac ys0iDBIY0gnkadQaKMwsLlJwf7wGPGO0OzKmFMicPc+YKauOmWL95SERbkhhKq00BlyWQw FbFNzJWa5/sRqSYubMgn4O7rIXqYd6byq0PaJHKNPlyJORV9LJnZVzgP0ZFAYrVA1j8nZx CsZF0CyQslCK2CPV9GJ2USzQTr9WRMBKX2nZe4pSl79pElT9r3b/m+ctXWx/HA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1653355388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CLQh98odlV6anGWnxgdJf22OGSDYTNPTDbRXk82ZmTE=; b=VWJw4aLLnuChYhgMmmwz2ykaq8vrN9jNkBwraHnsd9i2Et6XjW+txCHFEzTyhQrl2ljvbZ I034Gw0sf5HL7pKHxci4Xz9gvvkBE3FsSCbHHZObVCrZ5BxLo9IKSDgpHbcpq9k0YAdDeC G89ckuL4S3uC53hjkXeUrHf9VgtEk9kiKu+9vbECdsc8e3Q44by7869Fv5AUFGAzME/wlz cTdT5kggMEpZXIGsMlkjSxK9WS5jYN5XLLhEziOezzr6x1WK4mbvIN+s63JNreMpk79Eka ymGWVI3tcf9Xu6QpwxzrOsIsDD6yYOboS2m0rz78YBPL5Tqs0W6VY5KhnJic+g== Date: Mon, 23 May 2022 21:21:55 -0400 Message-Id: <20220524012155.48729-2-antero@mailbox.org> In-Reply-To: <20220524012155.48729-1-antero@mailbox.org> References: <20220524012155.48729-1-antero@mailbox.org> MIME-Version: 1.0 X-MBO-RS-META: hhq7nti1oieat1f4ukc1q5o69ajqtwa5 X-MBO-RS-ID: b1dac82452a8b45a415 X-Rspamd-Queue-Id: 4L6bzy4RXVz9sr0 Received-SPF: pass client-ip=2001:67c:2050:0:465::103; envelope-from=antero@mailbox.org; helo=mout-p-103.mailbox.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Antero Mejr X-ACL-Warn: , Antero Mejr via Guix-patches X-Patchwork-Original-From: Antero Mejr via Guix-patches via From: Antero Mejr X-getmail-retrieved-from-mailbox: Patches * gnu/packages/hare.scm (hare): New variable. --- Guix style was indenting badly when applied to the hare package, putting the text far past 80 characters. Corrected it by hand. gnu/packages/hare.scm | 136 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 gnu/packages/hare.scm diff --git a/gnu/packages/hare.scm b/gnu/packages/hare.scm new file mode 100644 index 0000000000..5936056fda --- /dev/null +++ b/gnu/packages/hare.scm @@ -0,0 +1,136 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Antero Mejr +;;; +;;; 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 ((guix licenses) #:prefix license:) + #:use-module (guix build-system gnu) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (gnu packages base) + #:use-module (gnu packages c) + #:use-module (gnu packages man) + #:use-module (gnu platform)) + +(define-public harec + (let ((commit "43b34048dd83bde5d4d2a7d93d37a593a9c12fda") (revision "0")) + (package + (name "harec") + (version (git-version "0.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://git.sr.ht/~sircmpwn/harec") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0502xw96za7bvnqvh6jhfjwrw4ddqwppr4ihcn9f5jvjpgw95284")))) + (native-inputs (list qbe)) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ;no test suite + #:make-flags + (list (string-append "CC=" + ,(cc-for-target)) + (string-append "DESTDIR=" + (assoc-ref %outputs "out")) "PREFIX=") + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key configure-flags #:allow-other-keys) + (setenv "QBE" + (string-append (assoc-ref %build-inputs "qbe") + "/bin/qbe")) + ;; configure rejects unrecognized options + (apply invoke "./configure" configure-flags)))))) + (home-page "https://harelang.org") + (synopsis "Hare bootstrap compiler") + (description "Hare compiler written in C11 for POSIX-compatible +systems.") + (license license:gpl3+)))) + +(define-public hare + (let ((commit "5af4fbd5f2f552da47af0f8f765050e49b0ae73f") (revision "0")) + (package + (name "hare") + (version (git-version "0.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://git.sr.ht/~sircmpwn/hare") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1gj2v5p73f8y5gpglm6mmfdadc6ih2bnd80nyax1xipsfy0f82di")))) + (build-system gnu-build-system) + (arguments + `(#:make-flags + (list (string-append "DESTDIR=" (assoc-ref %outputs "out")) + "BINDIR=/bin" + "MANDIR=/share/man" + "SRCDIR=/src" + "LOCALSRCDIR=/src/hare" + (string-append "HAREPATH=" + (assoc-ref %outputs "out") + "/src/hare/stdlib:" + (assoc-ref %outputs "out") + "/src/hare/third-party") + (string-append "PLATFORM=" "linux") + (string-append "ARCH=" + ,(platform-linux-architecture + (lookup-platform-by-target-or-system + (or (%current-target-system) + (%current-system))))) + (string-append "HAREC=" + (string-append (assoc-ref %build-inputs "harec") + "/bin/harec")) + "HAREFLAGS=" + (string-append "QBE=" + (string-append (assoc-ref %build-inputs "qbe") + "/bin/qbe")) + (string-append "AS=" + (string-append (assoc-ref %build-inputs "binutils") + "/bin/as")) + (string-append "LD=" + (string-append (assoc-ref %build-inputs "binutils") + "/bin/ld")) + (string-append "AR=" + (string-append (assoc-ref %build-inputs "binutils") + "/bin/ar")) + (string-append "SCDOC=" + (string-append (assoc-ref %build-inputs "scdoc") + "/bin/scdoc")) + "HARECACHE=.cache") + #:phases + (modify-phases %standard-phases + (delete 'configure) ;No configuration script. + ;; Use own make-flags instead of `config.mk`. + (add-before 'build 'dont-include-config-mk + (lambda _ + (substitute* "Makefile" + (("include config.mk") "")) #t))))) + (native-inputs (list scdoc)) + (propagated-inputs (list harec qbe binutils)) + (home-page "https://harelang.org") + (synopsis "Compiler for the Hare programming language") + (description "Hare is a systems programming language.") + (license (list license:gpl3+ license:mpl2.0)))))