From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CMU3BfkRWGIoNgEAgWs5BA (envelope-from ) for ; Thu, 14 Apr 2022 14:22:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 0CbaAfkRWGJhGgAAauVa8A (envelope-from ) for ; Thu, 14 Apr 2022 14:22:17 +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 3F0AE81EB for ; Thu, 14 Apr 2022 14:22:13 +0200 (CEST) Received: from localhost ([::1]:53612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1neyUF-0002M6-Kd for larch@yhetil.org; Thu, 14 Apr 2022 08:22:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1neyU7-0002J6-1b for guix-patches@gnu.org; Thu, 14 Apr 2022 08:22:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33400) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1neyU6-0005TD-OX for guix-patches@gnu.org; Thu, 14 Apr 2022 08:22:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1neyU6-0001ME-El for guix-patches@gnu.org; Thu, 14 Apr 2022 08:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49607] [PATCH v2 1/3] gnu: idris: Use wrap-program to define IDRIS_CC References: In-Reply-To: Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 14 Apr 2022 12:22:02 +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.16499388715129 (code B ref 49607); Thu, 14 Apr 2022 12:22:02 +0000 Received: (at 49607) by debbugs.gnu.org; 14 Apr 2022 12:21:11 +0000 Received: from localhost ([127.0.0.1]:55524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neyTG-0001Ke-Pf for submit@debbugs.gnu.org; Thu, 14 Apr 2022 08:21:11 -0400 Received: from mail-ed1-f46.google.com ([209.85.208.46]:39686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neyTF-0001KQ-7v for 49607@debbugs.gnu.org; Thu, 14 Apr 2022 08:21:09 -0400 Received: by mail-ed1-f46.google.com with SMTP id g20so6102998edw.6 for <49607@debbugs.gnu.org>; Thu, 14 Apr 2022 05:21:09 -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:mime-version :content-transfer-encoding; bh=5uWmftaN+JM06weGFTVE1BwNmo2pgFzoR3j0YUdtFPo=; b=GL0G6l1gf4IraQGca5us91WEYP+K5sAH7hz7/OWWqw3Q6vCrdBU6whItu/RWnlPpqn 3C/nc3rZUB/ryGK2GoEDWEz6sqkP/WdgZL0p18R/ZV/OzqfMEcCc9eBDtNZHzlq8BfHT guMx6hgIVpdUh4V0+Hw/MpH/Ox9JyPelv5iLPQofUNRj3xsgReIfdX4kjjI6qr/dTpvA 66fpS8XLJoPCQ4wAbo0tyalsa47iCWf+0hmmto5HuGcT9D+lZcSWTxkTtz+rPraN6QmC bQZ2x/yWFYjQQOm9blZhVjrWRg0f/VgzRaeefgfNnh96wrIcMSrPSVPJCZW2sCF3P9kv P2SA== 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 :mime-version:content-transfer-encoding; bh=5uWmftaN+JM06weGFTVE1BwNmo2pgFzoR3j0YUdtFPo=; b=WC+HI/p0OTu5eSEO9KJ8euf+QzvhMPcvEUyin07Wb7qVjkrpAe6SKqKXOnTAANP8nF 0IgG/TSxsu6PixMdHvMBk/n3ayn/TE6fZQ5CL04WBEikxJkIzgMypNw1Bi/IRUw6Q16W ErIbO6NPzpQoereR4n/E8c7y/RutonNqoL5UyEcv9U9qg14a1zK/MIkBbhCsEiEbaBXb YO0EKkZuvFLKoEBQoWbtlpSTDgbGWAlWoAN3BRuEl0tXWgY4/RnDP8nSRW2Evp9L4DCN VLAw5qcJQma/AShyWZ2ZaQ3/XCthrJ3q7bJJGaac1DVESHZskerZSIhIcctRDNJ1bt0d iF1w== X-Gm-Message-State: AOAM5326B0vhOa7WJlODORv6Pt8mqIpPHWvBU4eIaI8okLsmglzurgud mcjTPA3NkcbbiF9XTnPC/AQ9LK+SnoI= X-Google-Smtp-Source: ABdhPJyYvr5C6qDIg0ZitcyyZR6SEm7LCJBFXtUleUnI+fwJWxiSQIbJ+upiqggpsWhHqsysB+3AzQ== X-Received: by 2002:a50:ff0a:0:b0:419:4240:3be4 with SMTP id a10-20020a50ff0a000000b0041942403be4mr2657678edu.304.1649938863152; Thu, 14 Apr 2022 05:21:03 -0700 (PDT) Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu. [89.132.245.188]) by smtp.gmail.com with ESMTPSA id u3-20020a17090657c300b006d01de78926sm582042ejr.22.2022.04.14.05.21.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Apr 2022 05:21:02 -0700 (PDT) From: Attila Lendvai Date: Thu, 14 Apr 2022 14:16:11 +0200 Message-Id: <20220414121612.9815-1-attila@lendvai.name> X-Mailer: git-send-email 2.35.1 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 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=1649938936; 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=5uWmftaN+JM06weGFTVE1BwNmo2pgFzoR3j0YUdtFPo=; b=L7PIfuaoHNcAkqv9Sh+unffVxN2OjlIzhPJZDQ30/pOANPJs8jsOsqw1696+4wejulg89X 0T+gltRmE81yLYFGD9xZtlW6Q0pJBEaOrMKeBlAkyOvnVOoJz7D0epr39fsMZXiMk641g1 KdPr0giOPHjKCYQ5YuXiHQ+pYaJ4qvQJLfD5svv1i/uu+XUIG0qSI7l6NVIlApCodWSjvp bvkMLvm8gsioXvnfvXR5cuvGCSuWuttrq/tqwRXfwy/XSyw7RGZZXFFfc2mIZFW32+2Qar 9Hygf3mL69RYKWytV/M0llCDXcf2ERxa/BkonBERxczByUVHhtSqctlmuyBjfw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1649938936; a=rsa-sha256; cv=none; b=YkbAf6WOpvaepyqg1qY7iRYRdWYo6jAO9wU7PLovyd/EffwAivV3/k/K3CDcoD1en2JViM svo9HYqI+8xXGagH9BdMtncfwD5FOtjU28JdAu72Rw3UIHUu0V1iriFStPYURucDBaIdsW dzoSqf3PuxFu18eddNpPCiiMSq9jmxqkn4OEmWUdGv793tRKXHINlKmeWXVqw83ajdrt+h 4wlgoPUrp8q804PUchUHojR6/2SGxnVxlofn2lcd64iZGD5a7HrdfamZNT/6pAeNisVVH2 i3pOBVAdbq5SXA9ofLHjTlIeyQx7oh/RDOfH9S6O98fmZceImrQQ5HoDKGzRAA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=GL0G6l1g; dmarc=none; 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: 2.45 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=GL0G6l1g; dmarc=none; 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: 3F0AE81EB X-Spam-Score: 2.45 X-Migadu-Scanner: scn1.migadu.com X-TUID: RWRYeT50E22F 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). --- i think v2 is ready for inclusion. it can bootstrap idris all the way from GHC, but it also enables a/the bootstrap shortcut for the latest version, and disables substitution for the so called historical versions by default. a bootstrap shortcut is when the makefile builds a checked in build output, which is a scheme file, using Chez Scheme. this way the build farm is not loaded unnecessarily with building a full chain of bootstrap, but at the same time users can trigger/install any of the old versions manually. gnu/packages/idris.scm | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/gnu/packages/idris.scm b/gnu/packages/idris.scm index cdf76244fb..f84431cab9 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 @@ (define-module (gnu packages idris) #: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") @@ -56,7 +59,8 @@ (define-public idris (list perl ghc-cheapskate ghc-tasty ghc-tasty-golden ghc-tasty-rerun)) (inputs - (list gmp + (list bash-minimal + gmp ncurses ghc-aeson ghc-annotated-wl-pprint @@ -95,8 +99,7 @@ (define-public idris ;; This allows us to call the 'idris' binary before installing. (add-after 'unpack 'set-ld-library-path (lambda _ - (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/dist/build")) - #t)) + (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/dist/build")))) (add-before 'configure 'update-constraints (lambda _ (substitute* "idris.cabal" @@ -104,8 +107,7 @@ (define-public idris dep)))) (add-before 'configure 'set-cc-command (lambda _ - (setenv "CC" "gcc") - #t)) + (setenv "CC" ,(cc-for-target)))) (add-after 'install 'fix-libs-install-location (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -122,7 +124,6 @@ (define-public idris (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 @@ -134,8 +135,13 @@ (define-public idris (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))))) + (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)))))))))) (native-search-paths (list (search-path-specification (variable "IDRIS_LIBRARY_PATH") @@ -149,6 +155,8 @@ (define-public idris 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.35.1