aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
;;; Copyright © 2022 jgart <jgart@dismail.de>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages mercury)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages bdw-gc)
  #:use-module (gnu packages readline)
  #:use-module (gnu packages texinfo)
  #:use-module (gnu packages flex)
  #:use-module (gnu packages shells)
  #:use-module (gnu packages bison)
  #:use-module (gnu packages pkg-config)
  #:use-module ((ice-9 match) #:select (match-lambda)))

;; NOTE: Mercury uses a tightly coupled fork of BDWGC and
;; libatomic-ops. When updating the package, please check the GitHub
;; repository to ensure that the submodule commit matches what is
;; provided.
(define (gc-fork package-name package-url
                 package-commit package-hash)
  (let ((commit package-commit))
    (package (inherit package-name)
             (source
              (origin
                (method git-fetch)
                (uri (git-reference
                      (url package-url)
                      (commit commit)))
                (sha256 (base32 package-hash)))))))

;; NOTE: Mercury /MUST/ bootstrap from a tarball release.
;; Once the bootstrapping compiler is established, this
;; minimal build can be used for further compiling Mercury
;; from a git checkout with additional grades enabled.
(define-public mercury-minimal
  (package
    (name "mercury-minimal")
    (version "22.01.4")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://dl.mercurylang.org/release/mercury-srcdist-"
                    version ".tar.gz"))
              (sha256
               (base32
                "1vakjg4rqpplkxw7k91qv8jvlasrr6iwrzrylwqllbq088qs0mbp"))))
    (build-system gnu-build-system)
    (arguments
     `(#:modules ((guix build gnu-build-system)
                  (guix build utils)
                  (ice-9 match))
       #:tests? #f ; Tests are run on the stage-2 compiler.
       ;; TODO: Find a way to bypass all static linkages.
       #:configure-flags (list "--enable-minimal-install")
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'replace-boehm-gc
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out"))
                   (libgc (assoc-ref inputs "libgc"))
                   (libatomic-ops (assoc-ref inputs "libatomic-ops"))
                   (unpack (assoc-ref %standard-phases 'unpack))
                   (patch-source-shebangs
                    (assoc-ref %standard-phases 'patch-source-shebangs)))
               (map (match-lambda
                      ((src orig-name new-name)
                       (with-directory-excursion "."
                         (apply unpack (list #:source src)))
                       (delete-file-recursively new-name)
                       (invoke "mv" orig-name new-name)
                       (with-directory-excursion new-name
                         (apply patch-source-shebangs (list #:source src)))))
                    `((,libgc "source" "boehm_gc")))
               (map (match-lambda
                      ((src orig-name new-name)
                       (with-directory-excursion "."
                         (apply unpack (list #:source src)))
                       (delete-file-recursively new-name)
                       (invoke "mv" orig-name new-name)
                       (with-directory-excursion new-name
                         (apply patch-source-shebangs (list #:source src)))))
                    `((,libatomic-ops "source" "boehm_gc/libatomic_ops"))))))
         (add-after 'replace-boehm-gc 'patch-paths
           (lambda _
             (substitute*
                 (list "Makefile"
                       "Mmakefile"
                       "scripts/mercury_update_interface.in"
                       "scripts/mercury_config.in"
                       "scripts/mmake.in"
                       "scripts/Mmake.vars.in"
                       "scripts/mdb.in"
                       "scripts/rs6000_hack"
                       "scripts/mmc.in"
                       "scripts/canonical_grade"
                       "scripts/mprof.in"
                       "scripts/gud.el"
                       "scripts/ml.in"
                       "scripts/canonical_grade.in"
                       "scripts/mdprof.in"
                       "scripts/vpath_find"
                       "scripts/mkfifo_using_mknod.in"
                       "scripts/prepare_install_dir.in"
                       "scripts/mprof_merge_runs"
                       "scripts/mtc"
                       "scripts/mgnuc.in"
                       "scripts/c2init.in"
                       "bindist/bindist.Makefile"
                       "boehm_gc/configure.ac"
                       "boehm_gc/Makefile.direct")
               (("/bin/sh") (which "sh"))
               (("/bin/pwd") (which "pwd"))
               (("/bin/rm") (which "rm"))))))))
    (native-inputs
     `(("texinfo" ,texinfo)
       ("flex" ,flex)
       ("tcsh" ,tcsh)
       ("bison" ,bison)
       ("readline" ,readline)
       ("libatomic-ops" ,(package-source
                          (gc-fork
                           libatomic-ops
                           "https://github.com/Mercury-Language/libatomic_ops.git"
                           "95809e50a5ff6e765f1af2f589796970a73e9c00"
                           "0a1y795bvzwzk1v8d9g6wvifj7hvhmxlir1g581bq2slj16h95iz")))
       ("libgc" ,(package-source
                  (gc-fork
                   libgc-7
                   "https://github.com/Mercury-Language/bdwgc.git"
                   "def741752f55f9068d4f469a14c4b2c168829730"
                   "07d94j5l9w6l2kjmcwblgn5lf77aw3r0zjn22pq4hbhknky6ny43")))
       ("pkg-config" ,pkg-config)))
    (synopsis "Pure logic programming language (used only for
bootstrapping dependent Mercury)")
    (description "Mercury is a logic/functional programming language which
combines the clarity and expressiveness of declarative programming with advanced
static analysis and error detection features.  Its highly optimized execution
algorithm delivers efficiency far in excess of existing logic programming
systems, and close to conventional programming systems.  Mercury addresses
the problems of large-scale program development, allowing modularity,
separate compilation, and numerous optimization/time trade-offs.")
    (home-page "https://mercurylang.org")
    (license license:gpl2)))

;; NOTE: This package is quite large and will take an extensive
;; amount of time to compile, especially with bootcheck functionality
;; enabled. To ensure that we do not monopolize the CI & build servers,
;; please make sure that your changes are justified.
(define-public mercury
  (package (inherit mercury-minimal)
           (name "mercury")
           (version "22.01.4")
           (source
            (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/Mercury-Language/mercury")
                    (commit (string-append
                             "version-"
                             (string-join (string-split version #\.) "_")))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0ycy1j9a4rdj6d37x02dj6kyr00mykvc5kykci11fim906d92gzh"))))
           (arguments
            (substitute-keyword-arguments
                (package-arguments mercury-minimal)
              ;; TODO: Find a way to bypass all static linkages.
              ((#:configure-flags flags ''())
               `(list ""))
              ((#:tests? _) #f) ; FIXME: Many test-cases failing.
              ((#:phases phases)
               `(modify-phases ,phases
                  (replace 'patch-paths
                    (lambda _
                      (substitute*
                          (list "prepare.sh"
                                "Makefile"
                                "Mmakefile"
                                "scripts/mercury_update_interface.in"
                                "scripts/mercury_config.in"
                                "scripts/mmake.in"
                                "scripts/Mmake.vars.in"
                                "scripts/mdb.in"
                                "scripts/rs6000_hack"
                                "scripts/mmc.in"
                                "scripts/mprof.in"
                                "scripts/gud.el"
                                "scripts/ml.in"
                                "scripts/canonical_grade.in"
                                "scripts/mdprof.in"
                                "scripts/vpath_find"
                                "scripts/mkfifo_using_mknod.in"
                                "scripts/prepare_install_dir.in"
                                "scripts/mprof_merge_runs"
                                "scripts/mtc"
                                "scripts/mgnuc.in"
                                "scripts/c2init.in"
                                "tools/bootcheck"
                                "boehm_gc/configure.ac"
                                "boehm_gc/Makefile.direct")
                        (("/bin/sh") (which "sh"))
                        (("/bin/pwd") (which "pwd"))
                        (("/bin/rm") (which "rm"))
                        (("boehm_gc/.git") "boehm_gc"))))
                  (replace 'bootstrap
                    (lambda _
                      (invoke "./prepare.sh")))))))
           ;; TODO: Uncomment phase when tests are enabled.
           ;; (replace 'check
           ;;   (lambda _
           ;;     (invoke "./tools/bootcheck")
           ;;     #t))
           ;;
           ;; TODO: The mercury configuration system determines
           ;; grade support by looking for available toolchains.
           ;; Eventually we need to add inputs for Java, Erlang,
           ;; C#, etc. in order to enable these extra grades.
           (native-inputs
            (modify-inputs (package-native-inputs mercury-minimal)
              (prepend mercury-minimal autoconf automake)))
           (synopsis "Pure logic programming language")))
/span>gnu: git-minimal: Add coreutils and sed to PATH....Fixes <https://issues.guix.gnu.org/65924>. * gnu/packages/version-control.scm (git-minimal) [arguments] <imported-modules>: New field. <modules>: Augment with (ice-9 match), (ice-9 textual-ports) and (guix search-paths). <phases>: Add patch-commands phase. [inputs]: Add coreutils-minimal and sed. Reviewed-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Change-Id: I8e3dbbd24ef7f8fa98a392a36617b07fe632cd15 Maxim Cournoyer 2024-08-31gnu: git: Invert inheritance relationship....It's simpler to add features on top of a minimal variant than to remove them, and helps avoiding mistakenly changing git-minimal, which has many dependents. * gnu/packages/version-control.scm (git-minimal): Move above git and severe inheritance. Remove input label. Repatriate most fields from... (git): ... here. Define as package/inherit to inherit from git-minimal. Extend minimal values instead of overriding them whole. Reviewed-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Change-Id: Ia0ef0e7e4f007c2fafad3550344638b6661a408b Maxim Cournoyer 2024-08-31gnu: git: Remove labels and use gexps....* gnu/packages/version-control.scm (git) [native-inputs, inputs]: Remove labels. [arguments]: Use gexps. Use gexp variables input searching procedures where it makes sense. Reviewed-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Change-Id: I1c5d0bb5eb9639342c11af94dca2ae2174496459 Maxim Cournoyer 2024-08-28gnu: libgit2@1.8: Fix use of uninitialized value....* gnu/packages/patches/libgit2-uninitialized-proxy-settings.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/version-control.scm (libgit2-1.8)[source]: Use it. Change-Id: I6b0f009d352ddadfcc57b945baea0dcc1bac0589 Ludovic Courtès 2024-08-28gnu: stagit: Add a comment for source....* gnu/packages/version-control.scm (stagit): Add comment for why use git protocol. Change-Id: I748a85e252f6ad9f4de444bd176c5ad2b5f1023c Zheng Junjie 2024-08-28gnu: stagit: Fix cross-compiling....* gnu/packages/version-control.scm (stagit)[arguments]: Use G-expressions. Change-Id: I7de0449d0709d554095df7532c92cb589d328b4c Zheng Junjie 2024-08-28gnu: stagit: Update to 1.2....* gnu/packages/version-control.scm (stagit): Update to 1.2. Change-Id: I4da6e85303d3591b61eeb6c90738171a17f0a81e Signed-off-by: Zheng Junjie <zhengjunjie@iscas.ac.cn> Lilah Tascheter via Guix-patches 2024-08-20gnu: Add python-klaus....* gnu/packages/version-control.scm (python-klaus): New variable. Change-Id: I1b7c31deb799e0ea5195eda109740fdb90e5fabd jgart 2024-08-19gnu: libgit2-1.8: Update to 1.8.1....* gnu/packages/version-control.scm (libgit2-1.8): Update to 1.8.1. [source]: deps/http-parser does not exist so update the list [arguments]: semantics of -DUSE_HTTP_PARSER has changed, so update configure-flags to reflect the same Change-Id: Ifd9694a93326f7c3d368bd354a5fadf4e4b93119 Signed-off-by: Ludovic Courtès <ludo@gnu.org> Ashish SHUKLA 2024-08-19gnu: gitile: Replace outdated dependency....* gnu/packages/version-control.scm (gitile): Replace outdated dependency. * gnu/packages/guile-xyz.scm (guile-syntax-highlight-for-gitile): Remove. Change-Id: I24295a24d0dfef08d5161c206757996ccdd881fd Evgeny Pisemsky 2024-08-01gnu: cgit: Update to 1.2.3-5.9811bf0....* gnu/packages/version-control.scm (cgit): Update to 1.2.3-5.9811bf0. Change-Id: Ifa8d731b7a7e1217becb2179d1009e8051137293 Signed-off-by: Christopher Baines <mail@cbaines.net> Tomas Volf 2024-07-31gnu: Add git-tools....* gnu/packages/version-control.scm (git-tools): New variable. Change-Id: I0ac65c24f787714fe0ef234fce639c6ec561600d Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Suhail Singh 2024-07-19gnu: stgit-2: Allow building with newer dependencies....* gnu/packages/version-control.scm (stgit-2)[source]: Add snippet to allow building with newer dependencies. Change-Id: Ia1309c0656a3f0df2529f52e2ddd4bfbd59e163d Efraim Flashner 2024-07-15gnu: ghq: Update to 1.6.2....* gnu/packages/version-control.scm (ghq): Update to 1.6.2. Change-Id: Ie9b8d82b27364d183ba29c2673a9679cda671568 Sharlatan Hellseher 2024-07-15gnu: packages/golang: Set default go version to 1.21....Golang versions 1.17 (02 Aug 2022), 1.18 (01 Feb 2023), 1.19 (06 Sep 2023) and 1.20 (06 Feb 2024) are EOL <https://endoflife.date/go>. These changes set preferable default version to the minimal currently maintained one e.g. 1.21 * gnu/packages/golang.scm (go): Set default to go-1.21, add annotation for the future maintenance. Remove field <#:go> setting Golang version to go-1.18, go-1.19, 1.20 and 1.21: * gnu/packages/admin.scm * gnu/packages/configuration-management.scm * gnu/packages/databases.scm * gnu/packages/disk.scm * gnu/packages/education.scm * gnu/packages/file-systems.scm * gnu/packages/finance.scm * gnu/packages/golang-check.scm * gnu/packages/golang-crypto.scm * gnu/packages/golang-web.scm * gnu/packages/golang-xyz.scm * gnu/packages/golang.scm * gnu/packages/high-availability.scm * gnu/packages/ipfs.scm * gnu/packages/irc.scm * gnu/packages/messaging.scm * gnu/packages/networking.scm * gnu/packages/syncthing.scm * gnu/packages/textutils.scm * gnu/packages/time.scm * gnu/packages/version-control.scm * gnu/packages/video.scm Change-Id: Ieba6a5d7a18423f838d14c02ad55a2ba9c8559eb Sharlatan Hellseher 2024-06-29gnu: Remove go-golang.org-x-sync-semaphore....* gnu/packages/golang-build.scm (go-golang.org-x-sync-semaphore): Delete variable. * gnu/packages/check.scm (actionlint): Adjust inputs. [inputs]: Remove go-golang.org-x-sync-semaphore. * gnu/packages/version-control.scm (git-lfs): Likewise. [propagated-inputs]: Remove go-golang.org-x-sync-semaphore; add go-golang-org-x-sync. Change-Id: Icf3edfc46696c8b9af79787ff77f7e65852bfef4 Sharlatan Hellseher 2024-06-29gnu: Remove go-golang.org-x-sync-errgroup....* gnu/packages/golang-build.scm (go-golang.org-x-sync-errgroup): Delete variable. * gnu/packages/check.scm (actionlint): Adjust inputs. [inputs]: Remove go-golang.org-x-sync-errgroup; add go-golang-org-x-sync. * gnu/packages/golang.scm (gotestsum): Likewise. [native-inputs]: Remove go-golang.org-x-sync-errgroup; add go-golang-org-x-sync. * gnu/packages/golang.scm (go-github-com-prometheus-procfs): Likewise. [propagated-inputs]: Remove go-golang.org-x-sync-errgroup; add go-golang-org-x-sync. * gnu/packages/terminals.scm (go-github-com-junegunn-fzf): Likewise. [inputs]: Remove go-golang.org-x-sync-errgroup; add go-golang-org-x-sync. * gnu/packages/version-control.scm (ghq): Likewise. [inputs]: Remove go-golang.org-x-sync-errgroup; add go-golang-org-x-sync. Change-Id: If64c30da47ed9cd043798f427f2927b76394f3c4 Sharlatan Hellseher 2024-06-29gnu: Remove go-golang-org-x-net-html....golang.org/x/net is distributed as a single module according to provided go.mod file. This changes remove the last reference to golang.org/x/net/html. * gnu/packages/golang-build.scm (go-golang-org-x-net) [propagated-inputs]: Add go-golang-org-x-sys, go-golang-org-x-term and go-golang-org-x-text. (go-golang-org-x-net-html): Remove variable. * gnu/packages/version-control.scm (ghq) [inputs]: Remove go-golang-org-x-net-html. Add go-golang-org-x-net. * gnu/packages/textutils.scm (vale) [inputs]: Remove go-golang-org-x-net-html. Add go-golang-org-x-net. Change-Id: Ic275f2f7ccd145edfd376d65bd24599a550e849a Sharlatan Hellseher 2024-06-26gnu: git: Update to 2.45.2....* gnu/packages/version-control.scm (git): Update to 2.45.2. Change-Id: I6bcbc5f0f12a50cbfc0fdc51c30b26e765005d28 Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Ashish SHUKLA 2024-06-26Revert "gnu: git: Update to 2.45.2."...This partially reverts commit 26c0ff98cf4302fc69539272d646c0ef28991991, removing some extraneous changes that were added by mistake. This is a followup to commit 26c0ff98cf4302fc69539272d646c0ef28991991 Change-Id: I907cfb98414ec8aeb1bbfc7b1b3d41fd36e8d309 Leo Famulari 2024-06-24gnu: git: Update to 2.45.2....* gnu/packages/version-control.scm (git): Update to 2.45.2. Change-Id: I6bcbc5f0f12a50cbfc0fdc51c30b26e765005d28 Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Ashish SHUKLA 2024-06-24gnu: subversion: Update to 1.14.3....* gnu/packages/version-control.scm (subversion): Update to 1.14.3. Change-Id: I2d94d32065959d0bcf5b17922af2a62e3f743121 Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Andy Tai 2024-06-18gnu: tig: Update package style....* gnu/packages/version-control.scm (tig)[arguments]: Switch to gexps. Move above input fields. Change-Id: I32976ccd3f5602e847b1573695356c7e4e6dd9d7 Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Timotej Lazar 2024-06-18gnu: tig: Update to 2.5.10....* gnu/packages/version-control.scm (tig): Update to 2.5.10. [source]: Switch to git. Drop unbundling snippet. [native-inputs]: Add autoconf, automake, docbook-xsl, libxml2, pkg-config. Change-Id: I79d8239e7d0d83bfef42263718e8d2d3a2c83252 Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Timotej Lazar 2024-06-15gnu: cgit: Update to 1.2.3-4.b2c939a....* gnu/packages/version-control.scm (cgit): Update to 1.2.3-4.b2c939a. Change-Id: Ief3b27a4fc7cfa1d4341b951957d8cd08892696b Signed-off-by: Christopher Baines <mail@cbaines.net> Tomas Volf 2024-05-30gnu: git: Update to 2.45.1 [security fixes]....* gnu/packages/version-control.scm (git): Update to 2.45.1. Change-Id: Ia0634c6b0a4a3b5cc5c584ca064bbeb62b207c3e Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Ashish SHUKLA 2024-05-29gnu: Add libgit2-1.8....* gnu/packages/version-control.scm (libgit2-1.8): New variable. Change-Id: I6400e5699a363ba500d1fa1939fa0e2b7fdac285 Maxim Cournoyer 2024-05-13gnu: cgit: Update to 1.2.3-3.dbadd85....* gnu/packages/version-control.scm (cgit): Update to 1.2.3-3.dbadd85. Change-Id: I41827d1d97f28be71af5532b554d6b7a5e1123cc Signed-off-by: Christopher Baines <mail@cbaines.net> Tomas Volf