You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

180 lines
5.5 KiB

#!/bin/sh
# Slackware build script for graphviz
# Copyright 2007 Robby Workman <rworkman@slackbuilds.org>
# Copyright 2011 Heinz Wiesinger <pprkut@slackbuilds.org>
# Copyright 2013-2015 Audrius Kažukauskas <audrius@neutrino.lt>
# Copyright 2016-2017 tde-slackbuilds - modified for inclusion in build method
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=graphviz
VERSION=${VERSION:-2.42.3}
BUILD=${BUILD:-1}
TAG=${TAG:-}
SRCURL="https://ftp.osuosl.org/pub/blfs/conglomeration/graphviz/graphviz-$VERSION.tar.gz"
ARCHIVE_TYPE="tar.gz"
source ../../get-source.sh
getsource_fn
untar_fn
# Install PHP bindings to proper location.
sed -i 's|/php/modules|/php/extensions|' configure
# Fix for php-5.4 and patches from Arch (thanks!)
echo $'--- plugin/gs/gvloadimage_gs.c
+++ plugin/gs/gvloadimage_gs.c
@@ -83,11 +83,11 @@
assert (err < 0);
- if (err >= e_VMerror)
+ if (err >= gs_error_VMerror)
errsrc = "PostScript Level 1";
- else if (err >= e_unregistered)
+ else if (err >= gs_error_unregistered)
errsrc = "PostScript Level 2";
- else if (err >= e_invalidid)
+ else if (err >= gs_error_invalidid)
errsrc = "DPS error";
else
errsrc = "Ghostscript internal error";
--- tclpkg/gv/gv_php_init.c
+++ tclpkg/gv/gv_php_init.c
@@ -27,0 +28 @@
+ TSRMLS_FETCH();
@@ -32,0 +34 @@
+ TSRMLS_FETCH();
' | while read line
do
patch -p0
done
listdocs_fn
chown_fn
cd_builddir_fn
CFLAGS=$SLKCFLAGS \
CXXFLAGS=$SLKCFLAGS \
LDFLAGS=$SLKLDFLAGS \
CC=$COMPILER \
CXX=$COMPILER_CXX \
../configure \
--prefix=/usr \
--libdir=/usr/lib$LIBDIRSUFFIX \
--mandir=/usr/man \
--enable-ocaml=no
make $NUMJOBS || exit 1
make install-strip DESTDIR=$PKG || exit 1
## The primary purpose of this build is for 'dot' for kscope.
## If you want the pdf and html documentation, then comment out this line:
rm -rf $PKG/usr/share/$PRGNAM/doc
# Install config file for PHP.
mkdir -p $PKG/etc/php.d
cat << EOF > $PKG/etc/php.d/graphviz.ini.new
; Enable graphviz extension module
; extension=gv.so
; Graphviz' own documentation mentions a "gv.php" file that should
; be included. This file is however not necessary, it is just a
; wrapper class around functions that are already available after
; loading the extension, just leave out the "gv::" prefix.
; In case you still prefer to use the wrapper class you have to
; include it using its absolute path:
; <?php
; include ('/usr/lib$LIBDIRSUFFIX/graphviz/php/gv.php');
; ?>
EOF
# Remove empty directories of language bindings that are absent.
find $PKG/usr/lib$LIBDIRSUFFIX/graphviz -depth -type d -empty -exec rmdir {} \;
# Create a "dummy" config file in /usr/lib$LIBDIRSUFFIX/graphviz so that it
# will be removed when the package is uninstalled. This file is generated by
# the postinstall script and contains information about available plugins, so
# this is (or at least should be) safe.
#
# Write some dummy content to it to avoid
# "Error: /usr/lib64/graphviz/config6 is zero sized, or other read error."
# message during installation.
echo '# Dummy content.' > $PKG/usr/lib$LIBDIRSUFFIX/graphviz/config6
installdocs_fn
INSTALL_TDE=/usr
mangzip_fn
strip_fn
mkdir_install_fn
cat << EOF > $PKG/install/doinst.sh
config() {
NEW="\$1"
OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r \$OLD ]; then
mv \$NEW \$OLD
elif [ "\$(cat \$OLD|md5sum)" = "\$(cat \$NEW|md5sum)" ]; then
# toss the redundant copy
rm \$NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
config etc/php.d/graphviz.ini.new
# Configure plugins
# (writes /usr/lib*/graphviz/config6 with available plugin information)
chroot . /usr/bin/dot -c
EOF
echo "
# HOW TO EDIT THIS FILE:
# The 'handy ruler' below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
$PRGNAM: graphviz (Graph Visualization)
$PRGNAM:
$PRGNAM: Graphviz is open source graph visualization software.
$PRGNAM: It has several main graph layout programs. It also has
$PRGNAM: web and interactive graphical interfaces, and auxiliary
$PRGNAM: tools, libraries, and language bindings.
$PRGNAM:
$PRGNAM: Homepage: http://graphviz.org/
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
" > $PKG/install/slack-desc
makepkg_fn