summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/patches/31-fix-dlopen.patch48
-rw-r--r--debian/patches/series1
2 files changed, 49 insertions, 0 deletions
diff --git a/debian/patches/31-fix-dlopen.patch b/debian/patches/31-fix-dlopen.patch
new file mode 100644
index 0000000..b89681e
--- /dev/null
+++ b/debian/patches/31-fix-dlopen.patch
@@ -0,0 +1,48 @@
+Description: Allow overriding path to libXft.so and libX11.so
+ Currently, this works only if libx11-dev and libxft-dev are
+ installed. The build script will set those accordingly to
+ the location of actual libraries.
+Author: Andrew Shadura <andrewsh@debian.org>
+
+--- a/lib/libstuff/x11/xft.c
++++ b/lib/libstuff/x11/xft.c
+@@ -9,12 +9,16 @@
+ #ifdef HAVE_RTLD
+ #include <dlfcn.h>
+
++#ifndef LIBXFT_SO
++#define LIBXFT_SO "libXft.so"
++#endif
++
+ bool
+ havexft(void) {
+ void *libxft;
+
+ if(xft == nil) {
+- libxft = dlopen("libXft.so", RTLD_LAZY);
++ libxft = dlopen(LIBXFT_SO, RTLD_LAZY);
+ if(libxft == nil)
+ return false;
+ xft = emalloc(sizeof *xft);
+--- a/lib/libwmii_hack/hack.c
++++ b/lib/libwmii_hack/hack.c
+@@ -13,6 +13,10 @@
+ #include "util.c"
+ #include "x11.c"
+
++#ifndef LIBX11_SO
++#define LIBX11_SO "libX11.so"
++#endif
++
+ enum {
+ Timeout = 10,
+ };
+@@ -40,7 +44,7 @@
+ long n;
+ int i;
+
+- xlib = dlopen("libX11.so", RTLD_GLOBAL | RTLD_LAZY);
++ xlib = dlopen(LIBX11_SO, RTLD_GLOBAL | RTLD_LAZY);
+ if(xlib == nil)
+ return;
+ mapwindow = (mapfn)(uintptr_t)dlsym(xlib, "XMapWindow");
diff --git a/debian/patches/series b/debian/patches/series
index abee818..30ee908 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -19,3 +19,4 @@
28-fix-regexp-clients.patch
29-witray-xinerama.patch
30-fix-ftbfs-with-binutils-gold.patch
+31-fix-dlopen.patch