#!/bin/bash # Slackware build script for tigervnc # Written 2026-09-23 for Parted Magic. There was no recipe on file for the # tigervnc that shipped in 26.09_3 (1.12.0), so this one is new, not recovered. # # Configuration choices are taken from the SHIPPED 1.12.0 binaries so the # rebuild lands in the same place: # - font path, xkb paths and serverconfig path read out of the shipped Xvnc # - PAM on (shipped Xvnc and vncviewer both link libpam) # - H.264 OFF (the shipped vncviewer links no libavcodec) set -e cd "$(dirname "$0")" ; CWD=$(pwd) PRGNAM=tigervnc VERSION=${VERSION:-1.16.2} XORGVER=${XORGVER:-21.1.24} BUILD=${BUILD:-1} TAG=${TAG:-_pmagic} PKGTYPE=${PKGTYPE:-txz} ARCH=${ARCH:-x86_64} if [ -n "${PRINT_PACKAGE_NAME:-}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"; exit 0 fi TMP=${TMP:-/tmp/pm-build} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-$TMP} NUMJOBS=${NUMJOBS:--j8} SLKCFLAGS="-O2 -fPIC" FONTPATH="/usr/share/fonts/local,/usr/share/fonts/TTF,/usr/share/fonts/OTF,/usr/share/fonts/Type1,/usr/share/fonts/misc,/usr/share/fonts/CID,/usr/share/fonts/75dpi/:unscaled,/usr/share/fonts/100dpi/:unscaled,/usr/share/fonts/75dpi,/usr/share/fonts/100dpi,/usr/share/fonts/cyrillic" rm -rf "$PKG" "$TMP/$PRGNAM-$VERSION" mkdir -p "$TMP" "$PKG" "$OUTPUT" cd "$TMP" tar xzf "$CWD/$PRGNAM-$VERSION.tar.gz" cd "$PRGNAM-$VERSION" chown -R root:root . find . -perm /111 -a \! -perm 755 -exec chmod 755 {} \+ -o \ \! -perm /111 -a \! -perm 644 -exec chmod 644 {} \+ # ---- part 1: viewer, common libraries, x0vncserver ----------------------- # IN-TREE on purpose. unix/xserver/hw/vnc/Makefile.am resolves # TIGERVNC_SRCDIR = $(abspath $(top_srcdir)/../..) # TIGERVNC_BUILDDIR = $(abspath $(top_builddir)/../..) # from unix/xserver, so both only point at the tigervnc root when the cmake # build and the xserver build share that root. An out-of-tree build makes # them point at the build directory and hw/vnc then cannot find # common/core/Configuration.h. cmake -G "Unix Makefiles" \ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib64 \ -DCMAKE_INSTALL_MANDIR=/usr/man \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DBUILD_VIEWER=ON \ -DENABLE_NLS=ON \ -DENABLE_H264=OFF \ -DENABLE_GNUTLS=ON \ -DENABLE_NETTLE=ON \ -DCMAKE_BUILD_TYPE=Release \ . make $NUMJOBS make install DESTDIR="$PKG" # ---- part 2: Xvnc and the libvnc Xorg module ---------------------------- # Built against the SAME xorg-server the image ships, so the module matches # the running server's ABI. tar xf "$CWD/xorg-server-$XORGVER.tar.xz" -C "$TMP" cp -R "$TMP/xorg-server-$XORGVER"/* unix/xserver/ cd unix/xserver patch -p1 < ../../unix/xserver21.patch cd "$TMP/$PRGNAM-$VERSION" # upstream 1.16 leaves CORE_LIB undefined, so libcore is never linked into the # Xorg module and libvnc.so will not load. See the patch header. patch -p1 < "$CWD/$PRGNAM-$VERSION-libvnc-link.patch" cd unix/xserver autoreconf -fiv ./configure \ --prefix=/usr \ --libdir=/usr/lib64 \ --mandir=/usr/man \ --sysconfdir=/etc \ --with-pic --without-dtrace --disable-static --disable-dri \ --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg \ --disable-dmx --disable-xwin --disable-xephyr --disable-kdrive \ --disable-config-hal --disable-config-udev --disable-dri2 --enable-glx \ --enable-pam \ --with-default-font-path="$FONTPATH" \ --with-xkb-path=/usr/share/X11/xkb \ --with-xkb-output=/var/lib/xkb \ --with-xkb-bin-directory=/usr/bin \ --with-serverconfig-path=/usr/lib64/xorg make $NUMJOBS make install DESTDIR="$PKG" cd "$TMP/$PRGNAM-$VERSION" # ---- packaging ---------------------------------------------------------- # 1.16 no longer installs the snippet that loads the Xorg module; 1.12.0 # shipped one and without it libvnc.so is never loaded. Take upstream's. mkdir -p "$PKG/etc/X11/xorg.conf.d" cp -a contrib/packages/rpm/el9/SOURCES/10-libvnc.conf \ "$PKG/etc/X11/xorg.conf.d/10-libvnc.conf" # no systemd in this image rm -rf "$PKG/usr/lib/systemd" "$PKG/usr/lib/tmpfiles.d" rmdir "$PKG/usr/lib" 2>/dev/null || true # Slackware keeps documentation in /usr/doc if [ -d "$PKG/usr/share/doc" ]; then mkdir -p "$PKG/usr/doc/$PRGNAM-$VERSION" cp -a "$PKG/usr/share/doc/$PRGNAM"/* "$PKG/usr/doc/$PRGNAM-$VERSION/" 2>/dev/null || true rm -rf "$PKG/usr/share/doc" fi # config files ship as .new so an upgrade never clobbers a running setup for f in "$PKG"/etc/tigervnc/* "$PKG"/etc/X11/xorg.conf.d/*.conf "$PKG"/etc/pam.d/*; do [ -f "$f" ] && [ "${f##*.}" != new ] && mv "$f" "$f.new" done rm -f "$PKG"/usr/lib64/xorg/modules/extensions/libvnc.la || true find "$PKG" -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \ grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2>/dev/null || true find "$PKG"/usr/man -type f -exec gzip -9 {} \; 2>/dev/null || true mkdir -p "$PKG/usr/doc/$PRGNAM-$VERSION" cp -a LICENCE.TXT README.rst BUILDING.txt "$PKG/usr/doc/$PRGNAM-$VERSION/" 2>/dev/null || true cp -a "$CWD/$PRGNAM.SlackBuild" "$CWD/$PRGNAM.info" "$PKG/usr/doc/$PRGNAM-$VERSION/" 2>/dev/null || true mkdir -p "$PKG/install" cat > "$PKG/install/slack-desc" <<'EOD' tigervnc: tigervnc (VNC server and client) tigervnc: tigervnc: Virtual Network Computing (VNC) is a remote display system which tigervnc: allows you to view a desktop environment from anywhere on the Internet tigervnc: and from a wide variety of machine architectures. tigervnc: tigervnc: Homepage: https://tigervnc.org/ tigervnc: tigervnc: tigervnc: tigervnc: EOD cat > "$PKG/install/doinst.sh" <<'EOD' config() { NEW="$1"; OLD="$(dirname $NEW)/$(basename $NEW .new)" if [ ! -r $OLD ]; then mv $NEW $OLD elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then rm $NEW; fi } for f in etc/tigervnc/*.new etc/pam.d/*.new etc/X11/xorg.conf.d/*.new ; do [ -e "$f" ] && config "$f" done EOD cd "$PKG" /sbin/makepkg -l y -c n "$OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"