diff options
Diffstat (limited to 'system/kmscon/kmscon.SlackBuild')
-rw-r--r-- | system/kmscon/kmscon.SlackBuild | 102 |
1 files changed, 66 insertions, 36 deletions
diff --git a/system/kmscon/kmscon.SlackBuild b/system/kmscon/kmscon.SlackBuild index a8aafaaa03..caa3e0c555 100644 --- a/system/kmscon/kmscon.SlackBuild +++ b/system/kmscon/kmscon.SlackBuild @@ -2,18 +2,29 @@ # Slackware build script for kmscon -# Written by B. Watson (yalhcru@gmail.com) +# Written by B. Watson (urchlay@slackware.uk) # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. +# 20230722 bkw: switch to Aetf's fork, which looks actively +# maintained. Thanks to lockywolf for finding it. Also, include +# libtsm here instead of as a separate build: it's been on SBo for ~9 +# years and nothing but this ever depended on it. + +# 20210825 bkw: update to the last git commit, post v8 release. It's from +# 2014, so I doubt there will be more version updates. + cd $(dirname $0) ; CWD=$(pwd) PRGNAM=kmscon -VERSION=${VERSION:-8} +VERSION=${VERSION:-9.0.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} +LIBNAM=libtsm +LIBVER=${LIBVER:-4.0.2} + if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; @@ -22,9 +33,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -50,44 +58,66 @@ fi set -e -rm -rf $PKG -mkdir -p $TMP $PKG $OUTPUT -cd $TMP -rm -rf $PRGNAM-$VERSION +TOPDIR=$TMP/$PRGNAM-build +rm -rf $PKG $TOPDIR +mkdir -p $TOPDIR $PKG $OUTPUT +cd $TOPDIR tar xvf $CWD/$PRGNAM-$VERSION.tar.xz -cd $PRGNAM-$VERSION +tar xvf $CWD/$LIBNAM-$LIBVER.tar.gz 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 \ - \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; - -SLKCFLAGS="$SLKCFLAGS -DSIGUNUSED=SIGSYS" -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -./configure \ - --disable-static \ - --enable-shared \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --mandir=/usr/man \ - --docdir=/usr/doc/$PRGNAM-$VERSION \ - --build=$ARCH-slackware-linux - -make -make install-strip DESTDIR=$PKG +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} + + +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +LIBDOC=$PKGDOC/$LIBNAM-$LIBVER +mkdir -p $LIBDOC + +# first, the library: +cd $TOPDIR/$LIBNAM-$LIBVER +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release .. + make + make install/strip DESTDIR=$PKG +cd .. + +cp -a COPYING LICENSE_htable NEWS README* $LIBDOC + +export PKG_CONFIG_PATH=$PKG/usr/lib$LIBDIRSUFFIX/pkgconfig:$PKG_CONFIG_PATH + +# now, build the app, using the lib we just built. +cd $TOPDIR/$PRGNAM-$VERSION + +# meson is a moving target. this patch doesn't entirely fix things, we also +# have to manually set some LDFLAGS and CFLAGS, below. +patch -p1 < $CWD/meson-compat.diff + +mkdir build +cd build + LDFLAGS="-L$PKG/usr/lib$LIBDIRSUFFIX -ldl" \ + CFLAGS="-I$PKG/usr/include $SLKCFLAGS" \ + meson .. \ + --buildtype=release \ + --infodir=/usr/info \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --localstatedir=/var \ + --mandir=/usr/man \ + --prefix=/usr \ + --sysconfdir=/etc \ + -Dstrip=true + "${NINJA:=ninja}" + DESTDIR=$PKG $NINJA install +cd .. gzip $PKG/usr/man/man1/$PRGNAM.1 - mkdir -p $PKG/etc/$PRGNAM cat $CWD/$PRGNAM.conf > $PKG/etc/$PRGNAM/$PRGNAM.conf.new -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a COPYING NEWS README $PKG/usr/doc/$PRGNAM-$VERSION -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +cp -a COPYING NEWS README* docs/*.txt $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc |