Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
From e5969b50e6570b5d8dd188be067b3085a99d484e Mon Sep 17 00:00:00 2001
From: Kazuo Teramoto <kaz.rag@gmail.com>
Date: Wed, 28 Oct 2015 21:30:10 -0200
Subject: [PATCH] Add support for build options
This make easier to customize what is included in the packages.
---
PKGBUILD | 44 +++++++++++++++++++++++++-------------------
1 file changed, 25 insertions(+), 19 deletions(-)
diff --git a/PKGBUILD b/PKGBUILD
index d4e5f7c..2b955ea 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,5 +1,14 @@
# Maintainer: Bruno Pagani (a.k.a. ArchangeGabriel) <bruno.n.pagani at gmail dot com>
+# Configure what to build. Use "yes" or "no".
+_pdf="no" # pdf file support
+_ps="no" # ps file support
+_djvu="no" # djvu file support
+_dvi="no" # dvi file support
+_xps="no" # xps file support
+_comics="no" # cb[zr7t] comics file support
+_bookmarks="no" # bookmark and annotations support
+
pkgbase=evince
pkgname=evince-light
pkgver=3.18.0
@@ -14,13 +23,14 @@ depends=('desktop-file-utils'
'gtk3'
'libsm'
'libarchive')
-# Add to depends:
-# 'poppler-glib' for PDF
-# 'libspectre' for PostScript
-# 'djvulibre' for DJVU
-# 'texlive-bin' for DVI
-# 'libgxps' for XPS
-# 'gvfs' for bookmark and annotations
+
+[[ "$_pdf" == "yes" ]] && depends+=('poppler-glib')
+[[ "$_ps" == "yes" ]] && depends+=('libspectre')
+[[ "$_djvu" == "yes" ]] && depends+=('djvulibre')
+[[ "$_dvi" == "yes" ]] && depends+=('texlive-bin')
+[[ "$_xps" == "yes" ]] && depends+=('libgxps')
+[[ "$_bookmarks" == "yes" ]] && depends+=('gvfs')
+
makedepends=('itstool' 'intltool')
provides=("${pkgbase}")
conflicts=("${pkgbase}")
@@ -32,12 +42,13 @@ build()
{
cd ${srcdir}/${pkgbase}-${pkgver}
-# --enable-pdf if building with poppler-glib
-# --enable-ps if building with libspectre
-# --enable-djvu if building with djvulibre
-# --enable-dvi if building with texlive-bin
-# --enable-xps if building with libgxps
-# --enable-comics if you want comics support
+_build_cfg=''
+[[ "$_pdf" == "yes" ]] && _build_cfg+='--enable-pdf ' || _build_cfg+='--disable-pdf '
+[[ "$_ps" == "yes" ]] && _build_cfg+='--enable-ps ' || _build_cfg+='--disable-ps '
+[[ "$_djvu" == "yes" ]] && _build_cfg+='--enable-djvu ' || _build_cfg+='--disable-djvu '
+[[ "$_dvi" == "yes" ]] && _build_cfg+='--enable-dvi ' || _build_cfg+='--disable-dvi '
+[[ "$_xps" == "yes" ]] && _build_cfg+='--enable-xps ' || _build_cfg+='--disable-xps '
+[[ "$_comics" == "yes" ]] && _build_cfg+='--enable-comics ' || _build_cfg+='--disable-comics '
./configure \
--sysconfdir=/etc \
@@ -51,12 +62,7 @@ build()
--enable-viewer \
--enable-previewer \
--enable-thumbnailer \
- --disable-pdf \
- --disable-ps \
- --disable-djvu \
- --disable-dvi \
- --disable-xps \
- --disable-comics \
+ $_build_cfg \
--enable-t1lib \
--enable-tiff \
--disable-nautilus \
--
2.6.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.