about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/interpreters/tcl/generic.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/interpreters/tcl/generic.nix')
-rw-r--r--nixpkgs/pkgs/development/interpreters/tcl/generic.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/interpreters/tcl/generic.nix b/nixpkgs/pkgs/development/interpreters/tcl/generic.nix
new file mode 100644
index 000000000000..9aaf8223837d
--- /dev/null
+++ b/nixpkgs/pkgs/development/interpreters/tcl/generic.nix
@@ -0,0 +1,55 @@
+{ stdenv
+
+# Version specific stuff
+, release, version, src
+, ...
+}:
+
+stdenv.mkDerivation {
+  pname = "tcl";
+  inherit version;
+
+  inherit 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"
+  ] ++ stdenv.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 stdenv.lib; {
+    description = "The Tcl scripting language";
+    homepage = "https://www.tcl.tk/";
+    license = licenses.tcltk;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ vrthra ];
+  };
+
+  passthru = rec {
+    inherit release version;
+    libPrefix = "tcl${release}";
+    libdir = "lib/${libPrefix}";
+  };
+}