1 # Generic builder for tcl packages/applications, generally based on mk-python-derivation.nix
10 , nativeBuildInputs ? []
11 , propagatedBuildInputs ? []
13 , nativeCheckInputs ? []
15 # true if we should skip the configuration phase altogether
16 , dontConfigure ? false
18 # Extra flags passed to configure step
21 # Whether or not we should add common Tcl-related configure flags
22 , addTclConfigureFlags ? true
31 inherit (lib) getBin optionalAttrs;
33 defaultTclPkgConfigureFlags = [
34 "--with-tcl=${tcl}/lib"
35 "--with-tclinclude=${tcl}/include"
36 "--exec-prefix=${placeholder "out"}"
39 self = (stdenv.mkDerivation ((builtins.removeAttrs attrs [
40 "addTclConfigureFlags" "checkPhase" "checkInputs" "nativeCheckInputs" "doCheck"
43 buildInputs = buildInputs ++ [ tcl.tclPackageHook ];
44 nativeBuildInputs = nativeBuildInputs ++ [ makeWrapper tcl ];
45 propagatedBuildInputs = propagatedBuildInputs ++ [ tcl ];
47 TCLSH = "${getBin tcl}/bin/tclsh";
49 # Run tests after install, at which point we've done all TCLLIBPATH setup
51 doInstallCheck = attrs.doCheck or (attrs.doInstallCheck or false);
52 installCheckInputs = checkInputs ++ (attrs.installCheckInputs or []);
53 nativeInstallCheckInputs = nativeCheckInputs ++ (attrs.nativeInstallCheckInputs or []);
55 # Add typical values expected by TEA for configureFlags
57 if (!dontConfigure && addTclConfigureFlags)
58 then (configureFlags ++ defaultTclPkgConfigureFlags)
62 platforms = tcl.meta.platforms;
66 } // optionalAttrs (attrs?checkPhase) {
67 installCheckPhase = attrs.checkPhase;
71 in lib.extendDerivation true passthru self