diff options
author | jose1711 | 2019-03-24 22:00:27 +0100 |
---|---|---|
committer | jose1711 | 2019-03-24 22:00:41 +0100 |
commit | c24f149ff4ca2cb26e1f6eba4efacfdf080ea7e2 (patch) | |
tree | c6d914069ea7e2fa3bc820adc9fea458f41aaeb1 | |
parent | 049e44833bd038d5bcbb0c460633c650cff0716a (diff) | |
download | aur-c24f149ff4ca2cb26e1f6eba4efacfdf080ea7e2.tar.gz |
Update
-rw-r--r-- | .SRCINFO | 31 | ||||
-rw-r--r-- | PKGBUILD | 116 | ||||
-rw-r--r-- | jasper.patch | 24 |
3 files changed, 60 insertions, 111 deletions
@@ -1,32 +1,25 @@ +# Generated by mksrcinfo v8 +# Sun Mar 24 21:00:03 UTC 2019 pkgbase = k2pdfopt pkgdesc = A tool that optimizes PDF files for viewing on mobile readers - pkgver = 2.42 + pkgver = 2.51 pkgrel = 1 url = http://www.willus.com/k2pdfopt/ arch = i686 arch = x86_64 license = GPL3 makedepends = cmake - depends = mupdf>=1.10 + depends = mupdf>=1.14 depends = djvulibre>=3.5.25.3 depends = netpbm>=10.61.02 - depends = leptonica>=1.74.1 - source = http://www.willus.com/k2pdfopt/src/k2pdfopt_v2.42_src.zip - source = http://www.mupdf.com/downloads/archive/mupdf-1.10a-source.tar.gz - source = https://github.com/tesseract-ocr/tesseract/archive/3.05.00.tar.gz - source = http://www-e.uni-magdeburg.de/jschulen/ocr/gocr-0.50.tar.gz - source = http://downloads.sourceforge.net/project/openjpeg.mirror/2.1.0/openjpeg-2.1.0.tar.gz - source = leptonica-1.74.1.tar.gz::https://github.com/DanBloomberg/leptonica/archive/1.74.1.tar.gz - source = k2pdfopt.patch - source = tesseract.patch - md5sums = e3a62a25d9ab310f8b7ab218df8dd8df - md5sums = f80fbba2524d1d52f6ed09237d382411 - md5sums = 478ba26e8e7ea8f6f466d4dfc2332d34 - md5sums = 553ea40c2b3a1a0b03a30675d0e0aba1 - md5sums = f6419fcc233df84f9a81eb36633c6db6 - md5sums = b3de9ae35976fd4fc3f6dae5a4368bca - md5sums = 1c34ef8378dc52f29d9d97714c899e90 - md5sums = 3db9d9cd3b7745af036c968dfe0ba376 + depends = leptonica>=1.74.4 + depends = jasper + source = http://www.willus.com/k2pdfopt/src/k2pdfopt_v2.51_src.zip + source = http://deb.debian.org/debian/pool/main/k/k2pdfopt/k2pdfopt_2.51+ds-1.debian.tar.xz + source = jasper.patch + md5sums = 97bd96b21c7ee2680a9bfe12060992ba + md5sums = 9075edbbef77506cb18e2a4479d71ec4 + md5sums = aa38a1626c75962385bb3a0f5123a297 pkgname = k2pdfopt @@ -1,115 +1,47 @@ -# Maintainer: Facundo Tuesca <facutuesca at gmail dot com> +# Maintainer: Jose Riha <jose 1711 gmail com> +# Contributor: Facundo Tuesca <facutuesca at gmail dot com> -_mupdf_version=1.10a -_tesseract_version=3.05.00 -_gocr_version=0.50 -_openjpeg_version=2.1.0 -_leptonica_version=1.74.1 +_tesseract_version=4.0.0 pkgname=k2pdfopt -pkgver=2.42 +pkgver=2.51 pkgrel=1 pkgdesc="A tool that optimizes PDF files for viewing on mobile readers" arch=('i686' 'x86_64') url="http://www.willus.com/k2pdfopt/" license=('GPL3') makedepends=('cmake') -depends=('mupdf>=1.10' +depends=('mupdf>=1.14' 'djvulibre>=3.5.25.3' 'netpbm>=10.61.02' - 'leptonica>=1.74.1') + 'leptonica>=1.74.4' + 'jasper') source=("http://www.willus.com/k2pdfopt/src/${pkgname}_v${pkgver}_src.zip" - "http://www.mupdf.com/downloads/archive/mupdf-${_mupdf_version}-source.tar.gz" - "https://github.com/tesseract-ocr/tesseract/archive/${_tesseract_version}.tar.gz" - "http://www-e.uni-magdeburg.de/jschulen/ocr/gocr-${_gocr_version}.tar.gz" - "http://downloads.sourceforge.net/project/openjpeg.mirror/${_openjpeg_version}/openjpeg-${_openjpeg_version}.tar.gz" - "leptonica-${_leptonica_version}.tar.gz::https://github.com/DanBloomberg/leptonica/archive/${_leptonica_version}.tar.gz" - "k2pdfopt.patch" - "tesseract.patch") -md5sums=('e3a62a25d9ab310f8b7ab218df8dd8df' - 'f80fbba2524d1d52f6ed09237d382411' - '478ba26e8e7ea8f6f466d4dfc2332d34' - '553ea40c2b3a1a0b03a30675d0e0aba1' - 'f6419fcc233df84f9a81eb36633c6db6' - 'b3de9ae35976fd4fc3f6dae5a4368bca' - '1c34ef8378dc52f29d9d97714c899e90' - '3db9d9cd3b7745af036c968dfe0ba376') + "http://deb.debian.org/debian/pool/main/k/k2pdfopt/k2pdfopt_2.51+ds-1.debian.tar.xz" + "jasper.patch") +md5sums=('97bd96b21c7ee2680a9bfe12060992ba' + '9075edbbef77506cb18e2a4479d71ec4' + 'aa38a1626c75962385bb3a0f5123a297') prepare() { cd "${srcdir}/${pkgname}_v${pkgver}" - rm -f "include_mod/gocr.h" - cp mupdf_mod/font.c mupdf_mod/font-win32.c mupdf_mod/string.c mupdf_mod/stext-device.c "${srcdir}/mupdf-${_mupdf_version}-source/source/fitz/" - cp mupdf_mod/pdf-* "${srcdir}/mupdf-${_mupdf_version}-source/source/pdf/" - cp "${srcdir}/mupdf-${_mupdf_version}-source/source/fitz/font-imp.h" "${srcdir}/mupdf-${_mupdf_version}-source/source/pdf/" - cp "${srcdir}/mupdf-${_mupdf_version}-source/source/fitz/colorspace-imp.h" "${srcdir}/mupdf-${_mupdf_version}-source/source/pdf/" - cp "${srcdir}/mupdf-${_mupdf_version}-source/source/fitz/colorspace-imp.h" "${srcdir}/mupdf-${_mupdf_version}-source/source/pdf/" - rm -rf ${srcdir}/mupdf-${_mupdf_version}-source/thirdparty/{curl,freetype,harfbuzz,jpeg,zlib,openjpeg} - # this does not build with openssl 1.1.0, so disable checks - sed -i 's/pkg-config --exists \(libcrypto\|openssl\)/false/' "${srcdir}/mupdf-${_mupdf_version}-source/Makerules" - cp tesseract_mod/dawg.cpp "${srcdir}/tesseract-${_tesseract_version}/dict/" - cp tesseract_mod/tessdatamanager.cpp tesseract_mod/ambigs.cpp tesseract_mod/ccutil.cpp tesseract_mod/ccutil.h "${srcdir}/tesseract-${_tesseract_version}/ccutil/" - cp tesseract_mod/tessedit.cpp tesseract_mod/thresholder.cpp "${srcdir}/tesseract-${_tesseract_version}/ccmain/" - cp tesseract_mod/imagedata.cpp "${srcdir}/tesseract-${_tesseract_version}/ccstruct/" - cp tesseract_mod/openclwrapper.h "${srcdir}/tesseract-${_tesseract_version}/opencl/" - cp tesseract_mod/tess_lang_mod_edge.h "${srcdir}/tesseract-${_tesseract_version}/cube/" - cp include_mod/tesseract.h include_mod/leptonica.h tesseract_mod/tesscapi.cpp "${srcdir}/tesseract-${_tesseract_version}/api/" - cp tesseract_mod/config_auto.h "${srcdir}/tesseract-${_tesseract_version}/" - cp leptonica_mod/allheaders.h leptonica_mod/dewarp2.c "${srcdir}/leptonica-${_leptonica_version}/src/" - cd "${srcdir}" - patch -p0 -i "${srcdir}/tesseract.patch" - patch -p1 -i "${srcdir}/k2pdfopt.patch" - mkdir -p "patched_libraries/lib" + for i in ../debian/patches/*.patch + do + patch -p1 -i "$i" + done + patch -p2 -i "${srcdir}/jasper.patch" } build() { - cd "${srcdir}/openjpeg-${_openjpeg_version}/" - cmake -D BUILD_SHARED_LIBS:bool=off . - make openjp2 - cp bin/libopenjp2.a "${srcdir}/patched_libraries/lib/" - mkdir -p "${srcdir}/patched_libraries/include/openjpeg-2.1/" - cp src/lib/openjp2/{opj_stdint.h,opj_config.h,openjpeg.h} "${srcdir}/patched_libraries/include/openjpeg-2.1/" - - cd "${srcdir}/mupdf-${_mupdf_version}-source/" -#Use the same openjpeg2 libraries as mupdf - make SYS_OPENJPEG_LIBS=-L/${srcdir}/patched_libraries/lib\ -lopenjp2 prefix="${srcdir}/patched_libraries" generate - make SYS_OPENJPEG_LIBS=-L/${srcdir}/patched_libraries/lib\ -lopenjp2 prefix="${srcdir}/patched_libraries" install - - cd "${srcdir}/leptonica-${_leptonica_version}/" - ./autobuild - ./configure --without-libopenjpeg --prefix="${srcdir}/patched_libraries" --disable-shared - make install - - cd "${srcdir}/tesseract-${_tesseract_version}/" - ./autogen.sh - ./configure --prefix="${srcdir}/patched_libraries" --disable-shared - make install - cd "${srcdir}/gocr-${_gocr_version}/" - ./configure - cp src/{gocr.h,pnm.h,unicode.h,list.h} "${srcdir}/patched_libraries/include" - cp include/config.h "${srcdir}/patched_libraries/include" - make libs - cp src/libPgm2asc.a "${srcdir}/patched_libraries/lib" - - cd "${srcdir}/${pkgname}_v${pkgver}/k2pdfoptlib" - gcc -Ofast -Wall -c *.c -I ../include_mod/ -I ${srcdir}/patched_libraries/include \ - -I . -I ../willuslib - ar rcs libk2pdfopt.a *.o - cd "${srcdir}/${pkgname}_v${pkgver}/willuslib" - gcc -Ofast -Wall -c *.c -I ../include_mod/ -I ${srcdir}/patched_libraries/include - ar rcs libwillus.a *.o cd "${srcdir}/${pkgname}_v${pkgver}" - gcc -Wall -Ofast -o k2pdfopt.o -c k2pdfopt.c -I k2pdfoptlib/ -I willuslib/ \ - -I include_mod/ -I ${srcdir}/patched_libraries/include - g++ -Ofast k2pdfopt.o -o k2pdfopt -I willuslib/ -I k2pdfoptlib/ -I include_mod/ \ - -I ${srcdir}/patched_libraries/include -L ${srcdir}/patched_libraries/lib/ \ - -L willuslib/ -L k2pdfoptlib/ -lk2pdfopt -lwillus -ldjvulibre -lz -lmupdf \ - -ljbig2dec -ljpeg -lopenjp2 -lpng -lfreetype -lpthread \ - -lPgm2asc -llept -ltesseract -lcrypto -lharfbuzz -ltiff -lgif -lwebp - + [ -d build ] && rm -r build + mkdir build + cd build + cmake -DCMAKE_INSTALL_PREFIX=/usr .. + make } package() { - cd "${srcdir}/${pkgname}_v${pkgver}" - mkdir -p "${pkgdir}/usr/bin/" - cp ${pkgname} "${pkgdir}/usr/bin/" + cd "${srcdir}/${pkgname}_v${pkgver}/build" + make DESTDIR="$pkgdir" install } diff --git a/jasper.patch b/jasper.patch new file mode 100644 index 000000000000..7f87deb9ecaf --- /dev/null +++ b/jasper.patch @@ -0,0 +1,24 @@ +diff -aur src.orig/k2pdfopt_v2.51/CMakeLists.txt src/k2pdfopt_v2.51/CMakeLists.txt +--- src.orig/k2pdfopt_v2.51/CMakeLists.txt 2019-03-24 21:45:17.683484849 +0100 ++++ src/k2pdfopt_v2.51/CMakeLists.txt 2019-03-24 21:46:17.443514984 +0100 +@@ -5,7 +5,7 @@ + + include(FindPkgConfig) + +-set(K2PDFOPT_LIB "-lm") ++set(K2PDFOPT_LIB "-lm -ljasper") + + # cmake -DCMAKE_BUILD_TYPE=Debug <path> + +diff -aur src.orig/k2pdfopt_v2.51/willuslib/bmp.c src/k2pdfopt_v2.51/willuslib/bmp.c +--- src.orig/k2pdfopt_v2.51/willuslib/bmp.c 2019-01-01 00:21:16.000000000 +0100 ++++ src/k2pdfopt_v2.51/willuslib/bmp.c 2019-03-24 21:45:48.713500408 +0100 +@@ -37,7 +37,7 @@ + #include <jpeglib.h> + #endif + #ifdef HAVE_JASPER_LIB +-#include <jasper.h> ++#include <jasper/jasper.h> + #endif + + #define BOUND(x,xmin,xmax) if ((x)<(xmin)) (x)=(xmin); else { if ((x)>(xmax)) (x)=(xmax); } |