Skip to content

Commit

Permalink
[fix, AppImage] Add libXss.so.1 dummy (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
Frenzie committed Feb 21, 2019
1 parent 765bd8b commit 83c1287
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ $(OUTPUT_DIR)/data:
libs: \
$(if $(or $(SDL),$(ANDROID)),,$(OUTPUT_DIR)/libs/libkoreader-input.so) \
$(if $(or $(SDL),$(ANDROID)),$(OUTPUT_DIR)/libs/libblitbuffer.so,) \
$(if $(APPIMAGE),$(OUTPUT_DIR)/libs/libXss.so.1,) \
$(OUTPUT_DIR)/libs/libkoreader-lfs.so \
$(OUTPUT_DIR)/libs/libkoreader-djvu.so \
$(OUTPUT_DIR)/libs/libkoreader-cre.so \
Expand Down Expand Up @@ -135,6 +136,9 @@ $(OUTPUT_DIR)/libs/libwrap-mupdf.so: wrap-mupdf.c \
$(MUPDF_LIB)
$(CC) -I$(MUPDF_DIR)/include $(DYNLIB_CFLAGS) -o $@ $^

$(OUTPUT_DIR)/libs/libXss.so.1: libxss-dummy.c
$(CC) $(DYNLIB_CFLAGS) -o $@ $^

ffi/mupdf_h.lua: ffi-cdecl/mupdf_decl.c $(MUPDF_DIR)/include
CPPFLAGS="$(CFLAGS) -I. -I$(MUPDF_DIR)/include" $(FFI_CDECL) gcc ffi-cdecl/mupdf_decl.c $@

Expand Down
19 changes: 19 additions & 0 deletions libxss-dummy.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Dummy symbol resolver for AppImage
// See https://github.com/koreader/koreader/issues/4627
// Thanks to https://github.com/AppImage/pkg2appimage/issues/127#issuecomment-278397037
#include <X11/Xlib.h>
typedef unsigned long ulong;
typedef unsigned int uint;
typedef struct { Window window; int state; int kind; ulong til_or_since; ulong idle; ulong eventMask; } XScreenSaverInfo;
Bool XScreenSaverQueryExtension(Display *dpy, int *event_base_return, int *error_base_return){}
Status XScreenSaverQueryVersion(Display *dpy, int *major_version_return, int *minor_version_return){}
XScreenSaverInfo *XScreenSaverAllocInfo(void){}
Status XScreenSaverQueryInfo(Display *dpy, Drawable drawable, XScreenSaverInfo *saver_info){}
void XScreenSaverSelectInput(register Display *dpy, Drawable drawable, ulong mask){}
void XScreenSaverSetAttributes(Display *dpy, Drawable drawable, int x, int y, uint width, uint height,
uint border_width, int depth, uint class, Visual *visual, ulong valuemask, XSetWindowAttributes *attributes){}
void XScreenSaverUnsetAttributes(register Display *dpy, Drawable drawable){}
Status XScreenSaverRegister(Display *dpy, int screen, XID xid, Atom type){}
Status XScreenSaverUnregister(Display *dpy, int screen){}
Status XScreenSaverGetRegistered(Display *dpy, int screen, XID *xid, Atom *type){}
void XScreenSaverSuspend(Display *dpy, Bool suspend){}

0 comments on commit 83c1287

Please sign in to comment.