From patchwork Thu Feb 6 16:40:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nigko Yerden X-Patchwork-Id: 38329 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 3006227BBEA; Thu, 6 Feb 2025 16:44:48 +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,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,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 2FA2127BBE2 for ; Thu, 6 Feb 2025 16:44:47 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tg4yy-0006vd-MQ; Thu, 06 Feb 2025 11:44:04 -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 1tg4yx-0006vM-L2 for guix-patches@gnu.org; Thu, 06 Feb 2025 11:44:03 -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 1tg4yx-0005XY-Ah for guix-patches@gnu.org; Thu, 06 Feb 2025 11:44:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=FnLPAqONLe67YUtb6ChyEiE+Vw0sIYnz33zoD8oNrmM=; b=TKzLZKNZQo7/fGdsdTPG0e+z74S05eBAWPzl1DkSuKxxF6H2I+omYywuJ/woqAWu2XOtIx7xyt3ZdfirW07PFgEHSvKRHLdOM08QGtGeHoKzgUZZFS/mKd4r+mQC/WOFfi0+xd1Lj3Kdvt2rQMGhBd36MyTiJx1vfaURDGXuiNfjyDVnwGxXjkpLwwwqyF7H/4JNPH9LMyZLXV7PzS81JKJ4opUFuNzpPyjpBFUd5S6TljS5fsuLAynyH9YvUCbcSSLukUKlc69xvyZH5bOOXdKXiLOYfwz6x0aWrsschr8o3sKHmhRM4ygJawOOaoP2ncSxuidbRPXEYFMUzHqhOA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tg4yw-0007f6-Fa; Thu, 06 Feb 2025 11:44:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#66606] [PATCH v2] gnu: Add reduce-csl. References: In-Reply-To: Resent-From: Nigko Yerden Original-Sender: "Debbugs-submit" Resent-CC: andreas@enge.fr, bavier@posteo.net, sharlatanus@gmail.com, guix-patches@gnu.org Resent-Date: Thu, 06 Feb 2025 16:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66606 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66606@debbugs.gnu.org Cc: andreas@enge.fr, efraim@flashner.co.il, Nigko Yerden , bavier@posteo.net, Andreas Enge , Eric Bavier , Sharlatan Hellseher X-Debbugs-Original-Xcc: Andreas Enge , Eric Bavier , Sharlatan Hellseher Received: via spool by 66606-submit@debbugs.gnu.org id=B66606.173886019629377 (code B ref 66606); Thu, 06 Feb 2025 16:44:02 +0000 Received: (at 66606) by debbugs.gnu.org; 6 Feb 2025 16:43:16 +0000 Received: from localhost ([127.0.0.1]:59218 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tg4y8-0007dd-CA for submit@debbugs.gnu.org; Thu, 06 Feb 2025 11:43:16 -0500 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]:61594) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tg4y4-0007dI-Ll for 66606@debbugs.gnu.org; Thu, 06 Feb 2025 11:43:10 -0500 Received: by mail-lf1-x142.google.com with SMTP id 2adb3069b0e04-53f22fd6887so1253257e87.2 for <66606@debbugs.gnu.org>; Thu, 06 Feb 2025 08:43:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738860182; x=1739464982; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FnLPAqONLe67YUtb6ChyEiE+Vw0sIYnz33zoD8oNrmM=; b=UZgS40F0WSxhdP31GrLEcNfGJuNfsE+1hS3z2jdOiy3xj46bPZ3FbYrImvI1HhIL9K ximibLg7ioRqckO6+qtmskSVCOAhQfugebicyBmlcmXA4KR80xfmBppMlpypwItG7/df 7DCxChgl8WW74KPVPt5/9434KkxBronhGEwto14m7X87O7dCXYQw+XondlrYyIzLQD4s oeyMYT9GeCAhPcszMMiNxmacF4XLzZx3AjyvnyMVSPi6BdDWcEyvZbaiQ/wLZ5Exjcu9 +cNO2gk1dTvC4vBcnHTEM13q8zkAooPLInoQDoaRpKaa8G/f1gPdpk+dnx8J+wThNswt +YTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738860182; x=1739464982; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FnLPAqONLe67YUtb6ChyEiE+Vw0sIYnz33zoD8oNrmM=; b=roRJWbedBwTZaNNZp83zgNPepD5Nlw+LSzYNiFB1/geWMgHX7X800XePWHPQlndf9z /V3ep/F3ffdvYqBdigkaqSL5xp7V5CrR5FvCxQLvwnfeXnFGS+KYSqC3qowN2YM4QLu5 BWUr5n9babtUwGd3yVIdzmkP0ScqeBXMgU5MBsb8VQ0W/nagrtN5tauBDjVvsy7cLRkY lwSsKN0PHixijxdSesog+xzwOepp3O8GcwMl/QJZmG/MbB/I9JtBSid+/hnh8Fpvjues +G9EetZ27A6XKSrEoHfSeoSYbpmiaNTO9r4uovzmk1CmAEqGbmgLJAYV/gi+6twKFfuS I6sQ== X-Gm-Message-State: AOJu0YwejtOP1dGyYxNjX/QNO/lhiCn5apOI5i6rS7lW7N2lX6YOy18o AANW60uqao2wrbJIh5g4nh4laKPvc7SpPCgAGZpEq3LgC7bCTAR5ygKMv4mN X-Gm-Gg: ASbGncuiqA0iFaN8mYzncV0wVYJtqy9sEJZ8eECnayLJutDgXybUW63mpke3CQwsXxY IzUbcuAWW7falV1Mn7tHS8sE1d/0XapNK1h5QbDjJVjdtVid/RhuF+P1WNlzLW09o+gtypDFOCR vP9LzBB2vTX0FID6qsN3Iqqsx3hcdRHX9U1TGV0KC9Yym1XBGDziMikRPhoJ2IonUIWPSLLdfLJ muJFNHq1Nxhdvx8qFzG5srm4sQIEDT6IQ5OEvO3DjN8+cIt8X8sr0s2kdJAU40QFmCIPdj2UThU aqGrZJPOCTqFMNLhcGoI97BUzN+lytg= X-Google-Smtp-Source: AGHT+IHiEeNcCQn48NfX+wPxQ/tYGyZzJ/QskvEuKidgxixl/jJvo51+uNedkjCtoVxQc7hai0PwCg== X-Received: by 2002:a05:6512:1386:b0:540:3571:fea8 with SMTP id 2adb3069b0e04-54405a0fe90mr2816293e87.12.1738860181418; Thu, 06 Feb 2025 08:43:01 -0800 (PST) Received: from localhost.localdomain ([188.68.135.99]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-307de2d8efesm1647831fa.88.2025.02.06.08.43.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 08:43:00 -0800 (PST) From: Nigko Yerden Date: Thu, 6 Feb 2025 21:40:11 +0500 Message-ID: X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 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/math.scm (reduce-csl): New variable. * gnu/packages/patches/reduce-csl.patch: New patch which unbundles libffi. Change-Id: Ic85be7dc490f005f7ba65c418250cc9681fbb3a8 --- Hello, Andreas Enge wrote: >sorry for overlooking this patch for so long! > >The commit currently does not apply with "git am"; would you be able to >provide a v2 that applies? >I also wonder if you could already unbundle libffi. > >> + (list #:tests? #f > >Are there no tests? If this is the case, please add a comment. >Otherwise it would be good to enable the tests. > I rewrote this old patch. New patch provides 1. Updated package revision number 6860 (was 6547). 2. Apparent reproducibility of the package. 3. 'check' build phase for running tests. 4. Unbundled libffi. >> + (add-after 'install 'fix-install >> + (lambda _ >> + (delete-file-recursively (string-append #$output >> + "/man")) > >Why is this needed? This was the wrong location for the man pages coming from upstream rev. 6547. (it should be "share/man/man.1"). The current upstream version is free from this bug and these lines were removed in consequence. Regards, Nigko gnu/packages/maths.scm | 103 +++++++++++++++++++++ gnu/packages/patches/reduce-csl.patch | 125 ++++++++++++++++++++++++++ 2 files changed, 228 insertions(+) create mode 100644 gnu/packages/patches/reduce-csl.patch base-commit: 5c5f72cac9c49db918eba158d0c751ab1be1e95a diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index c3017976f6..33fc692375 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -67,6 +67,7 @@ ;;; Copyright © 2024 Foundation Devices, Inc. ;;; Copyright © 2024, 2025 Artyom V. Poptsov ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com> +;;; Copyright © 2025 Nigko Yerden ;;; ;;; This file is part of GNU Guix. ;;; @@ -197,6 +198,7 @@ (define-module (gnu packages maths) #:use-module (gnu packages wxwidgets) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xml) + #:use-module (gnu packages libffi) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26)) @@ -5398,6 +5400,107 @@ (define-public maxima ;; GPLv2 only is therefore the smallest subset. (license license:gpl2))) +(define-public reduce-csl + (package + (name "reduce-csl") + (version "6860") + (source (origin + (method url-fetch) + (uri (string-append + "mirror://sourceforge/reduce-algebra/snapshot_" + "2024-08-12" "/Reduce-svn" version "-src.tar.gz")) + (sha256 + (base32 + "13bij9d4dj96vd5di59skz77s2fihj7awmkx403fvh9rd04ly25z")) + (modules '((guix build utils))) + ;; unbundle libffi + (patches (search-patches "reduce-csl.patch")) + ;; remove binaries and unnecessary parts + ;; to ensure we build from source files only + (snippet '(map delete-file-recursively + (append (find-files "csl/generated-c" "\\.img$") + '("psl" "vsl" + "jlisp" + "jslisp" + "libedit" + "macbuild" + "MacPorts" + "mac-universal" + "reduce2" + "winbuild64" + "common-lisp" + "contrib" + "generic/qreduce" + "web/htdocs/images/Thumbs.db") + (find-files "csl" + "^(embedded|new-embedded|winbuild|support-packages)$" + #:directories? #t) + (find-files "libraries" + "^(original|wineditline|libffi|libffi-for-mac)$" + #:directories? #t)))))) + (build-system gnu-build-system) + (arguments + (list #:configure-flags + #~(list "--without-autogen" + ;; fix conflict with internal build name determination + "--build=" + "--with-csl" + (string-append "CPPFLAGS=-I" + #$freetype + "/include/freetype2")) + #:make-flags #~(list "csl") + #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "scripts/testall.sh" "--csl" "--noregressions")))) + (add-before 'patch-source-shebangs 'autogen + (lambda _ + (invoke "sh" "autogen.sh"))) + (add-after 'install 'fix-install + (lambda _ + (copy-file "bin/rfcsl" + (string-append #$output "/bin/rfcsl")) + (copy-file "generic/newfront/redfront.1" + (string-append #$output + "/share/man/man1/rfcsl.1")) + (let ((.desktop-file + "debianbuild/reduce/debian/redcsl.desktop") + (icon "debianbuild/reduce/debian/reduce.png")) + (install-file .desktop-file + (string-append #$output + "/share/applications")) + (install-file icon + (string-append + #$output + "/share/icons/hicolor/32x32/apps"))) + (with-directory-excursion #$output + (map (lambda (dir) + (map (lambda (file) + (chmod file #o444)) + (find-files dir))) + '("share/man/man1" "share/reduce/fonts")))))))) + (native-inputs (list which autoconf automake libtool)) + (inputs + ;; bundled libraries: fox (adjusted) editline (adjusted) + ;; libffi (unbundled, see patch) crlibm softfloat + (list ncurses freetype libxft libx11 libxext libffi)) + (synopsis "Portable general-purpose computer algebra system") + (description + "REDUCE is a portable general-purpose computer algebra system. It is a +system for doing scalar, vector and matrix algebra by computer, which also +supports arbitrary precision numerical approximation and interfaces to gnuplot +to provide graphics. It can be used interactively for simple calculations but +also provides a full programming language, with a syntax similar to other +modern programming languages. REDUCE supports alternative user interfaces +including Run-REDUCE, TeXmacs and GNU Emacs. This package provides Codemist +Standard Lisp (CSL) version of REDUCE. It uses gnuplot program, if installed, +to make figures.") + (home-page "https://reduce-algebra.sourceforge.io/") + (license (license:non-copyleft "file://README" + "See README in the deistribution.")))) + (define-public wxmaxima (package (name "wxmaxima") diff --git a/gnu/packages/patches/reduce-csl.patch b/gnu/packages/patches/reduce-csl.patch new file mode 100644 index 0000000000..21529840b6 --- /dev/null +++ b/gnu/packages/patches/reduce-csl.patch @@ -0,0 +1,125 @@ +This patch unbundles libffi. + +Index: autogen.sh +=================================================================== +diff --git a/autogen.sh b/autogen.sh +--- a/autogen.sh (revision 6860) ++++ b/autogen.sh (working copy) +@@ -142,18 +142,6 @@ + ;; + *--with-csl* | *--with-both*) + L="$L ./csl ./csl/cslbase ./csl/cslbase-nothrow ./libraries/SoftFloat-3a/source" +-# On Apple m1 (ie arm64) I will want to build a universal version of the +-# libffi library and that is done in a way that differs from standrad builds. +- case "`uname -s` `uname -m`" in +- *Darwin*arm64*) +- L="$L ./libraries/libffi-for-mac/libffi-3.3-arm64" +- L="$L ./libraries/libffi-for-mac/libffi-3.3-x86_64" +- L="$L ./libraries/libffi" +- ;; +- *) +- L="$L ./libraries/libffi" +- ;; +- esac + case $a in + *--without-fox* | *with-fox=no* | \ + *--without-gui* | *with-gui=no*) +Index: configure.ac +=================================================================== +diff --git a/configure.ac b/configure.ac +--- a/configure.ac (revision 6860) ++++ b/configure.ac (working copy) +@@ -1389,37 +1389,6 @@ + cd "$builddir" + fi + +-AC_MSG_NOTICE([About to configure libffi]) +-mkdir -p libffi +-if test `uname` = "Darwin" && test "$enable_universal" != "no" +-then +-# This is a messy script that arranges to build a universal version of +-# the library on MacOS. It does this by building arm64 and an x86_64 +-# separately and then merging the resulting libraries. +- sed "s+@srcdir@+$abssrcdir+" \ +- < $abssrcdir/libraries/libffi-for-mac/Makefile \ +- > libffi/Makefile +-else +- cd libffi +- setpasscc +- doconfig="$SHELL $abssrcdir/libraries/libffi/configure -C $filtered \ +- $pass_host \ +- CPPFLAGS=\"$CPPFLAGS\" \ +- CFLAGS=\"$CFLAGS\" \ +- CXXFLAGS=\"$CXXFLAGS\" \ +- LDFLAGS=\"$LDFLAGS\" \ +- $passcc \ +- --disable-multi-os-directory \ +- --disable-docs \ +- --prefix=\"$builddir\" \ +- --libdir=\"$builddir/lib\" \ +- --includedir=\"$builddir/include\"" +- AC_MSG_NOTICE([doconfig = $doconfig]) +- printf "\n\n+++ About to configure libffi +++\n\n" +- eval "$doconfig" +- cd "$builddir" +-fi +- + AC_MSG_NOTICE([About to configure libsoftfloat]) + mkdir -p softfloat + cd softfloat +Index: csl/cslbase/Makefile.am +=================================================================== +diff --git a/csl/cslbase/Makefile.am b/csl/cslbase/Makefile.am +--- a/csl/cslbase/Makefile.am (revision 6860) ++++ b/csl/cslbase/Makefile.am (working copy) +@@ -807,35 +807,6 @@ + + endif !crlibm + +-LIBFFIDEPS=../lib/libffi.a ../include/ffi.h +- +-FFIDEP = ../include/ffi.h +-FFIINC = -I../include +-AM_CPPFLAGS += $(FFINC) +-reduce_CPPFLAGS += $(FFINC) +-bootstrapreduce_CPPFLAGS += $(FFINC) +-csl_CPPFLAGS += $(FFINC) +-flatcsl_CPPFLAGS += $(FFINC) +- +-# The following ugly dependencies are here so that one can go, for +-# instance, "make csl.o" in a clean tree and libffi building will get +-# triggered. +- +- +-csl_LDADD += ../lib/libffi.a +-flatcsl_LDADD += ../lib/libffi.a +-bootstrapreduce_LDADD += ../lib/libffi.a +-reduce_LDADD += ../lib/libffi.a +- +-csl_DEPENDENCIES += $(LIBFFIDEPS) +-flatcsl_DEPENDENCIES += $(LIBFFIDEPS) +-bootstrapreduce_DEPENDENCIES += $(LIBFFIDEPS) +-reduce_DEPENDENCIES += $(LIBFFIDEPS) +- +-$(LIBFFIDEPS): +- @printf "About to build libffi for %s ($@)\n" `pwd` +- -$(TRACE)@$(MAKE) -C ../libffi install +- + SOFTFLOATDEPS=../lib/libsoftfloat.a ../include/softfloat.h + + SOFTFLOATDEP = ../include/softfloat.h +Index: csl/cslbase/configure.ac +=================================================================== +diff --git a/csl/cslbase/configure.ac b/csl/cslbase/configure.ac +--- a/csl/cslbase/configure.ac (revision 6860) ++++ b/csl/cslbase/configure.ac (working copy) +@@ -146,8 +146,8 @@ + AC_DEFINE(WITHOUT_FFI, [1], [remove the foreign function support]) + fi + ++AC_SEARCH_LIBS([ffi_call], [ffi]) + +- + # What host am I on? + AC_CANONICAL_HOST() +