nixpkgs/pkgs/development/libraries/tk/generic.nix
Jörg Thalheim 5356420466 treewide: remove unused with statements from maintainer lists
$ find -type f -name '*.nix' -print0 | xargs -P "$(nproc)" -0 sed -i \
  -e 's!with lib.maintainers; \[ *\];![ ];!' \
  -e 's!with maintainers; \[ *\];![ ];!'
2024-07-29 10:06:20 +08:00

75 lines
2.0 KiB
Nix

{ stdenv, lib, src, pkg-config, tcl, libXft, patches ? []
, enableAqua ? stdenv.isDarwin, darwin
, ... }:
tcl.mkTclDerivation {
pname = "tk";
version = tcl.version;
inherit src patches;
outputs = [ "out" "man" "dev" ];
setOutputFlags = false;
preConfigure = ''
configureFlagsArray+=(--mandir=$man/share/man --enable-man-symlinks)
cd unix
'';
postPatch = ''
for file in $(find library/demos/. -type f ! -name "*.*"); do
substituteInPlace $file --replace "exec wish" "exec $out/bin/wish"
done
''
+ lib.optionalString (stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "11") ''
substituteInPlace unix/configure* \
--replace " -framework UniformTypeIdentifiers" ""
'';
postInstall = ''
ln -s $out/bin/wish* $out/bin/wish
cp ../{unix,generic}/*.h $out/include
ln -s $out/lib/libtk${tcl.release}${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libtk${stdenv.hostPlatform.extensions.sharedLibrary}
''
+ lib.optionalString (stdenv.isDarwin) ''
cp ../macosx/*.h $out/include
'';
configureFlags = [
"--enable-threads"
] ++ lib.optional stdenv.is64bit "--enable-64bit"
++ lib.optional enableAqua "--enable-aqua";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ ];
propagatedBuildInputs = [
libXft
] ++ lib.optionals enableAqua ([
darwin.apple_sdk.frameworks.Cocoa
] ++ lib.optionals (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") [
darwin.apple_sdk.frameworks.UniformTypeIdentifiers
]);
enableParallelBuilding = true;
doCheck = false; # fails. can't find itself
inherit tcl;
passthru = rec {
inherit (tcl) release version;
libPrefix = "tk${tcl.release}";
libdir = "lib/${libPrefix}";
};
meta = with lib; {
description = "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 = [ ];
};
}