Skip to content

Instantly share code, notes, and snippets.

@ChristophHaag
Created June 24, 2018 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChristophHaag/9c782013e7fc3698bc38caf0a4a8667e to your computer and use it in GitHub Desktop.
Save ChristophHaag/9c782013e7fc3698bc38caf0a4a8667e to your computer and use it in GitHub Desktop.
qtpdf pkgbuild
# Maintainer: Christoph Haag <christoph.haag@collabora.co.uk>
pkgname=qtpdf-git
pkgver=r83.d4e9cbc
pkgrel=1
pkgdesc='Qt wrapper around PDFium'
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h')
url='http://blog.qt.io/blog/2017/01/30/new-qtpdf-qtlabs-module/'
license=('GPL3')
depends=()
makedepends=('git' 'qt5-tools')
provides=("qtpdf")
conflicts=("qtpdf")
source=("git+https://github.com/qt-labs/qtpdf.git")
sha512sums=('SKIP')
pkgver() {
cd qtpdf
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
# build system only works with python 2: https://www.kdab.com/browse-pdfs-in-a-qt-widgets-application/#comment-144079
virtualenv "$srcdir"/ve --python=/usr/bin/python2
source "$srcdir"/ve/bin/activate
cd qtpdf
git submodule update --init --recursive
#install -d build
}
build() {
source "$srcdir"/ve/bin/activate
cd qtpdf
qmake INCLUDEPATH+=/usr/include/freetype2 PREFIX="/usr"
make
}
package() {
source "$srcdir"/ve/bin/activate
cd qtpdf
# Installation does not honor DESTDIR
#make DESTDIR="$pkgdir" install
install -d "$pkgdir/usr/lib"
cp -a "$srcdir/qtpdf/lib"/*.so* "$pkgdir/usr/lib"
install -d "$pkgdir/usr/include/QtPdf"
install -d "$pkgdir/usr/include/QtPdfWidgets"
cp -Ra "$srcdir/qtpdf/src/pdf"/*.h "$pkgdir/usr/include/QtPdf"
cp -Ra "$srcdir/qtpdf/src/pdfwidgets/"/*.h "$pkgdir/usr/include/QtPdfWidgets"
ln -s "qpdfdocument.h" "$pkgdir/usr/include/QtPdf/QPdfDocument"
ln -s "qpdfdocumentrenderoptions.h" "$pkgdir/usr/include/QtPdf/QPdfDocumentRenderOptions"
ln -s "qpdfbookmarkmodel.h" "$pkgdir/usr/include/QtPdf/QPdfBookmarkModel"
#TODO: more symlinks
}
@ChristophHaag
Copy link
Author

Just for reference if someone googles it. The installed headers are probably NOT complete and you need to add some more symlinks, the three I added were just to get one application to compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment