aboutsummaryrefslogblamecommitdiffstats
path: root/community/poppler-qt5/APKBUILD
blob: 00fa988ccaa5be90c427df8cbd25cbd0f4a0b7e5 (plain) (tree)
1
2
3
4
5
6
7
8
9






                                                                 

             



                                                 
                       
                                      






                                                                                
                                                               
                                    

           

                       
                                 
                                                                           
                            






                                                                                             


         


                                                                                          
                        
                                         

                                             



                                                      


                                               

                                  


           

                                                                                      

 
                                                                                                                                                                    
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>

# this aport only includes glib/gtk support in order to break the
# circular make dependency: gtk <- cups <- poppler <- gtk

pkgname=poppler-qt5
_pkgname=poppler
pkgver=0.89.0
pkgrel=0
pkgdesc="PDF rendering library based on xpdf 3.0"
url="https://poppler.freedesktop.org/"
arch="all"
license="GPL-2.0-only"
replaces="poppler-glib"
provides="poppler-qt4-$pkgver-$pkgrel"
options="!check" # Requires dl of testfiles and only checks qt5 libs
makedepends="cairo-dev cmake fontconfig-dev jpeg-dev lcms2-dev libjpeg-turbo-dev
	libpng-dev libxml2-dev openjpeg-dev openjpeg-tools poppler-dev>=$pkgver
	qt5-qtbase-dev tiff-dev zlib-dev
	"
depends_dev="$makedepends"
subpackages="$pkgname-dev"
source="https://poppler.freedesktop.org/poppler-$pkgver.tar.xz"
builddir="$srcdir/$_pkgname-$pkgver"

prepare() {
	default_prepare

	local _linked_pkg=poppler
	local _linked_apkbuild="$startdir"/../../main/$_linked_pkg/APKBUILD
	mkdir -p "$builddir"
	if  [ -f "$_linked_apkbuild" ]; then
		local _linked_ver=$( . "$_linked_apkbuild"; echo "$pkgver")
		if [ "$_linked_ver" != "$pkgver" ]; then
			error "pkgver needs to be identical with $_linked_pkg ($_linked_ver)"
			return 1
		fi
	fi
}

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
		-DBUILD_GTK_TESTS=OFF \
		-DBUILD_QT5_TESTS=ON \
		-DBUILD_CPP_TESTS=OFF \
		-DENABLE_QT5=ON \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		$CMAKE_CROSSOPTS .
	make -C build
}

package() {
	install -Dm644 build/poppler-qt5.pc "$pkgdir"/usr/lib/pkgconfig/poppler-qt5.pc
	make -C build/qt5 DESTDIR="$pkgdir" install
}

sha512sums="e2af2ab20cc1bba72080d42e229379bda0802aff355d2932dd970ee5924f454577529aef21f0f90fc57efba54caf15cd973c75446f309498f88199d5c2d93f11  poppler-0.89.0.tar.xz"