summaryrefslogtreecommitdiff
path: root/office/pandoc/pandoc.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'office/pandoc/pandoc.SlackBuild')
-rw-r--r--office/pandoc/pandoc.SlackBuild52
1 files changed, 31 insertions, 21 deletions
diff --git a/office/pandoc/pandoc.SlackBuild b/office/pandoc/pandoc.SlackBuild
index 4c4c991505..d39d222391 100644
--- a/office/pandoc/pandoc.SlackBuild
+++ b/office/pandoc/pandoc.SlackBuild
@@ -3,18 +3,19 @@
# Slackware build script for pandoc
# Written by Peter Wang <novalazy@gmail.com>
+# Public domain.
PRGNAM=pandoc
-VERSION=${VERSION:-1.3}
+VERSION=${VERSION:-1.6}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
-# Automatically determine the architecture we're building on:
+GHC_VERSION=$(ghc --numeric-version)
+
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
- # Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi
@@ -25,10 +26,13 @@ PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
@@ -50,31 +54,37 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-# Pandoc explicitly requires parsec < 3 because parsec 3 can be slower (see
-# issue #116). We patch the cabal file to allow the build to proceed anyway,
-# but only if parsec 2 is not installed. Then, if both are installed, parsec 2
-# is still preferred.
-if ! ghc-pkg list --simple-output parsec | grep -q 'parsec-2'
-then
- patch -p0 < $CWD/pandoc-1.3-parsec3.patch
-fi
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+runghc Setup.hs configure \
+ --prefix=/usr \
+ --enable-shared \
+ --libdir=/usr/lib$LIBDIRSUFFIX \
+ --libsubdir=ghc-$GHC_VERSION/$PRGNAM-$VERSION \
+ --docdir=/usr/doc/$PRGNAM-$VERSION
+
+runghc Setup.hs build
+runghc Setup.hs haddock
+runghc Setup.hs copy --destdir=$PKG
+runghc Setup.hs register --gen-pkg-config
-make install \
- PREFIX=/usr \
- DESTDIR=$PKG \
- DATAPATH=$PKG/usr \
- DOCDIR=doc/$PRGNAM-$VERSION
+mv $PKG/usr/share/man $PKG/usr/man
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $(find $PKG/usr/man -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
-( cd $PKG/usr/man
- find . -type f -exec gzip -9 {} \;
- for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
-)
+PKGCONFD=/usr/lib${LIBDIRSUFFIX}/ghc-${GHC_VERSION}/package.conf.d
+PKGID=$( grep -E "^id: " $PRGNAM-$VERSION.conf | cut -d" " -f2 )
+mkdir -p $PKG/$PKGCONFD
+mv $PRGNAM-$VERSION.conf $PKG/$PKGCONFD/$PKGID.conf
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a changelog COPYRIGHT COPYING $PKG/usr/doc/$PRGNAM-$VERSION
+mv $PKG/usr/share/$PRGNAM-$VERSION/{BUGS,COPYRIGHT,README,changelog} \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+rm $PKG/usr/share/$PRGNAM-$VERSION/INSTALL
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG