about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/tk
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/tk
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/tk')
-rw-r--r--nixpkgs/pkgs/development/libraries/tk/8.5.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/tk/8.6.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/tk/Fix-bad-install_name-for-libtk8.6.dylib.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/tk/different-prefix-with-tcl.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/tk/generic.nix51
5 files changed, 127 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/tk/8.5.nix b/nixpkgs/pkgs/development/libraries/tk/8.5.nix
new file mode 100644
index 000000000000..141f6da14ce4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tk/8.5.nix
@@ -0,0 +1,10 @@
+{ callPackage, fetchurl, tcl, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+
+  src = fetchurl {
+    url = "mirror://sourceforge/tcl/tk${tcl.version}-src.tar.gz";
+    sha256 = "0an3wqkjzlyyq6l9l3nawz76axsrsppbyylx0zk9lkv7llrala03";
+  };
+
+})
diff --git a/nixpkgs/pkgs/development/libraries/tk/8.6.nix b/nixpkgs/pkgs/development/libraries/tk/8.6.nix
new file mode 100644
index 000000000000..cd8d42faa914
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tk/8.6.nix
@@ -0,0 +1,12 @@
+{ callPackage, fetchurl, tcl, stdenv, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+
+  src = fetchurl {
+    url = "mirror://sourceforge/tcl/tk${tcl.version}-src.tar.gz";
+    sha256 = "17diivcfcwdhp4v5zi6j9nkxncccjqkivhp363c4wx5lf4d3fb6n";
+  };
+
+  patches = [ ./different-prefix-with-tcl.patch ] ++ stdenv.lib.optionals stdenv.isDarwin [ ./Fix-bad-install_name-for-libtk8.6.dylib.patch ];
+
+})
diff --git a/nixpkgs/pkgs/development/libraries/tk/Fix-bad-install_name-for-libtk8.6.dylib.patch b/nixpkgs/pkgs/development/libraries/tk/Fix-bad-install_name-for-libtk8.6.dylib.patch
new file mode 100644
index 000000000000..528a75e1c91f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tk/Fix-bad-install_name-for-libtk8.6.dylib.patch
@@ -0,0 +1,29 @@
+From f90278dac42135acd55200b7d2153f44d72fec53 Mon Sep 17 00:00:00 2001
+From: Josef Knedl <josef.kemetmueller@aon.at>
+Date: Wed, 24 Feb 2016 00:37:40 +0100
+Subject: [PATCH] Fix bad install_name for libtk8.6.dylib
+
+This follows: https://trac.macports.org/ticket/37395
+and https://trac.macports.org/changeset/100816
+Alternative would be to use Quartz build instead:
+https://sourceforge.net/p/tktoolkit/bugs/3048/
+---
+ unix/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/unix/Makefile.in b/unix/Makefile.in
+index f21fdbb..1b89256 100644
+--- a/unix/Makefile.in
++++ b/unix/Makefile.in
+@@ -283,7 +283,7 @@ CC_SEARCH_FLAGS	= @CC_SEARCH_FLAGS@
+ LD_SEARCH_FLAGS	= @LD_SEARCH_FLAGS@
+ 
+ # support for embedded libraries on Darwin / Mac OS X
+-DYLIB_INSTALL_DIR	= ${LIB_RUNTIME_DIR}
++DYLIB_INSTALL_DIR	= $(libdir)
+ 
+ # support for building the Aqua resource file
+ TK_RSRC_FILE		= @TK_RSRC_FILE@
+-- 
+2.7.1
+
diff --git a/nixpkgs/pkgs/development/libraries/tk/different-prefix-with-tcl.patch b/nixpkgs/pkgs/development/libraries/tk/different-prefix-with-tcl.patch
new file mode 100644
index 000000000000..aee46e149b1a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tk/different-prefix-with-tcl.patch
@@ -0,0 +1,25 @@
+diff --git a/generic/tkWindow.c b/generic/tkWindow.c
+index b5cbbab..96b5501 100644
+--- a/generic/tkWindow.c
++++ b/generic/tkWindow.c
+@@ -988,6 +988,7 @@ TkCreateMainWindow(
+ 
+     Tcl_SetVar2(interp, "tk_patchLevel", NULL, TK_PATCH_LEVEL, TCL_GLOBAL_ONLY);
+     Tcl_SetVar2(interp, "tk_version",    NULL, TK_VERSION,     TCL_GLOBAL_ONLY);
++    Tcl_SetVar2(interp, "tk_library",    NULL, TK_LIBRARY,     TCL_GLOBAL_ONLY);
+ 
+     tsdPtr->numMainWindows++;
+     return tkwin;
+diff --git a/unix/Makefile.in b/unix/Makefile.in
+index f21fdbb..c61b0df 100644
+--- a/unix/Makefile.in
++++ b/unix/Makefile.in
+@@ -1029,7 +1029,7 @@ tkVisual.o: $(GENERIC_DIR)/tkVisual.c
+ 	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkVisual.c
+ 
+ tkWindow.o: $(GENERIC_DIR)/tkWindow.c
+-	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkWindow.c
++	$(CC) -c $(CC_SWITCHES) -DTK_LIBRARY=\"${TK_LIBRARY}\" $(GENERIC_DIR)/tkWindow.c
+ 
+ tkButton.o: $(GENERIC_DIR)/tkButton.c
+ 	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkButton.c
diff --git a/nixpkgs/pkgs/development/libraries/tk/generic.nix b/nixpkgs/pkgs/development/libraries/tk/generic.nix
new file mode 100644
index 000000000000..34024b23e270
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tk/generic.nix
@@ -0,0 +1,51 @@
+{ stdenv, src, pkgconfig, tcl, libXft, fontconfig, patches ? [], ... }:
+
+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
+  '';
+
+  configureFlags = [
+    "--with-tcl=${tcl}/lib"
+  ];
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ ]
+    ++ stdenv.lib.optional stdenv.isDarwin fontconfig;
+
+  propagatedBuildInputs = [ tcl libXft ];
+
+  NIX_CFLAGS_LINK = if stdenv.isDarwin then "-lfontconfig" else null;
+
+  doCheck = false; # fails. can't find itself
+
+  inherit tcl;
+
+  passthru = rec {
+    inherit (tcl) release version;
+    libPrefix = "tk${tcl.release}";
+    libdir = "lib/${libPrefix}";
+  };
+
+  meta = with stdenv.lib; {
+    description = "A widget toolkit that provides a library of basic elements for building a GUI in many different programming languages";
+    homepage = http://www.tcl.tk/;
+    license = licenses.tcltk;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ lovek323 vrthra wkennington ];
+  };
+}