summaryrefslogtreecommitdiff
path: root/app-text/llpp/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-12-24 14:11:38 +0000
committerV3n3RiX <venerix@redcorelinux.org>2018-12-24 14:11:38 +0000
commitde49812990871e1705b64051c35161d5e6400269 (patch)
tree5e1e8fcb0ff4579dbd22a1bfee28a6b97dc8aaeb /app-text/llpp/files
parent536c3711867ec947c1738f2c4b96f22e4863322d (diff)
gentoo resync : 24.12.2018
Diffstat (limited to 'app-text/llpp/files')
-rw-r--r--app-text/llpp/files/Makefile91
-rw-r--r--app-text/llpp/files/llpp-30-keysym.patch55
-rw-r--r--app-text/llpp/files/llpp.desktop14
3 files changed, 160 insertions, 0 deletions
diff --git a/app-text/llpp/files/Makefile b/app-text/llpp/files/Makefile
new file mode 100644
index 000000000000..0bd94cab00f2
--- /dev/null
+++ b/app-text/llpp/files/Makefile
@@ -0,0 +1,91 @@
+VERSION = $(shell test -d .git && git describe --tags --dirty 2>/dev/null)
+ifeq "$(VERSION)" ""
+VERSION = 28
+endif
+
+# paths
+PREFIX ?= /usr/local
+LIBDIR ?= /usr/lib
+
+# includes and libs
+PKGCONF_DEPS := freetype2 harfbuzz libopenjp2 libjpeg mupdf x11 zlib
+CPPFLAGS += -D_GNU_SOURCE -DFFP
+CFLAGS += -std=c99 -pedantic -Wall -Wextra -Wshadow $(shell pkg-config --cflags $(PKGCONF_DEPS))
+LDLIBS = -L$(LIBDIR) -lpthread -ljbig2dec $(shell pkg-config --libs $(PKGCONF_DEPS))
+
+# ocaml
+CAMLOPT = ocamlopt
+CAMLFLAGS = -g -w +a -safe-string -I +lablGL
+
+VPATH = wsi/x11
+
+C_SRC = cutils.c keysym2ucs.c link.c xlib.c version.c
+C_OBJ = $(C_SRC:.c=.o)
+OCAML_SRC = utils.ml wsi.ml confstruct.ml parser.ml config.ml ffi.ml glutils.ml help.ml keys.ml utf8syms.ml listview.ml main.ml
+OCAML_OBJ = $(OCAML_SRC:.ml=.cmx)
+MOD = unix.cmxa str.cmxa lablgl.cmxa
+SRCMANS = $(wildcard adoc/*.adoc)
+MANS = $(SRCMANS:.adoc=.1)
+
+DISTFILES := Makefile $(OCAML_SRC) link.c glfont.c keysym2ucs.c wsi.mli
+DISTFILES += $(wildcard *.sh) KEYS README BUILDING
+DISTFILES += misc/ adoc/
+
+all: llpp $(MANS)
+
+# dependency ordering
+config.cmx: wsi.cmi parser.cmx utils.cmx confstruct.cmx
+confstruct.cmx: wsi.cmx utils.cmx
+ffi.cmx: config.cmx
+glutils.cmx: ffi.cmx
+help.cmx: help.cmi config.cmx utils.cmx
+listview.cmx: utils.cmx glutils.cmx config.cmx utf8syms.cmx
+main.cmx: main.ml utils.cmx config.cmx glutils.cmx listview.cmx ffi.cmx keys.cmx wsi.cmx
+main.cmx: CAMLFLAGS += -thread
+parser.cmx: utils.cmx
+wsi.cmi: utils.cmx keys.cmx
+wsi.cmx: wsi.cmi
+
+link.o: glfont.c
+version.o: CPPFLAGS += -DLLPP_VERSION=$(VERSION)
+
+# ordinary targets
+llpp: $(OCAML_OBJ) $(C_OBJ)
+ $(CAMLOPT) -o $@ $(CAMLFLAGS) $(C_OBJ) -ccopt '$(LDFLAGS)' -cclib '$(LDLIBS)' $(MOD) $(OCAML_OBJ)
+
+
+confstruct.ml: genconfstr.sh
+ sh $< >$@
+
+# pattern rules
+%.o: %.c
+ $(CAMLOPT) -c -o $@ $(CAMLFLAGS) -cc $(CC) -ccopt '$(CFLAGS) $(CPPFLAGS)' $<
+
+%.cmx: %.ml
+ $(CAMLOPT) -c -o $@ $(CAMLFLAGS) $<
+
+%.cmi: %.mli
+ $(CAMLOPT) -c -o $@ $(CAMLFLAGS) $<
+
+%.1: %.adoc adoc/asciidoc.conf
+ a2x -d manpage -f manpage --asciidoc-opts="-f adoc/asciidoc.conf --out-file=$@.xml" $<
+
+# special targets
+clean:
+ $(RM) llpp link.o help.ml $(OCAML_OBJ) $(OCAML_OBJ:.cmx=.cmi) $(OCAML_OBJ:.cmx=.o) $(MANS) $(MANS:.1=.xml)
+
+dist: clean
+ mkdir llpp-$(VERSION)
+ cp -r $(DISTFILES) llpp-$(VERSION)
+ tar czf llpp-$(VERSION).tar.gz llpp-$(VERSION)
+ rm -rf llpp-$(VERSION)
+
+install:
+ install -Dm755 llpp "$(DESTDIR)"$(PREFIX)/bin/llpp
+ install -Dm644 -t "$(DESTDIR)"$(PREFIX)/share/man/man1 $(MANS)
+ install -Dm755 misc/llppac "$(DESTDIR)"$(PREFIX)/bin/llppac
+ install -Dm755 misc/llpp.inotify "$(DESTDIR)"$(PREFIX)/bin/llpp.inotify
+ install -Dm755 misc/llpphtml "$(DESTDIR)"$(PREFIX)/bin/llpphtml
+ install -Dm644 misc/llpp.desktop "$(DESTDIR)"$(PREFIX)/share/applications/llpp.desktop
+
+.PHONY: all clean dist install
diff --git a/app-text/llpp/files/llpp-30-keysym.patch b/app-text/llpp/files/llpp-30-keysym.patch
new file mode 100644
index 000000000000..b1527e1856f1
--- /dev/null
+++ b/app-text/llpp/files/llpp-30-keysym.patch
@@ -0,0 +1,55 @@
+From 6e40f7315cb620fef1d96bbe56cfe24dd91e182a Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz93@gmail.com>
+Date: Tue, 5 Jun 2018 11:56:06 -0400
+Subject: [PATCH] Do not use CPPFLAGS to add headers to source files
+
+Source code, e.g. #include, belongs in the source code, not the build
+system. Build systems are for defining include paths, not the includes
+themselves.
+
+Drop the KeySym keyword since it seems to be a useless alias for
+uint32_t which might as well be used directly instead of indirectly
+using #define everywhere.
+---
+ link.c | 4 ++--
+ wsi/x11/keysym2ucs.c | 4 +++-
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/link.c b/link.c
+index 783b12f..e8dcac3 100644
+--- a/link.c
++++ b/link.c
+@@ -3437,9 +3437,9 @@ CAMLprim value ml_keysymtoutf8 (value keysym_v)
+ {
+ CAMLparam1 (keysym_v);
+ CAMLlocal1 (str_v);
+- KeySym keysym = Int_val (keysym_v);
++ uint32_t keysym = Int_val (keysym_v);
+ Rune rune;
+- extern long keysym2ucs (KeySym);
++ extern long keysym2ucs (uint32_t);
+ int len;
+ char buf[5];
+
+diff --git a/wsi/x11/keysym2ucs.c b/wsi/x11/keysym2ucs.c
+index 38f9f1f..0f907c2 100644
+--- a/wsi/x11/keysym2ucs.c
++++ b/wsi/x11/keysym2ucs.c
+@@ -37,6 +37,8 @@
+ * AUTOMATICALLY GENERATED FILE, DO NOT EDIT !!! (unicode/convmap.pl)
+ */
+
++#include <inttypes.h>
++
+ struct codepair {
+ unsigned short keysym;
+ unsigned short ucs;
+@@ -816,7 +818,7 @@ struct codepair {
+ { 0x20ac, 0x20ac }, /* EuroSign € EURO SIGN */
+ };
+
+-long keysym2ucs(KeySym keysym)
++long keysym2ucs(uint32_t keysym)
+ {
+ int min = 0;
+ int max = sizeof(keysymtab) / sizeof(struct codepair) - 1;
diff --git a/app-text/llpp/files/llpp.desktop b/app-text/llpp/files/llpp.desktop
new file mode 100644
index 000000000000..9d81141aede6
--- /dev/null
+++ b/app-text/llpp/files/llpp.desktop
@@ -0,0 +1,14 @@
+[Desktop Entry]
+Name=llpp
+GenericName=PDF Pager
+Exec=llpp %f
+TryExec=llpp
+Terminal=false
+Type=Application
+MimeType=application/pdf;application/x-pdf;application/x-cbz;application/oxps;application/vnd.ms-xpsdocument;application/epub+zip;image/png;image/jpeg;image/pjpeg;image/gif;image/bmp;image/jpx;image/jp2;image/vnd.ms-photo;image/jxr;image/x-portable-bitmap;image/x-portable-greymap;image/x-portable-pixmap;image/x-portable-arbitrarymap;image/png;
+Categories=Office;Viewer;Graphics
+Actions=View
+Version=1.0
+[Desktop Action View]
+Name=View with llpp
+Exec=llpp %f