Merge pull request #139114 from r-burns/tix

[staging-next] tix: fix build on darwin
This commit is contained in:
Luke Granger-Brown
2021-09-23 14:28:00 +01:00
committed by GitHub
4 changed files with 96 additions and 4 deletions
+9 -1
View File
@@ -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";
@@ -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
+19 -1
View File
@@ -1,4 +1,11 @@
{ callPackage, fetchurl, tcl, ... } @ args:
{ lib
, stdenv
, callPackage
, fetchurl
, fetchpatch
, tcl
, ...
} @ args:
callPackage ./generic.nix (args // {
@@ -7,4 +14,15 @@ callPackage ./generic.nix (args // {
sha256 = "0an3wqkjzlyyq6l9l3nawz76axsrsppbyylx0zk9lkv7llrala03";
};
patches = lib.optionals stdenv.isDarwin [
# Define MODULE_SCOPE before including tkPort.h
# https://core.tcl-lang.org/tk/info/dba9f5ce3b
(fetchpatch {
name = "module_scope.patch";
url = "https://core.tcl-lang.org/tk/vpatch?from=ef6c6960c53ea30c&to=9b8aa74eebed509a";
extraPrefix = "";
sha256 = "0crhf4zrzdpc1jdgyv6l6mxqgmny12r3i39y1i0j8q3pbqkd04bv";
})
];
})
+19 -2
View File
@@ -1,4 +1,11 @@
{ callPackage, fetchurl, tcl, lib, stdenv, ... } @ args:
{ lib
, stdenv
, callPackage
, fetchurl
, fetchpatch
, tcl
, ...
} @ args:
callPackage ./generic.nix (args // {
@@ -7,6 +14,16 @@ callPackage ./generic.nix (args // {
sha256 = "1gh9k7l76qg9l0sb78ijw9xz4xl1af47aqbdifb6mjpf3cbsnv00";
};
patches = [ ./different-prefix-with-tcl.patch ] ++ lib.optionals stdenv.isDarwin [ ./Fix-bad-install_name-for-libtk8.6.dylib.patch ];
patches = [ ./different-prefix-with-tcl.patch ] ++ lib.optionals stdenv.isDarwin [
./Fix-bad-install_name-for-libtk8.6.dylib.patch
# Define MODULE_SCOPE before including tkPort.h
# https://core.tcl-lang.org/tk/info/dba9f5ce3b
(fetchpatch {
name = "module_scope.patch";
url = "https://core.tcl-lang.org/tk/vpatch?from=ef6c6960c53ea30c&to=9b8aa74eebed509a";
extraPrefix = "";
sha256 = "0crhf4zrzdpc1jdgyv6l6mxqgmny12r3i39y1i0j8q3pbqkd04bv";
})
];
})