unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: jgart via Guix-patches via <guix-patches@gnu.org>
To: 58898@debbugs.gnu.org
Cc: "\(" <paren@disroot.org>, jgart <jgart@dismail.de>
Subject: [bug#58898] [PATCH v2] gnu: Add carp.
Date: Thu, 10 Nov 2022 23:55:07 -0600	[thread overview]
Message-ID: <20221111055506.21408-1-jgart@dismail.de> (raw)
In-Reply-To: <20221030160224.30625-1-jgart@dismail.de>

* gnu/packages/lisp.scm (carp): New variable.

Co-authored-by: ( <paren@disroot.org>
---
 gnu/packages/lisp.scm | 72 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index d0f24163cb..80018f8e1a 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -22,6 +22,7 @@
 ;;; Copyright © 2021 Charles Jackson <charles.b.jackson@protonmail.com>
 ;;; Copyright © 2022 Joeke de Graaf <joeke@posteo.net>
 ;;; Copyright © 2021, 2022 jgart <jgart@dismail.de>
+;;; Copyright © 2022 ( <paren@disroot.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -55,6 +56,7 @@ (define-module (gnu packages lisp)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system ant)
   #:use-module (guix build-system asdf)
+  #:use-module (guix build-system haskell)
   #:use-module (guix build-system trivial)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages base)
@@ -71,10 +73,14 @@ (define-module (gnu packages lisp)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages groff)
+  #:use-module (gnu packages haskell-check)
+  #:use-module (gnu packages haskell-web)
+  #:use-module (gnu packages haskell-xyz)
   #:use-module (gnu packages libffcall)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages libsigsegv)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages llvm)
   #:use-module (gnu packages m4)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages multiprecision)
@@ -1257,6 +1263,72 @@ (define-public janet
 assembler, PEG) is less than 1MB.")
     (license license:expat)))
 
+(define-public carp
+  (package
+    (name "carp")
+    (version "0.5.5")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/carp-lang/Carp")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "14jdnv0ljqvpr9ych1plfw7hp5q57a8j1bv8h3v345x06z783d07"))))
+    (build-system haskell-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               ;; Carp looks inside the sources checkout to know where to
+               ;; find its core libraries and other files.
+               ;; Carp emits C code and tries to compile it with an external
+               ;; C compiler. On Linux it defaults to Clang.
+               (add-after 'install 'wrap-programs
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (define (wrap-carp-program program)
+                     (wrap-program (string-append
+                                    #$output "/bin/" program)
+                       `("CARP_DIR" prefix
+                         (#$(package-source this-package)))
+                       `("PATH" prefix
+                         ,(list (dirname
+                                 (search-input-file inputs "bin/clang"))
+                                (dirname
+                                 (search-input-file inputs "bin/ld"))))
+                       `("C_INCLUDE_PATH" prefix
+                         ,(list (dirname
+                                 (search-input-directory
+                                  inputs "include/linux"))
+                                (dirname
+                                 (search-input-file
+                                  inputs "include/stdlib.h"))))))
+
+                   (for-each wrap-carp-program
+                             (list "carp"
+                                   "carp-header-parse")))))))
+    (inputs
+     (list bash-minimal
+           clang
+           ghc-blaze-markup
+           ghc-blaze-html
+           ghc-split
+           ghc-ansi-terminal
+           ghc-cmark
+           ghc-edit-distance
+           ghc-hashable
+           ghc-open-browser
+           ghc-optparse-applicative))
+    (native-inputs
+     (list ghc-hunit))
+    (home-page "https://carp-lang.org/")
+    (synopsis "Statically typed Lisp without a garbage collector")
+    (description
+     "@code{carp} is a Lisp-like programming language that compiles to
+C.  It features inferred static typing, macros, automatic memory
+management without a garbage collector, a REPL, and straightforward
+integration with code written in C.")
+    (license license:asl2.0)))
 (define-public lisp-repl-core-dumper
   (package
     (name "lisp-repl-core-dumper")
-- 
2.38.1





  parent reply	other threads:[~2022-11-11  5:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-30 16:02 [bug#58898] [PATCH] gnu: Add carp jgart via Guix-patches via
2022-10-30 16:15 ` [bug#58898] [PATCH v2] " jgart via Guix-patches via
2022-10-30 16:22 ` [bug#58898] [PATCH v3] " jgart via Guix-patches via
2022-10-30 16:30 ` [bug#58898] [PATCH v4] " jgart via Guix-patches via
2022-10-30 17:18   ` Christine Lemmer-Webber
2022-11-09  2:48     ` jgart via Guix-patches via
2022-10-30 21:38 ` [bug#58898] [PATCH v5] " jgart via Guix-patches via
2022-11-11  5:55 ` jgart via Guix-patches via [this message]
2022-11-11 13:32 ` [bug#58898] [PATCH v7] " jgart via Guix-patches via
2022-11-11 13:37 ` [bug#58898] [PATCH v8] " jgart via Guix-patches via
2022-11-12  9:07 ` bug#58898: [PATCH] " Raghav Gururajan via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221111055506.21408-1-jgart@dismail.de \
    --to=guix-patches@gnu.org \
    --cc=58898@debbugs.gnu.org \
    --cc=jgart@dismail.de \
    --cc=paren@disroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).