Date: Saturday, January 1, 2022 @ 08:25:34 Author: polyzen Revision: 1091618
upgpkg: llpp 34-1 Adapt some of the work done by NixOS folks on patching build.bash. Seems I haven't figured out some magic from the makefile that made !strip unnecessary, but perhaps figure that out another day. Added: llpp/trunk/system-makedeps.patch Modified: llpp/trunk/PKGBUILD Deleted: llpp/trunk/GNUmakefile -----------------------+ GNUmakefile | 95 ------------------------------------------------ PKGBUILD | 49 +++++++----------------- system-makedeps.patch | 82 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+), 129 deletions(-) Deleted: GNUmakefile =================================================================== --- GNUmakefile 2022-01-01 05:56:37 UTC (rev 1091617) +++ GNUmakefile 2022-01-01 08:25:34 UTC (rev 1091618) @@ -1,95 +0,0 @@ -MAKEFLAGS := -r - -VERSION = $(shell test -d .git && git describe --tags --dirty 2>/dev/null) -ifeq ($(VERSION),) - VERSION = 31 -endif - -# paths -PREFIX ?= /usr/local -bindir ?= $(PREFIX)/bin -datarootdir ?= $(PREFIX)/share -mandir ?= $(datarootdir)/man - -# includes and libs -PKGCONF_DEPS := gumbo freetype2 harfbuzz libopenjp2 libjpeg x11 zlib -override CPPFLAGS += -D_GNU_SOURCE -DFFP -override CFLAGS := $(CFLAGS) -g -std=c99 -pedantic -Wall -Wextra -Wshadow $(shell pkg-config --cflags $(PKGCONF_DEPS)) -LDLIBS := -lpthread -lmupdf -lmupdf-third -ljbig2dec $(shell pkg-config --libs $(PKGCONF_DEPS)) - -# ocaml -override OCAMLFLAGS += -g -w +a -safe-string - -# Some source files are stored in an OS-specific directory here. -# Divert them to the main srcdir. -ifeq ($(shell uname -s),Linux) - VPATH := wsi/x11 -else - VPATH := wsi/cocoa # Darwin -endif - -# Ensure main.cmx is last in this list: -OCAML_OBJ := utils.cmx wsi.cmx confstruct.cmx parser.cmx config.cmx ffi.cmx glutils.cmx keys.cmx utf8syms.cmx listview.cmx help.cmx main.cmx -C_OBJ := cutils.o keysym2ucs.o link.o xlib.o version.o -MODULES := unix.cmxa str.cmxa lablgl.cmxa -SRCMANS = $(wildcard adoc/*.adoc) -MANS = $(SRCMANS:.adoc=.1) - -OCAMLC := ocamlopt -COMPILE.ocaml = $(OCAMLC) $(OCAMLFLAGS) -c -LINK.ocaml = $(OCAMLC) $(OCAMLFLAGS) - -all: llpp $(MANS) - -# dependency ordering -main.cmx: private OCAMLFLAGS += -thread -I +lablGL -main.cmx: main.cmi utils.cmx config.cmx glutils.cmx listview.cmx ffi.cmx help.cmx -config.cmx: wsi.cmx confstruct.cmx parser.cmx -confstruct.cmx: wsi.cmx -parser.cmx: utils.cmx -wsi.cmx: keys.cmx utils.cmx -listview.cmx: private OCAMLFLAGS += -I +lablGL -listview.cmx: utf8syms.cmx glutils.cmx -glutils.cmx: private OCAMLFLAGS += -I +lablGL -glutils.cmx: ffi.cmx -ffi.cmx: config.cmx -help.cmx: help.cmi utils.cmx ffi.cmx config.cmx -help.cmi: config.cmx - -link.o: glfont.c -version.o: private CPPFLAGS += -DLLPP_VERSION=$(VERSION) - -# ordinary targets -llpp: private OCAMLFLAGS += -I +lablGL -llpp: $(OCAML_OBJ) $(C_OBJ) - $(LINK.ocaml) $(OUTPUT_OPTION) $(C_OBJ) -ccopt '$(LDFLAGS)' -cclib '$(LDLIBS)' $(MODULES) $(OCAML_OBJ) - -confstruct.ml: genconfstr.sh - sh $< > $@ - -# pattern rules -%.o: %.c - $(COMPILE.ocaml) $(OUTPUT_OPTION) -cc '$(CC)' -ccopt '$(CFLAGS) $(CPPFLAGS)' $< - -%.cmx: %.ml - $(COMPILE.ocaml) $(OUTPUT_OPTION) $< - -%.cmi: %.mli - $(COMPILE.ocaml) $(OUTPUT_OPTION) $< - -%.1: %.adoc - asciidoctor -b manpage -o $@ $< - -# special targets -clean: - $(RM) llpp confstruct.ml $(C_OBJ) $(OCAML_OBJ) $(OCAML_OBJ:.cmx=.cmi) $(OCAML_OBJ:.cmx=.o) $(MANS) $(MANS:.1=.xml) - -install: - install -Dm755 llpp "$(DESTDIR)$(bindir)"/llpp - install -Dm644 -t "$(DESTDIR)$(mandir)"/man1 $(MANS) - install -Dm755 misc/llppac "$(DESTDIR)$(bindir)"/llppac - install -Dm755 misc/llpp.inotify "$(DESTDIR)$(bindir)"/llpp.inotify - install -Dm755 misc/llpphtml "$(DESTDIR)$(bindir)"/llpphtml - install -Dm644 misc/llpp.desktop "$(DESTDIR)$(datarootdir)"/applications/llpp.desktop - -.PHONY: all clean install Modified: PKGBUILD =================================================================== --- PKGBUILD 2022-01-01 05:56:37 UTC (rev 1091617) +++ PKGBUILD 2022-01-01 08:25:34 UTC (rev 1091618) @@ -1,11 +1,10 @@ -# Maintainer: Eli Schwartz <[email protected]> +# Maintainer: Daniel M. Capella <[email protected]> +# Contributor: Eli Schwartz <[email protected]> # Contributor: earnestly pkgname=llpp -pkgver=33 -# Often breaks with mupdf, which means I'll occasionally need to pin a specific commit. -_commit=3fb41e63167a01638c1bf808e876e2380fe7a1f6 -pkgrel=2 +pkgver=34 +pkgrel=1 pkgdesc='opengl accelerated pdf viewer based on mupdf' arch=('x86_64') url="https://github.com/moosotc/${pkgname}" @@ -17,31 +16,13 @@ 'librsvg: llppac svg conversion' 'imagemagick: llppac image conversion' 'inotify-tools: for the llpp.inotify autoreload wrapper') -makedepends=('git' 'asciidoctor' 'ocaml' 'ocaml-lablgl' 'libmupdf') - -# llpp seems to go through build systems like fasion, holomorph has provided a -# very nice Makefile for building this software which has served well for -# months. It was contributed, or offered, to the author malc, but he concluded -# that make was bad and needed constant effort to prevent "bitrot" as -# justification for using a terrible shell script that downloaded arbitrary -# commits of bundled libraries. Then he used ninja. Then he moved on to -# shake, a haskell NIH implementation of make requiring that you now also have -# ghc and the shake library to build this software. Now he is back to a (new) -# shell script. - -# For obvious reasons I'm sticking with the custom makefile which greatly -# reduces maintainence burden and unecessary dependency bloat. -source=("git+${url}#commit=${_commit}" - 'GNUmakefile') +makedepends=('git' 'asciidoc' 'ocaml' 'ocaml-lablgl' 'libmupdf') +options=('!strip') +source=("git+${url}#tag=v${pkgver}" + 'system-makedeps.patch') sha256sums=('SKIP' - '5771cc554407ff32ddd8c8982e8260687f31af37a4cb5e32875897ff5426a91f') + 'c4e3f3fb6b74ffe7e9dccb7eff2cccda8177ba7e4574f894a06e3fc3a820e6db') -pkgver() { - cd "${srcdir}"/${pkgname} - - git describe --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' -} - prepare() { cd "${srcdir}"/${pkgname} @@ -48,20 +29,20 @@ # apparently the desktop file went "stale" git revert --no-commit aad4b1e65e581ff7a096a3c3901b222a9c127a1c - # This symlink ruins all the fun - rm wsi/x11/wsi.mli - - ln -sf ../GNUmakefile GNUmakefile + patch --forward --strip=1 --input=../system-makedeps.patch } build() { cd "${srcdir}"/${pkgname} - make + bash ./build.bash build + bash ./build.bash build doc } package() { cd "${srcdir}"/${pkgname} - make PREFIX=/usr DESTDIR="${pkgdir}" install + install -Dt "${pkgdir}"/usr/bin build/llpp misc/llpp{.inotify,ac} + install -Dm644 -t "${pkgdir}"/usr/share/applications misc/llpp.desktop + install -Dm644 -t "${pkgdir}"/usr/share/man/man1 build/doc/*.1 } Added: system-makedeps.patch =================================================================== --- system-makedeps.patch (rev 0) +++ system-makedeps.patch 2022-01-01 08:25:34 UTC (rev 1091618) @@ -0,0 +1,82 @@ +diff --git a/build.bash b/build.bash +index 9f72c04..6462b11 100755 +--- a/build.bash ++++ b/build.bash +@@ -33,9 +33,7 @@ test -n "${1-}" || die "usage: $0 build-directory" + outd=$1 + srcd=$(dirname $0) + mudir=$outd/mupdf +-muinc="-I $mudir/include -I $mudir/thirdparty/freetype/include" +- +-test -d $mudir || die muPDF wasn\'t found in $outd/, consult $srcd/BUILDING ++mudeps=('freetype2' 'gumbo' 'harfbuzz' 'libjpeg' 'libopenjp2' 'x11' 'zlib') + + mkdir -p $outd/{$wsid,lablGL} + +@@ -45,8 +43,6 @@ mbt=${mbt:-release} + test -n "${gmk:-}" && gmk=false || gmk=true + + mulibs="$mudir/build/$mbt/libmupdf.a $mudir/build/$mbt/libmupdf-third.a" +-make="make -C "$mudir" build=$mbt -j $mjobs libs" +-$make -q -s || $make + + oincs() { + local b=$1 incs +@@ -85,7 +81,7 @@ cflags() { + version.o) f=-DLLPP_VERSION=$ver;; + lablGL/*.o) f="-g -Wno-pointer-sign -Werror -O2";; + link.o) +- f="-g -std=c11 $muinc -Wall -Werror -Wextra -pedantic " ++ f="$CFLAGS -g -std=c11 $(pkg-config --cflags "${mudeps[@]}") -Wall -Werror -Wextra -pedantic " + test "${mbt-}" = "debug" || f+="-O2 " + $darwin && f+="-DMACOS -D_GNU_SOURCE -DGL_H='<OpenGL/gl.h>'" \ + || f+="-D_POSIX_C_SOURCE -DGL_H='<GL/gl.h>'" +@@ -104,39 +100,6 @@ mflags() { + } + + overs=$(ocamlc -vnum 2>/dev/null) || overs="" +-if test "$overs" != "4.13.0"; then +- url=https://caml.inria.fr/pub/distrib/ocaml-4.13/ocaml-4.13.0.tar.xz +- txz=$outd/$(basename $url) +- keycmd="printf $url; digest $txz;" +- isfresh $txz "$(eval $keycmd)" || { +- if executable_p wget; then dl() { wget "$1" -O "$2"; } +- elif executable_p curl; then dl() { curl -L "$1" -o "$2"; } +- else die "no program to fetch remote urls found" +- fi +- dl $url $txz +- eval $keycmd >$txz.past +- } && vecho "fresh $txz" +- absprefix=$(realpath $outd) +- export PATH=$absprefix/bin:$PATH +- ocamlc=$absprefix/bin/ocamlc +- keycmd="printf $url; digest $ocamlc;" +- isfresh $ocamlc "$(eval $keycmd)" || ( +- # This will needlessly re{configure,make} ocaml since "past" +- # of configure/make is hard to ascertain. "Better safe than +- # sorry" approach is taken here. The check will work for a +- # single ocaml url/version, but _will_ redo _everything_ +- # otherwise (even if fully built artifacts are available) +- tar xf $txz -C $outd +- bn=$(basename $url) +- cd $outd/${bn%.tar.xz} +- ./configure --disable-ocamldoc --disable-ocamltest \ +- --enable-debugger=no --prefix=$absprefix +- make -j $mjobs world +- make install +- eval $keycmd >$absprefix/bin/ocamlc.past +- ) && vecho "fresh ocamlc" +- overs=$(ocamlc -vnum 2>/dev/null) +-fi + + while read k v; do + case "$k" in +@@ -307,7 +270,7 @@ for m in ml_gl ml_glarray ml_raw; do + done + + libs="str.cma unix.cma" +-clibs="-L$mudir/build/$mbt -lmupdf -lmupdf-third -lpthread" ++clibs="-ljbig2dec $(pkg-config --libs "${mudeps[@]}") -lmupdf -lmupdf-third -lpthread" + if $darwin; then + mcomp=$ccomp + clibs+=" -framework Cocoa -framework OpenGL"
