diff options
author | Eric Hameleers <alien@slackware.com> | 2013-12-07 23:35:12 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2013-12-07 23:35:12 +0000 |
commit | 848c96150e6d69f901a6f0861bb6f1d4caa7ee9d (patch) | |
tree | 278c840d8bdbd1a7e78197070412f1eda2460237 /tigervnc/build/tigervnc.SlackBuild | |
parent | 4f73af7ff6804f78852596d4ee44f5886cade08a (diff) | |
download | asb-848c96150e6d69f901a6f0861bb6f1d4caa7ee9d.tar.gz asb-848c96150e6d69f901a6f0861bb6f1d4caa7ee9d.tar.xz |
Update to 1.3.0, using internally built libjpeg-turbo and fltk
Diffstat (limited to 'tigervnc/build/tigervnc.SlackBuild')
-rwxr-xr-x | tigervnc/build/tigervnc.SlackBuild | 315 |
1 files changed, 207 insertions, 108 deletions
diff --git a/tigervnc/build/tigervnc.SlackBuild b/tigervnc/build/tigervnc.SlackBuild index 237c6972..48524435 100755 --- a/tigervnc/build/tigervnc.SlackBuild +++ b/tigervnc/build/tigervnc.SlackBuild @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # $Id$ # Copyright 2010, 2011, 2012, 2013 Eric Hameleers, Eindhoven. NL # All rights reserved. @@ -28,7 +28,8 @@ # For: tigervnc # Descr: VNC server and client # URL: http://tigervnc.org/ -# Needs: jdk (only during building the java applet) +# Needs: +# BuildNeeds: jdk (only when building the java applet) # Changelog: # r4126-1: 31/Aug/2010 by Eric Hameleers <alien@slackware.com> # * Initial build. @@ -51,17 +52,25 @@ # 1.1.0-4: 11/oct/2013 by Eric Hameleers <alien@slackware.com> # * Build 1.1.0 again, on slackware-current (nee 14.1) with new # X.Org 1.14 patches. -# ---------------------------------------------------------------------------- - +# 1.3.0-1: 12/dec/2013 by Eric Hameleers <alien@slackware.com> +# * Update. All my issues except copy/paste from local to remote +# seem to have been addressed in 1.3.0. +# Build against private versions of libjpeg-turbo and fltk, +# in order to eliminate external dependencies. +# +# ----------------------------------------------------------------------------- PKGNAM=tigervnc -VERSION=${VERSION:-1.1.0} -BUILD=${BUILD:-4} +VERSION=${VERSION:-1.3.0} +PVER=$(echo $VERSION | cut -f1,2 -d. --output-delimiter=) +BUILD=${BUILD:-1} NUMJOBS=${NUMJOBS:" -j4 "} TAG=${TAG:-alien} -# Do we build the java applet (needs jdk)? -DO_APPLET=${DO_APPLET:-"YES"} +# We compile static libraries for libjpeg-turbo and fltk so that they do +# not conflict with (unpatched) system packages: +JPEG=1.3.0 +FLTK=1.3.2 # TigerVNC needs to use source of the X.Org server whose version matches # that of your installed X.Org package: @@ -73,8 +82,25 @@ OSNAME="$(head -1 /etc/slackware-version)" OSVENDOR="Slackware Linux Project" BUILDER="Built by Alien BOB on $(date -u)" +# Do we build the java applet (needs jdk)? +DO_APPLET=${DO_APPLET:-"YES"} + +# Check for the availability of a Java compiler: +if [ "$DO_APPLET" = "YES" ]; then + if ! javac -version 1>/dev/null 2>&1 ; then + echo "**" + echo "** DO_APPLET="YES" means to compile the Java viewer," + echo "** However you do not have a Java JDK installed." + echo "** Press Ctrl-C to abort this script," + echo "** or wait 10 seconds to continue without building the Java viewer." + echo "**" + sleep 10 + DO_APPLET="NO" + fi +fi + # This covers most filenames you'd want as documentation. Change if needed. -DOCS="LICENCE.TXT doc/TODO doc/*.txt doc/*.odt" +DOCS="BUILDING.txt LICENCE.TXT README.txt doc/TODO doc/*.txt doc/*.odt" DOCS_XORG="COPYING ChangeLog" if [ -e $CWD/machine.conf ]; then @@ -120,58 +146,13 @@ CWD=$(pwd) TMP=${TMP:-/tmp} PKG=$TMP/package-$PKGNAM -rm -rf $PKG -mkdir -p $TMP $PKG -cd $TMP -rm -rf $PKGNAM-$VERSION -rm -rf xorg-server-${XORG} -tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1 -tar xvf $CWD/xorg-server-${XORG}.tar.?z* || exit 1 -cd $PKGNAM-$VERSION || exit 1 - -# Move the xorg-server sources into the TigerVNC tree: -mv unix/xserver/hw/vnc ../xorg-server-${XORG}/hw/ -rm -rf unix/xserver/hw -mv ../xorg-server-${XORG}/* unix/xserver/ - -# We have patches for X.Org later than 1.10 which tigervnc does not have: -for PATCHVER in 111 112 113 114 ; do - if [ -e $CWD/tigervnc$(echo $VERSION | cut -f1,2 -d. --output-delimiter=)-xorg${PATCHVER}.patch ]; then - cp $CWD/tigervnc$(echo $VERSION | cut -f1,2 -d. --output-delimiter=)-xorg${PATCHVER}.patch unix/xserver${PATCHVER}.patch - fi -done - -if [ $MAXPATCHVER -gt 110 ]; then - if [ $MAXPATCHVER -lt 113 ]; then - # The sed magic in the hw/vnc Makefile needs some love: - # ... taken care of in the xserver113 patch if we ever move to X.Org 1.13. - cat $CWD/tigervnc$(echo $VERSION | cut -f1,2 -d. --output-delimiter=)-xorg_headers.patch | patch -p1 --verbose || exit 1 - else - # We need to rewrite the xserver110.patch for X.Org 1.13 and newer: - cp $CWD/tigervnc$(echo $VERSION | cut -f1,2 -d. --output-delimiter=)-xorg110.patch unix/xserver110.patch - fi -fi - -# Patch the xorg-server source to include building the vnc driver -cd unix/xserver - if [ $MAXPATCHVER -le 110 ]; then - # apply one of the tigervnc-provided patches: - cat ../xserver${MAXPATCHVER}.patch | patch -p1 --verbose || exit 1 - else - # these external patches are incremental and must be applied in order: - for PATCHVER in 110 111 112 113 114 ; do - if [ $PATCHVER -le $MAXPATCHVER -a -e ../xserver${PATCHVER}.patch ]; then - cat ../xserver${PATCHVER}.patch | patch -p1 --verbose || exit 1 - fi - done - fi -cd - - -# We use Java7: -cat $CWD/tigervnc11-java7.patch | patch -p1 --verbose || exit 1 - -# Explicitly put the java applet into a directory named 'tigervnc': -sed -i -e 's#/vnc/class#/tigervnc/class#'g $(grep -rl vnc/class .) +rm -rf $TMP/tmp-${PKGNAM} $PKG +mkdir -p $TMP/tmp-${PKGNAM}/deps/usr $PKG +cd $TMP/tmp-${PKGNAM} +tar --owner=root --group=root -xvf $CWD/sources/$PKGNAM-$VERSION.tar.?z* || exit 1 +tar --owner=root --group=root -xvf $CWD/sources/libjpeg-turbo-${JPEG}.tar.?z* || exit 1 +tar --owner=root --group=root -xvf $CWD/sources/fltk-${FLTK}-source.tar.?z* || exit 1 +tar --owner=root --group=root -xvf $CWD/sources/xorg-server-${XORG}.tar.?z* || exit 1 # Make sure ownerships and permissions are sane: chown -R root:root . @@ -181,30 +162,163 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; -export LDFLAGS="$SLKLDFLAGS -lpthread" +export LDFLAGS="$SLKLDFLAGS" export CXXFLAGS="$SLKCFLAGS" export CFLAGS="$SLKCFLAGS" -echo -e "\n*** Building tigervnc ***\n" -autoreconf -vif -./configure \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --mandir=/usr/man \ - --docdir=/usr/doc/$PKGNAM-$VERSION \ - --localstatedir=/var \ - --sysconfdir=/etc \ - --disable-static \ - --program-prefix= \ - --program-suffix= \ - --build=$TARGET - -make $NUMJOBS || make || exit 1 -make DESTDIR=$PKG install || exit 1 - -cd unix/xserver - echo -e "\n*** Building xserver ***\n" - export CXXFLAGS="$SLKCFLAGS -fpermissive" +cat <<EOT +# +# Compile libjpeg-turbo: +# +EOT + +cd libjpeg-turbo-${JPEG} || exit 1 + + ./configure \ + --prefix=$TMP/tmp-${PKGNAM}/deps/usr \ + --libdir=$TMP/tmp-${PKGNAM}/deps/usr/lib${LIBDIRSUFFIX}/libjpeg-turbo \ + --includedir=$TMP/tmp-${PKGNAM}/deps/usr/include/libjpeg-turbo \ + --mandir=$TMP/tmp-${PKGNAM}/deps/usr/man \ + --program-prefix= \ + --program-suffix="-turbo" \ + --build=$TARGET + + make $NUMJOBS || make || exit 1 + make install || exit 1 +cd - + +cat <<EOT +# +# Compile fltk: +# +EOT + +cd fltk-${FLTK} || exit 1 + + # Essentially these patches are copied from BUILDING.txt + # embedded in the tigervnc source tarball: + + # Export dead key information from FLTK to the apps + # http://www.fltk.org/str.php?L2599 + cat $CWD/patches/fltk-1_v4.3.x-keyboard-x11.patch | patch -p1 --verbose || exit 1 + cat $CWD/patches/fltk-1_v4.3.x-keyboard-win32.patch | patch -p1 --verbose || exit 1 + cat $CWD/patches/fltk-1_v6.3.x-keyboard-osx.patch | patch -p1 --verbose || exit 1 + + # Notify applications of changes to the clipboard + # http://www.fltk.org/str.php?L2636 + cat $CWD/patches/fltk-1.3.x-clipboard.patch | patch -p1 --verbose || exit 1 + cat $CWD/patches/fltk-1_v6.3.x-clipboard-x11.patch | patch -p1 --verbose || exit 1 + cat $CWD/patches/fltk-1_v3.3.x-clipboard-win32-fix.patch | patch -p1 --verbose || exit 1 + cat $CWD/patches/fltk-1_v2.3.x-clipboard-win32.patch | patch -p1 --verbose || exit 1 + cat $CWD/patches/fltk-1_v2.3.x-clipboard-osx.patch | patch -p1 --verbose || exit 1 + + # Ability to convert a Fl_Pixmap to a Fl_RGB_Image + # http://www.fltk.org/str.php?L2659 + cat $CWD/patches/pixmap_v2.patch | patch -p1 --verbose || exit 1 + + # Support for custom cursors + # http://www.fltk.org/str.php?L2660 + cat $CWD/patches/fltk-1_v5.3.x-cursor.patch | patch -p1 --verbose || exit 1 + + # Improve modality interaction with WM + # http://www.fltk.org/str.php?L2802 + cat $CWD/patches/fltk-1_v2.3.0-modal.patch | patch -p1 --verbose || exit 1 + + # Window icons + # http://www.fltk.org/str.php?L2816 + cat $CWD/patches/fltk-1_v3.3.0-icons.patch | patch -p1 --verbose || exit 1 + + # Multihead + # http://fltk.org/str.php?L2860 + cat $CWD/patches/fltk-1.3.x-screen_num.patch | patch -p1 --verbose || exit 1 + cat $CWD/patches/fltk-1_v3.3.x-multihead.patch | patch -p1 --verbose || exit 1 + + # Verbose build output: + sed -i -e '\,^.SILENT:,d' makeinclude.in + + ./configure \ + --prefix=$TMP/tmp-${PKGNAM}/deps/usr \ + --libdir=$TMP/tmp-${PKGNAM}/deps/usr/lib${LIBDIRSUFFIX} \ + --includedir=$TMP/tmp-${PKGNAM}/deps/usr/include/fltk \ + --mandir=$TMP/tmp-${PKGNAM}/deps/usr/man \ + --enable-cairo \ + --enable-gl \ + --enable-largefile \ + --disable-shared \ + --enable-threads \ + --enable-xinerama \ + --enable-xft \ + --enable-xdbe \ + --build=$TARGET + + make $NUMJOBS || make || exit 1 + make install || exit 1 +cd - + +cat <<EOT +# +# Compile tigervnc: +# +EOT + +cd $PKGNAM-$VERSION || exit 1 + +# Apply some patches from SVN: +cat $CWD/patches/tigervnc${PVER}_screenindex.patch | patch -p2 --verbose || exit 1 +cat $CWD/patches/tigervnc${PVER}_typecast.patch | patch -p2 --verbose || exit 1 +cat $CWD/patches/tigervnc${PVER}_clipboard_probe.patch | patch -p2 --verbose || exit 1 + +# Explicitly link against libpng to prevent linking errors: +cat $CWD/patches/tigervnc13_link_png.patch | patch -p1 --verbose || exit 1 + +[ "$DO_APPLET" = "YES" ] && CMAKE_JAVA="ON" || CMAKE_JAVA="OFF" +# Explicitly put the java applet into a directory named 'tigervnc': +sed -i -e 's#/vnc/class#/tigervnc/class#'g $(grep -rl vnc/class .) +sed -i -e 's#DESTINATION vnc/class#DESTINATION share/tigervnc/class#'g $(grep -rl vnc/class .) + +export LDFLAGS="$SLKLDFLAGS -ldl -lpthread" +export CXXFLAGS="$SLKCFLAGS -fpermissive -I $(pwd)/common" + +# Fix the man page installation: +sed -i -e 's,set(MAN_DIR "${DATA_DIR}/man"),set(MAN_DIR "${MAN_INSTALL_DIR}"),' CMakeLists.txt + +mkdir -p build +cd build + echo -e "\n*** Building vnc client ***\n" + cmake \ + -G "Unix Makefiles" \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DMAN_INSTALL_DIR=/usr/man \ + -DSYSCONF_INSTALL_DIR=/etc \ + -DLIB_SUFFIX=${LIBDIRSUFFIX} \ + -DENABLE_PAM:BOOL=OFF \ + -DBUILD_JAVA:BOOL=${CMAKE_JAVA} \ + -DJPEG_INCLUDE_DIR=$TMP/tmp-${PKGNAM}/deps/usr/include/libjpeg-turbo \ + -DJPEG_LIBRARY=$TMP/tmp-${PKGNAM}/deps/usr/lib${LIBDIRSUFFIX}/libjpeg-turbo/libjpeg.a \ + -DFLTK_FLUID_EXECUTABLE="$TMP/tmp-${PKGNAM}/deps/usr/bin/fluid" \ + -DFLTK_INCLUDE_DIR="$TMP/tmp-${PKGNAM}/deps/usr/include/fltk" \ + .. + make V=1 $NUMJOBS || make || exit 1 + make DESTDIR=$PKG install +cd - + +# Do we have a patch for X.Org which tigervnc does not have? +if [ ! -f unix/xserver${MAXPATCHVER}.patch -a -f $CWD/xserver${MAXPATCHVER}.patch ] +then + cp $CWD/xserver${MAXPATCHVER}.patch unix/ +fi + +# Prepare the Xvnc sources (we are building out-of-tree, in ./build directory): +mkdir -p build/unix +cp -R unix/xserver unix/xserver${MAXPATCHVER}.patch build/unix/ +cp -R ../xorg-server-${XORG}/* build/unix/xserver/ + +cd build/unix/xserver/ + # Patch the xorg-server source to include building vnc driver: + cat ../xserver${MAXPATCHVER}.patch | patch -p1 --verbose + echo -e "\n*** Building vnc server ***\n" autoreconf -vif # Default font paths to be used by the X server @@ -216,7 +330,7 @@ cd unix/xserver --sysconfdir=/etc \ --localstatedir=/var \ --mandir=/usr/man \ - --disable-dri \ + --disable-dri --disable-dri2 \ --disable-static \ --disable-xorg --disable-xnest --disable-xvfb --disable-dmx \ --disable-xwin --disable-xephyr --disable-kdrive \ @@ -243,30 +357,11 @@ cd unix/xserver --with-builderstring="$BUILDER" \ --build=$TARGET - make $NUMJOBS || make || exit 1 - make -C hw/vnc DESTDIR=$PKG install + make V=1 TIGERVNC_SRCDIR="$TMP/tmp-${PKGNAM}/${PKGNAM}-${VERSION}" $NUMJOBS + make TIGERVNC_SRCDIR="$TMP/tmp-${PKGNAM}/${PKGNAM}-${VERSION}" -C hw/vnc \ + DESTDIR=$PKG install cd - -if [ "$DO_APPLET" = "YES" ]; then - # Compile the java applet (needs the JDK... JRE is not enough): - cd java/src/com/tigervnc/vncviewer - make || exit 1 - cd - -fi - -# Create .png icons from the .svg file: -make -C media - -if [ "$DO_APPLET" = "YES" ]; then - # Install the java applet: - cd java/src/com/tigervnc/vncviewer - mkdir -p $PKG/usr/share/tigervnc/classes - install -m0755 VncViewer.jar $PKG/usr/share/tigervnc/classes/ - install -m0644 index.vnc $PKG/usr/share/tigervnc/classes/ - install -m0644 *.class $PKG/usr/share/tigervnc/classes/ - cd - -fi - # Install menu entry: mkdir -p $PKG/usr/share/{applications,icons/hicolor/{16x16,24x24,32x32,48x48}/apps} for PSIZE in 16 24 32 48; do @@ -314,9 +409,13 @@ fi EOT # Add documentation: +# First, remove files which were misplaced: +rm -f $PKG/usr/doc/* +cd $TMP/tmp-${PKGNAM}/${PKGNAM}-${VERSION} mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION cp -a $DOCS $PKG/usr/doc/$PKGNAM-$VERSION || true -for FIL in $(echo $DOCS_XORG); do cp -a unix/xserver/$FIL $PKG/usr/doc/$PKGNAM-$VERSION/${FIL}.xorg ; done +for FIL in $(echo $DOCS_XORG); do cp -a build/unix/xserver/$FIL $PKG/usr/doc/$PKGNAM-$VERSION/${FIL}.xorg ; done || true +cat $CWD/$(basename $0) > $PKG/usr/doc/$PKGNAM-$VERSION/$PKGNAM.SlackBuild chown -R root:root $PKG/usr/doc/$PKGNAM-$VERSION find $PKG/usr/doc -type f -exec chmod 644 {} \; @@ -328,7 +427,7 @@ fi # Strip binaries (if any): find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true # Add a package description: mkdir -p $PKG/install @@ -339,5 +438,5 @@ fi # Build the package: cd $PKG -/sbin/makepkg -l y -c n $TMP/${PKGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz +/sbin/makepkg -l y -c n $TMP/${PKGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz} |