depot/third_party/nixpkgs/pkgs/development/interpreters/tcl/generic.nix
Default email 841d9c7fc1 Project import generated by Copybara.
GitOrigin-RevId: 3a8d7958a610cd3fec3a6f424480f91a1b259185
2021-06-29 00:13:55 +01:00

67 lines
1.8 KiB
Nix

{ lib, stdenv, callPackage, makeSetupHook, makeWrapper
# Version specific stuff
, release, version, src
, ...
}:
let
baseInterp =
stdenv.mkDerivation {
pname = "tcl";
inherit version src;
outputs = [ "out" "man" ];
setOutputFlags = false;
preConfigure = ''
cd unix
'';
configureFlags = [
"--enable-threads"
# Note: using $out instead of $man to prevent a runtime dependency on $man.
"--mandir=${placeholder "out"}/share/man"
"--enable-man-symlinks"
# Don't install tzdata because NixOS already has a more up-to-date copy.
"--with-tzdata=no"
"tcl_cv_strtod_unbroken=ok"
] ++ lib.optional stdenv.is64bit "--enable-64bit";
enableParallelBuilding = true;
postInstall = let
dllExtension = stdenv.hostPlatform.extensions.sharedLibrary;
in ''
make install-private-headers
ln -s $out/bin/tclsh${release} $out/bin/tclsh
ln -s $out/lib/libtcl${release}${dllExtension} $out/lib/libtcl${dllExtension}
'';
meta = with lib; {
description = "The Tcl scripting language";
homepage = "https://www.tcl.tk/";
license = licenses.tcltk;
platforms = platforms.all;
maintainers = with maintainers; [ agbrooks ];
};
passthru = rec {
inherit release version;
libPrefix = "tcl${release}";
libdir = "lib/${libPrefix}";
tclPackageHook = callPackage ({}: makeSetupHook {
name = "tcl-package-hook";
deps = [ makeWrapper ];
} ./tcl-package-hook.sh) {};
};
};
mkTclDerivation = callPackage ./mk-tcl-derivation.nix { tcl = baseInterp; };
in baseInterp.overrideAttrs (self: {
passthru = self.passthru // {
inherit mkTclDerivation;
};
})