nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, lib, src, pkgconfig, tcl, libXft, patches ? []
2, enableAqua ? stdenv.isDarwin, darwin
3, ... }:
4
5stdenv.mkDerivation {
6 name = "tk-${tcl.version}";
7
8 inherit src patches;
9
10 outputs = [ "out" "man" "dev" ];
11
12 setOutputFlags = false;
13
14 preConfigure = ''
15 configureFlagsArray+=(--mandir=$man/share/man --enable-man-symlinks)
16 cd unix
17 '';
18
19 postInstall = ''
20 ln -s $out/bin/wish* $out/bin/wish
21 cp ../{unix,generic}/*.h $out/include
22 ln -s $out/lib/libtk${tcl.release}${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libtk${stdenv.hostPlatform.extensions.sharedLibrary}
23 ''
24 + stdenv.lib.optionalString (stdenv.isDarwin) ''
25 cp ../macosx/*.h $out/include
26 '';
27
28 configureFlags = [
29 "--enable-threads"
30 "--with-tcl=${tcl}/lib"
31 ] ++ stdenv.lib.optional stdenv.is64bit "--enable-64bit"
32 ++ stdenv.lib.optional enableAqua "--enable-aqua";
33
34 nativeBuildInputs = [ pkgconfig ];
35 buildInputs = lib.optional enableAqua (with darwin.apple_sdk.frameworks; [ Cocoa ]);
36
37 propagatedBuildInputs = [ tcl libXft ];
38
39 doCheck = false; # fails. can't find itself
40
41 inherit tcl;
42
43 passthru = rec {
44 inherit (tcl) release version;
45 libPrefix = "tk${tcl.release}";
46 libdir = "lib/${libPrefix}";
47 };
48
49 meta = with stdenv.lib; {
50 description = "A widget toolkit that provides a library of basic elements for building a GUI in many different programming languages";
51 homepage = "https://www.tcl.tk/";
52 license = licenses.tcltk;
53 platforms = platforms.all;
54 maintainers = with maintainers; [ lovek323 vrthra ];
55 };
56}