From patchwork Mon Mar 15 14:20:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?L=C3=A9o_Le_Bouter?= X-Patchwork-Id: 27711 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 45AF527BC54; Mon, 15 Mar 2021 14:23:33 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id ADCC727BC52 for ; Mon, 15 Mar 2021 14:23:32 +0000 (GMT) Received: from localhost ([::1]:41706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLo83-00073D-Ur for patchwork@mira.cbaines.net; Mon, 15 Mar 2021 10:23:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLo6c-00063a-Rr for guix-patches@gnu.org; Mon, 15 Mar 2021 10:22:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52996) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lLo6c-0002ad-JG for guix-patches@gnu.org; Mon, 15 Mar 2021 10:22:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lLo6c-0002Qd-Fy for guix-patches@gnu.org; Mon, 15 Mar 2021 10:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47006] [PATCH v2 1/1] gnu: Add zig. Resent-From: =?utf-8?q?L=C3=A9o?= Le Bouter Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Mar 2021 14:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47006 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47006@debbugs.gnu.org Cc: =?utf-8?q?L=C3=A9o?= Le Bouter , Leo Prikler Received: via spool by 47006-submit@debbugs.gnu.org id=B47006.16158180859277 (code B ref 47006); Mon, 15 Mar 2021 14:22:02 +0000 Received: (at 47006) by debbugs.gnu.org; 15 Mar 2021 14:21:25 +0000 Received: from localhost ([127.0.0.1]:36308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lLo61-0002PY-AX for submit@debbugs.gnu.org; Mon, 15 Mar 2021 10:21:25 -0400 Received: from mail.zaclys.net ([178.33.93.72]:54373) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lLo5t-0002P0-KY for 47006@debbugs.gnu.org; Mon, 15 Mar 2021 10:21:22 -0400 Received: from localhost.localdomain (82-64-145-38.subs.proxad.net [82.64.145.38]) (authenticated bits=0) by mail.zaclys.net (8.14.7/8.14.7) with ESMTP id 12FEL8nb026359 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Mon, 15 Mar 2021 15:21:10 +0100 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.zaclys.net 12FEL8nb026359 Authentication-Results: mail.zaclys.net; dmarc=fail (p=reject dis=none) header.from=zaclys.net Authentication-Results: mail.zaclys.net; spf=fail smtp.mailfrom=lle-bout@zaclys.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zaclys.net; s=default; t=1615818070; bh=yulflcoIPLqBDgqSRfbI7i6i7E+GRbUk/9hnfRHsYNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZYg4+FCtKNSLxNfHDDWn+agHJMeikOfaSL4olk5tQrBwMPRKOQ8b3q7Jre2RM6Jl3 cZ4u3iaZ2alKMQrqk4KrkJLfJIOBAGezcHpS+XYH/YYnfRBsk4Bz7TNv4Dvg34syzi 3NdDzvj46UgUbEkEkmKg6UilxT4Eyj8I1Fr0HFDY= Date: Mon, 15 Mar 2021 15:20:45 +0100 Message-Id: <20210315142045.25392-2-lle-bout@zaclys.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315142045.25392-1-lle-bout@zaclys.net> References: <20210315142045.25392-1-lle-bout@zaclys.net> MIME-Version: 1.0 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: =?utf-8?q?L=C3=A9o?= Le Bouter X-ACL-Warn: , =?utf-8?q?L=C3=A9o?= Le Bouter via Guix-patches X-Patchwork-Original-From: =?utf-8?q?L=C3=A9o?= Le Bouter via Guix-patches via From: =?utf-8?q?L=C3=A9o_Le_Bouter?= X-getmail-retrieved-from-mailbox: Patches From: Leo Prikler * gnu/packages/zig.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it here. Co-authored-by: Léo Le Bouter --- gnu/local.mk | 1 + gnu/packages/zig.scm | 76 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 gnu/packages/zig.scm diff --git a/gnu/local.mk b/gnu/local.mk index cf8849cf59..ffa8005533 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -586,6 +586,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/xdisorg.scm \ %D%/packages/xorg.scm \ %D%/packages/xfce.scm \ + %D%/packages/zig.scm \ %D%/packages/zile.scm \ %D%/packages/zwave.scm \ \ diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm new file mode 100644 index 0000000000..adc4c3e1e0 --- /dev/null +++ b/gnu/packages/zig.scm @@ -0,0 +1,76 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Leo Prikler +;;; +;;; 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 zig) + #:use-module (guix packages) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix build-system cmake) + #:use-module (gnu packages) + #:use-module (gnu packages llvm)) + +(define-public zig + (package + (name "zig") + (version "0.7.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ziglang/zig.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1z6c4ym9jmga46cw2arn7zv2drcpmrf3vw139gscxp27n7q2z5md")))) + (build-system cmake-build-system) + (native-inputs + `(("clang" ,clang-11) + ("lld" ,lld) + ("llvm" ,llvm-11))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'save-unpack-dir + (lambda _ + ;; HACK: Passing unpacked source directory to 'check phase. + (setenv "ZIG_UNPACK_DIR" (getcwd)) + #t)) + (add-after 'configure 'set-home + (lambda _ + (setenv "HOME" (getcwd)) ; zig writes to $HOME/.cache + #t)) + (delete 'check) + (add-after 'install 'check + (lambda* (#:key outputs #:allow-other-keys) + (with-directory-excursion (getenv "ZIG_UNPACK_DIR") + (invoke (string-append (assoc-ref outputs "out") "/bin/zig") + "build" "test")) + #t))))) + (synopsis "General purpose programming language and toolchain") + (description "Zig is a general-purpose programming language and +toolchain. Among other features it provides +@itemize +@item an Optional type instead of null pointers, +@item manual memory management, +@item generic data structures and functions, +@item compile-time reflection and compile-time code execution, +@item integration with C using zig as a C compiler, and +@item concurrency via async functions. +@end itemize") + (home-page "https://github.com/ziglang/zig") + (license license:expat)))