From patchwork Tue Aug 15 15:27:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Johann X-Patchwork-Id: 52851 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 4823C27BBEA; Tue, 15 Aug 2023 16:28:22 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 75D7927BBE2 for ; Tue, 15 Aug 2023 16:28:21 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVvxj-0003u3-JR; Tue, 15 Aug 2023 11:28:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qVvxi-0003tg-EE for guix-patches@gnu.org; Tue, 15 Aug 2023 11:28:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qVvxi-000625-63 for guix-patches@gnu.org; Tue, 15 Aug 2023 11:28:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qVvxh-0000kJ-S3 for guix-patches@gnu.org; Tue, 15 Aug 2023 11:28:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65313] [PATCH 1/1] * gnu/packages/erlang.scm (erlang-lfe): New variable. Resent-From: Tim Johann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 15 Aug 2023 15:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65313 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65313@debbugs.gnu.org Cc: Tim Johann Received: via spool by 65313-submit@debbugs.gnu.org id=B65313.16921132662844 (code B ref 65313); Tue, 15 Aug 2023 15:28:01 +0000 Received: (at 65313) by debbugs.gnu.org; 15 Aug 2023 15:27:46 +0000 Received: from localhost ([127.0.0.1]:36504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVvxS-0000jo-Eo for submit@debbugs.gnu.org; Tue, 15 Aug 2023 11:27:46 -0400 Received: from ms-10.1blu.de ([178.254.4.101]:50734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVvxO-0000je-Em for 65313@debbugs.gnu.org; Tue, 15 Aug 2023 11:27:45 -0400 Received: from [176.199.211.189] (helo=dolos.fritz.box) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qVvxN-00083t-QZ; Tue, 15 Aug 2023 17:27:41 +0200 From: Tim Johann Date: Tue, 15 Aug 2023 17:27:32 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-Con-Id: 303810 X-Con-U: 0-t1m X-Originating-IP: 176.199.211.189 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches --- gnu/packages/erlang.scm | 77 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm index a7f161647b..df7212b0e5 100644 --- a/gnu/packages/erlang.scm +++ b/gnu/packages/erlang.scm @@ -738,3 +738,80 @@ (define-public rebar3-proper (description "This plugin allows running PropEr test suites from within rebar3.") (license license:bsd-3))) + +(define-public erlang-lfe + (package + (name "erlang-lfe") + (version "2.1.2") + (source + (origin + (method git-fetch) + ;; The tarball from http://erlang.org/download contains many + ;; pre-compiled files, so we use this snapshot of the source + ;; repository. + (uri (git-reference + (url "https://github.com/lfe/lfe") + (commit "v2.1.2"))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "180hz1p2v3vb6yyzcfwircmljlnd86ln8z80lzy3mwlyrcxblvxy")))) + (build-system gnu-build-system) + (native-inputs + (list rebar3 rebar3-proper erlang-proper)) + (propagated-inputs + (list erlang)) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) + + ;; The following is inspired by rebar-build-system.scm + (add-before 'check 'erlang-depends + (lambda* (#:key inputs #:allow-other-keys) + (use-modules (ice-9 ftw)) + (define input-directories + (map (lambda (p) (cdr (assoc p inputs))) + '("rebar3-proper" "erlang-proper"))) + (mkdir-p "_checkouts") + (for-each + (lambda (input-dir) + (let ((elibdir (string-append input-dir "/lib/erlang/lib"))) + (when (directory-exists? elibdir) + (for-each + (lambda (dirname) + (let ((src (string-append elibdir "/" dirname)) + (dest (string-append "_checkouts/" dirname))) + (when (not (file-exists? dest)) + ;; symlinking will not work, since rebar3 will try + ;; to overwrite the _build directory several times + ;; with the contents of _checkout, so we copy the + ;; directory tree to _checkout and make it writeable. + (copy-recursively src dest #:follow-symlinks? #t) + (for-each + (lambda (file) + (chmod file #o777)) + (find-files dest))))) + (scandir elibdir + (lambda (file) + (and (not (member file '("." ".."))) + (file-is-directory? (string-append elibdir "/" file))))))))) + input-directories))) + + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (begin + ;;(setenv "DEBUG" "1") + (setenv "REBAR_CACHE_DIR" "/tmp") + (invoke "make" "tests")))))) + #:make-flags + (list (string-append "PREFIX=" (assoc-ref %outputs "out")) + "CC=gcc"))) + (home-page "https://github.com/lfe/lfe") + (synopsis "Lisp Flavoured Erlang") + (description + "LFE, Lisp Flavoured Erlang, is a lisp syntax front-end to the Erlang +compiler. Code produced with it is compatible with \"normal\" Erlang + code. An LFE evaluator and shell is also included.") + (license license:asl2.0)))