contrib/dia/Pkgfile

51 lines
1.3 KiB
Plaintext

# Description: GTK+ Diagramming Creation Software.
# URL: https://wiki.gnome.org/action/show/Apps/Dia
# Maintainer: unmaintained
# Depends on: docbook-xsl gtk libart_lgpl xorg-libxdamage
# Optional: python
name=dia
version=0.97.3
release=3
source=(https://download.gnome.org/sources/$name/${version%.*}/$name-$version.tar.xz)
build() {
cd $name-$version
# pkgconf obviates the three patches we used to apply to configure.in
sed -e 's/freetype-config --libs/pkgconf --libs freetype2/' \
-e 's/freetype-config --cflags/pkgconf --cflags freetype2/' \
-i configure
# avoid filling /usr/share/locale with unwanted translations
sed -e 's/all-local$//; s/all-local //;' \
-e '/^SUBDIRS/s/ po / /' \
-i Makefile.in
PKGMK_DIA="--prefix=/usr
--mandir=/usr/share/man
--with-cairo
--without-hardbooks
--disable-gnome
--disable-nls"
if prt-get isinst python; then
PKGMK_DIA+=" --with-python"
for file in $(grep -lrE "/usr/bin/env python$" .); do
sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python2|' "$file"
done
sed -e 's/python python2\.1/python2 python2.1/' \
-i configure
else
PKGMK_DIA+=" --without-python"
fi
./configure $PKGMK_DIA
make
make DESTDIR=$PKG install
[[ "$PKGMK_DIA" =~ --with-python ]] && /usr/bin/python2 -mcompileall $PKG
rm -rf $PKG/usr/share/doc
rm -rf $PKG/usr/share/man/fr
}