From patchwork Sat Feb 1 13:19:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lars-Dominik Braun X-Patchwork-Id: 38145 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 1795E27BBEA; Sat, 1 Feb 2025 13:20:33 +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=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, 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 833DA27BBE9 for ; Sat, 1 Feb 2025 13:20:31 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1teDQ5-0005DS-L2; Sat, 01 Feb 2025 08:20:23 -0500 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 1teDPm-00051Z-PG for guix-patches@gnu.org; Sat, 01 Feb 2025 08:20:05 -0500 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 1teDPm-0001He-Fk for guix-patches@gnu.org; Sat, 01 Feb 2025 08:20:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:MIME-Version:References:From:Date:To:Subject; bh=8Tr2WJPTE1zoshChV1uEauQ641jxPWg+Cnf02l0odbU=; b=ikKQrEQTAcjn3D46eQ1FfPPPTcO7SBrwbQ2XKiAAPHfiP5vleeZkgqC8s4wzg5GNWWGe1SlWq6dk0JpNBLpe/1OlVvYg7YbdsG8aLs7Scafi6BzaoL3g5QyfVq2hGUMlK4jecGCwjF8OUDQoCE0TRIUglie15pH4dr6yAMX+FCnzpYYSguE/C4w/nGsDKW7tTcQ+8nFJXPDGDZ56S41hUGBBYNzp2Oy7zHod3bC9oGbnjQ/hH/7wvhrKeV6+SHoCtWec437hs01gRMV9bohzXoQGp3cCaAs9VNEjvTtHzRRV0AiXNBomg4pd/yDqG7YX7C0LE0/YoRIYQgK+Zu8o1g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1teDPm-0004CI-9P for guix-patches@gnu.org; Sat, 01 Feb 2025 08:20:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75787] [PATCH] gnu: Add microcabal. Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Feb 2025 13:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75787 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Homo Cc: divya@subvertising.org, 75787@debbugs.gnu.org Received: via spool by 75787-submit@debbugs.gnu.org id=B75787.173841599416115 (code B ref 75787); Sat, 01 Feb 2025 13:20:02 +0000 Received: (at 75787) by debbugs.gnu.org; 1 Feb 2025 13:19:54 +0000 Received: from localhost ([127.0.0.1]:57017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1teDPd-0004Br-PT for submit@debbugs.gnu.org; Sat, 01 Feb 2025 08:19:54 -0500 Received: from mout-p-102.mailbox.org ([2001:67c:2050:0:465::102]:45674) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1teDPa-0004BV-9T for 75787@debbugs.gnu.org; Sat, 01 Feb 2025 08:19:51 -0500 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4YlYJW0jz2z9scX; Sat, 1 Feb 2025 14:19:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1738415979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8Tr2WJPTE1zoshChV1uEauQ641jxPWg+Cnf02l0odbU=; b=Ynk/moaTYBhjUWwWkgS88nN6km7V+aWftiKn4Z39Gl3mRNdlJoj27Jy3kQh7sSczGIFzg6 uEIRwgLw64hoqHp7KZh2MeOftDEoo7Qdf7XzUgoLA8osJe9XMmgSWfGitdnWN/mrvGR5pD e8EA92h4WFmfS7BEXgVK32MC9Y8CKudguK+9bNkVGT1Xdhp2HuoohO32t93ARKz2bPzFIe QEe8WeHeNzBFDD68TIwMLcQ/NJvsnDL6nUx1g7jkv10ODqTTNTH8UZ3w3IP6jPmZwKWbHc p3VhzHP0zI6qgR3PDwLuZS5BCp++PHZXUQ1h5Zbgz/QjU+jO6gUQfcdx7OeMug== Date: Sat, 1 Feb 2025 14:19:36 +0100 From: Lars-Dominik Braun Message-ID: References: <20250123162034.16946-1-gay@disroot.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250123162034.16946-1-gay@disroot.org> X-Rspamd-Queue-Id: 4YlYJW0jz2z9scX 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 Hi, > * gnu/packages/haskell-apps.scm (microcabal): New variable. I’m using a slightly modified patch (see attachment), but `mcabal` cannot build any packages. It seems that it ignores the MHSDIR environment variable: mcabal build fail mcabal: Build package fail mcabal: Building in /home/lars/.mcabal/packages/fail-4.9.0.0 mcabal: Building library fail mhs: error: no location: Module not found: Mhs.Builtin search path=[".","dist-mcabal/autogen"] package path=["."] mhs: error: callCommand: failed 256, "mhs -Pfail-4.9.0.0 -ofail-4.9.0.0.pkg -i -i. -idist-mcabal/autogen '-DVERSION_base=\"4.19.1.0\"' '-DMIN_VERSION_base(x,y,z)=((x)<4||(x)==4&&(y)<19||(x)==4&&(y)==19&&(z)<=1)' -a. Control.Monad.Fail" Looking at the MicroCabal sources mcabal might be expecting mhs to be installed as an “mcabal package”? Lars From 9d701dac7c56db1e662e2930a324bd4581e7ce79 Mon Sep 17 00:00:00 2001 Message-ID: <9d701dac7c56db1e662e2930a324bd4581e7ce79.1738415691.git.lars@6xq.net> From: Homo Date: Thu, 23 Jan 2025 18:20:33 +0200 Subject: [PATCH] gnu: Add microcabal. Depends on . * gnu/packages/haskell-apps.scm (microcabal): New variable. Change-Id: Ib676c2afc360c379183422b1038f045af5485b59 Signed-off-by: Lars-Dominik Braun --- gnu/packages/haskell-apps.scm | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) base-commit: b226a1007a9111adacb05984b8d74def24257dce prerequisite-patch-id: cf5c00ff7ab68e16a9c83d294d57d08c1745dfeb diff --git a/gnu/packages/haskell-apps.scm b/gnu/packages/haskell-apps.scm index 1ef3ed4035..6b61ae026b 100644 --- a/gnu/packages/haskell-apps.scm +++ b/gnu/packages/haskell-apps.scm @@ -20,6 +20,7 @@ ;;; Copyright © 2021 Morgan Smith ;;; Copyright © 2022 David Thompson ;;; Copyright © 2024 jgart +;;; Copyright © 2025 Homo ;;; ;;; This file is part of GNU Guix. ;;; @@ -42,8 +43,10 @@ (define-module (gnu packages haskell-apps) #:use-module (guix git-download) #:use-module (guix packages) #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix build-system gnu) #:use-module (guix build-system haskell) #:use-module (gnu packages) + #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages curl) #:use-module (gnu packages freedesktop) @@ -59,6 +62,7 @@ (define-module (gnu packages haskell-apps) #:use-module (gnu packages pkg-config) #:use-module (gnu packages rsync) #:use-module (gnu packages version-control) + #:use-module (gnu packages wget) #:use-module (gnu packages xorg)) (define-public apply-refact @@ -783,6 +787,61 @@ (define-public matterhorn "This is a terminal client for the Mattermost chat system.") (license license:bsd-3))) +(define-public microcabal + ;; There are no tags, using latest commit. + (let ((commit "75aab2f5dfa3bacc1876dc1da9828a7e54e01d68") + (revision "0")) + (package + (name "microcabal") + (version (git-version "0.5.0.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/augustss/MicroCabal") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0hzp2zfvldl5gmnvr33vxbpd75fhm4kkdsvakd49wdpmcamp01yg")))) + (build-system gnu-build-system) + (arguments + (list + #:make-flags #~(list "MHS=mhs") + ;; Tests require *.cabal files from MicroHs's code. + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "src/MicroCabal/Unix.hs" + (("(\"[^\"]*)(wget|mkdir|tar|rm|cp)( [^\"]*\")" all prefix binary postfix) + (string-append + prefix + (search-input-file inputs (string-append "/bin/" binary)) + postfix))))) + (replace 'configure + (lambda _ + (substitute* "Makefile" + (("MHSDIR=[^ ]* ?") + "") + ;; Don't build with GHC. + (("bin/gmcabal bin/mcabal") + "bin/mcabal")))) + (replace 'install + (lambda _ + (let ((bin (string-append #$output "/bin/"))) + (install-file "bin/mcabal" bin))))))) + (inputs (list wget tar coreutils)) + (propagated-inputs (list microhs)) ;; Propagate microhs, because it needs a search path. + (home-page "https://github.com/augustss/MicroCabal") + (synopsis "Reimplementation of a subset of Cabal") + (description "Why a reimplementation? Because Cabal is not a Haskell tool, it is a ghc tool. +A Haskell tool should be compilable by an implementation of Haskell2010, +which Cabal is definitely not. + +To get a consistent set of packages MicroCabal uses Stackage to find compatible packages. +So in a sense, MicroCabal is more like a MicroStackage.") + (license license:asl2.0)))) + (define-public nixfmt (package (name "nixfmt")