diff options
Diffstat (limited to 'system/kmscon')
-rw-r--r-- | system/kmscon/README.Slackware | 2 | ||||
-rw-r--r-- | system/kmscon/git2tarxz.sh | 71 | ||||
-rw-r--r-- | system/kmscon/kmscon.SlackBuild | 112 | ||||
-rw-r--r-- | system/kmscon/kmscon.info | 14 | ||||
-rw-r--r-- | system/kmscon/meson-compat.diff | 32 |
5 files changed, 188 insertions, 43 deletions
diff --git a/system/kmscon/README.Slackware b/system/kmscon/README.Slackware index a3e71f6d80..e8a97402a9 100644 --- a/system/kmscon/README.Slackware +++ b/system/kmscon/README.Slackware @@ -5,7 +5,7 @@ As shipped, kmscon only works for root. If you want to be able to run it as a normal user, you could make it setuid root (not recommended). A better solution: -setcap cap_sys_tty_config,cap_sys_admin=ep +setcap cap_sys_tty_config,cap_sys_admin=ep /usr/bin/kmscon See capabilities(7) and http://www.slackbuilds.org/caps/ for more info on capabilities. diff --git a/system/kmscon/git2tarxz.sh b/system/kmscon/git2tarxz.sh new file mode 100644 index 0000000000..1b26868216 --- /dev/null +++ b/system/kmscon/git2tarxz.sh @@ -0,0 +1,71 @@ +#!/bin/sh + +# This git2tarxz has special case code for kmscon. + +# Create source tarball from git repo, with generated version number. + +# Takes one optional argument, which is the commit or tag to create a +# tarball of. With no arg, HEAD is used. + +# Version number example: 0.0.1+20200227_ad7ec17 + +# Notes: + +# Do not use this if you're packaging a release. + +# This script doesn't need to be run as root. It does need to be able +# to write to the current directory it's run from. + +# Running this script twice for the same commit will NOT give identical +# tarballs, even if the contents are identical. This is because tar +# includes the current time in a newly-created tarball (plus there may +# be other git-related reasons). + +# Once you've generated a tarball, you'll still need a place to host it. +# Ask on the mailing list, if you don't have your own web server to +# play with. + +## Config: +# final tarball and slackbuild PRGNAM: +PRGNAM=kmscon + +# For github projects, you can use this unmodified: +CLONE_URL=git://people.freedesktop.org/~dvdhrm/kmscon + +## End of config. + +set -e + +GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX ) +rm -rf $GITDIR +git clone $CLONE_URL $GITDIR + +CWD="$( pwd )" +cd $GITDIR + +if [ "$1" != "" ]; then + git reset --hard "$1" || exit 1 +fi + +GIT_SHA=$( git rev-parse --short HEAD ) + +DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 ) + +# special case here: upstream's tags are "kmscon-<version>", not +# just <version>. +VERTAG=$( git tag -l | tail -1 | cut -d- -f2 ) + +VERSION=${VERTAG}+${DATE}_${GIT_SHA} + +rm -rf .git +find . -name .gitignore -print0 | xargs -0 rm -f + +cd "$CWD" +rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz +mv $GITDIR $PRGNAM-$VERSION +tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION + +echo +echo "Created tarball: $PRGNAM-$VERSION.tar.xz" +echo "VERSION=\"$VERSION\"" +echo "MD5SUM=\"$( md5sum $PRGNAM-$VERSION.tar.xz | cut -d' ' -f1 )\"" diff --git a/system/kmscon/kmscon.SlackBuild b/system/kmscon/kmscon.SlackBuild index e766a633fa..caa3e0c555 100644 --- a/system/kmscon/kmscon.SlackBuild +++ b/system/kmscon/kmscon.SlackBuild @@ -1,15 +1,29 @@ -#!/bin/sh +#!/bin/bash # 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 @@ -19,7 +33,11 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} @@ -40,48 +58,70 @@ 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 cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/kmscon/kmscon.info b/system/kmscon/kmscon.info index ffeac16026..895effecbb 100644 --- a/system/kmscon/kmscon.info +++ b/system/kmscon/kmscon.info @@ -1,10 +1,12 @@ PRGNAM="kmscon" -VERSION="8" -HOMEPAGE="http://www.freedesktop.org/wiki/Software/kmscon/" -DOWNLOAD="http://www.freedesktop.org/software/kmscon/releases/kmscon-8.tar.xz" -MD5SUM="90d39c4ef53a11c53f27be4a7e9acee4" +VERSION="9.0.0" +HOMEPAGE="https://github.com/Aetf/kmscon" +DOWNLOAD="https://github.com/Aetf/kmscon/releases/download/v9.0.0/kmscon-9.0.0.tar.xz \ + https://github.com/Aetf/libtsm/archive/v4.0.2/libtsm-4.0.2.tar.gz" +MD5SUM="1095a675c17d6adc6aa1537aff72c642 \ + bcf1bafa3798bced0e9bd16b4afdf256" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="libtsm" +REQUIRES="" MAINTAINER="B. Watson" -EMAIL="yalhcru@gmail.com" +EMAIL="urchlay@slackware.uk" diff --git a/system/kmscon/meson-compat.diff b/system/kmscon/meson-compat.diff new file mode 100644 index 0000000000..6e5c693194 --- /dev/null +++ b/system/kmscon/meson-compat.diff @@ -0,0 +1,32 @@ +diff -Naur kmscon-9.0.0/meson.build kmscon-9.0.0.patched/meson.build +--- kmscon-9.0.0/meson.build 2022-06-15 03:48:52.000000000 -0400 ++++ kmscon-9.0.0.patched/meson.build 2023-07-22 03:32:29.965571375 -0400 +@@ -7,7 +7,7 @@ + license: 'MIT', + # meson 0.58: f-string + # meson 0.62: dependency libdl +- meson_version: '>=0.62.0', ++ meson_version: '>=0.59.4', + default_options: [ + 'warning_level=1', + 'werror=true', +@@ -48,7 +48,6 @@ + libtsm_deps = dependency('libtsm', version: '>=4.0.0') + libudev_deps = dependency('libudev', version: '>=172') + libdrm_deps = dependency('libdrm') +-dl_deps = dependency('dl') + threads_deps = dependency('threads') + + python = find_program('python3') +diff -Naur kmscon-9.0.0/src/meson.build kmscon-9.0.0.patched/src/meson.build +--- kmscon-9.0.0/src/meson.build 2022-06-15 03:48:52.000000000 -0400 ++++ kmscon-9.0.0.patched/src/meson.build 2023-07-22 03:33:42.300564567 -0400 +@@ -257,7 +257,7 @@ + kmscon_srcs += 'kmscon_terminal.c' + endif + kmscon = executable('kmscon', kmscon_srcs, +- dependencies: [xkbcommon_deps, libtsm_deps, threads_deps, dl_deps, conf_deps, shl_deps, eloop_deps, uterm_deps], ++ dependencies: [xkbcommon_deps, libtsm_deps, threads_deps, conf_deps, shl_deps, eloop_deps, uterm_deps], + export_dynamic: true, + install: true, + install_dir: libexecdir, |