From patchwork Fri Jan 28 17:48:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Wurmus X-Patchwork-Id: 36860 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 85A6627BBEA; Fri, 28 Jan 2022 17:50:45 +0000 (GMT) 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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 E90D827BBE9 for ; Fri, 28 Jan 2022 17:50:44 +0000 (GMT) Received: from localhost ([::1]:35702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nDVOW-0004Hs-4t for patchwork@mira.cbaines.net; Fri, 28 Jan 2022 12:50:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDVNr-0004Gs-2w for guix-patches@gnu.org; Fri, 28 Jan 2022 12:50:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nDVNq-0002Sk-Op for guix-patches@gnu.org; Fri, 28 Jan 2022 12:50:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nDVNq-0001QP-KE for guix-patches@gnu.org; Fri, 28 Jan 2022 12:50:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53609] [PATCH 2/2] gnu: Add ghc-4. Resent-From: Ricardo Wurmus Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 28 Jan 2022 17:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53609 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53609@debbugs.gnu.org Cc: Ricardo Wurmus Received: via spool by 53609-submit@debbugs.gnu.org id=B53609.16433921535395 (code B ref 53609); Fri, 28 Jan 2022 17:50:02 +0000 Received: (at 53609) by debbugs.gnu.org; 28 Jan 2022 17:49:13 +0000 Received: from localhost ([127.0.0.1]:60445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDVMx-0001Or-TX for submit@debbugs.gnu.org; Fri, 28 Jan 2022 12:49:13 -0500 Received: from sender4-of-o51.zoho.com ([136.143.188.51]:21140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDVMu-0001Og-6V for 53609@debbugs.gnu.org; Fri, 28 Jan 2022 12:49:04 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1643392143; cv=none; d=zohomail.com; s=zohoarc; b=iuXdW6evE1BtsuN+UfYKx4IyQTLRGQ7Ww+wAqeuh6oUlxi3mbvlwrPpOjYSfBZwMyxKYtrjVxrm36g1dRnD3WaO6FjmPAvcH68j6YTBsEEhRJMykdqFPHenfuRG0scRl9wZLOE4ws/3s252Qipg8P01MppaPdnmQKtbXh+LOd1s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643392143; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=x97BrmwcZBuBB6ifzIISWdGsE5E3FeCIWyWqoud/gtk=; b=eAbgRZxE8KpxQh/+orL/yOahhQc2L9m/8VJLnILUHA2lTzy30++lBoacFwI6liu0n0ZYVoVx9E1Gm1zepty0/1fgA3Hesdmv3hhw99HF3Z2DIvUFTRqOD183kv+HvbM+AOI7/l0s6cpnjXF6uzbvPmZuQrZu4EivZZYOzJWt+rE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1643392143; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=x97BrmwcZBuBB6ifzIISWdGsE5E3FeCIWyWqoud/gtk=; b=QafsXfB7iCZ7y6sz0ByqOdTpUG39hNsAQl2muia7RghLM3fiKYONoVnz5dTX3wJH g4G8sB0oN8l0/rfhzO4o89fWlvmN0LV+menmZpnJnDTBPd+J0YGpnfsDETz2e6faxhi mw9s6kEDdXXwbQf+5p5YZ7awPh7zng23e+n/uI50= Received: from localhost (p54ad4fa1.dip0.t-ipconnect.de [84.173.79.161]) by mx.zohomail.com with SMTPS id 1643392140918723.5731038276593; Fri, 28 Jan 2022 09:49:00 -0800 (PST) From: Ricardo Wurmus Date: Fri, 28 Jan 2022 18:48:52 +0100 Message-Id: <20220128174852.10637-2-rekado@elephly.net> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220128174852.10637-1-rekado@elephly.net> References: <20220128174852.10637-1-rekado@elephly.net> MIME-Version: 1.0 X-ZohoMailClient: External 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/commencement.scm (ghc-4): New variable. --- gnu/packages/commencement.scm | 131 ++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 96d914344d..03f1ea276c 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -30,6 +30,7 @@ (define-module (gnu packages commencement) #:use-module (gnu packages) + #:use-module (gnu packages autotools) #:use-module (gnu packages bootstrap) #:use-module (gnu packages base) #:use-module (gnu packages bash) @@ -3902,5 +3903,135 @@ (define-public gfortran-toolchain gfortran, as well as libc (headers and binaries, plus debugging symbols in the @code{debug} output), and binutils."))) +(define-public ghc-4 + (package + (name "ghc") + (version "4.08.2") + (source + (origin + (method url-fetch) + (uri (string-append "https://www.haskell.org/ghc/dist/" + version "/" name "-" version "-src.tar.bz2")) + (sha256 + (base32 + "0ar4nxy4cr5vwvfj71gmc174vx0n3lg9ka05sa1k60c8z0g3xp1q")))) + (build-system gnu-build-system) + (supported-systems '("i686-linux" "x86_64-linux")) + (arguments + `(#:system "i686-linux" + #:implicit-inputs? #f + #:strip-binaries? #f + #:phases + (modify-phases %standard-phases + (replace 'bootstrap + (lambda* (#:key inputs #:allow-other-keys) + (delete-file "configure") + (delete-file "config.sub") + (install-file (string-append (assoc-ref inputs "automake") + "/share/automake-1.16/config.sub") + ".") + (let ((bash (which "bash"))) + (substitute* '("configure.in" + "ghc/configure.in" + "ghc/rts/gmp/mpn/configure.in" + "ghc/rts/gmp/mpz/configure.in" + "ghc/rts/gmp/configure.in" + "distrib/configure-bin.in") + (("`/bin/sh") (string-append "`" bash)) + (("SHELL=/bin/sh") (string-append "SHELL=" bash)) + (("^#! /bin/sh") (string-append "#! " bash))) + + (substitute* '("mk/config.mk.in" + "ghc/rts/gmp/mpz/Makefile.in" + "ghc/rts/gmp/Makefile.in") + (("^SHELL.*=.*/bin/sh") (string-append "SHELL = " bash))) + (substitute* "aclocal.m4" + (("SHELL=/bin/sh") (string-append "SHELL=" bash)))) + + (invoke "autoreconf" "--verbose" "--force"))) + (add-before 'configure 'configure-gmp + (lambda* (#:key build inputs outputs #:allow-other-keys) + (with-directory-excursion "ghc/rts/gmp" + (let ((bash (which "bash")) + (out (assoc-ref outputs "out"))) + (setenv "CONFIG_SHELL" bash) + (setenv "SHELL" bash) + (invoke bash "./configure"))))) + (replace 'configure + (lambda* (#:key build inputs outputs #:allow-other-keys) + (let ((bash (which "bash")) + (out (assoc-ref outputs "out"))) + (setenv "CONFIG_SHELL" bash) + (setenv "SHELL" bash) + (invoke bash "./configure" + "--enable-hc-boot" + (string-append "--prefix=" out) + (string-append "--build=" build) + (string-append "--host=" build))))) + (replace 'build + (lambda _ + ;; mkdirhier doesn't get built, so just use mkdir -p. + (substitute* "mk/paths.mk" + (("^INSTALL_DIR.*") + "INSTALL_DIR = mkdir -p")) + + #; + (substitute* "ghc/driver/ghc-asm.prl" + (("local\\(\\$\\*\\) = 1;") "") + (("endef\\$/") "endef$/s")) + + (invoke "make" "boot") + (invoke "make")))))) + (native-inputs + `(("gcc" ,gcc-mesboot0) + ("libc" ,glibc-mesboot0) + ("binutils" ,binutils-mesboot0) + + ("autoconf" ,autoconf-2.13) + ("automake" ,automake) + + ("make" ,gnu-make-final) + ("sed" ,sed-final) + ("grep" ,grep-final) + ("coreutils" ,coreutils-final) + ("bash" ,bash-final) + ("ld-wrapper" ,ld-wrapper) + ("kernel-headers" ,%bootstrap-linux-libre-headers) + ("tar" ,tar) + ("bzip2" ,bzip2) + ("diffutils" ,diffutils) + ("file" ,file) + ("findutils" ,findutils) + ("gawk" ,gawk) + + ;; TODO: Perl used to allow setting $* to enable multi-line + ;; matching. If we want to use a more recent Perl we need to + ;; patch all expressions that require multi-line matching. Hard + ;; to tell. + ("perl" ,perl-5.14))) + (native-search-paths (list (search-path-specification + (variable "GHC_PACKAGE_PATH") + (files (list + (string-append "lib/ghc-" version))) + (file-pattern ".*\\.conf\\.d$") + (file-type 'directory)))) + (home-page "https://www.haskell.org/ghc") + (synopsis "The Glasgow Haskell Compiler") + (description + "The Glasgow Haskell Compiler (GHC) is a state-of-the-art compiler and +interactive environment for the functional language Haskell.") + (license license:bsd-3))) + (native-search-paths (list (search-path-specification + (variable "GHC_PACKAGE_PATH") + (files (list + (string-append "lib/ghc-" version))) + (file-pattern ".*\\.conf\\.d$") + (file-type 'directory)))) + (home-page "https://www.haskell.org/ghc") + (synopsis "The Glasgow Haskell Compiler") + (description + "The Glasgow Haskell Compiler (GHC) is a state-of-the-art compiler and +interactive environment for the functional language Haskell.") + (license license:bsd-3))) ;;; commencement.scm ends here