nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, callPackage, makeSetupHook
2
3# Version specific stuff
4, release, version, src
5, ...
6}:
7
8let
9 baseInterp =
10 stdenv.mkDerivation {
11 pname = "tcl";
12 inherit version src;
13
14 outputs = [ "out" "man" ];
15
16 setOutputFlags = false;
17
18 preConfigure = ''
19 cd unix
20 '';
21
22 configureFlags = [
23 "--enable-threads"
24 # Note: using $out instead of $man to prevent a runtime dependency on $man.
25 "--mandir=${placeholder "out"}/share/man"
26 "--enable-man-symlinks"
27 # Don't install tzdata because NixOS already has a more up-to-date copy.
28 "--with-tzdata=no"
29 "tcl_cv_strtod_unbroken=ok"
30 ] ++ lib.optional stdenv.is64bit "--enable-64bit";
31
32 enableParallelBuilding = true;
33
34 postInstall = let
35 dllExtension = stdenv.hostPlatform.extensions.sharedLibrary;
36 in ''
37 make install-private-headers
38 ln -s $out/bin/tclsh${release} $out/bin/tclsh
39 ln -s $out/lib/libtcl${release}${dllExtension} $out/lib/libtcl${dllExtension}
40 '';
41
42 meta = with lib; {
43 description = "The Tcl scripting language";
44 homepage = "https://www.tcl.tk/";
45 license = licenses.tcltk;
46 platforms = platforms.all;
47 maintainers = with maintainers; [ agbrooks ];
48 };
49
50 passthru = rec {
51 inherit release version;
52 libPrefix = "tcl${release}";
53 libdir = "lib/${libPrefix}";
54 tclPackageHook = callPackage ({ buildPackages }: makeSetupHook {
55 name = "tcl-package-hook";
56 propagatedBuildInputs = [ buildPackages.makeWrapper ];
57 } ./tcl-package-hook.sh) {};
58 };
59 };
60
61 mkTclDerivation = callPackage ./mk-tcl-derivation.nix { tcl = baseInterp; };
62
63in baseInterp.overrideAttrs (self: {
64 passthru = self.passthru // {
65 inherit mkTclDerivation;
66 };
67})