From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AMVkF6eLXGEftwAAgWs5BA (envelope-from ) for ; Tue, 05 Oct 2021 19:30:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id cLGeEqeLXGETPgAAbx9fmQ (envelope-from ) for ; Tue, 05 Oct 2021 17:30:15 +0000 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 DAFAA2EC11 for ; Tue, 5 Oct 2021 19:30:14 +0200 (CEST) Received: from localhost ([::1]:51512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXoGb-0005pk-Gg for larch@yhetil.org; Tue, 05 Oct 2021 13:30:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXnbm-0005I0-4X for guix-patches@gnu.org; Tue, 05 Oct 2021 12:48:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXnbl-0006VD-Nq for guix-patches@gnu.org; Tue, 05 Oct 2021 12:48:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mXnbl-00020q-Mo for guix-patches@gnu.org; Tue, 05 Oct 2021 12:48:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49607] [PATCH 2/3] gnu: idris: Use wrap-program to define IDRIS_CC Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 05 Oct 2021 16:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49607 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49607@debbugs.gnu.org Cc: Attila Lendvai Received: via spool by 49607-submit@debbugs.gnu.org id=B49607.16334524737709 (code B ref 49607); Tue, 05 Oct 2021 16:48:01 +0000 Received: (at 49607) by debbugs.gnu.org; 5 Oct 2021 16:47:53 +0000 Received: from localhost ([127.0.0.1]:41743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mXnbc-00020G-Uh for submit@debbugs.gnu.org; Tue, 05 Oct 2021 12:47:53 -0400 Received: from mail-ed1-f47.google.com ([209.85.208.47]:45794) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mXnbb-0001zr-I1 for 49607@debbugs.gnu.org; Tue, 05 Oct 2021 12:47:52 -0400 Received: by mail-ed1-f47.google.com with SMTP id r18so1254904edv.12 for <49607@debbugs.gnu.org>; Tue, 05 Oct 2021 09:47:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9lmrrjRr9ey1wAA35cKXdhVsPUKS0uzBnApt5UnZsxo=; b=PkqqmKcg3qWsJPl7H7L8WD83i2giK5Y6Tbvpiv53deUdkm66GgK0CMD4PyaHaKnJ/i cFdz9oLyQ0XOnWqil5hyf8Ibudi+RTqKu+ezIOrm4o8ACxpIVycrBQggUTo+U7RnDSo4 mRqwsOxiNeHnn+StYF8ZRLsrLHIntf0DFE6fvUBUB4nEjagZCzuoBdDaf/RAEiD0Om/b 0PF+P1uZjzz3LGZOtt9MVLjmkjK8ZTgYLKRu1MqH9I2bYZcFTiqT5G2wz3ybz7oDKdEG z82ds9x8tUxcY5yI/XALw5GsqeyQ3ikNBf7cWvEpVYS0oM18evnvhH+2dah66S8aI0oD bMNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=9lmrrjRr9ey1wAA35cKXdhVsPUKS0uzBnApt5UnZsxo=; b=JRsCPlVgxzgYtgd3AaoFfWTbtqqeLtCbHAmKVnhE1b20fBNTbGRTKyNgYeoq5e1J+8 PTPgoiCkoLbqdtC+Wqn2/v2S04FPlj9xHISdOQnCfKXjU39W35bpRyUWglIBsZbb7LSx GZcdefYUIB7uNTPP5dHsIjkcYd+YVIGcVqOZQX2ohi0yeJALRvHqOEabGSracs+4XXv4 6dsLRStDb1U6b8fanEGitTog+a36IxJSCkGObBDYd/FUYFoXXZ9qzc81g26G1W1dPOXP tFgVsIwoxhgDVPjFij74LJkSFVUgtCUDadotndDhy8UI2jfJldYOhri4975gxNI2WCfT kPZw== X-Gm-Message-State: AOAM531Z5TYuTgJx7zJG6eHpeQfWCyl5ttS2ldUg2Nl3jC0wqT/F0acR 22uo2hOG8Oz9UTz8YnQA53NeRo+txyo= X-Google-Smtp-Source: ABdhPJzD+lEKLY53ykCLiwEZHHH512+rSbbBBlPVj/an8yX1PZ+AQQRzkXF98NzuMwA0+Ut0jZMYLw== X-Received: by 2002:a05:6402:3088:: with SMTP id de8mr27731733edb.76.1633452465842; Tue, 05 Oct 2021 09:47:45 -0700 (PDT) Received: from lelap.lan (catv-213-222-131-28.catv.broadband.hu. [213.222.131.28]) by smtp.gmail.com with ESMTPSA id n6sm8999335eds.10.2021.10.05.09.47.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 09:47:45 -0700 (PDT) From: Attila Lendvai Date: Tue, 5 Oct 2021 18:37:57 +0200 Message-Id: <20211005163757.29637-2-attila@lendvai.name> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211005163757.29637-1-attila@lendvai.name> References: <20211005163757.29637-1-attila@lendvai.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633455015; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=9lmrrjRr9ey1wAA35cKXdhVsPUKS0uzBnApt5UnZsxo=; b=bSmeA9oB5gXR3socjrUWgkaTDpHAgM0T1nd3oKJj//+Ztq8W+/VcOW+/ENrW62j3+uc5Cz jDK2mCj/YNKXJynwt2yn6nyAOJ1gUCAJFuTvU6wob9voHLt9OHROKAJiYmfxmhhUK+jCFQ zOBenkDolEH61snVtKC4Tmj785jG8eBI6U6ncco8fAK+OH9oOH92j5pPbMc4WMUUswKj/q sIz3T0zexAreav9K/AkZDLL9VNzLmE+XWaVdkTzyTa0HJgl78h3zVH2ViXjlJKVSMqWHwi 5mWunCggSClX4G4eTsv21edlxFGtZg+qT/b4mOhjFMzzig9gc11vjG4w7xUn5w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633455015; a=rsa-sha256; cv=none; b=hisI3MTc4/VCxpu1Xkm0kgfeXdFW+xZo+mQCgIUvniwYGVi6LueUo3OxSi5JP3TL+ZkjtT Oa7x47RMk8yWajIOHC74E0q1LmhbAUGtSy631+5OSbXzk02JLcTrsr388kNPcecT5ptgbt Li535UIqyFaNFwB/tWc20Jd1Cdd/43loqHg8q+tTI2iPHQNOUtpUnX26LreOLD9GjUbDZm LgiOYQ3RfdV35eRM0D9B2W8BVyufaeRj9hU14Rg/Eb+ynIYKVoBrsZFcO32+fsVb3RbtGj pFfOuOBpfGod8Gt/idgv33KK+Y57OzOuEXWHeW0ja7MDgyhDBiQQZtRsEw677A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=PkqqmKcg; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 3.19 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=PkqqmKcg; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: DAFAA2EC11 X-Spam-Score: 3.19 X-Migadu-Scanner: scn1.migadu.com X-TUID: yI1+ALQx+EJM Idris requires a C compiler at runtime to generate executables. * gnu/packages/idris.scm (idris): Rename the scheme variable to idris-1.3.3 to prepare for adding different versions later on. [inputs]: Add Clang, and bash-minimal (for wrap-program). [phases]: use (cc-for-target). --- gnu/packages/idris.scm | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/gnu/packages/idris.scm b/gnu/packages/idris.scm index 058d679c1f..1f6e984a90 100644 --- a/gnu/packages/idris.scm +++ b/gnu/packages/idris.scm @@ -21,10 +21,12 @@ (define-module (gnu packages idris) #:use-module (gnu packages) + #:use-module (gnu packages bash) #:use-module (gnu packages haskell-check) #:use-module (gnu packages haskell-web) #:use-module (gnu packages haskell-xyz) #:use-module (gnu packages libffi) + #:use-module (gnu packages llvm) #:use-module (gnu packages multiprecision) #:use-module (gnu packages ncurses) #:use-module (gnu packages perl) @@ -33,9 +35,10 @@ #:use-module (guix download) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) - #:use-module (guix packages)) + #:use-module (guix packages) + #:use-module (guix utils)) -(define-public idris +(define-public idris-1.3.3 (package (name "idris") (version "1.3.3") @@ -51,12 +54,15 @@ (build-system haskell-build-system) (native-inputs ;For tests `(("perl" ,perl) + ("clang" ,clang) ; the tests want to generate exeutables ("ghc-cheapskate" ,ghc-cheapskate) ("ghc-tasty" ,ghc-tasty) ("ghc-tasty-golden" ,ghc-tasty-golden) ("ghc-tasty-rerun" ,ghc-tasty-rerun))) (inputs - `(("gmp" ,gmp) + `(("bash" ,bash-minimal) + ("clang" ,clang) ; FIXME clang compiles faster than gcc, but (cc-for-target) ignores it + ("gmp" ,gmp) ("ncurses" ,ncurses) ("ghc-aeson" ,ghc-aeson) ("ghc-annotated-wl-pprint" ,ghc-annotated-wl-pprint) @@ -105,7 +111,7 @@ #t)) (add-before 'configure 'set-cc-command (lambda _ - (setenv "CC" "gcc") + (setenv "CC" ,(cc-for-target)) #t)) (add-after 'install 'fix-libs-install-location (lambda* (#:key outputs #:allow-other-keys) @@ -116,14 +122,14 @@ (lambda (module) (symlink (string-append modules "/" module) (string-append lib "/" module))) - '("prelude" "base" "contrib" "effects" "pruviloj"))))) + '("prelude" "base" "contrib" "effects" "pruviloj"))) + #t)) (delete 'check) ;Run check later (add-after 'install 'check (lambda* (#:key outputs #:allow-other-keys #:rest args) (let ((out (assoc-ref outputs "out"))) (chmod "test/scripts/timeout" #o755) ;must be executable (setenv "TASTY_NUM_THREADS" (number->string (parallel-job-count))) - (setenv "IDRIS_CC" "gcc") ;Needed for creating executables (setenv "PATH" (string-append out "/bin:" (getenv "PATH"))) (apply (assoc-ref %standard-phases 'check) args)))) (add-before 'check 'restore-libidris_rts @@ -135,8 +141,15 @@ (static (assoc-ref outputs "static")) (filename "/lib/idris/rts/libidris_rts.a")) (rename-file (string-append static filename) - (string-append out filename)) - #t)))))) + (string-append out filename))) + #t)) + (add-before 'check 'wrap-program + (lambda* (#:key outputs inputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (exe (string-append out "/bin/idris"))) + (wrap-program exe + `("IDRIS_CC" = (,',(cc-for-target))))) + #true))))) (native-search-paths (list (search-path-specification (variable "IDRIS_LIBRARY_PATH") @@ -150,6 +163,8 @@ can be specified precisely in the type. The language is closely related to Epigram and Agda.") (license license:bsd-3))) +(define-public idris idris-1.3.3) + ;; Idris modules use the gnu-build-system so that the IDRIS_LIBRARY_PATH is set. (define (idris-default-arguments name) `(#:modules ((guix build gnu-build-system) -- 2.33.0