2021-02-05 17:12:51 +00:00
|
|
|
{ stdenv, lib, src, pkg-config, tcl, libXft, patches ? []
|
2020-04-24 23:36:52 +00:00
|
|
|
, enableAqua ? stdenv.isDarwin, darwin
|
|
|
|
, ... }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "tk-${tcl.version}";
|
|
|
|
|
|
|
|
inherit src patches;
|
|
|
|
|
|
|
|
outputs = [ "out" "man" "dev" ];
|
|
|
|
|
|
|
|
setOutputFlags = false;
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
configureFlagsArray+=(--mandir=$man/share/man --enable-man-symlinks)
|
|
|
|
cd unix
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
ln -s $out/bin/wish* $out/bin/wish
|
|
|
|
cp ../{unix,generic}/*.h $out/include
|
2020-09-25 04:45:31 +00:00
|
|
|
ln -s $out/lib/libtk${tcl.release}${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libtk${stdenv.hostPlatform.extensions.sharedLibrary}
|
2020-04-24 23:36:52 +00:00
|
|
|
''
|
2021-02-05 17:12:51 +00:00
|
|
|
+ lib.optionalString (stdenv.isDarwin) ''
|
2020-04-24 23:36:52 +00:00
|
|
|
cp ../macosx/*.h $out/include
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-threads"
|
|
|
|
"--with-tcl=${tcl}/lib"
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optional stdenv.is64bit "--enable-64bit"
|
|
|
|
++ lib.optional enableAqua "--enable-aqua";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = lib.optional enableAqua (with darwin.apple_sdk.frameworks; [ Cocoa ]);
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ tcl libXft ];
|
|
|
|
|
|
|
|
doCheck = false; # fails. can't find itself
|
|
|
|
|
|
|
|
inherit tcl;
|
|
|
|
|
|
|
|
passthru = rec {
|
|
|
|
inherit (tcl) release version;
|
|
|
|
libPrefix = "tk${tcl.release}";
|
|
|
|
libdir = "lib/${libPrefix}";
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A widget toolkit that provides a library of basic elements for building a GUI in many different programming languages";
|
|
|
|
homepage = "https://www.tcl.tk/";
|
|
|
|
license = licenses.tcltk;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ lovek323 vrthra ];
|
|
|
|
};
|
|
|
|
}
|