diff options
Diffstat (limited to 'graphics/GraphicsMagick/GraphicsMagick.SlackBuild')
-rw-r--r-- | graphics/GraphicsMagick/GraphicsMagick.SlackBuild | 162 |
1 files changed, 104 insertions, 58 deletions
diff --git a/graphics/GraphicsMagick/GraphicsMagick.SlackBuild b/graphics/GraphicsMagick/GraphicsMagick.SlackBuild index f71e58178b..e9920d37aa 100644 --- a/graphics/GraphicsMagick/GraphicsMagick.SlackBuild +++ b/graphics/GraphicsMagick/GraphicsMagick.SlackBuild @@ -8,7 +8,13 @@ # MIA. Original version had no license; I'm licensing the update under the # terms of the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. -# 20180613 bkw: updated for v1.3.29 +# 20180627 bkw: +# - updated for v1.3.30. +# - get rid of the need to build/install/build again for the Tcl bindings. +# - actually install the damn perl module (when did *that* break?) +# - get rid of static tcl/tk libs +# - get rid of --disable-openmp (but add OPENMP=no just in case) + # 20180123 bkw: updated for v1.3.28 # 20171219 bkw: updated for v1.3.27, added last few missing delegates # 20170708 bkw: updated for v1.3.26 @@ -23,7 +29,7 @@ # - document optional deps in README PRGNAM=GraphicsMagick -VERSION=${VERSION:-1.3.29} +VERSION=${VERSION:-1.3.30} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -56,6 +62,23 @@ fi set -e +OLDVER="$(pkg-config --silence-errors --modversion $PRGNAM || true)" +if [ "$OLDVER" != "" ]; then + cat <<EOF 1>&2 +************************************************************************ +* +* $PRGNAM is already installed (version $OLDVER). +* +* If the build fails, 'removepkg $PRGNAM' and try again. +* +* Don't say I didn't warn you. +* +************************************************************************ +EOF + sleep 3 +fi + + rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP @@ -65,9 +88,9 @@ cd $PRGNAM-$VERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \; -o \ + -o -perm 511 \) -exec chmod 755 {} \+ -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+ # libfpx isn't autodetected, so let's help it a bit: if [ -e /usr/include/fpxlib.h ]; then @@ -76,9 +99,22 @@ else FPXOPT=no fi +# 20180628 bkw: OpenMP seems to work OK now, so enable it by default. In +# fact it may have worked in GraphicsMagick all along: I copied the +# config arguments from Pat's SlackBuild for ImageMagick... But since +# I haven't done exhaustive testing, make it possible to disable: +if [ "${OPENMP:-yes}" = "yes" ]; then + OMPOPT=--enable-openmp + WITHOMP=WITH +else + OMPOPT=--disable-openmp + WITHOMP=WITHOUT +fi + CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ + $OMPOPT \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --mandir=/usr/man \ @@ -87,7 +123,6 @@ CXXFLAGS="$SLKCFLAGS" \ --with-x \ --with-frozenpaths=no \ --without-modules \ - --disable-openmp \ --enable-static=no \ --enable-shared \ --with-perl \ @@ -98,7 +133,7 @@ CXXFLAGS="$SLKCFLAGS" \ make INSTALLDIRS=vendor make install INSTALLDIRS=vendor DESTDIR=$PKG -### Build the perl module +### Build the perl module, if not disabled. # In the olden days, PerlMagick was a separate module, not part of # GraphicsMagick, and it had its own SlackBuild. These days, PerlMagick @@ -106,73 +141,80 @@ make install INSTALLDIRS=vendor DESTDIR=$PKG # has to be built after GraphicsMagick is installed system-wide, but # I've come up with functional (if unattractive) way around that. -cd PerlMagick - -# munge Makefile.PL to build using the includes/libs we just installed -# to $PKG, instead of systemwide ones. -sed -i \ - -e "/magick_CFLAGS/s,=',&-I$PKG/usr/include ," \ - -e "/magick_LDFLAGS/s,=',&-L$PKG/usr/lib$LIBDIRSUFFIX ," \ - Makefile.PL - -# don't know why we have to explicitly force -lGraphicsMagick here... -perl Makefile.PL \ - LIBS=-lGraphicsMagick \ - PREFIX=/usr \ - INSTALLDIRS=vendor \ - INSTALLVENDORMAN1DIR=/usr/man/man1 \ - INSTALLVENDORMAN3DIR=/usr/man/man3 - -make - -# 'make test' will attempt to display an image, if it thinks it's running -# in X. Let's not do this. Also, use the shared libs in $PKG. -# The rungm.sh script sets up the environment so GraphicsMagick will look -# for its support files in the source tree instead of /usr. -DISPLAY="" \ -LD_PRELOAD="$PKG/usr/lib$LIBDIRSUFFIX/lib$PRGNAM.so" \ - ../rungm.sh make test - -cd - +WITHPERL=WITHOUT +if [ "${PERL:-yes}" = "yes" ]; then + cd PerlMagick + + # munge Makefile.PL to build using the includes/libs we just installed + # to $PKG, instead of systemwide ones. + sed -i \ + -e "/magick_CFLAGS/s,=',&-I$PKG/usr/include ," \ + -e "/magick_LDFLAGS/s,=',&-L$PKG/usr/lib$LIBDIRSUFFIX ," \ + Makefile.PL + + # don't know why we have to explicitly force -lGraphicsMagick here... + perl Makefile.PL \ + LIBS=-lGraphicsMagick \ + PREFIX=/usr \ + INSTALLDIRS=vendor \ + INSTALLVENDORMAN1DIR=/usr/man/man1 \ + INSTALLVENDORMAN3DIR=/usr/man/man3 + + make + + # 'make test' will attempt to display an image, if it thinks it's running + # in X. Let's not do this. Also, use the shared libs in $PKG. + # The rungm.sh script sets up the environment so GraphicsMagick will look + # for its support files in the source tree instead of /usr. + DISPLAY="" \ + LD_PRELOAD="$PKG/usr/lib$LIBDIRSUFFIX/lib$PRGNAM.so" \ + ../rungm.sh make test + + make install DESTDIR=$PKG + + cd - + WITHPERL=WITH +fi ### Done with perl module -### Build the tcl module, if & only if GraphicsMagick was already -# installed system-wide. This means, to get tcl bindings, you have to -# build twice. You can thank libtool and its .la files (with hard-coded -# paths) for this stupidity. I could probably spend more time with -# this and fix it (like the perl stuff above), but I suspect nobody -# really cares about TclMagick. +### Build the tcl module, if not disabled. + +WITHTCL=WITHOUT +if [ "${TCL:-yes}" = "yes" ]; then + # 20180627 bkw: the TclMagick build chokes on the .la file. + # In 15.0, we will be removing all .la files. For 14.2, I'll + # temporarily rename it out of the way. + # You can thank libtool and its .la files (with hard-coded + # paths) for this stupidity. + + rename .la .la_renamed $PKG/usr/lib$LIBDIRSUFFIX/*.la + + INC=$(pwd) -GMVER="$(pkg-config --silence-errors --modversion $PRGNAM || true)" -if [ "$GMVER" = "$VERSION" ]; then cd TclMagick -# LIBS needed to avoid libTclMagick.so: undefined symbol: tclStubsPtr + # LIBS needed to avoid libTclMagick.so: undefined symbol: tclStubsPtr source /usr/lib$LIBDIRSUFFIX/tclConfig.sh - LIBS="$TCL_STUB_LIB_FLAG" \ - CFLAGS="$SLKCFLAGS" \ - CXXFLAGS="$SLKCFLAGS" \ - ./configure \ + LIBS="$TCL_STUB_LIB_FLAG -L$PKG/usr/lib$LIBDIRSUFFIX" \ + CFLAGS="$SLKCFLAGS -I$INC" \ + CXXFLAGS="$SLKCFLAGS -I$INC" \ + ../rungm.sh ./configure \ + --with-magick=$(pwd)/../wand/GraphicsMagickWand-config \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --mandir=/usr/man \ - --with-magick=/usr/bin/${PRGNAM}Wand-config \ + --enable-shared \ + --disable-static \ --with-tcl=/usr/lib$LIBDIRSUFFIX \ --with-tk=/usr/lib$LIBDIRSUFFIX - make - make install INSTALL=$( which install ) DESTDIR=$PKG + ../rungm.sh make + ../rungm.sh make install INSTALL=$( which install ) DESTDIR=$PKG WITHTCL=WITH cd - -else - cat <<EOF -Building without Tcl/Tk bindings. If you need TclMagick, install this -package, then re-run the SlackBuild and reinstall the package. The 2nd -build will include TclMagick. -EOF - WITHTCL=WITHOUT + rename .la_renamed .la $PKG/usr/lib$LIBDIRSUFFIX/*.la_renamed fi ### Done with tcl module @@ -192,7 +234,11 @@ cp -a ChangeLog *.txt $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install -sed "s,@WITHTCL@,$WITHTCL," $CWD/slack-desc > $PKG/install/slack-desc +sed \ + -e "s,@WITHOMP@,$WITHOMP," \ + -e "s,@WITHTCL@,$WITHTCL," \ + -e "s,@WITHPERL@,$WITHPERL," \ + $CWD/slack-desc > $PKG/install/slack-desc cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} |