From 1729f37d2b44677d8379802f4230e3349a88357b Mon Sep 17 00:00:00 2001 From: Vincenzo Mantova <1962985+xworld21@users.noreply.github.com> Date: Mon, 14 Aug 2023 13:14:11 +0100 Subject: [PATCH] biber-ms: init --- pkgs/tools/typesetting/biber-ms/default.nix | 55 +++++++++++++++++++ pkgs/tools/typesetting/tex/texlive/bin.nix | 2 + .../tools/typesetting/tex/texlive/default.nix | 3 +- pkgs/top-level/all-packages.nix | 2 + 4 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 pkgs/tools/typesetting/biber-ms/default.nix diff --git a/pkgs/tools/typesetting/biber-ms/default.nix b/pkgs/tools/typesetting/biber-ms/default.nix new file mode 100644 index 000000000000..53bd708c23bd --- /dev/null +++ b/pkgs/tools/typesetting/biber-ms/default.nix @@ -0,0 +1,55 @@ +{ lib, stdenv, fetchFromGitHub, fetchurl, perlPackages, shortenPerlShebang, texlive }: + +let + biberSource = lib.head (builtins.filter (p: p.tlType == "source") texlive.biber-ms.pkgs); + # missing test file + multiscriptBltxml = (fetchFromGitHub { + owner = "plk"; + repo = "biber"; + rev = "e8d056433063add7800f24589de76f89c4b64c20"; + hash = "sha256-QnN6Iyw6iOjfTX7DLVptsfAO/QNn9vOIk5IZlI15EvQ="; + }) + "/t/tdata/multiscript.bltxml"; +in + +perlPackages.buildPerlModule { + pname = "biber-ms"; + inherit (biberSource) version; + + src = "${biberSource}/source/bibtex/biber-ms/biblatex-biber-ms.tar.gz"; + + # from META.json + # (aliases in /* */ are replaced by the actual dependencies to prevent + # evaluation errors with config.allowAliases = false) + buildInputs = with perlPackages; [ + # build deps + ConfigAutoConf ExtUtilsLibBuilder FileWhich TestDifferences + /*TestMore=TestSimple=null*/ + # runtime deps + BusinessISBN BusinessISMN BusinessISSN ClassAccessor DataCompare DataDump + DataUniqid DateTimeCalendarJulian DateTimeFormatBuilder EncodeEUCJPASCII + EncodeHanExtra EncodeJIS2K EncodeLocale FileSlurper IOString IPCRun3 + LWPProtocolHttps LWP/*LWPUserAgent*/ libwwwperl LinguaTranslit ListAllUtils + ListMoreUtils ListMoreUtilsXS LogLog4perl MozillaCA ParseRecDescent + PerlIOutf8_strict RegexpCommon SortKey TextBalanced TextBibTeX TextCSV + TextCSV_XS TextRoman URI UnicodeLineBreak XMLLibXML XMLLibXMLSimple + XMLLibXSLT XMLWriter autovivification + ]; + nativeBuildInputs = lib.optional stdenv.isDarwin shortenPerlShebang; + + preConfigure = '' + cp '${multiscriptBltxml}' t/tdata/multiscript.bltxml + ''; + + postInstall = '' + mv "$out"/bin/biber{,-ms} + '' + lib.optionalString stdenv.isDarwin '' + shortenPerlShebang "$out"/bin/biber-ms + ''; + + meta = with lib; { + description = "Backend for BibLaTeX (multiscript version)"; + license = biberSource.meta.license; + platforms = platforms.unix; + maintainers = [ maintainers.xworld21 ]; + }; +} diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index 21e916f66429..0df36335311c 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -6,6 +6,7 @@ , libpaper, graphite2, zziplib, harfbuzz, potrace, gmp, mpfr , brotli, cairo, pixman, xorg, clisp, biber, woff2, xxHash , makeWrapper, shortenPerlShebang, useFixedHashes, asymptote +, biber-ms }: # Useful resource covering build options: @@ -427,6 +428,7 @@ pygmentex = python3Packages.buildPythonApplication rec { inherit asymptote; inherit biber; +inherit biber-ms; bibtexu = bibtex8; bibtex8 = stdenv.mkDerivation { pname = "texlive-bibtex-x.bin"; diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix index 8dff1469a90d..d6a801afb020 100644 --- a/pkgs/tools/typesetting/tex/texlive/default.nix +++ b/pkgs/tools/typesetting/tex/texlive/default.nix @@ -7,7 +7,7 @@ , makeWrapper , python3, ruby, perl, tk, jdk, bash, snobol4 , coreutils, findutils, gawk, getopt, gnugrep, gnumake, gnused, gzip, ncurses, zip -, libfaketime, asymptote, makeFontsConf +, libfaketime, asymptote, biber-ms, makeFontsConf , useFixedHashes ? true , recurseIntoAttrs }: @@ -125,7 +125,6 @@ let # TODO patch the scripts from bin.* directly in bin.* instead of here # TODO we do not build binaries for the following packages (yet!) - biber-ms.binfiles = []; xpdfopen.binfiles = []; # mptopdf is a format link, but not generated by texlinks diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9942cd0dc795..7c032c2b41dd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6516,6 +6516,8 @@ with pkgs; biber = callPackage ../tools/typesetting/biber { }; + biber-ms = callPackage ../tools/typesetting/biber-ms { }; + biblatex-check = callPackage ../tools/typesetting/biblatex-check { }; binlore = callPackage ../development/tools/analysis/binlore { };