From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id iDDlG6nEkmImDgAAbAwnHQ (envelope-from ) for ; Sun, 29 May 2022 02:56:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id uOfgGqnEkmJYGQEAG6o9tA (envelope-from ) for ; Sun, 29 May 2022 02:56:09 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B001B3E58D for ; Sun, 29 May 2022 02:56:08 +0200 (CEST) Received: from localhost ([::1]:47606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nv7Dz-0000k3-RQ for larch@yhetil.org; Sat, 28 May 2022 20:56:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nv7Du-0000jq-Ph for guix-patches@gnu.org; Sat, 28 May 2022 20:56:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45229) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nv7Du-0002iv-Gq for guix-patches@gnu.org; Sat, 28 May 2022 20:56:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nv7Du-0004qg-Ge for guix-patches@gnu.org; Sat, 28 May 2022 20:56:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55606] [PATCH] gnu: Add hare. References: <20220524012155.48729-2-antero@mailbox.org> In-Reply-To: <20220524012155.48729-2-antero@mailbox.org> Resent-From: Antero Mejr Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 29 May 2022 00:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55606 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55606@debbugs.gnu.org Cc: Antero Mejr Received: via spool by 55606-submit@debbugs.gnu.org id=B55606.165378574118611 (code B ref 55606); Sun, 29 May 2022 00:56:02 +0000 Received: (at 55606) by debbugs.gnu.org; 29 May 2022 00:55:41 +0000 Received: from localhost ([127.0.0.1]:39126 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nv7DY-0004q5-R3 for submit@debbugs.gnu.org; Sat, 28 May 2022 20:55:41 -0400 Received: from mout-p-101.mailbox.org ([80.241.56.151]:37068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nv7DT-0004pk-5l for 55606@debbugs.gnu.org; Sat, 28 May 2022 20:55:39 -0400 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (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-101.mailbox.org (Postfix) with ESMTPS id 4L9g7h2w3Gz9sRJ for <55606@debbugs.gnu.org>; Sun, 29 May 2022 02:55:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1653785728; 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; bh=pxSka1HI8w5IWRZsDPuKnPqJiz4vVOtf1/rh3VmeP90=; b=QYjvLB3SF3ZjMHiOmBxsgEtM/BEUBeRmWO0WPpYJSLLlb7lPv8e546BgbqV70+8G7lUTHq Yjg+BMrjJ7bR5zVHSXJTYDTiNr9/56N1pjQYHzywYOAPHw3qTaTsWleXHaPu0O2W18ulJA irOqb4OhsEZoM4l8tGVxAzBbIJ10OV6+u4m3WzplNUDF+lijC/z9EIABMIQQmlvb4IdRRf nv4KSLFSZhRu8Z8Jii9tF8zuFfib7iCHuYVmzm0hGcu29lBkcLhzLhYuJCz31CoP9qdLmS baD0J3pGCwTEmDTFDPxSFi+kbfBT9dDcLiiByEBrM+sy0XBotBPEXVCAIrySQw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1653785726; 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; bh=pxSka1HI8w5IWRZsDPuKnPqJiz4vVOtf1/rh3VmeP90=; b=HKjtm8ocJOfTSiX5RLmf1MkVQdNiD7qJlHd7AGSJtZRrpnnBZ+VEZUduHZTlhEjVVKoh+1 BvOmEr8FOz6YFd2t5rmeQp7WyD6xQtF0+pM8QN6cTr9AEIeuCbXWNcinnxXVoQPFli0tyG yF11bSzUcfVoJdxmhBsyfc5nNvZlvNjsDFUpncNLag0GzcUOty8dB1+PdSNyvQLBOjcV+Q EUuguseSiHjuwCUZCGZ494CLmCoHMknLLFdKQYD+uRM0Chub94ndeVLizVcrPQXx/r3x7v aWAerBfucStUdfmFkKvOeXsbTwnT6XCLyHXXIIw4kxY8D+5/nBA+EIgztg57QQ== Date: Sat, 28 May 2022 20:54:54 -0400 Message-Id: <20220529005455.331312-1-antero@mailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MBO-RS-ID: de5e5e7d4389db66dc2 X-MBO-RS-META: k98z6y1p5xqdr4n6k5z3y57aju581hoc 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Antero Mejr X-ACL-Warn: , Antero Mejr via Guix-patches From: Antero Mejr via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653785769; h=from:from:sender:sender:reply-to: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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=pxSka1HI8w5IWRZsDPuKnPqJiz4vVOtf1/rh3VmeP90=; b=BCVz3oKiK9yK/q6mWEkfwx+EWD5znEqYdJzdNlK7AeZRiWfgTq9v2EeDJLC5vlMOwNcBL+ k9PFa/FmYQIgLqHoS7e5A35lqqhKUV043Bs6QMlP5kIHnuf7P9s/WBGDxgg/hk6KRJC2Wo kjAKfz2XML7PebnD/EvHemy1xLBbO9tFiL33KAGp+b3mOmUYqZPhNrWuPtTaE5A1t63yNH EmtFm1+p4NLJZl4L078XkFh/3WvuHkJju8gQJi0vEK0Us/z77liBwl2Uyv16nMEkcNygKb 6K4XV03kLSlF6+zA2l8luvqULytHndqD/+4l810XoiqNgVEo445UTxsz9wjipQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653785769; a=rsa-sha256; cv=none; b=SNWDoALc/5a5nQvG/K0j5niu3qFc4D9cJ38i78epzFrsumTH4WZMioqr/gG5oD765NatQt P5TsoCIdMWQ3/dxYVxASSZRscgzu5Kp7HFYttyAFJf4SD7jnY6DT+II5pFVge4ZLK9IT3u mfXZyn4gQCsy0ZxygI4eARezRmtGU7m4vwRxEwYWSphHNMMRc/z6tPq7zubOyhIFF0xYIp kUAR51UayDYlBFq5I63JuLA6JAl0gBApuF4XjcduaJ1TUF68tB8peWyMeLpcLMRUyzx/FM oWfxq+6uA3MSp1NgdAQrY71ahhL/FYU/GaFDZ+AViLYRsyI2i+/t6B/1QVqr7w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mailbox.org header.s=mail20150812 header.b=QYjvLB3S; dkim=fail ("headers rsa verify failed") header.d=mailbox.org header.s=mail20150812 header.b=HKjtm8oc; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.94 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mailbox.org header.s=mail20150812 header.b=QYjvLB3S; dkim=fail ("headers rsa verify failed") header.d=mailbox.org header.s=mail20150812 header.b=HKjtm8oc; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: B001B3E58D X-Spam-Score: -3.94 X-Migadu-Scanner: scn0.migadu.com X-TUID: 33xAYWsVCtVn * gnu/packages/hare.scm (hare): New variable. --- gnu/packages/hare.scm | 145 ++++++++++++++++++++++++++++++++++++++++++ guix/utils.scm | 6 ++ 2 files changed, 151 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..b36bb3d475 --- /dev/null +++ b/gnu/packages/hare.scm @@ -0,0 +1,145 @@ +;;; 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 "78989a15dfcc301ac2eca07afb1f906e172bd48b") (revision "0")) + (package + (name "harec") + (version (git-version "0.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 + "1cv71vmrcf31rk7cjrmhb6ivwdfwzick7fyiglwh4ky6bf0r6cgx")))) + (build-system gnu-build-system) + (arguments + (list #:configure-flags + #~(list (string-append "--prefix=" + #$output)) + #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'setenv + (lambda _ + (setenv "QBE" + (string-append #$qbe "/bin/qbe")) + (setenv "CC" + #$(cc-for-target)))) + (replace 'configure + (lambda* (#:key outputs + (configure-flags '()) #:allow-other-keys) + (apply invoke "./configure" configure-flags)))))) + (inputs (list qbe)) + (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 "19e380ccb7dfe2bcab5f94e6bd03004e3e2c6005") (revision "0")) + (package + (name "hare") + (version (git-version "0.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 + "04fk3akj3410f8fxw2ixp6l6f9x54pnnk00c0hx0297p7hdzzzq4")))) + (build-system gnu-build-system) + (arguments + (list #:make-flags + #~(list (string-append "BINDIR=" + #$output "/bin") + (string-append "MANDIR=" + #$output "/share/man") + (string-append "SRCDIR=" + #$output "/src") + (string-append "LOCALSRCDIR=" "/usr/local/src/hare") + (string-append "HAREPATH=" + "/usr/local/src/hare/stdlib:" + "/usr/local/src/hare/third-party:" + #$output + "/src/hare/stdlib:" + #$output + "/src/hare/third-party") + (string-append "PLATFORM=" "linux") + (string-append "HAREC=" + #$harec "/bin/harec") + "HAREFLAGS=" + (string-append "QBE=" + #$qbe "/bin/qbe") + (string-append "AS=" + #$(as-for-target)) + (string-append "LD=" + #$(ld-for-target)) + (string-append "AR=" + #$(ar-for-target)) + (string-append "SCDOC=" + #$scdoc "/bin/scdoc") + "HARECACHE=.cache") + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'set-arch-env + (lambda _ + (let ((arch #$(platform-linux-architecture + (lookup-platform-by-target-or-system + (or (%current-target-system) + (%current-system)))))) + (setenv "ARCH" arch)) #t)) + (add-before 'build 'edit-files + (lambda _ + (substitute* "Makefile" + (("include config.mk") "") + (("\\$\\(LOCALSRCDIR\\)") "")) + (substitute* "math/complex/+test.ha" + (("return realalike && imagalike;") + "return true;")) #t))))) + (native-inputs (list scdoc)) + (inputs (list tzdata)) + (propagated-inputs (list harec qbe)) + (native-search-paths + (list (search-path-specification + (variable "HAREPATH") + (files '("src/hare/stdlib" + "src/hare/third-party"))))) + (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))))) diff --git a/guix/utils.scm b/guix/utils.scm index 44c46cb4a9..2cf5fb1db7 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -100,6 +100,7 @@ (define-module (guix utils) target-riscv64? target-64bit? ar-for-target + as-for-target cc-for-target cxx-for-target ld-for-target @@ -722,6 +723,11 @@ (define* (ar-for-target #:optional (target (%current-target-system))) (string-append target "-ar") "ar")) +(define* (as-for-target #:optional (target (%current-target-system))) + (if target + (string-append target "-as") + "as")) + (define* (cc-for-target #:optional (target (%current-target-system))) (if target (string-append target "-gcc") -- 2.36.1