summary refs log tree commit diff
path: root/pkgs/development/libraries/tix
diff options
context:
space:
mode:
authorRyan Burns <rtburns@protonmail.com>2021-09-23 00:49:55 -0700
committerRyan Burns <rtburns@protonmail.com>2021-09-23 02:24:58 -0700
commit56d9b433368cf65bc2a0d238a4b0701508f5bef1 (patch)
tree95edde1e5d92078ff3c0e239567113485b7bb815 /pkgs/development/libraries/tix
parenta86e1f5dac8aac6629cacc9ccf99725d082e1f02 (diff)
downloadnixpkgs-56d9b433368cf65bc2a0d238a4b0701508f5bef1.tar
nixpkgs-56d9b433368cf65bc2a0d238a4b0701508f5bef1.tar.gz
nixpkgs-56d9b433368cf65bc2a0d238a4b0701508f5bef1.tar.bz2
nixpkgs-56d9b433368cf65bc2a0d238a4b0701508f5bef1.tar.lz
nixpkgs-56d9b433368cf65bc2a0d238a4b0701508f5bef1.tar.xz
nixpkgs-56d9b433368cf65bc2a0d238a4b0701508f5bef1.tar.zst
nixpkgs-56d9b433368cf65bc2a0d238a4b0701508f5bef1.zip
tix: fix build on darwin
Diffstat (limited to 'pkgs/development/libraries/tix')
-rw-r--r--pkgs/development/libraries/tix/default.nix10
-rw-r--r--pkgs/development/libraries/tix/duplicated-xlowerwindow.patch49
2 files changed, 58 insertions, 1 deletions
diff --git a/pkgs/development/libraries/tix/default.nix b/pkgs/development/libraries/tix/default.nix
index c42847ef533..b017b3eb661 100644
--- a/pkgs/development/libraries/tix/default.nix
+++ b/pkgs/development/libraries/tix/default.nix
@@ -1,4 +1,10 @@
-{ lib, stdenv, fetchurl, tcl, tk, fetchpatch } :
+{ lib
+, stdenv
+, fetchurl
+, fetchpatch
+, tcl
+, tk
+}:
 
 tcl.mkTclDerivation {
   version = "8.4.3";
@@ -13,6 +19,8 @@ tcl.mkTclDerivation {
     url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-tcltk/tix/files/tix-8.4.3-tcl8.5.patch?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d";
     sha256 = "0wzqmcxxq0rqpnjgxz10spw92yhfygnlwv0h8pcx2ycnqiljz6vj";
     })
+    # Remove duplicated definition of XLowerWindow
+    ./duplicated-xlowerwindow.patch
   ] ++ lib.optional (tcl.release == "8.6")
   (fetchpatch {
     name = "tix-8.4.3-tcl8.6.patch";
diff --git a/pkgs/development/libraries/tix/duplicated-xlowerwindow.patch b/pkgs/development/libraries/tix/duplicated-xlowerwindow.patch
new file mode 100644
index 00000000000..0ea888749a2
--- /dev/null
+++ b/pkgs/development/libraries/tix/duplicated-xlowerwindow.patch
@@ -0,0 +1,49 @@
+This is duplicated code from Tk.
+It causes errors during build since XLowerWindow is not only a function but also "defined" in tkIntXlibDecls.h.
+
+See
+https://github.com/tcltk/tk/blob/71dcaddc69769cbd3e2c4b5edb5810f974579527/generic/tkIntXlibDecls.h#L396
+and
+https://github.com/tcltk/tk/blob/71dcaddc69769cbd3e2c4b5edb5810f974579527/generic/tkIntXlibDecls.h#L1487
+
+--- a/unix/tixUnixWm.c	2005-03-25 13:15:53.000000000 -0700
++++ b/unix/tixUnixWm.c	2021-03-20 07:31:52.000000000 -0700
+@@ -24,38 +24,3 @@
+ {
+     return TCL_OK;
+ }
+-
+-#ifdef MAC_OSX_TK
+-#include "tkInt.h"
+-/*
+- *----------------------------------------------------------------------
+- *
+- * XLowerWindow --
+- *
+- *	Change the stacking order of a window.
+- *
+- * Results:
+- *	None.
+- *
+- * Side effects:
+- *	Changes the stacking order of the specified window.
+- *
+- *----------------------------------------------------------------------
+- */
+-
+-int 
+-XLowerWindow(
+-    Display* display,		/* Display. */
+-    Window window)		/* Window. */
+-{
+-    TkWindow *winPtr = *((TkWindow **) window);
+-    
+-    display->request++;
+-    if (Tk_IsTopLevel(winPtr) && !Tk_IsEmbedded(winPtr)) {
+-	TkWmRestackToplevel(winPtr, Below, NULL);
+-    } else {
+-    	/* TODO: this should generate damage */
+-    }
+-    return 0;
+-}
+-#endif