Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 121 lines (104 sloc) 3.37 KB
#! /bin/bash
PKG=xfig
VERSION=3.2.7a
FSVERSION=3.2.7 # no silly 'a' in the filesystem
BUILD=1
PREFIX=/pkg/$PKG-$FSVERSION-$BUILD
if [ -n "$TESTING" ]; then PREFIX=/dev/shm/$PKG-$FSVERSION-$BUILD ; fi
set -xe
umask 022
BUILD_TMPDIR=/dev/shm/$PKG-$FSVERSION-$BUILD.build.tmp
test -d $BUILD_TMPDIR && ( chmod -R u+rwx $BUILD_TMPDIR || true ; rm -rf $BUILD_TMPDIR )
mkdir -p $BUILD_TMPDIR/home
export TMPDIR=$BUILD_TMPDIR
export HOME=$BUILD_TMPDIR/home
exec </dev/null
mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:\$PATH
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig\${PKG_CONFIG_PATH:+:\$PKG_CONFIG_PATH}
export PKG_CONFIG_PATH
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH} ; fi
EOF
. $PREFIX/profile
export MAKEFLAGS="-j $(nproc)"
BUILDDIR=$PREFIX/build
mkdir -p $BUILDDIR
cd $BUILDDIR
(
NPBMVERSION=10.73.29
test -e netpbm-${NPBMVERSION}.tgz || wget --no-verbose https://sourceforge.net/projects/netpbm/files/super_stable/${NPBMVERSION}/netpbm-${NPBMVERSION}.tgz
test -d netpbm-${NPBMVERSION} || tar -xf netpbm-${NPBMVERSION}.tgz
cd netpbm-${NPBMVERSION}
cat config.mk.in - <<- EOF > config.mk
DEFAULT_TARGET = nonmerge
NETPBMLIBTYPE = unixshared
NETPBMLIBSUFFIX = so
STATICLIB_TOO = Y
CFLAGS = -O3 -ffast-math -pedantic -fno-common -Wall -Wno-uninitialized -Wmissing-declarations -Wimplicit -Wwrite-strings -Wmissing-prototypes -Wundef -Wno-unknown-pragmas
CFLAGS_MERGE = -Wno-missing-declarations -Wno-missing-prototypes
LDRELOC = ld --reloc
LINKER_CAN_DO_EXPLICIT_LIBRARY = Y
LINKERISCOMPILER = Y
CFLAGS_SHLIB += -fPIC
TIFFLIB = libtiff.so
JPEGLIB = libjpeg.so
ZLIB = libz.so
NETPBM_DOCURL = http://netpbm.sourceforge.net/doc/
WANT_SSE = Y
RPATH = -Wl,-rpath=$PREFIX/lib
EOF
make || make -j1
PKGDIR=$(pwd)/pkg
make package pkgdir=$PKGDIR
# say no to interactive buildtools/installnetpbm.pl
mkdir -p $PREFIX/bin
mkdir -p $PREFIX/share/man
mkdir -p $PREFIX/lib/pkgconfig
sed -e "s,@VERSION@,$NPBMVERSION," \
-e "s,@LINKDIR@,$PREFIX/lib," \
-e "s,@INCLUDEDIR@,$PREFIX/include," \
buildtools/pkgconfig_template > $PREFIX/lib/pkgconfig/netpbm.pc
cd $PKGDIR
cp -va bin $PREFIX
cp -va include $PREFIX
( cd $PREFIX/include; for i in netpbm/*.h; do ln -s $i; done ) # an awful compatibility hack ...
if [ -r lib/libnetpbm.so.11 ]; then
( cd lib ; rm -f libnetpbm.so ; ln -sf libnetpbm.so.11 libnetpbm.so )
else
echo "ERROR: libnetpbm.so.11 not found."
echo "Please edit the correct library major version into the build script"
kill $$; exit 1
fi
cp -va lib $PREFIX
cp -vp link/libnetpbm.a $PREFIX/lib
cp -va man/man? $PREFIX/share/man
cp -vp misc/* $PREFIX/lib
)
(
test -e xfig-full-${VERSION}.tar.xz || wget --no-verbose https://downloads.sourceforge.net/mcj/xfig-full-${VERSION}.tar.xz
test -d xfig-${VERSION} || tar -xf xfig-full-${VERSION}.tar.xz
cd xfig-${VERSION}
./configure \
--prefix=$PREFIX
make
make install
# create a xfig wrapper since /etc/X11/app-defaults/Fig is gone/outdated
(
cd $PREFIX/bin
mv xfig xfig.app
cat <<- EOF > xfig
#! /bin/bash
XAPPLRESDIR=\${XAPPLRESDIR:-$PREFIX/share/X11/app-defaults} \\
exec $PREFIX/bin/xfig.app "\$@"
EOF
chmod 755 xfig
)
)
(
cd fig2dev-${VERSION}
./configure --enable-transfig --prefix=$PREFIX
make
make install
)
exit