aboutsummaryrefslogblamecommitdiffstats
path: root/main/ghostscript/APKBUILD
blob: 1df48367c8e5cf5928bbcb80549b0e603e2f897b (plain) (tree)
1
2
3
4
5
6
7
8
9


                                               
           
        

                                                                
          
              
                                                                                
                                                                        
                         
                                                    
                                                                        
 
                                       
           
                       



                                                                        

            
                                     
                                                                




                                                                     








                                                                           






                                  


                       





                                                                    


                                           


                                                    
                            

                                 
                              
                                           
                                                                         

                                         
                                


           
                       

                                                                  





                                                        

                                                  





                                                                 





                                                                                         

 





                                                                   


                                                                                                                                                                      
# Contributor: Cameron Banta <cbanta@gmail.com>
# Maintainer: Cameron Banta <cbanta@gmail.com>
pkgname=ghostscript
pkgver=9.10
pkgrel=1
pkgdesc="An interpreter for the PostScript language and for PDF"
url="http://ghostscript.com/"
arch="all"
license="GPL3"
makedepends="autoconf automake libjpeg-turbo-dev libpng-dev jasper-dev expat-dev
	zlib-dev tiff-dev freetype-dev libiconv-dev lcms-dev gtk+3.0-dev
	cups-dev libtool"
subpackages="$pkgname-doc $pkgname-dev $pkgname-gtk"
source="http://downloads.ghostscript.com/public/$pkgname-$pkgver.tar.gz"

_builddir="$srcdir/ghostscript-$pkgver"
prepare() {
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done

	# force it to use system-libs
	rm -rf jpeg libpng zlib jasper expat tiff lcms cups/libs

	# fix parallel builds
	sed -i -e 's/ECHO_XE/ECHOGS_XE/g' \
		-e 's/^\($(GLOBJ)md5.$(OBJ) :.*\)/\1 $(ECHOGS_XE)/' \
		base/lib.mak || return 1
	aclocal && autoconf --force

	cd $_builddir/ijs
	libtoolize --force && aclocal && autoconf && automake --add-missing
}

build(){
	# build ijs
	cd "$_builddir"/ijs
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-shared \
		--disable-static \
		|| return 1
	make

	cd "$_builddir"

	# --disable-compile-inits is needed to link with system-zlib
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--docdir=/usr/share/doc/"$pkgname" \
		--enable-dynamic \
		--with-system-libtiff \
		--with-ijs \
		--with-jbig2dec \
		--without-omni \
		--enable-gtk \
		--with-drivers=FILES,cups \
		--with-fontpath=/usr/share/fonts/Type1:/usr/share/fonts \
		--disable-compile-inits \
		|| return 1
	make so all || return 1 
}

package() {
	cd "$_builddir"
	make -j1 DESTDIR="${pkgdir}" install soinstall || return 1

	cd "$_builddir"/ijs
	make -j1 DESTDIR="${pkgdir}" install || return 1
	cd..

	rm "$pkgdir"/usr/lib/*.la || return 1

	#create empty dir for future fonts
	mkdir -p "${pkgdir}"/usr/share/fonts/Type1

	# license and copying
	install -m644 -D "$srcdir/$pkgname-$pkgver/LICENSE" \
		"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
	install -m644 -D "$srcdir/$pkgname-$pkgver/doc/COPYING" \
		"$pkgdir/usr/share/licenses/$pkgname/COPYING"

	# make the doc and examples more alpine like 
	#	(the --docdir above doesn't seem to work so good)
	mkdir -p "$pkgdir/usr/share/doc/$pkgname"
	mv "$pkgdir/usr/share/$pkgname/$pkgver/doc" "$pkgdir/usr/share/doc/$pkgname"
	mv "$pkgdir/usr/share/$pkgname/$pkgver/examples" "$pkgdir/usr/share/doc/$pkgname"
}

gtk() {
	pkgdesc="A GTK-enabled PostScript interpreter and renderer"
	install -d "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/gsx "$subpkgdir"/usr/bin/
}

md5sums="5f0c0a2670b08466a4050ddbd1f3de63  ghostscript-9.10.tar.gz"
sha256sums="913fc974433238ffd4e0549ce11ba2a3360d1d159cf5c3b988d72a77acb74d04  ghostscript-9.10.tar.gz"
sha512sums="310bc7fa2312c1a739b93bed421387a293309036a0ddc6a8be3c9b44d6363f5cc7f1f0f5c6bbd4428902f10e2e59087d63679b94e9b3fa869d7de76edd93d89e  ghostscript-9.10.tar.gz"