From 3aeca58073eff8b7a835f6492e735dd152d9dc99 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 19 Jun 2023 14:43:56 +0200 Subject: [PATCH] gnu: biber -> texlive-biber. Build from sources provided by TeX Live distribution, so they always match BibLaTeX version. * gnu/packages/patches/biber-adapt-perl-5.36.patch: Delete file. * gnu/local.mk: Apply removal. * gnu/packages/tex.scm (texlive-biber): New variable. (biber): Deprecate variable. (perl-text-bibtex): Move from here... * gnu/packages/perl.scm (perl-text-bibtex): ... to here. --- gnu/local.mk | 1 - .../patches/biber-adapt-perl-5.36.patch | 40 ------ gnu/packages/perl.scm | 40 ++++++ gnu/packages/tex.scm | 136 +++++++----------- 4 files changed, 95 insertions(+), 122 deletions(-) delete mode 100644 gnu/packages/patches/biber-adapt-perl-5.36.patch diff --git a/gnu/local.mk b/gnu/local.mk index a56864be86..f2ef72c10a 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -957,7 +957,6 @@ dist_patch_DATA = \ %D%/packages/patches/bsd-games-stdio.h.patch \ %D%/packages/patches/beancount-disable-googleapis-fonts.patch \ %D%/packages/patches/beignet-correct-file-names.patch \ - %D%/packages/patches/biber-adapt-perl-5.36.patch \ %D%/packages/patches/bidiv-update-fribidi.patch \ %D%/packages/patches/binutils-boot-2.20.1a.patch \ %D%/packages/patches/binutils-loongson-workaround.patch \ diff --git a/gnu/packages/patches/biber-adapt-perl-5.36.patch b/gnu/packages/patches/biber-adapt-perl-5.36.patch deleted file mode 100644 index 895813c1f2..0000000000 --- a/gnu/packages/patches/biber-adapt-perl-5.36.patch +++ /dev/null @@ -1,40 +0,0 @@ -From d9e961710074d266ad6bdf395c98868d91952088 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= -Date: Wed, 25 May 2022 12:41:59 +0200 -Subject: [PATCH] Adapt to Perl 5.36 - -A developmental release of Perl 5.36.0 fails to run tests with: - - $ perl -Ilib t/basic-misc.t - 1..72 - Can't modify undef operator in scalar assignment at lib/Biber/Section.pm line 433, near "undef;" - Compilation failed in require at lib/Biber.pm line 24. - BEGIN failed--compilation aborted at lib/Biber.pm line 24. - Compilation failed in require at t/basic-misc.t line 11. - BEGIN failed--compilation aborted at t/basic-misc.t line 11. - # Looks like your test exited with 255 before it could output anything. - -This is because of a missing semicolon between commands in -del_everykeys(). The new perl is more strict and raises a compile-time -error: - - $ perl -e '$a = undef $b = undef;' - Can't modify undef operator in scalar assignment at -e line 1, near "undef;" - Execution of -e aborted due to compilation errors. ---- - lib/Biber/Section.pm | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/Biber/Section.pm b/lib/Biber/Section.pm -index 03ed69a51..a78942f57 100644 ---- a/lib/Biber/Section.pm -+++ b/lib/Biber/Section.pm -@@ -429,7 +429,7 @@ sub add_everykey { - - sub del_everykeys { - my $self = shift; -- $self->{everykey} = undef -+ $self->{everykey} = undef; - $self->{everykey_lc} = undef; - return; - } diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 13bf3fa84c..57852a3cee 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -10631,6 +10631,46 @@ (define-public perl-text-balanced text sequences from strings.") (license (package-license perl)))) +(define-public perl-text-bibtex + (package + (name "perl-text-bibtex") + (version "0.88") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/A/AM/AMBS/Text-BibTeX-" + version ".tar.gz")) + (sha256 + (base32 + "0b7lmjvfmypps1nw6nsdikgaakm0n0g4186glaqazg5xd1p5h55h")))) + (build-system perl-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'add-output-directory-to-rpath + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "inc/MyBuilder.pm" + (("-Lbtparse" line) + (string-append "-Wl,-rpath=" + (assoc-ref outputs "out") "/lib " line))) + #t)) + (add-after 'unpack 'install-libraries-to-/lib + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "Build.PL" + (("lib64") "lib")) + #t))))) + (native-inputs + (list perl-capture-tiny perl-config-autoconf perl-extutils-libbuilder + perl-module-build)) + (home-page "https://metacpan.org/release/Text-BibTeX") + (synopsis "Interface to read and parse BibTeX files") + (description "@code{Text::BibTeX} is a Perl library for reading, parsing, +and processing BibTeX files. @code{Text::BibTeX} gives you access to the data +at many different levels: you may work with BibTeX entries as simple field to +string mappings, or get at the original form of the data as a list of simple +values (strings, macros, or numbers) pasted together.") + (license license:perl-license))) + (define-public perl-text-charwidth (package (name "perl-text-charwidth") diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index 30ce70619b..bd81c33bee 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -9515,78 +9515,56 @@ (define-public texlive (license (license:fsf-free "https://www.tug.org/texlive/copying.html")) (home-page "https://www.tug.org/texlive/"))) -(define-public perl-text-bibtex +(define-public texlive-biber (package - (name "perl-text-bibtex") - (version "0.88") - (source - (origin - (method url-fetch) - (uri (string-append "mirror://cpan/authors/id/A/AM/AMBS/Text-BibTeX-" - version ".tar.gz")) - (sha256 - (base32 - "0b7lmjvfmypps1nw6nsdikgaakm0n0g4186glaqazg5xd1p5h55h")))) - (build-system perl-build-system) + (name "texlive-biber") + (version (number->string %texlive-revision)) + (source (texlive-origin + name version + (list "doc/bibtex/biber/" "source/bibtex/biber/") + (base32 + "0i1hqr9zb7b9d1zjlyg4awa6mkyq6wnrb6z4689j1rg07vnbd7mw"))) + (outputs '("out" "doc")) + (build-system texlive-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'add-output-directory-to-rpath - (lambda* (#:key outputs #:allow-other-keys) - (substitute* "inc/MyBuilder.pm" - (("-Lbtparse" line) - (string-append "-Wl,-rpath=" - (assoc-ref outputs "out") "/lib " line))) - #t)) - (add-after 'unpack 'install-libraries-to-/lib - (lambda* (#:key outputs #:allow-other-keys) - (substitute* "Build.PL" - (("lib64") "lib")) - #t))))) + (list + #:tests? #true + #:imported-modules `(,@%texlive-build-system-modules + (guix build perl-build-system)) + #:modules '((guix build texlive-build-system) + ((guix build perl-build-system) #:prefix perl:) + (guix build utils)) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-biber-source + (lambda _ + (mkdir-p "build") + (with-directory-excursion "build" + (invoke "tar" "xvf" + "../source/bibtex/biber/biblatex-biber.tar.gz" + "--strip-components=1")))) + (add-after 'unpack-biber-source 'build-biber + (lambda args + (with-directory-excursion "build" + (for-each (lambda (phase) + (apply (assoc-ref perl:%standard-phases phase) args)) + '(configure build check install))))) + (add-after 'install 'wrap-programs + (lambda _ + (let ((perl5lib (getenv "PERL5LIB"))) + (wrap-program (string-append #$output "/bin/biber") + `("PERL5LIB" ":" prefix + (,(string-append perl5lib ":" + #$output "/lib/perl5/site_perl")))))))))) (native-inputs - (list perl-capture-tiny perl-config-autoconf perl-extutils-libbuilder - perl-module-build)) - (home-page "https://metacpan.org/release/Text-BibTeX") - (synopsis "Interface to read and parse BibTeX files") - (description "@code{Text::BibTeX} is a Perl library for reading, parsing, -and processing BibTeX files. @code{Text::BibTeX} gives you access to the data -at many different levels: you may work with BibTeX entries as simple field to -string mappings, or get at the original form of the data as a list of simple -values (strings, macros, or numbers) pasted together.") - (license license:perl-license))) - -(define-public biber - (package - ;; Note: When updating Biber, make sure it matches our BibLaTeX version by - ;; checking the Biber/BibLaTeX compatibility matrix in the BibLaTeX manual - ;; at . - (name "biber") - (version "2.16") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/plk/biber/") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "0586q8y1f2k23mvb02ccm3qsb35cwskafksixsjaih7a7xcf5gxx")) - (patches (search-patches "biber-adapt-perl-5.36.patch")))) - (build-system perl-build-system) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'install 'wrap-programs - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (perl5lib (getenv "PERL5LIB"))) - (wrap-program (string-append out "/bin/biber") - `("PERL5LIB" ":" prefix - (,(string-append perl5lib ":" out - "/lib/perl5/site_perl"))))) - #t))))) + (list perl-config-autoconf + perl-extutils-libbuilder + perl-file-which + perl-module-build + perl-test-differences)) (inputs - (list perl-autovivification + (list perl + perl-autovivification perl-class-accessor perl-data-dump perl-data-compare @@ -9625,19 +9603,15 @@ (define-public biber perl-business-issn perl-business-ismn perl-lingua-translit)) - (native-inputs - `(("perl-config-autoconf" ,perl-config-autoconf) - ("perl-extutils-libbuilder" ,perl-extutils-libbuilder) - ("perl-module-build" ,perl-module-build) - ;; for tests - ("perl-file-which" ,perl-file-which) - ("perl-test-more" ,perl-test-most) ; FIXME: "more" would be sufficient - ("perl-test-differences" ,perl-test-differences))) - (home-page "https://biblatex-biber.sourceforge.net/") - (synopsis "Backend for the BibLaTeX citation management tool") - (description "Biber is a BibTeX replacement for users of biblatex. Among -other things it comes with full Unicode support.") - (license license:artistic2.0))) + (home-page "https://ctan.org/pkg/biber") + (synopsis "BibTeX replacement for users of BibLaTeX") + (description + "Biber is a BibTeX replacement for users of BibLaTeX. It supports full +UTF-8, can (re)-encode input and output, supports highly configurable sorting, +dynamic bibliography sets and many other features.") + (license license:gpl3+))) + +(define-deprecated-package biber texlive-biber) (define-public rubber (package