texlive-new: Export source tarballs via an attribute
This allows them to be found by find-tarballs.nix (which can only see fetchurl dependencies if they are attributes, not if they're part of a string context).
This commit is contained in:
parent
ec198e3868
commit
be8fc33164
@ -114,11 +114,15 @@ let
|
|||||||
("${mirror}/pub/tex/historic/systems/texlive/${bin.texliveYear}/tlnet-final/archive");
|
("${mirror}/pub/tex/historic/systems/texlive/${bin.texliveYear}/tlnet-final/archive");
|
||||||
# beware: standard mirrors http://mirror.ctan.org/ don't have releases
|
# beware: standard mirrors http://mirror.ctan.org/ don't have releases
|
||||||
mirror = "http://ftp.math.utah.edu"; # ftp://tug.ctan.org no longer works, although same IP
|
mirror = "http://ftp.math.utah.edu"; # ftp://tug.ctan.org no longer works, although same IP
|
||||||
in ''
|
in
|
||||||
tar -xf '${ fetchurl { inherit url md5; } }' \
|
rec {
|
||||||
|
src = fetchurl { inherit url md5; };
|
||||||
|
unpackCmd = ''
|
||||||
|
tar -xf '${src}' \
|
||||||
'--strip-components=${toString stripPrefix}' \
|
'--strip-components=${toString stripPrefix}' \
|
||||||
-C "$out" --anchored --exclude=tlpkg --keep-old-files
|
-C "$out" --anchored --exclude=tlpkg --keep-old-files
|
||||||
'' + postUnpack;
|
'' + postUnpack;
|
||||||
|
};
|
||||||
|
|
||||||
# create a derivation that contains unpacked upstream TL packages
|
# create a derivation that contains unpacked upstream TL packages
|
||||||
mkPkgs = { pname, tlType, version, pkgList }@args:
|
mkPkgs = { pname, tlType, version, pkgList }@args:
|
||||||
@ -129,10 +133,14 @@ let
|
|||||||
let
|
let
|
||||||
tlName = "${mkUrlName args}-${version}";
|
tlName = "${mkUrlName args}-${version}";
|
||||||
fixedHash = fixedHashes.${tlName} or null; # be graceful about missing hashes
|
fixedHash = fixedHashes.${tlName} or null; # be graceful about missing hashes
|
||||||
|
pkgs = map unpackPkg (fastUnique (a: b: a.md5 < b.md5) pkgList);
|
||||||
in runCommand "texlive-${tlName}"
|
in runCommand "texlive-${tlName}"
|
||||||
( { # lots of derivations, not meant to be cached
|
( { # lots of derivations, not meant to be cached
|
||||||
preferLocalBuild = true; allowSubstitutes = false;
|
preferLocalBuild = true; allowSubstitutes = false;
|
||||||
passthru = { inherit pname tlType version; };
|
passthru = {
|
||||||
|
inherit pname tlType version;
|
||||||
|
srcs = map (pkg: pkg.src) pkgs;
|
||||||
|
};
|
||||||
} // lib.optionalAttrs (fixedHash != null) {
|
} // lib.optionalAttrs (fixedHash != null) {
|
||||||
outputHash = fixedHash;
|
outputHash = fixedHash;
|
||||||
outputHashAlgo = "sha1";
|
outputHashAlgo = "sha1";
|
||||||
@ -141,7 +149,7 @@ let
|
|||||||
)
|
)
|
||||||
( ''
|
( ''
|
||||||
mkdir "$out"
|
mkdir "$out"
|
||||||
'' + lib.concatMapStrings unpackPkg (fastUnique (a: b: a.md5 < b.md5) pkgList)
|
'' + lib.concatMapStrings (pkg: pkg.unpackCmd) pkgs
|
||||||
);
|
);
|
||||||
|
|
||||||
# combine a set of TL packages into a single TL meta-package
|
# combine a set of TL packages into a single TL meta-package
|
||||||
|
Loading…
Reference in New Issue
Block a user