summaryrefslogtreecommitdiff
path: root/guix/import
diff options
context:
space:
mode:
Diffstat (limited to 'guix/import')
-rw-r--r--guix/import/cpan.scm3
-rw-r--r--guix/import/elpa.scm3
-rw-r--r--guix/import/hackage.scm2
-rw-r--r--guix/import/minetest.scm3
-rw-r--r--guix/import/opam.scm10
-rw-r--r--guix/import/stackage.scm2
-rw-r--r--guix/import/texlive.scm55
7 files changed, 46 insertions, 32 deletions
diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index eeb142a9b8..da47018c35 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -28,6 +28,7 @@
#:use-module ((ice-9 rdelim) #:select (read-line))
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
+ #:use-module (srfi srfi-34)
#:use-module (json)
#:use-module (gcrypt hash)
#:use-module (guix diagnostics)
@@ -310,7 +311,7 @@ in RELEASE, a <cpan-release> record."
(define* (latest-release package #:key (version #f))
"Return an <upstream-source> for the latest release of PACKAGE."
(when version
- (error
+ (raise
(formatted-message
(G_ "~a updater doesn't support updating to a specific version, sorry.")
"cpan")))
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index f71e758db4..8ebebcafb3 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -34,6 +34,7 @@
#:use-module (srfi srfi-9 gnu)
#:use-module (srfi srfi-11)
#:use-module (srfi srfi-26)
+ #:use-module (srfi srfi-34)
#:use-module (srfi srfi-35)
#:use-module (guix i18n)
#:use-module (guix diagnostics)
@@ -405,7 +406,7 @@ type '<elpa-package>'."
(define repo (elpa-repository package))
(when version
- (error
+ (raise
(formatted-message
(G_ "~a updater doesn't support updating to a specific version, sorry.")
"elpa")))
diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm
index 83ad85f3fe..56c8696ad7 100644
--- a/guix/import/hackage.scm
+++ b/guix/import/hackage.scm
@@ -356,7 +356,7 @@ respectively."
(define* (latest-release package #:key (version #f))
"Return an <upstream-source> for the latest release of PACKAGE."
(when version
- (error
+ (raise
(formatted-message
(G_ "~a updater doesn't support updating to a specific version, sorry.")
"hackage")))
diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm
index 7e7b6dd6ac..5ea6e023ce 100644
--- a/guix/import/minetest.scm
+++ b/guix/import/minetest.scm
@@ -22,6 +22,7 @@
#:use-module (ice-9 threads)
#:use-module (ice-9 hash-table)
#:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-34)
#:use-module (guix diagnostics)
#:use-module ((guix packages) #:prefix package:)
#:use-module (guix upstream)
@@ -492,7 +493,7 @@ or #false if the latest release couldn't be determined."
(define source (package:package-source pkg))
(when version
- (error
+ (raise
(formatted-message
(G_ "~a updater doesn't support updating to a specific version, sorry.")
"minetest")))
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index e336936306..e67146e593 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -29,6 +29,7 @@
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-2)
#:use-module ((srfi srfi-26) #:select (cut))
+ #:use-module (srfi srfi-34)
#:use-module ((web uri) #:select (string->uri uri->string))
#:use-module ((guix build utils) #:select (dump-port find-files mkdir-p))
#:use-module (guix build-system)
@@ -335,10 +336,9 @@ path to the repository."
(sha256 (base32 ,(guix-hash-url temp)))))))
'no-source-information)))
-(define* (opam->guix-package name #:key (repo 'opam) version #:allow-other-keys)
- "Import OPAM package NAME from REPOSITORY (a directory name) or, if
-REPOSITORY is #f, from the official OPAM repository. Return a 'package' sexp
-or #f on failure."
+(define* (opam->guix-package name #:key (repo '("opam")) version #:allow-other-keys)
+ "Import OPAM package NAME from REPO, a list of repository names, URLs, or
+file names. Return a 'package' sexp or #f on failure."
(and-let* ((with-opam (if (member "opam" repo) repo (cons "opam" repo)))
(opam-file (opam-fetch name with-opam))
(version (assoc-ref opam-file "version"))
@@ -417,7 +417,7 @@ package in OPAM."
(define* (latest-release package #:key (version #f))
"Return an <upstream-source> for the latest release of PACKAGE."
(when version
- (error
+ (raise
(formatted-message
(G_ "~a updater doesn't support updating to a specific version, sorry.")
"opam")))
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index 735eeb75f7..f98b86c334 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -145,7 +145,7 @@ included in the Stackage LTS release."
"Return an <upstream-source> for the latest Stackage LTS release of
PACKAGE or #f if the package is not included in the Stackage LTS release."
(when version
- (error
+ (raise
(formatted-message
(G_ "~a updater doesn't support updating to a specific version, sorry.")
"stackage")))
diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm
index 82014ee568..086cd363a9 100644
--- a/guix/import/texlive.scm
+++ b/guix/import/texlive.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2021, 2022 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2017, 2021, 2022, 2023 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
@@ -246,11 +246,15 @@ of those files are returned that are unexpectedly installed."
(define (tlpdb->package name version package-database)
(and-let* ((data (assoc-ref package-database name))
(dirs (files->directories
- (map (lambda (dir)
- (string-drop dir (string-length "texmf-dist/")))
- (append (or (assoc-ref data 'docfiles) (list))
- (or (assoc-ref data 'runfiles) (list))
- (or (assoc-ref data 'srcfiles) (list))))))
+ (filter-map (lambda (dir)
+ ;; Ignore any file not starting with the
+ ;; expected prefix. Nothing good can come
+ ;; from this.
+ (and (string-prefix? "texmf-dist/" dir)
+ (string-drop dir (string-length "texmf-dist/"))))
+ (append (or (assoc-ref data 'docfiles) (list))
+ (or (assoc-ref data 'runfiles) (list))
+ (or (assoc-ref data 'srcfiles) (list))))))
(name (guix-name name))
;; TODO: we're ignoring the VERSION argument because that
;; information is distributed across %texlive-tag and
@@ -260,6 +264,12 @@ of those files are returned that are unexpectedly installed."
%texlive-tag "/Master/texmf-dist"))
(locations dirs)
(revision %texlive-revision)))
+ ;; Ignore arch-dependent packages.
+ (filtered-depends
+ (or (and=> (assoc-ref data 'depend)
+ (lambda (inputs)
+ (remove (cut string-suffix? ".ARCH" <>) inputs)))
+ '()))
(source (with-store store
(download-multi-svn-to-store
store ref (string-append name "-svn-multi-checkout")))))
@@ -278,24 +288,25 @@ of those files are returned that are unexpectedly installed."
;; package->definition in (guix import utils) expects to see a
;; version field.
(version ,version)
- ,@(or (and=> (assoc-ref data 'depend)
- (lambda (inputs)
- `((propagated-inputs
- (list ,@(map (lambda (tex-name)
- (let ((name (guix-name tex-name)))
- (string->symbol name)))
- inputs))))))
- '())
- ,@(or (and=> (assoc-ref data 'catalogue-ctan)
- (lambda (url)
- `((home-page ,(string-append "https://ctan.org" url)))))
+ ,@(match filtered-depends
+ (() '())
+ (inputs
+ `((propagated-inputs
+ (list ,@(map
+ (lambda (tex-name)
+ (let ((name (guix-name tex-name)))
+ (string->symbol name)))
+ inputs))))))
+ ,@(or (and=> (assoc-ref data 'name)
+ (lambda (name)
+ `((home-page ,(string-append "https://ctan.org/pkg/"
+ name)))))
'((home-page "https://www.tug.org/texlive/")))
(synopsis ,(assoc-ref data 'shortdesc))
- (description ,(beautify-description
- (assoc-ref data 'longdesc)))
- (license ,(string->license
- (assoc-ref data 'catalogue-license))))
- (or (assoc-ref data 'depend) (list)))))
+ (description ,(and=> (assoc-ref data 'longdesc) beautify-description))
+ (license ,(and=> (assoc-ref data 'catalogue-license)
+ string->license)))
+ filtered-depends)))
(define texlive->guix-package
(memoize