26

Re: [Collection] Compilation of packages and ports (not in repositories)

Package sile

(as possible replacement for LaTex)

PKGBUILD

# Maintainer: Tobias Dausend <throgh@hyperbola.info>

pkgname=sile
pkgdesc="Free and libre typesetting engine, fully customizable in Lua"
pkgver=0.9.4
pkgrel=1
arch=('i686' 'x86_64')
url='https://www.sile-typesetter.org'
license=('Expat')
_luadeps=(lpeg
          filesystem
          compat53
          expat)
depends=("${_luadeps[@]/#/lua51-}" 'fontconfig' 'freetype2' 'ttf-gentium'
         'glibc' 'harfbuzz' 'icu' 'libpng' 'luajit' 'zlib')
source=("https://github.com/sile-typesetter/sile/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.bz2")
sha512sums=('194a6279aa2cd21772fb20adfd20e0d92e95fe652f9ba193e26d872bb5f9b5367f0e6cd15228f7a077881b510d82cc8fe7d0e90b40236fa0d4590971c6824108')

build () {
  cd "${pkgname}-${pkgver}"
  ./configure \
    --prefix /usr \
    --docdir /usr/share/doc/$pkgname
  make all
}

package () {
  cd "${pkgname}-${pkgver}"
  make install DESTDIR="$pkgdir"
  install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

27

Re: [Collection] Compilation of packages and ports (not in repositories)

Package mariadb

We have removed mariadb out of the reasoning of being not fully compliant to community-oriented software. Sharing now the removed data from the commit here: https://git.hyperbola.info:50100/~team/ … 1d9aede210
Perhaps there is interest to create further packages from and for the community in a separate repository.

PKGBUILD

# Maintainer (Arch): Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Maintainer (Arch): Christian Hesse <mail@eworm.de>
# Maintainer: André Silva <emulatorman@hyperbola.info>
# Contributor: Tobias Dausend <throgh@hyperbola.info>

pkgbase=mariadb
pkgname=('mariadb-libs' 'mariadb-clients' 'mariadb' 'mytop')
pkgver=10.3.24
_debver=$pkgver
_debrel=2
pkgrel=9
arch=('i686' 'x86_64')
license=('GPL-2')
url='https://mariadb.org/'
makedepends=('boost' 'bzip2' 'cmake' 'jemalloc' 'libaio' 'libxcrypt' 'libressl' 'libxml2'
             'lz4' 'lzo' 'zlib' 'quilt')
source=("https://archive.mariadb.org/mariadb-$pkgver/source/mariadb-$pkgver.tar.gz"{,.asc}
        "https://repo.hyperbola.info:50000/sources/${pkgbase}/${pkgbase}-10.3_$_debver-$_debrel.debian.tar.xz"{,.sig}
        "mariadb.initd"
        "mariadb.run"
        "mariadb_log.run"
        "fix-cmake.patch")
sha512sums=('cfd0154d984ddc344554cd3df1d02b0811f8e35c90caf745532491688850736d079c67d40e9414daba83f2bd0c06569bfc99213d5280c63cf051c68abd7c56b5'
            'SKIP'
            'f406e0d7f85654ad33ef2f9722ca40b4763b882d83083b547aead7f6033813c424cdae9b986351edf415c4eaff8f6a43cd5039ad2d98b962395018b8702cf3fd'
            'SKIP'
            '5661610576977b87b5435a304d8409962c4451389d6cd6801666c507e871e9182c37b56daa37c580a62ccf60ebfff34a9c1dc85da62a2dac5a69b8776c218020'
            '208f1246a3fc7478262e6a7d8e6d82d83377d8fd86ef7a7f3a03e2c2383367b9c0560e2ecbb4e686e4b6d64e48bb29f2b75780e4e449a4146fcb3d95e2e67c60'
            'ceccc2ceae499524322ec99d3929e088aaed4f94e52274d8a1691a22c0a322781dc93ac00fb28a91f3d0d1541e95de95d588d91011c4b0293b322c5f49d5fd69'
            '15179f2e10bd18612ad03d332cc27bde7751c29a7a0bd6661745f43370f93b947138618ab11f7c43831f47f1324538d563962d465b75e23b03f58eb558f194a3')
validpgpkeys=('199369E5404BD5FC7D2FE43BCBCB082A1BB943DB'  # MariaDB Package Signing Key <package-signing-key@mariadb.org>
              'C92BAA713B8D53D3CAE63FC9E6974752F9704456') # André Silva

prepare() {
  cd $pkgbase-$pkgver/

  if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
    # Debian patches
    export QUILT_PATCHES=debian/patches
    export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
    export QUILT_DIFF_ARGS='--no-timestamps'

    rm -r debian
    mv "$srcdir"/debian .

    quilt push -av
  fi
  patch -Np1 -i ${srcdir}/fix-cmake.patch
}

build() {
  local _cmake_options=(
    # build options
    -DCMAKE_BUILD_TYPE=RelWithDebInfo
    -Wno-dev

    # file paths
    # /etc
    -DINSTALL_SYSCONFDIR=/etc
    -DINSTALL_SYSCONF2DIR=/etc/my.cnf.d
    # /run
    -DINSTALL_UNIX_ADDRDIR=/run/mysqld/mysqld.sock
    # /usr
    -DCMAKE_INSTALL_PREFIX=/usr
    # /usr/bin /usr/include
    -DINSTALL_SCRIPTDIR=bin
    -DINSTALL_INCLUDEDIR=include/mysql
    # /usr/lib
    -DINSTALL_PLUGINDIR=lib/mysql/plugin
    # /usr/share
    -DINSTALL_SHAREDIR=share
    -DINSTALL_SUPPORTFILESDIR=share/mysql
    -DINSTALL_MYSQLSHAREDIR=share/mysql
    -DINSTALL_DOCREADMEDIR=share/doc/mariadb
    -DINSTALL_DOCDIR=share/doc/mariadb
    -DINSTALL_MANDIR=share/man
    # /var
    -DMYSQL_DATADIR=/var/lib/mysql

    # default settings
    -DDEFAULT_CHARSET=utf8mb4
    -DDEFAULT_COLLATION=utf8mb4_unicode_ci

    # features
    -DENABLED_LOCAL_INFILE=ON
    -DPLUGIN_EXAMPLE=NO
    -DPLUGIN_FEDERATED=NO
    -DPLUGIN_FEEDBACK=NO
    -DWITH_EMBEDDED_SERVER=ON
    -DWITH_EXTRA_CHARSETS=complex
    -DWITH_LIBWRAP=OFF
    -DWITH_PCRE=bundled
    -DWITH_READLINE=ON
    -DWITH_JEMALLOC=system
    -DWITH_SSL=system
    -DWITH_SYSTEMD=no
    -DWITH_UNIT_TESTS=OFF
    -DWITH_ZLIB=system
  )

  mkdir build
  cd build

  cmake ../"$pkgbase-$pkgver" "${_cmake_options[@]}"

  make
}

package_mariadb-libs() {
  pkgdesc='MariaDB libraries'
  depends=('bzip2' 'libaio' 'libxcrypt' 'libressl' 'lz4' 'lzo' 'xz' 'zlib')
  conflicts=('libmysqlclient' 'libmariadbclient' 'mariadb-connector-c')
  provides=('libmariadbclient' 'mariadb-connector-c')
  replaces=('libmariadbclient')

  cd build

  for dir in libmariadb libmysqld libservices include; do
    make -C $dir DESTDIR="$pkgdir" install
  done

  ln -s mariadb_config "$pkgdir"/usr/bin/mysql_config
  install -D -m0644 "$srcdir"/$pkgbase-$pkgver/man/mysql_config.1 "$pkgdir"/usr/share/man/man1/mysql_config.1

  install -D -m0644 support-files/mariadb.pc "$pkgdir"/usr/share/pkgconfig/mariadb.pc
  install -D -m0644 "$srcdir"/$pkgbase-$pkgver/support-files/mysql.m4 "$pkgdir"/usr/share/aclocal/mysql.m4

  # remove static libraries
  rm "$pkgdir"/usr/lib/*.a

  # install license files
  install -dm0755 "$pkgdir"/usr/share/licenses/$pkgname
  install -m0644 "$srcdir"/$pkgbase-$pkgver/COPYING* "$pkgdir"/usr/share/licenses/$pkgname
}

package_mariadb-clients() {
  pkgdesc='MariaDB client tools'
  depends=("mariadb-libs=${pkgver}" 'jemalloc')
  conflicts=('mysql-clients')
  provides=("mysql-clients=$pkgver")

  cd build

  make -C client DESTDIR="$pkgdir" install

  # install man pages
  for man in mysql mysql_plugin mysql_upgrade mysqladmin mysqlbinlog mysqlcheck mysqldump mysqlimport mysqlshow mysqlslap mysqltest; do
    install -D -m0644 "$srcdir"/$pkgbase-$pkgver/man/$man.1 "$pkgdir"/usr/share/man/man1/$man.1
  done

  # install license files
  install -dm0755 "$pkgdir"/usr/share/licenses/$pkgname
  install -m0644 "$srcdir"/$pkgbase-$pkgver/COPYING* "$pkgdir"/usr/share/licenses/$pkgname
}

package_mariadb() {
  pkgdesc='Fast SQL database server, drop-in replacement for MySQL'
  backup=('etc/my.cnf'
          'etc/my.cnf.d/client.cnf'
          'etc/my.cnf.d/enable_encryption.preset'
          'etc/my.cnf.d/mysql-clients.cnf'
          'etc/my.cnf.d/server.cnf')
  install=mariadb.install
  depends=("mariadb-clients=${pkgver}" 'inetutils' 'libxml2')
  optdepends=('perl-dbd-mysql: for mysqlhotcopy, mysql_convert_table_format and mysql_setpermission'
              'logger: message logging support')
  conflicts=('mysql')
  provides=("mysql=$pkgver")
  options=('emptydirs')

  cd build

  make DESTDIR="$pkgdir" install

  cd "$pkgdir"

  rm -r etc/init.d
  rm usr/bin/rcmysql
  rm usr/share/mysql/{binary-configure,mysql{,d_multi}.server}

  install -Dm0755 "${srcdir}"/mariadb.initd etc/init.d/mariadb

  install -Dm0755 "${srcdir}"/mariadb.run etc/sv/mariadb/run
  install -Dm0755 "${srcdir}"/mariadb_log.run etc/sv/mariadb/log/run

  install -dm0700 var/lib/mysql
  chown -R 89:89 var/lib/mysql &>/dev/null

  # move mysqld to /usr/sbin
  install -dm0755 usr/sbin
  mv usr/{,s}bin/mysqld

  # install license files
  install -dm0755 "$pkgdir"/usr/share/licenses/$pkgname
  install -m0644 "$srcdir"/$pkgbase-$pkgver/COPYING* "$pkgdir"/usr/share/licenses/$pkgname

  # move it where one might look for it
  mv usr/share/{groonga{,-normalizer-mysql},doc/mariadb/}

  # provided by mariadb-libs
  rm usr/bin/mariadb_config
  rm usr/bin/mysql_config
  rm -r usr/include/
  rm usr/share/man/man1/mysql_config.1
  rm -r usr/share/aclocal
  rm usr/lib/lib*
  rm usr/lib/mysql/plugin/{auth_gssapi_client,caching_sha2_password,client_ed25519,dialog,mysql_clear_password,sha256_password}.so
  rm -r usr/lib/pkgconfig/

  # provided by mariadb-clients
  rm usr/bin/{mysql,mysql_plugin,mysql_upgrade,mysqladmin,mysqlbinlog,mysqlcheck,mysqldump,mysqlimport,mysqlshow,mysqlslap,mysqltest}
  rm usr/share/man/man1/{mysql,mysql_plugin,mysql_upgrade,mysqladmin,mysqlbinlog,mysqlcheck,mysqldump,mysqlimport,mysqlshow,mysqlslap,mysqltest}.1

  # provided by mytop
  rm usr/bin/mytop

  # not needed
  rm -r usr/{data,mysql-test,sql-bench}
  rm usr/share/man/man1/mysql-test-run.pl.1
}

package_mytop() {
  pkgdesc='Top clone for MariaDB'
  depends=('perl' 'perl-dbd-mysql' 'perl-term-readkey')

  cd build

  install -Dm0755 scripts/mytop "$pkgdir"/usr/bin/mytop

  # install license files
  install -dm0755 "$pkgdir"/usr/share/licenses/$pkgname
  install -m0644 "$srcdir"/$pkgbase-$pkgver/COPYING* "$pkgdir"/usr/share/licenses/$pkgname
}

fix-cmake.patch

--- a/libmariadb/cmake/ConnectorName.cmake    2020-08-06 17:15:46.000000000 +0200
+++ b/libmariadb/cmake/ConnectorName.cmake    2023-01-22 10:49:08.416903691 +0100
@@ -11,18 +11,22 @@
   SET(IS64 1)
 ENDIF()
 
-SET (PLAFORM_NAME CMAKE_SYSTEM_NAME)
-SET (MACHINE_NAME CMAKE_SYSTEM_PROCESSOR)
+SET (PLATFORM_NAME ${CMAKE_SYSTEM_NAME})
+SET (MACHINE_NAME ${CMAKE_SYSTEM_PROCESSOR})
 SET (CONCAT_SIGN "-")
 
 IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
   SET(PLATFORM_NAME "win")
   SET(CONCAT_SIGN "")
   IF(IS64)
-    SET(MACHINE_NAME "x64")
+    IF(CMAKE_C_COMPILER_ARCHITECTURE_ID)
+      STRING(TOLOWER "${CMAKE_C_COMPILER_ARCHITECTURE_ID}" MACHINE_NAME)
+    ELSE()
+      SET(MACHINE_NAME x64)
+    ENDIF()
   ELSE()
     SET(MACHINE_NAME "32")
-  END()
+  ENDIF()
 ENDIF()
 
 SET(product_name "mysql-connector-c-${CPACK_PACKAGE_VERSION}-${PLATFORM_NAME}${CONCAT_SIGN}${MACHINE_NAME}")

mariadb.initd

#!/sbin/openrc-run
# Copyright 2018 Hyperbola Project
# Distributed under the terms of the GNU General Public License v2

getconf() {
    v=$(my_print_defaults --mysqld | grep ^--$1)
    [ -z $v ] && echo $2 || echo ${v#*=}
}

retry="60"
command="/usr/bin/mysqld_safe"
command_args="--syslog --nowatch"
command_user="mysql"

depend() {
    use logger net
    need localmount
}

start_pre() {
    pidfile=$(getconf pid-file "/run/mysqld/mysqld.pid")
    command_args="$command_args --pid-file=$pidfile"
    required_dirs=$(getconf datadir "/var/lib/mysql")
    if [ ! -d $required_dirs/mysql ]; then
        eerror "Datadir '$required_dirs' is empty or invalid."
        eerror "Run 'mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql' to create a new database."
    fi
    checkpath --directory --owner mysql:mysql --mode 0755 /run/mysqld
}

start_post() {
    ewaitfile 10 $(getconf socket "/run/mysqld/mysqld.sock")
}

stop_pre() {
    pidfile=$(getconf pid-file "/run/mysqld/mysqld.pid")
}

mariadb.install

post_install(){
  if ! getent group mysql &>/dev/null; then
    groupadd -g 89 mysql >/dev/null
  fi
  if ! getent passwd mysql &>/dev/null; then
    useradd -u 89 -g 89 -d /var/lib/mysql -s /bin/nologin mysql >/dev/null
  fi
  if ! groups mysql | grep adm &>/dev/null; then
    gpasswd -a mysql adm >/dev/null
  fi
  mysql_shell=$(getent passwd mysql | cut -d: -f7)
  if [ "$mysql_shell" != '/bin/nologin' ]; then
    chsh -s /bin/nologin mysql &>/dev/null
  fi

  echo ":: You need to initialize the MariaDB data directory prior to starting"
  echo "   the service. This can be done with mysql_install_db command, e.g.:"
  echo "   mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql"
}

post_upgrade(){
  if ! getent group mysql &>/dev/null; then
    groupadd -g 89 mysql >/dev/null
  fi
  if ! getent passwd mysql &>/dev/null; then
    useradd -u 89 -g 89 -d /var/lib/mysql -s /bin/nologin mysql >/dev/null
  fi
  if ! groups mysql | grep adm &>/dev/null; then
    gpasswd -a mysql adm >/dev/null
  fi
  mysql_shell=$(getent passwd mysql | cut -d: -f7)
  if [ "$mysql_shell" != '/bin/nologin' ]; then
    chsh -s /bin/nologin mysql &>/dev/null
  fi

  if [[ "$(vercmp $2 5.5.25-4)" -lt 0 ]] && [[ -d /data ]]; then
    for x in data/*; do
      cp -r $x /var/lib/mysql
    done
    rm -rf data
  fi
}

post_remove() {
  if getent passwd mysql &>/dev/null; then
    userdel mysql >/dev/null
  fi
  if getent group mysql &>/dev/null; then
    groupdel mysql >/dev/null
  fi
}

mariadb.run

#!/bin/sh
[ ! -d /run/mysqld ] && mkdir -p /run/mysqld
chown mysql:mysql /run/mysqld
exec chpst -U mysql:mysql mysqld --user=mysql 2>&1
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

28

Re: [Collection] Compilation of packages and ports (not in repositories)

Package perl-dbd-mysql

PKGBUILD

# Maintainer (Arch): Felix Yan <felixonmars@archlinux.org>
# Contributor (Arch): Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor (Arch): kevin <kevin@archlinux.org>
# Contributor (Arch): Eric Johnson <eric@coding-zone.com>
# Maintainer: André Silva <emulatorman@hyperbola.info>

pkgname=perl-dbd-mysql
pkgver=4.050
_debver=4.050
_debrel=3
pkgrel=1
pkgdesc='Perl/CPAN DBD::mysql module for interacting with MySQL via DBD'
arch=('i686' 'x86_64')
license=('GPL-1')
url="https://metacpan.org/release/DBD-mysql"
depends=('mariadb-libs' 'perl-dbi')
makedepends=('perl-devel-checklib' 'quilt')
checkdepends=('mariadb' 'perl-test-deep')
options=('!emptydirs')
source=(https://search.cpan.org/CPAN/authors/id/D/DV/DVEEDEN/DBD-mysql-${pkgver}.tar.gz
        https://deb.debian.org/debian/pool/main/libd/libdbd-mysql-perl/libdbd-mysql-perl_$_debver-$_debrel.debian.tar.xz
        mariadb-10.3.13-zerofill.patch)
sha512sums=('910f5b4ba7a7890d50a79f37d04ec8971a4f62acd0fe30bf3ab634f66e3128f0cd6513e5c9da8c807a0f4477d0cc766682ea8dd0d8072d02821b78df51f37879'
            '91a2f1e0137228d23a07271a6f2231c3c1966ef4d8d39407117942409f4ac94b089710f846f6f845d3dc1faa28a9eeaa9b89be228c388179060b279d50de7344'
            '090039d383d05958c5d0cf23f13b8062ba89158583ca6dad9ce7c72b28bc3eccc039d4f815aef13592ea35a57662c80156b25aaa04ace171d64a15f5ac489a09')

prepare() {
  cd DBD-mysql-$pkgver

  if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
    # Debian patches
    export QUILT_PATCHES=debian/patches
    export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
    export QUILT_DIFF_ARGS='--no-timestamps'

    mv "$srcdir"/debian .

    quilt push -av
  else
    # https://github.com/perl5-dbi/DBD-mysql/issues/304
    patch -Np1 -i ../mariadb-10.3.13-zerofill.patch
  fi
}

build() {
  cd DBD-mysql-$pkgver
  perl Makefile.PL INSTALLDIRS=vendor --testsocket=/tmp/socket.mysql
  make
}

check() {
  cd DBD-mysql-$pkgver
  mkdir -p /tmp/mysql_test
  mysql_install_db \
     --basedir=/usr \
     --datadir=/tmp/mysql_test
  mysqld -P 17999 \
     --socket=/tmp/socket.mysql \
     --datadir=/tmp/mysql_test &
  sleep 10
  DAEMON_PORT=$!
  make test
  kill -9 $DAEMON_PORT
}

package() {
  cd DBD-mysql-$pkgver
  make install DESTDIR="$pkgdir"
  install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
}

mariadb-10.3.13-zerofill.patch

From 19734814ed4beeebd48180ad4c123047e3743ff2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= <git@myname.nl>
Date: Tue, 5 Mar 2019 16:24:17 +0100
Subject: [PATCH] Fix for MariaDB 10.3.13 with zerofil

Issue: #304
---
 dbdimp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dbdimp.c b/dbdimp.c
index a9c37cf..0cea5c8 100644
--- a/dbdimp.c
+++ b/dbdimp.c
@@ -4055,9 +4055,13 @@ int dbd_describe(SV* sth, imp_sth_t* imp_sth)
         break;
 
       default:
-#if MYSQL_VERSION_ID > 100300
+#if (MYSQL_VERSION_ID > 100300) && (MYSQL_VERSION_ID < 10313)
         // https://jira.mariadb.org/browse/MDEV-18143
         buffer->buffer_length= fields[i].max_length ? fields[i].max_length : 2;
+#elif MYSQL_VERSION_ID > 100312
+        // https://jira.mariadb.org/browse/MDEV-18823
+        buffer->buffer_length= fields[i].max_length ? fields[i].max_length + 1 : 2;
+        buffer->buffer_length= fields[i].length > fields[i].max_length ? fields[i].length + 1 : 2;
 #else
         buffer->buffer_length= fields[i].max_length ? fields[i].max_length : 1;
 #endif
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

29

Re: [Collection] Compilation of packages and ports (not in repositories)

Package iec16022

PKGBUILD

# Maintainer (Arch): Balló György <ballogyor+arch at gmail dot com>
# Maintainer: Tobias Dausend <throgh@hyperbola.info>

pkgname=iec16022
pkgver=0.3.1
pkgrel=1
pkgdesc='Produce 2D barcodes often also referenced as DataMatrix'
arch=('i686' 'x86_64')
url='https://rdoeffinger.github.io/'
license=('GPL-2')
depends=('popt' 'zlib')
source=("https://github.com/rdoeffinger/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.xz")
sha512sums=('90044be3b4b8750a7c99399c33084612dc58912b138789239dbabdab7cc2d526040e325f7ade7b129aa14ee044cf032c6b928dc2b4761b48de6cd17b3051416c')

build() {
  cd $pkgname-$pkgver
  ./configure \
    --prefix=/usr
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 COPYING -t "$pkgdir/usr/share/licenses/$pkgname"
}
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

30

Re: [Collection] Compilation of packages and ports (not in repositories)

Package lzdoom

PKGBUILD

# Maintainer (Arch): Lawrence González <pentestian [at] airmail [dot] cc>
# Contributor (Arch): Jan Cholasta <grubber at grubber cz>
# Maintainer: Tobias Dausend <throgh@hyperbola.info>

_name=gzdoom
pkgname=lzdoom
pkgver=3.88
pkgrel=1
pkgdesc="Advanced Doom source port with OpenGL support (legacy version)"
arch=('i686' 'x86_64')
url='http://www.zdoom.org/'
license=('Modified-BSD' 'custom:dumb' 'custom:bzip2' 'GPL-3' 'LGPL-3' 'Expat')
depends=('hicolor-icon-theme' 'libjpeg-turbo' 'sdl2' 'alsa-lib')
makedepends=('cmake' 'fluidsynth>=2' 'gtk' 'graphicsmagick')
optdepends=('fluidsynth>=2: FluidSynth MIDI device'
            'freedoom: Freedoom game data'
            'freedm: FreeDM game data'
            'blasphemer: Blasphemer game data'
            'gtk: IWAD selection dialog'
            'libsndfile: WAV/FLAC/OGG audio support'
            'mpg123: MP3 audio support'
            'openal: in-game sound'
            'soundfont-fluid: FluidR3 soundfont for FluidSynth'
            'xenocara-xmessage: crash dialog (other)')
groups=('games')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/drfrag666/${_name}/archive/refs/tags/${pkgver}.tar.gz"
        "${pkgname}.desktop")
sha512sums=('0b883991b35bbe44943404a04e59f47848bbd9ffc7d6b4949a2c6f1f365a90e116a567f3b276697e83587e991c385c32f9ee1d7c6bb86776400dfbdf2606018b'
            '0c5d97ec8e43ea65c62a5bbf261c016beaf8144bfa521e17540db563df165c17569829e4d83a4b9e55900b0620efe6a788ff2c828fd24b3918f3bc0349d16bda')

prepare() {
  cd "$srcdir/${_name}-$pkgver"

  # Patches GCC 11 errors
  sed -i '/^#include "types.h"$/a \#include <limits>' src/scripting/types.cpp

  # Patches soundfonts paths
  sed -i -f - src/gameconfigfile.cpp <<- "EOF"
        \%^\t\tSetValueForKey("Path", "/usr/share/games/doom/fm_banks", true);$% a \
        \t\tSetValueForKey("Path", SHARE_DIR "/soundfonts", true);\
        \t\tSetValueForKey("Path", SHARE_DIR "/fm_banks", true);\
        \t\tSetValueForKey("Path", "/usr/share/soundfonts", true);
        EOF
}

build() {
  cd "$srcdir/${_name}-$pkgver"

  local _cflags="-ffile-prefix-map=\"$PWD\"=. \
                 -DSHARE_DIR=\\\"/usr/share/games/$pkgname\\\" \
                 -DFLUIDSYNTHLIB2=\\\"libfluidsynth.so.2\\\""
  cmake -DCMAKE_BUILD_TYPE=Release \
                 -DCMAKE_C_FLAGS="${CFLAGS} ${_cflags}" \
                 -DCMAKE_CXX_FLAGS="${CXXFLAGS} ${_cflags}" \
                 -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS} -Wl,-z,noexecstack" \
                 -DCMAKE_INSTALL_PREFIX=/usr \
                 -DINSTALL_PATH=games \
                 -DINSTALL_PK3_PATH="share/games/$pkgname" \
                 .
  make
}

package() {
  cd "$srcdir/${_name}-$pkgver"

  make install DESTDIR="$pkgdir"
  install -D -m644 "soundfonts/${pkgname}.sf2" \
    "$pkgdir/usr/share/games/$pkgname/soundfonts/${pkgname}.sf2"
  install -D -m644 fm_banks/GENMIDI.GS.wopl \
    "$pkgdir/usr/share/games/$pkgname/fm_banks/GENMIDI.GS.wopl"
  install -D -m644 fm_banks/gs-by-papiezak-and-sneakernets.wopn \
    "$pkgdir/usr/share/games/$pkgname/fm_banks/gs-by-papiezak-and-sneakernets.wopn"

  install -D -m644 "$srcdir/${pkgname}.desktop" \
    "$pkgdir/usr/share/applications/${pkgname}.desktop"
  for SIZE in 16 24 32 48 64 96 128 256; do
    # set modify/create for reproducible builds
    gm convert -scale ${SIZE} +set date:create +set date:modify \
      "ico_${pkgname}.png" \
      "${srcdir}"/$pkgname.png
    install -Dm644 "${srcdir}"/$pkgname.png "${pkgdir}/usr/share/icons/hicolor/${SIZE}x${SIZE}/apps/$pkgname.png"
  done

  install -D -m644 -t "$pkgdir/usr/share/licenses/$pkgname" docs/licenses/*
}

lzdoom.desktop

[Desktop Entry]
Type=Application
Version=1.0
Name=LZDoom
Comment=Advanced Doom source port with OpenGL.
Icon=lzdoom
Exec=lzdoom %F
Terminal=false
MimeType=application/x-doom-wad;
Categories=Game;ActionGame;
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

31

Re: [Collection] Compilation of packages and ports (not in repositories)

Package perp

PKGBUILD

# Maintainer: Tobias Dausend <throgh@hyperbola.info>

pkgname=perp
pkgver=2.07
pkgrel=1
arch=('i686' 'x86_64')
pkgdesc="Perp, a persistent process supervisor"
url='http://b0llix.net/perp/'
license=('Simplified-BSD')
install=$pkgname.install
source=("http://b0llix.net/perp/distfiles/$pkgname-$pkgver.tar.gz")
sha512sums=('7b9ddd5b72ac88f34598ffe82e5cb1cc460a1d84daa6d52222aaa3ce891e7fa9b12839fc87cae80c913349684ec369155bae3955a8d06067859b57bbd4818c7e')

build() {
  cd $srcdir/$pkgname-$pkgver
  make
}

package() {
  cd $srcdir/$pkgname-$pkgver
  make DESTDIR=$pkgdir install
  install -Dm644 LICENSE -t $pkgdir/usr/share/licenses/$pkgname
}

perp.install

post_install() {
echo " >> to activate perp, run the commands "
echo " >> # perp-setup /etc/perp"
echo " >> # kill -HUP 1"
echo " >> become familiar with perp's configuration and operation. skim the manual pages for perp_intro(8), perpd(8), and perpetrate(5)."
}

post_upgrade() {
echo " >> If upgrading a previous perp installation, follow all the steps above. The perp-setup(8) utility script will not disturb any previous 
configuration it finds in any of /etc/inittab, /etc/rc.local, or /etc/perp/.boot."
echo " >> As a special case, if upgrading from perp-0.00 to a later release in"
echo " >> the perp-2.* series, it will be necessary to remove a couple of old"
echo " >> files from the earlier release manually. These are:"
echo " >> /usr/sbin/perpetrate"
echo " >> /usr/share/man/man8/perpetrate.8"
} 
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

32

Re: [Collection] Compilation of packages and ports (not in repositories)

Package wesnoth-legacy

PKGBUILD

# Maintainer (Arch): Sven-Hendrik Haase <svenstaro@gmail.com>
# Contributor (Arch): Jan de Groot <jgc@archlinux.org>
# Contributor (Arch): Tobias Powalowski <tpowa@archlinux.org>
# Contributor (Arch): Jacobo Arvelo <unix4all@ya.com>
# Contributor (Arch): Douglas Soares de Andrade <douglas@archlinux.org>
# Maintainer: Tobias Dausend <throgh@hyperbola.info>

_realpkgname=wesnoth
pkgname=$_realpkgname-legacy
pkgver=1.16.9
pkgrel=1
pkgdesc="A free, libre and turn-based strategy game on a fantasy world (legacy version)"
arch=('i686' 'x86_64')
license=('GPL-2')
url='https://github.com/wesnoth/wesnoth'
depends=('sdl2_ttf' 'sdl2_net' 'sdl2_mixer' 'sdl2_image' 'fribidi' 'boost-libs' 'pango' 'lua' 'tauthon')
makedepends=('boost' 'cmake' 'intltool' 'gettext-tiny')
groups=('games')
options=(!emptydirs)
source=("${_realpkgname}-${pkgver}.tar.gz::https://github.com/wesnoth/wesnoth/archive/refs/tags/${pkgver}.tar.gz")
sha512sums=('313aaad95c66757a952c00f1e5a515ce61bcf7564d6555802bc2619714d038a9a5607f3395e3e8afe5f216205e5b9b07b651789a749b4de37b30f8b8a47cb47f')

build() {
  cmake \
    -S $_realpkgname-$pkgver \
    -B build \
    -DCMAKE_INSTALL_PREFIX="/usr/" \
    -DCMAKE_INSTALL_BINDIR="/usr/games" \
    -DCMAKE_INSTALL_DATAROOTDIR="/usr/share/games" \
    -DCMAKE_INSTALL_MANDIR="/usr/share/man" \
    -DDATADIRNAME="wesnoth" \
    -DLOCALEDIR="locale" \
    -DENABLE_DISPLAY_REVISION=OFF
  make -C build
}

package() {
  make DESTDIR="$pkgdir" -C build install

  # correcting wrong folder-location
  mv "$pkgdir/usr/share/games/"{applications,doc,icons,metainfo} "$pkgdir/usr/share"

  # license
  install -Dm644 "$srcdir/$_realpkgname-$pkgver/COPYING" -t "${pkgdir}/usr/share/licenses/$pkgname"
}
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

33

Re: [Collection] Compilation of packages and ports (not in repositories)

Package sbcl-legacy

PKGBUILD

# Maintainer (Arch): Juergen Hoetzel <juergen@archlinux.org>
# Contributor (Arch): John Proctor <jproctor@prium.net>
# Contributor (Arch): Daniel White <daniel@whitehouse.id.au>
# Contributor (Arch): Leslie Polzer (skypher)
# Maintainer: Tobias Dausend <throgh@hyperbola.info>

_realpkgname=sbcl
pkgname=$_realpkgname-legacy
pkgver=2.2.5
pkgrel=1
pkgdesc="Steel Bank Common Lisp (legacy version)"
url='https://www.sbcl.org/'
arch=('i686' 'x86_64')
license=('Expat' 'Modified-BSD')
depends=('zlib')
provides=('common-lisp' 'cl-asdf')
makedepends=('clisp')
source=("https://downloads.sourceforge.net/project/sbcl/sbcl/$pkgver/$_realpkgname-$pkgver-source.tar.bz2"
        "fixes.lisp")
sha512sums=('9d581535348bb709ca1f7edbe5ad92f079fd1cbc9a462524220fb229bd78770f7855c0b1a8641b990a1d663fb559edc0c2ca0f029281d4b0c80a5917b45d7b72'
            '5a0eacd952d16f07060b89a4c73c17154446f8f9e1afb8ae026c8dff18f9de48bfef9a1cd9a2c3bf3176bd11d0a917e47e069964ca7a7b319c5f5d9999116a42')

build() {
  cd "$srcdir/$_realpkgname-$pkgver"
  export CFLAGS+=" -D_GNU_SOURCE -fno-omit-frame-pointer -DSBCL_HOME=/usr/lib/sbcl"
  export GNUMAKE="make"

  # build system uses LINKFLAGS and OS_LIBS to build LDFLAGS
  export LINKFLAGS="$LDFLAGS"
  unset LDFLAGS
  unset MAKEFLAGS
  sh make.sh clisp --prefix=/usr --fancy
  make -C doc/manual info
}

package() {
  cd "$srcdir/$_realpkgname-$pkgver"

  # cannot have both SBCL_HOME and INSTALL_ROOT
  SBCL_HOME="" INSTALL_ROOT="$pkgdir/usr" sh install.sh

  src/runtime/sbcl --core output/sbcl.core --script "${srcdir}/fixes.lisp"
  mv sbcl-new.core "${pkgdir}/usr/lib/sbcl/sbcl.core"

  # sources
  mkdir -p "$pkgdir/usr/share/sbcl-source"
  cp -R -t "$pkgdir/usr/share/sbcl-source" "$srcdir/$_realpkgname-$pkgver/"{src,contrib}

  # license
  install -D -m644 "$srcdir/$_realpkgname-$pkgver/COPYING" -t "$pkgdir/usr/share/licenses/$pkgname"

  # drop unwanted files
  find "$pkgdir" \( -name Makefile -o -name .cvsignore \) -delete
  find "$pkgdir/usr/share/sbcl-source" -type f \
    \( -name \*.fasl -o -name \*.o -o -name \*.log -o -name \*.so -o -name a.out \) -delete

  rm "$pkgdir/usr/share/sbcl-source/src/runtime/sbcl"
}

fixes.lisp

(in-package "COMMON-LISP-USER")

(let* ((parent (make-pathname :directory '(:absolute "usr" "share" "sbcl-source")))
       (src
    (merge-pathnames
     (make-pathname :directory '(:relative "src" :wild-inferiors)
            :name :wild :type :wild)
     parent))
         (contrib
          (merge-pathnames
           (make-pathname :directory '(:relative "contrib" :wild-inferiors)
                          :name :wild :type :wild)
           parent)))
  (setf (logical-pathname-translations "SYS")
    `(("SYS:SRC;**;*.*.*" ,src)
      ("SYS:CONTRIB;**;*.*.*" ,contrib))))

(ignore-errors
  (sb-ext:gc :full t)
  (sb-ext:enable-debugger)
  (sb-ext:save-lisp-and-die "sbcl-new.core"))
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

34

Re: [Collection] Compilation of packages and ports (not in repositories)

Package abbayedesmorts

PKGBUILD

# Maintainer: Tobias Dausend <throgh@hyperbola.info>

pkgname=abbayedesmorts
pkgver=2.0.4
pkgrel=1
pkgdesc="l'Abbaye des Morts - An obsolete, free and libre video game for a dark passage of history"
arch=('i686' 'x86_64')
url='https://github.com/nevat/abbayedesmorts-gpl'
license=('GPL-3' 'CC-BY-3.0')
depends=('sdl2' 'sdl2_image' 'sdl2_mixer')
groups=('games')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/nevat/abbayedesmorts-gpl/archive/refs/tags/v${pkgver}.tar.gz"
        "fhs-compliant.patch")
sha512sums=('46e2384c2f176dd54c3056d2e8a7ea1ea40da918bc1598414c68a2449f198e49c3dba30dc8c3c771f8d37e7a6eaa38caccbc2275d1712b7a8e5332ca400c5562'
            '0e57c75c0887f0016c1508d980099c55ab6ae1ef2fdb9a7e1359a6f4e1fd958ec6a116d77de4dcf8436f65c66bb4dec5813488691d41880c704aa584cb97f3e6')

prepare() {
  mv "${pkgname}-gpl-${pkgver}" "${pkgname}-${pkgver}"
  cd "${pkgname}-${pkgver}"
  patch -Np1 -i "$srcdir/fhs-compliant.patch"
}

build() {
  cd "${pkgname}-${pkgver}"
  make
}

package() {
  cd "${pkgname}-${pkgver}"
  mkdir -p "$pkgdir/usr/games"
  mkdir -p "$pkgdir/usr/share"
  mkdir -p "$pkgdir/usr/share/applications"
  mkdir -p "$pkgdir/usr/share/pixmaps"
  make DESTDIR="$pkgdir" install

  # license
  install -Dm644 {COPYING,ReadMe.md} -t "$pkgdir/usr/share/licenses/$pkgname"
}

fhs-compliant.patch

--- a/Makefile    2024-09-23 23:18:05.000000000 +0200
+++ b/Makefile    2024-12-15 02:36:43.892348396 +0100
@@ -23,7 +23,7 @@
 DATADIR= "\"./\""
 endif
 
-DATADIR?="\"$(PREFIX)/share/abbayev2\""
+DATADIR?="\"$(PREFIX)/share/games/abbayev2\""
 LDFLAGS?=    -Wl,-z,relro
 
 CFLAGS+=    `sdl2-config --cflags` -DDATADIR=$(DATADIR)
@@ -61,28 +61,28 @@
 
 # Installation
 install: $(PROG)
-    mkdir -p $(DESTDIR)$(PREFIX)/bin
-    cp $(PROG) $(DESTDIR)$(PREFIX)/bin
+    mkdir -p $(DESTDIR)$(PREFIX)/games
+    cp $(PROG) $(DESTDIR)$(PREFIX)/games
     mkdir -p $(DESTDIR)$(PREFIX)/share/applications
     cp abbaye.desktop $(DESTDIR)$(PREFIX)/share/applications
-    mkdir -p $(DESTDIR)$(PREFIX)/share/abbayev2/sounds
-    cp ./sounds/* $(DESTDIR)$(PREFIX)/share/abbayev2/sounds
-    mkdir -p $(DESTDIR)$(PREFIX)/share/abbayev2/data
-    cp ./data/* $(DESTDIR)$(PREFIX)/share/abbayev2/data
+    mkdir -p $(DESTDIR)$(PREFIX)/share/games/abbayev2/sounds
+    cp ./sounds/* $(DESTDIR)$(PREFIX)/share/games/abbayev2/sounds
+    mkdir -p $(DESTDIR)$(PREFIX)/share/games/abbayev2/data
+    cp ./data/* $(DESTDIR)$(PREFIX)/share/games/abbayev2/data
     mkdir -p $(DESTDIR)$(PREFIX)/share/pixmaps
     cp abbaye.png $(DESTDIR)$(PREFIX)/share/pixmaps
-    mkdir -p $(DESTDIR)$(PREFIX)/share/abbayev2/graphics
-    cp -r ./graphics/* $(DESTDIR)$(PREFIX)/share/abbayev2/graphics
+    mkdir -p $(DESTDIR)$(PREFIX)/share/games/abbayev2/graphics
+    cp -r ./graphics/* $(DESTDIR)$(PREFIX)/share/games/abbayev2/graphics
     mkdir -p $(DESTDIR)$(PREFIX)/share/appdata
     cp ./appdata/abbaye.appdata.xml $(DESTDIR)$(PREFIX)/share/appdata
 
 uninstall:
-    rm $(DESTDIR)$(PREFIX)/bin/$(PROG)
+    rm $(DESTDIR)$(PREFIX)/games/$(PROG)
     rm $(DESTDIR)$(PREFIX)/share/applications/abbaye.desktop
     rm $(DESTDIR)$(PREFIX)/share/pixmaps/abbaye.png
-    rm -rf $(DESTDIR)$(PREFIX)/share/abbayev2
+    rm -rf $(DESTDIR)$(PREFIX)/share/games/abbayev2
     rm $(DESTDIR)$(PREFIX)/share/appdata/abbaye.appdata.xml
     # ignore if not empty
-    -rmdir $(DESTDIR)$(PREFIX)/bin
+    -rmdir $(DESTDIR)$(PREFIX)/games
     -rmdir $(DESTDIR)$(PREFIX)/share/applications
     -rmdir $(DESTDIR)$(PREFIX)/share/pixmaps
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

35

Re: [Collection] Compilation of packages and ports (not in repositories)

Package sar (Search and Rescue)

PKGBUILD

# Maintainer: Tobias Dausend <throgh@hyperbola.info>

pkgname=sar
_pkgbase=SearchAndRescue
_pkgname=searchandrescue
pkgver=1.5.0
_debver=$pkgver
_debrel=2.1
pkgdataver=1.3.0
pkgrel=1
pkgdesc="Fly aircraft to search (for) and rescue people in distress"
url='http://sourceforge.net/projects/searchandrescue/'
license=('GPL-2')
arch=('i686' 'x86_64')
depends=('glibc' 'glu' 'sdl' 'sdl_mixer' 'libx11' 'libxpm' 'libxxf86vm' 'libxext' 'libxmu')
makedepends=('clang')
groups=('games')
source=("https://deb.debian.org/debian/pool/main/s/searchandrescue/searchandrescue_${pkgver}.orig.tar.gz"
        "https://deb.debian.org/debian/pool/main/s/searchandrescue/searchandrescue_${_debver}-${_debrel}.diff.gz"
        "https://deb.debian.org/debian/pool/main/s/searchandrescue-data/searchandrescue-data_${pkgdataver}.orig.tar.gz")
sha512sums=('72a8e5c375bb2f5d11d1346bb3c81ea4678a9c58c36f53c048e9a16d32a926ff93c3ec9756867f0869aa2a8da5fb0bfe7764f704c4e79519ee0834d225513657'
            '7e3d76e54684f0a8f761dbbbc426a3bf68802d9a546864ef8c306b542b757976e9e73d0a9da70fba6c55a6c83d90c89b801815bd251f0462c7a463de061752cb'
            '5419376aeecb0f05570a8d2a0a6f830f3b22ce9d1d34a5e490485767546c6d0d1d2a2a3f37e5dfcef69e271a94a9c7dfc6b592e3c0dd62a8a6c38e4bf7d25ccd')
noextract=("searchandrescue-data_${pkgdataver}.orig.tar.gz")

prepare() {
  cd ${_pkgname}_${pkgver}
  patch -Np1 < ${srcdir}/${_pkgname}_${_debver}-${_debrel}.diff
}

build() {
  cd ${_pkgname}_${pkgver}
  make
}

package() {
  cd ${_pkgname}_${pkgver}
  make DESTDIR="$pkgdir/" install

  # install data-files
  install -d "${pkgdir}/usr/share/games/$_pkgname"
  tar -xzf "${srcdir}/searchandrescue-data_${pkgdataver}.orig.tar.gz" \
      -C   "${pkgdir}/usr/share/games/$_pkgname/"

  # install metadata-files
  install -Dm644 debian/$_pkgbase.desktop "${pkgdir}/usr/share/applications/"$_pkgbase.desktop

  # install license
  install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/$pkgname/"
}
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

36

Re: [Collection] Compilation of packages and ports (not in repositories)

Package sar2 (Search and Rescue 2)

PKGBUILD

# Maintainer (Arch): Popolon <popolon@popolon.org>
# Maintainer: Tobias Dausend <throgh@hyperbola.info>

_name=SearchAndRescue2
pkgname=sar2
pkgver=2.5.0
pkgrel=2
pkgdesc="Free and libre helicopter simulator"
url='https://searchandrescue2.github.io/sar2/'
license=('GPL-2')
arch=('i686' 'x86_64')
depends=('freealut' 'openal' 'libvorbis' 'sdl2' 'libsm' 'libxmu' 'libxpm' 'glu')
makedepends=('scons' 'python-setuptools')
groups=('games')
source=("https://github.com/$_name/$pkgname/archive/v$pkgver.tar.gz"
        "fhs-compliant.patch")
sha512sums=('b5e6036e9ca0bce4245b951cdc16e676470f95906c714b28facf0006c4db838d86dbb57982712fa5f6abb9bd774c61b9d1c593c82b08325e9f28db25273a194a'
            '754ced777865fbd2eb4102eb79eeb8ebb6ffad3e4a0ff81c9cdf29a089d33adf779c146aaa8b25c914e6034fc52545f7d760e7e51a385b142a54f1893d2373b6')

prepare() {
  cd "$pkgname-$pkgver"
  patch -Np1 -i ${srcdir}/fhs-compliant.patch
}

build() {
  cd "$pkgname-$pkgver"
  scons
}

package() {
  cd "$pkgname-$pkgver"
  scons install --prefix=${pkgdir}/usr
  install -Dm644 extra/$pkgname.desktop "${pkgdir}/usr/share/applications/$pkgname.desktop"
  install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/$pkgname"
}

fhs-compliant.patch

--- a/src/SConscript    2020-06-20 23:48:35.000000000 +0200
+++ b/src/SConscript    2021-10-24 17:56:07.030471759 +0200
@@ -177,11 +177,11 @@
 """)
 
 object_list = env.Object(source = sources)
-sar2 = env.Program(target='#bin/sar2', source=[object_list])
+sar2 = env.Program(target='#games/sar2', source=[object_list])
 data='#data'
 man='#man/sar2.6.bz2'
 pixmap='#extra/sar2.xpm'
-env.Alias("install", env.InstallAs('$DESTDIR/$PREFIX/share/sar2', data))
+env.Alias("install", env.InstallAs('$DESTDIR/$PREFIX/share/games/sar2', data))
 env.Alias("install", env.Install('$DESTDIR/$PREFIX/share/man/man6', man))
 env.Alias("install", env.Install('$DESTDIR/$PREFIX/share/pixmaps', pixmap))
-env.Alias("install", env.Install('$DESTDIR/$PREFIX/bin', sar2))
+env.Alias("install", env.Install('$DESTDIR/$PREFIX/games', sar2))
--- a/src/config.h    2020-06-20 23:48:35.000000000 +0200
+++ b/src/config.h    2021-10-24 18:06:58.489853438 +0200
@@ -502,7 +502,7 @@
 #define SAR_DEF_LOCAL_DATA_DIR  ".config/sar2"
 
 /* Game data dir */
-#define SAR_DEF_GLOBAL_DATA_DIR "/usr/share/sar2"
+#define SAR_DEF_GLOBAL_DATA_DIR "/usr/share/games/sar2"
 
 /* Subdirs, one of each in the local and global game dirs */
 #define SAR_DEF_AIRCRAFTS_DIR        "aircrafts"
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

37

Re: [Collection] Compilation of packages and ports (not in repositories)

Package enlightenment16

PKGBUILD

# Maintainer (Arch): Brian BIdulock <bidulock@openss7.org>
# Contributor (Arch): Eric Bélanger <eric@archlinux.org>
# Maintainer: André Silva <emulatorman@hyperbola.info>
# Contributor: Tobias Dausend <throgh@hyperbola.info>

pkgname=enlightenment16
pkgver=1.0.29
_themever=1.0.3
pkgrel=1
pkgdesc="A fast, flexible, and very extensible Window Manager"
arch=('i686' 'x86_64')
url='https://www.enlightenment.org/e16'
license=('Expat')
depends=('libxinerama' 'imlib2' 'perl' 'pango' 'libxcomposite' 'sndio' 'libxrandr' 'libxdamage' 'libsndfile')
makedepends=('libsndio')
source=("https://downloads.sourceforge.net/sourceforge/enlightenment/e16-${pkgver}.tar.gz"
        "https://downloads.sourceforge.net/enlightenment/e16-themes-${_themever}.tar.gz"
        "starte16")
sha512sums=('e95dc2ad05b4f2ec3f374c5268f8f790e9ddd212f4e5e60d3517ade8645e539de5207553a841e14d1c099496f8385271f3f95867ef8ebfd99c419201477ef299'
            '6c8d7d15233f401c9b6c406116d822c42b7eed9b81570f2f25824886eee0a8c51895dfeeffa5c6e820f5e9449d9d28ec55e029f1136b5cb55cd7072fe9f57cba'
            '99f382ddcb0951f38e3bff686cf4e2940e408729490719108e671c4bae7aae3708f8c6222b392ebf31bef21b788f8de7bdd894402b3e060dc0c9f716f78b0c22')

build() {
  pushd e16-${pkgver}
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --enable-sound=sndio \
    --enable-dbus=no \
    --with-gnome=no
  make
  popd
  
  cd e16-themes-${_themever}
  ./configure --prefix=/usr
}

package() {
  cd e16-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -D -m644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -D -m644 fonts/COPYRIGHT.Vera -t "${pkgdir}/usr/share/licenses/${pkgname}"

  cd "${srcdir}/e16-themes-${_themever}"
  make DESTDIR="${pkgdir}" install
  chown -R root:root "${pkgdir}"/usr/share/*

  # removing unsupported
  rm "${pkgdir}"/usr/share/e16/misc/e16-dbus-cmd
  rm "${pkgdir}"/usr/share/e16/misc/starte16-gnome
  rm "${pkgdir}"/usr/share/e16/misc/starte16-kde
  rm "${pkgdir}"/usr/share/e16/misc/Xclients.e16-gnome.sh
  rm "${pkgdir}"/usr/share/e16/misc/Xclients.e16-kde.sh
  rm "${pkgdir}"/usr/share/xsessions/e16-kde-session.desktop

  # attach script
  rm "${pkgdir}"/usr/share/e16/misc/starte16
  cp "${srcdir}"/starte16  "${pkgdir}"/usr/share/e16/misc/
}

starte16

#!/bin/sh

s=$1
test -z "$s" && s=$0

case "$s" in
*window)
    exec /usr/bin/e16 -w ${SIZE:-800x600}
    ;;
*)
    exec /usr/bin/e16
    ;;
esac
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

38

Re: [Collection] Compilation of packages and ports (not in repositories)

Package pekwm

PKGBUILD

# Maintainer (Arch): Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor (Arch): Kevin Piche <kevin@archlinux.org>
# Contributor (Arch): Eddie Lozon <almostlucky@attbi.com>
# Maintainer: Tobias Dausend <throgh@hyperbola.info>

pkgname=pekwm
pkgver=0.1.18
_debver=$pkgver
_debrel=1
pkgrel=1
pkgdesc="Tabbed X11 window manager"
arch=('i686' 'x86_64')
license=('GPL-2')
url='https://github.com/pekdon/pekwm'
depends=('libjpeg-turbo' 'libxft' 'libxinerama' 'libxpm' 'libxrandr')
makedepends=('quilt')
optdepends=('lxappearance: feature-rich GTK+ theme switcher'
            'nitrogen: background browser and setter'
            'tint2: basic, good-looking task manager')
backup=('etc/pekwm/autoproperties'
        'etc/pekwm/autoproperties_typerules'
        'etc/pekwm/config'
        'etc/pekwm/config_system'
        'etc/pekwm/keys'
        'etc/pekwm/menu'
        'etc/pekwm/mouse'
        'etc/pekwm/mouse_click'
        'etc/pekwm/mouse_sloppy'
        'etc/pekwm/mouse_system'
        'etc/pekwm/start'
        'etc/pekwm/vars')
source=("https://github.com/${pkgname}/${pkgname}/releases/download/release-${pkgver}/${pkgname}-${pkgver}.tar.gz"
        "https://deb.debian.org/debian/pool/main/p/pekwm/pekwm_${_debver}-${_debrel}.debian.tar.xz")
sha512sums=('7fe04c04089d3375d1f64d456a7a582e88fd1f442c1c710bdef71309c7fe5aab234026ba381eb9a49b3d459b759924b577ba9597156e46e60147a9d845c27e89'
            '7f8d285b2725ee24b5fcefc1bacbb9b9738f58c19b49bafe40645e72f71f9ca1498a55185184f22906cbdfa404c626b8e7abc33406549af0b85ba8d36f78c615')

prepare() {
  cd $pkgname-$pkgver
  if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
    # Debian patches
    export QUILT_PATCHES=debian/patches
    export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
    export QUILT_DIFF_ARGS='--no-timestamps'

    mv "$srcdir"/debian .

    quilt push -av
  fi
  ./autogen.sh
}

build() {
  cd $pkgname-$pkgver
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc
  make
}

package() {
  make -C $pkgname-$pkgver DESTDIR="$pkgdir" install
  install -Dm644 "$srcdir"/$pkgname-$pkgver/debian/$pkgname.desktop "$pkgdir"/usr/share/xsessions/$pkgname.desktop
  install -Dm644 "$srcdir"/$pkgname-$pkgver/LICENSE -t "${pkgdir}/usr/share/licenses/$pkgname"
}
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

39

Re: [Collection] Compilation of packages and ports (not in repositories)

Package pekwm-themes

PKGBUILD

# Maintainer (Arch): Alexander F Rødseth <xyproto@archlinux.org>
# Maintainer: Tobias Dausend <throgh@hyperbola.info>

pkgname=pekwm-themes
pkgver=1.0.5
_debver=$pkgver
_debrel=7
pkgrel=1
pkgdesc="PekWM theme collection"
arch=('any')
license=('GPL-2' 'GPL-3')
depends=('pekwm')
source=("${pkgname}-${pkgver}.tar.gz::https://deb.debian.org/debian/pool/main/p/pekwm-themes/pekwm-themes_${pkgver}.orig.tar.gz"
        "https://deb.debian.org/debian/pool/main/p/pekwm-themes/pekwm-themes_${_debver}-${_debrel}.debian.tar.xz")
sha512sums=('94ef6e1cb564fcc28601729e1a6e95c6f858ab7a31ea9bf3ad8478398931229ee0087ec3724c4df263b45191064503dae91bee7e8abeeeca10ca783601ad2fe3'
            '310df602fa223650cde9a7cbf6f8f46619d5ae4ef9ae241552ac629c9a619eb3b17b80e2109a6baf4c4638a65c7aa8e8916c5523e439f91f8d39aea1cbef0555')

package() {
  install -d "$pkgdir/usr/share/pekwm/themes"
  cp -R "$srcdir/$pkgname/"* "$pkgdir/usr/share/pekwm/themes/"
  install -Dm644 "$srcdir/debian/copyright" -t "$pkgdir/usr/share/licenses/$pkgname"
}
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

40 (edited by Ribby 2025-02-21 18:18:24)

Re: [Collection] Compilation of packages and ports (not in repositories)

Hello everybody, this is my first PKGBUILD patch script post, along with patches.
It's a slock color message PKGBUILD script with patches. It will download source code (from its repository) and modify it with patches (found here). Program with default settings can be run after packaging. You will have to compile the script modified source code in order to install slock with color messages as command. Post-compilation configuration required for color message operation. Details and instructions included in PKGBUILD.

I would vouch for certain tweaks that makes a representative slock variant for the OS repository. However, libre and simplicity are OS repository goals, plus we have the freedom to share code and patches on this topic. Wouldn't hurt to host them on mirrors. Discussions about packages and patches is a different story.

Package slock
Patch slock-colormessage
Patch backspace or slock-backspace

PKGBUILD

# Maintainer (Arch): Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor (Arch): Sebastian A. Liem <sebastian at liem dot se>
# Maintainer: Tobias Dausend <throgh@hyperbola.info>
# Contributor: rachad
#
# Author (slock-colormessage-#-*-#-#-#.patch): Guy Shefy <guyshefyb@gmail.com>
# Contributor (patched slock-colormessage-#-*-#-#-#.patch): Ribby

pkgname=slock
pkgver=1.4
pkgrel=6
pkgdesc="A simple screen locker for X"
pkgdesc="Ribby patched Guy Shefy's color message patch for slock."
pkgdesc="That includes source parameter, patch command of prepare() script, sha512sums parameter, and of course, Contributor parameter crediting me and Guy Shefy."
pkgdesc="It appears that you do not have to patch things."
pkgdesc="All you have to do is 'cd ~/* of PKGBUILD and patches/', 'doas makepkg', 'cd ~/* of PKGBUILD and patches/src/slock-#.#/', and 'doas make clean install'."
pkgdesc="Still, slock's default config renders it inoperable."
pkgdesc="Therefore, I will spell out the config changes for operation."
pkgdesc="Make sure to change config.h in '~/* of PKGBUILD and patches/src/slock-#.#/' directory path."
pkgdesc="'*group = ''nogroup/nobody'';' variable should have a valid user group name (but I could be wrong since I was compiling source code at that time, not making a package)."
pkgdesc="'font_name = ''6x10'';' variable should be a valid value from 'slock -f' command."
pkgdesc="You may set '[INIT]', '[INPUT]', '[FAILED]', 'message', and 'text_color' variable values as permitted by their constraints."
pkgdesc="Custom slock color message command as 'slock -m ''$(printf ''1st line\n2nd line'')'''."
pkgdesc="Afterword, there are other slock patches, but they are currently incompatible by dependency conflict. We will have to wait and see what other patch possibilities could be made, after modular compatibilty."
arch=('i686' 'x86_64')
url='https://tools.suckless.org/slock'
license=('X11')
depends=('libxext' 'libxrandr' 'libxinerama')
source=("https://dl.suckless.org/tools/$pkgname-$pkgver.tar.gz"
    "backspace.patch"
    "slock-colormessage-20200210-35633d4-1-1-1.patch")
sha512sums=('ad285360dd3f16a225159abaf2f82fabf2c675bd74478cf717f68cbe5941a6c620e3c88544ce675ce3ff19af4bb0675c9405685e0f74ee4e84f7d34c61a0532f'
            'da6577a26b488d5f5074786794bad0314bdaf04c738e8fa982d13ee339d3e65330feec125802efd692f3e6a0ec8131d0e9f0deb6f9459bd271d6840bb9a7c311'
            'bcaa694aad74a337b1e717509c9cb6499395971bd008019755721803ae881abffbb1fa568d6c2116f8fa66f04b748b9a682039c4ec924e70f189055eedde992f')

prepare() {
  cd "$srcdir/slock-$pkgver"
  sed -i 's|static const char \*group = "nogroup";|static const char *group = "nobody";|' config.def.h
  sed -ri 's/((CPP|C|LD)FLAGS) =/\1 +=/g' config.mk
  patch -p1 < $srcdir/backspace.patch
  patch -p1 < $srcdir/slock-colormessage-20200210-35633d4-1-1-1.patch
}

build() {
  cd "$srcdir/slock-$pkgver"
  make X11INC=/usr/include/X11 X11LIB=/usr/lib/X11
}

package() {
  cd "$srcdir/slock-$pkgver"
  make PREFIX=/usr DESTDIR="$pkgdir" install
  install -m644 -D LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}

slock-colormessage-20200210-35633d4-1-1-1.patch

From 53ba5a8d3608ca9c9c406b12c51c2bfdfb3e01d3 Mon Sep 17 00:00:00 2001
From: Guy Shefy <guyshefyb@gmail.com>
Date: Wed, 10 Feb 2021 00:17:46 +0200
Subject: [PATCH] Add a message command with 24 bit color support

---
 config.def.h |   9 +++
 config.mk    |   2 +-
 slock.1      |   7 +++
 slock.c      | 154 +++++++++++++++++++++++++++++++++++++++++++++++++--
 4 files changed, 167 insertions(+), 5 deletions(-)

diff --git a/config.def.h b/config.def.h
index 9855e21..c2a0ab2 100644
--- a/config.def.h
+++ b/config.def.h
@@ -10,3 +10,12 @@ static const char *colorname[NUMCOLS] = {
 
 /* treat a cleared input like a wrong password (color) */
 static const int failonclear = 1;
+
+/* default message */
+static const char * message = "Suckless: Software that sucks less.";
+
+/* text color */
+static const char * text_color = "#ffffff";
+
+/* text size (must be a valid size) */
+static const char * font_name = "6x10";
diff --git a/config.mk b/config.mk
index 74429ae..c4ccf66 100644
--- a/config.mk
+++ b/config.mk
@@ -12,7 +12,7 @@ X11LIB = /usr/X11R6/lib
 
 # includes and libs
 INCS = -I. -I/usr/include -I${X11INC}
-LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext -lXrandr
+LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext -lXrandr -lXinerama
 
 # flags
 CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -DHAVE_SHADOW_H
diff --git a/slock.1 b/slock.1
index 82cdcd6..946165f 100644
--- a/slock.1
+++ b/slock.1
@@ -6,6 +6,8 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl v
+.Op Fl f
+.Op Fl m Ar message
 .Op Ar cmd Op Ar arg ...
 .Sh DESCRIPTION
 .Nm
@@ -16,6 +18,11 @@ is executed after the screen has been locked.
 .Bl -tag -width Ds
 .It Fl v
 Print version information to stdout and exit.
+.It Fl f
+List all valid X fonts and exit.
+.It Fl m Ar message
+Overrides default slock lock message.
+.TP
 .El
 .Sh SECURITY CONSIDERATIONS
 To make sure a locked screen can not be bypassed by switching VTs
diff --git a/slock.c b/slock.c
index 5ae738c..b8b7fe4 100644
--- a/slock.c
+++ b/slock.c
@@ -15,6 +15,7 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <X11/extensions/Xrandr.h>
+#include <X11/extensions/Xinerama.h>
 #include <X11/keysym.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
@@ -24,6 +25,9 @@
 
 char *argv0;
 
+/* global count to prevent repeated error messages */
+int count_error = 0;
+
 enum {
     INIT,
     INPUT,
@@ -83,6 +87,132 @@ dontkillme(void)
 }
 #endif
 
+static int
+readescapedint(const char *str, int *i) {
+    int n = 0;
+    if (str[*i])
+        ++*i;
+    while(str[*i] && str[*i] != ';' && str[*i] != 'm') {
+        n = 10 * n + str[*i] - '0';
+        ++*i;
+    }
+    return n;
+}
+
+static void
+writemessage(Display *dpy, Window win, int screen)
+{
+    int len, line_len, width, height, s_width, s_height, i, k, tab_size, r, g, b, escaped_int, curr_line_len;
+    XGCValues gr_values;
+    XFontStruct *fontinfo;
+    XColor color, dummy;
+    XineramaScreenInfo *xsi;
+    GC gc;
+    fontinfo = XLoadQueryFont(dpy, font_name);
+
+    if (fontinfo == NULL) {
+        if (count_error == 0) {
+            fprintf(stderr, "slock: Unable to load font \"%s\"\n", font_name);
+            fprintf(stderr, "slock: Try listing fonts with 'slock -f'\n");
+            count_error++;
+        }
+        return;
+    }
+
+    tab_size = 8 * XTextWidth(fontinfo, " ", 1);
+
+    XAllocNamedColor(dpy, DefaultColormap(dpy, screen),
+         text_color, &color, &dummy);
+
+    gr_values.font = fontinfo->fid;
+    gr_values.foreground = color.pixel;
+    gc=XCreateGC(dpy,win,GCFont+GCForeground, &gr_values);
+
+    /*  To prevent "Uninitialized" warnings. */
+    xsi = NULL;
+
+    /*
+     * Start formatting and drawing text
+     */
+
+    len = strlen(message);
+
+    /* Max max line length (cut at '\n') */
+    line_len = curr_line_len = 0;
+    k = 0;
+    for (i = 0; i < len; i++) {
+        if (message[i] == '\n') {
+            curr_line_len = 0;
+            k++;
+        } else if (message[i] == 0x1b) {
+            while (i < len && message[i] != 'm') {
+                i++;
+            }
+            if (i == len)
+                die("slock: unclosed escape sequence\n");
+        } else {
+            curr_line_len += XTextWidth(fontinfo, message + i, 1);
+            if (curr_line_len > line_len)
+                line_len = curr_line_len;
+        }
+    }
+    /* If there is only one line */
+    if (line_len == 0)
+        line_len = len;
+
+    if (XineramaIsActive(dpy)) {
+        xsi = XineramaQueryScreens(dpy, &i);
+        s_width = xsi[0].width;
+        s_height = xsi[0].height;
+    } else {
+        s_width = DisplayWidth(dpy, screen);
+        s_height = DisplayHeight(dpy, screen);
+    }
+    height = s_height*3/7 - (k*20)/3;
+    width  = (s_width - line_len)/2;
+
+    line_len = 0;
+    /* print the text while parsing 24 bit color ANSI escape codes*/
+    for (i = k = 0; i < len; i++) {
+        switch (message[i]) {
+            case '\n':
+                line_len = 0;
+                while (message[i + 1] == '\t') {
+                    line_len += tab_size;
+                    i++;
+                }
+                k++;
+                break;
+            case 0x1b:
+                i++;
+                if (message[i] == '[') {
+                    escaped_int = readescapedint(message, &i);
+                    if (escaped_int == 39)
+                        continue;
+                    if (escaped_int != 38)
+                        die("slock: unknown escape sequence%d\n", escaped_int);
+                    if (readescapedint(message, &i) != 2)
+                        die("slock: only 24 bit color supported\n");
+                    r = readescapedint(message, &i) & 0xff;
+                    g = readescapedint(message, &i) & 0xff;
+                    b = readescapedint(message, &i) & 0xff;
+                    XSetForeground(dpy, gc, r << 16 | g << 8 | b);
+                } else
+                    die("slock: unknown escape sequence\n");
+                break;
+            default:
+                XDrawString(dpy, win, gc, width + line_len, height + 20 * k, message + i, 1);
+                line_len += XTextWidth(fontinfo, message + i, 1);
+        }
+    }
+
+    /* xsi should not be NULL anyway if Xinerama is active, but to be safe */
+    if (XineramaIsActive(dpy) && xsi != NULL)
+            XFree(xsi);
+}
+
+
+
 static const char *
 gethash(void)
 {
@@ -194,6 +324,7 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
                                          locks[screen]->win,
                                          locks[screen]->colors[color]);
                     XClearWindow(dpy, locks[screen]->win);
+                    writemessage(dpy, locks[screen]->win, screen);
                 }
                 oldc = color;
             }
@@ -300,7 +431,7 @@ lockscreen(Display *dpy, struct xrandr *rr, int screen)
 static void
 usage(void)
 {
-    die("usage: slock [-v] [cmd [arg ...]]\n");
+    die("usage: slock [-v] [-f] [-m message] [cmd [arg ...]]\n");
 }
 
 int
@@ -313,12 +444,25 @@ main(int argc, char **argv) {
     gid_t dgid;
     const char *hash;
     Display *dpy;
-    int s, nlocks, nscreens;
+    int i, s, nlocks, nscreens;
+    int count_fonts;
+    char **font_names;
 
     ARGBEGIN {
     case 'v':
         fprintf(stderr, "slock-"VERSION"\n");
         return 0;
+    case 'm':
+        message = EARGF(usage());
+        break;
+    case 'f':
+        if (!(dpy = XOpenDisplay(NULL)))
+            die("slock: cannot open display\n");
+        font_names = XListFonts(dpy, "*", 10000 /* list 10000 fonts*/, &count_fonts);
+        for (i=0; i<count_fonts; i++) {
+            fprintf(stderr, "%s\n", *(font_names+i));
+        }
+        return 0;
     default:
         usage();
     } ARGEND
@@ -363,10 +507,12 @@ main(int argc, char **argv) {
     if (!(locks = calloc(nscreens, sizeof(struct lock *))))
         die("slock: out of memory\n");
     for (nlocks = 0, s = 0; s < nscreens; s++) {
-        if ((locks[s] = lockscreen(dpy, &rr, s)) != NULL)
+        if ((locks[s] = lockscreen(dpy, &rr, s)) != NULL) {
+            writemessage(dpy, locks[s]->win, s);
             nlocks++;
-        else
+        } else {
             break;
+        }
     }
     XSync(dpy, 0);
 
-- 
2.30.0

backspace.patch

commit 35633d45672d14bd798c478c45d1a17064701aa9
Author: Tobias Stoeckmann <tobias@stoeckmann.org>
Date:   Sat Mar 25 21:16:01 2017 +0100

    Properly clear the last entered character
    
    When enter is pressed, passwd[len] will be set to '\0'. Pressing
    backspace is supposed to remove the last entered character.
    
    But currently, the clearing has an off-by-one, as in setting
    passwd[len] to '\0' just like enter would do.
    
    You can also verify it by imagining len=1 and that it's impossible to
    clear passwd[0] by pressing backspace with the current code.
    
    Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>

diff --git a/slock.c b/slock.c
index d55eb3d..5ae738c 100644
--- a/slock.c
+++ b/slock.c
@@ -177,7 +177,7 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
                 break;
             case XK_BackSpace:
                 if (len)
-                    passwd[len--] = '\0';
+                    passwd[--len] = '\0';
                 break;
             default:
if (num && !iscntrl((int)buf[0]) &&

41

Re: [Collection] Compilation of packages and ports (not in repositories)

Package fricas

PKGBUILD

# Maintainer (Arch): Antonio Rojas <arojas@archlinux.org>
# Contributor (Arch): Sergey Khorev <sergey.khorev@gmail.com>
# Maintainer: Tobias Dausend <throgh@hyperbola.info>

pkgname=fricas
pkgver=1.3.8
_debver=$pkgver
_debrel=6
pkgrel=1
pkgdesc="An advanced computer algebra system"
arch=('i686' 'x86_64')
url='https://fricas.github.io'
license=('Modified-BSD')
depends=('gawk' 'glibc' 'libx11' 'libxpm' 'sh')
makedepends=('sbcl-legacy' 'quilt')
options=(!strip)
source=("$pkgname-$pkgver.tar.bz2::https://deb.debian.org/debian/pool/main/f/fricas/fricas_$pkgver.orig.tar.bz2"
        "https://deb.debian.org/debian/pool/main/f/fricas/fricas_$_debver-$_debrel.debian.tar.xz")
sha512sums=('330554f9dc36b47451195e3dee88fe26a80ab2bf9b6750d651cd53c5ba16b9c9736176936c7c69e699685be25aa62b6a099ed7340913e946a4f5e53579835dbb'
            '6f34cb205fb13f7018a5c1bf4d278f1fe331e5de41f713180cb953a36bf75455fc55308c3a39d2e4104f4d8f167dcdff8f7012b6d13f22abe3511013161d58c8')

prepare() {
  cd $pkgname-$pkgver
  if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
    # Debian patches
    export QUILT_PATCHES=debian/patches
    export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
    export QUILT_DIFF_ARGS='--no-timestamps'

    mv "$srcdir"/debian .

    # Doesn't apply
    rm -v debian/patches/package-names-and-ansi-pathname || true

    quilt push -av
  fi
}

build() {
  cd $pkgname-$pkgver
  ./configure \
    --prefix=/usr \
    --with-lisp='sbcl \
    --control-stack-size 512 \
    --dynamic-space-size 6000'
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 license/LICENSE.AXIOM -t "$pkgdir"/usr/share/licenses/$pkgname
}
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

42

Re: [Collection] Compilation of packages and ports (not in repositories)

Package cdrip-tools

PKGBUILD

# Maintainer (Arch): John Lane <archlinux at jelmail dot com>
# Maintainer: Tobias Dausend <throgh@hyperbolainfo>

pkgname=cdrip-tools
pkgver=0.3
pkgrel=1
pkgdesc="Commandline accuraterip verifier and rip offset fixer"
url='https://github.com/spadev/cdrip-tools'
arch=('i686' 'x86_64')
license=('GPL-3')
depends=('python' 'libsndfile')
source=("${pkgname}-${pkgver}.zip::https://github.com/spadev/${pkgname}/archive/master.zip")
sha512sums=('43493a2f7b0f8cd0fc9f3de82cc3d1f0bb81b770e468ba7bf3259c89cbd7de3d1ba1295d1f628cf3dc7d65ab8fbc4cca7d73b85309932dd81eb0369d9137c20a')

prepare() {
  mv "$pkgname-master" "$pkgname-$pkgver"
}

build() {
  cd $srcdir/$pkgname-$pkgver
  cc -o ckcdda ckcdda.c
  cc -o splitaudio -l sndfile splitaudio.c

  # nasty library hack - change name to something less generic
  sed -i -e 's/^import utils/import cdrip_utils as utils/' \
         -e 's/^from utils/from cdrip_utils/' *.py
}

package() {
  cd $srcdir/$pkgname-$pkgver
  install -Dm644 README.md $pkgdir/usr/share/doc/$pkgname/README.md
  install -Dm755 arverify.py $pkgdir/usr/bin/arverify
  install -Dm755 fixoffset.py $pkgdir/usr/bin/fixoffset
  install -Dm755 splitaudio $pkgdir/usr/bin/
  install -Dm755 ckcdda $pkgdir/usr/bin/

  # nasty library hack - install renamed library (hopefully in site-packages!)
  pylibdir=$(python -c "import sys; print(sys.path[-1]);")
  install -Dm755 utils.py $pkgdir${pylibdir}/cdrip_utils.py

  install -Dm644 LICENSE -t $pkgdir/usr/share/licenses/$pkgname
}
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

43

Re: [Collection] Compilation of packages and ports (not in repositories)

Package rmw

PKGBUILD

# Maintainer (Arch): Andy Alt <arch_stanton5995 at proton.me>
# Contributor (Arch): Oliver Jaksch <arch-aur at com-in dot de>
# Maintainer: Tobias Dausend <throgh@hyperbola.info>

pkgname=rmw
pkgver=0.8.0
pkgrel=1
pkgdesc="Trash/recycle bin utility for the commandline"
arch=('i686' 'x86_64')
url='https://theimpossibleastronaut.com/rmw-website/'
license=('GPL-3')
depends=('glibc' 'ncurses')
makedepends=('meson' 'ninja')
source=("https://github.com/theimpossibleastronaut/rmw/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha512sums=('5744e4b46edecfd6d0588d9b0ecbc8a91e8495f2e07d87599d045f620a2ae08381e9efa97cfa51c83cfcf8a2e89a594f8e87c374dc452ffb5b1bd2371b46aa22')

build() {
  hyperbola-meson $pkgname-$pkgver build -Db_sanitize=none
  meson compile -v -C build
}

package() {
  DESTDIR="$pkgdir" meson install -C build
  rm -rf "$pkgdir/usr/share/doc/$pkgname/external"
  install -Dm644 "$srcdir/$pkgname-$pkgver/COPYING" -t "$pkgdir/usr/share/licenses/$pkgname"
}
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

44

Re: [Collection] Compilation of packages and ports (not in repositories)

Package scappit

PKGBUILD

# Maintainer (Arch): Oliver Giles <web ohwg net>
# Maintainer: Tobias Dausend <throgh@hyperbola.info>

pkgname=scappit
pkgver=0.3
pkgrel=1
pkgdesc="Simple screen capture and annotation"
arch=('i686' 'x86_64')
url='https://scappit.ohwg.net'
license=('Expat')
depends=('qt-base' 'qt-x11extras' 'gnome-icon-theme')
makedepends=('cmake')
options=('strip')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/ohwgiles/$pkgname/archive/v${pkgver}.tar.gz"
        "${pkgname}.desktop")
sha512sums=('66eac8dbd1f259ac92403029cd3558605d00f61c57846cce547ece503a9e9f691d98dafa50eab256448b762ac763c78886e0fa1ad6de331521de390f811994cf'
            '41364792a000f6065c85c60422a5c68c56951063be11a2d65ce25a7e38469b1c8e165e0de1fb766e978a6af124a9fd272c39e7303731bdecb3046be53e639ed1')

build() {
  cmake \
    -S $pkgname-$pkgver \
    -B build \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -Wno-dev
  make -C build
}

package() {
  make DESTDIR="$pkgdir/" -C build install/strip
  install -Dm644 "$srcdir/$pkgname.desktop" -t "$pkgdir/usr/share/applications"
  install -Dm644 "$srcdir/$pkgname-$pkgver/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname"
}

scappit.desktop

[Desktop Entry]
Version=1.0
Name=Scappit
GenericName=Simple screen capture and annotation
Comment=Simple screen capture and annotation
Type=Application
Categories=Graphics;GTK;
Exec=scappit
TryExec=scappit
Terminal=false
StartupNotify=true
Icon=applets-screenshooter
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

45

Re: [Collection] Compilation of packages and ports (not in repositories)

Package sdl3

PKGBUILD

# Maintainer (Arch): Sven-Hendrik Haase <svenstaro@archlinux.org>
# Maintainer: Tobias Dausend <throgh@hyperbola.info>

pkgname=sdl3
pkgver=3.2.14
pkgrel=1
pkgdesc="A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard (Version 3)"
arch=('i686' 'x86_64')
url="https://www.libsdl.org"
license=('zlib')
depends=('glibc' 'libxext' 'libxrender' 'libx11' 'mesa-libgl' 'libxcursor' 'libusb')
makedepends=('cmake' 'ninja' 'jack' 'alsa-lib' 'mesa' 'libxrandr' 'libxinerama' 'libxkbcommon'
             'libxss' 'sndio')
optdepends=(
  'alsa-lib: ALSA audio driver'
  'sndio: sndio audio driver'
)
source=("https://github.com/libsdl-org/SDL/releases/download/release-${pkgver}/SDL3-${pkgver}.tar.gz")
sha512sums=('7e501bda73cc7b42b860e6ba6f9a0450fdb5014f5999afa64ccd6b4eb633edf6646fd1e251d58189649755a883d7dd51e5bcc53e841974180ed73d56fb8e29cd')

build() {
  CFLAGS+=" -ffat-lto-objects"
  cmake -S SDL3-${pkgver} \
    -B build -G Ninja \
    -D CMAKE_BUILD_TYPE=None \
    -D CMAKE_INSTALL_PREFIX=/usr \
    -D SDL_STATIC=OFF \
    -D SDL_RPATH=OFF
  cmake --build build
}

package() {
  DESTDIR="${pkgdir}" cmake --install build
  install -Dm644 SDL3-${pkgver}/LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

46

Re: [Collection] Compilation of packages and ports (not in repositories)

Package dustrac

PKGBUILD

# Maintainer (Arch): Frederic Bezies <fredbezies at gmail dot com>
# Contributor (Arch): Daniel Milde
# Maintainer: Jayvee Enaguas <harvettfox96@dismail.de>
# Contributor: Tobias Dausend <throgh@hyperbola.info>

pkgname=dustrac
_pkgname=DustRacing2D
pkgver=2.1.1
pkgrel=2
_debver=2.1.1
_debrel=1
pkgdesc='Dust Racing 2D is a traditional top-down car racing game including a level editor'
arch=('x86_64' 'i686')
url='https://juzzlin.github.io/DustRacing2D/'
license=('GPL-3' 'CC-BY-SA-3.0')
depends=('qt-tools' 'openal' 'libvorbis' 'glu')
makedepends=('cmake' 'quilt')
groups=('games')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/juzzlin/${_pkgname}/archive/${pkgver}.tar.gz"
    "https://deb.debian.org/debian/pool/main/d/${pkgname}/${pkgname}_${_debver}-${_debrel}.debian.tar.xz")
sha512sums=('9a49cd0302ab47b12ee587a33cc74c1df2bf6cf7925141cbf957fc90a5c1a34423d4420be28bcb6909a862daa12d6214b397fd0fc77e9e18fa649f3ca5c2e1ab'
        '8824ae4dd0d281d945521262eb0a88927539ee335f475f3f42b5876bece2af32eaa1e4651b0be40d07cfd282a851c4a508229c90c23e02b40e5d3a7377399f57')

prepare() {
  cd ${_pkgname}-${pkgver}/

  if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
    # Debian patches
    export QUILT_PATCHES=debian/patches
    export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
    export QUILT_DIFF_ARGS='--no-timestamps'

    mv "$srcdir"/debian/ ./

    quilt push -av
  fi
}

build() {
  cd ${_pkgname}-${pkgver}/

  mkdir build && cd build
  cmake ../ \
    -DReleaseBuild=ON \
    -DCMAKE_INSTALL_PREFIX=/usr/ \
    -DBIN_PATH=games
  make
}

package() {
  cd ${_pkgname}-${pkgver}/build/

  make DESTDIR=${pkgdir} install
  # Install licence file.
  install -Dm644 ../COPYING -t ${pkgdir}/usr/share/licenses/${pkgname}/
}
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

47

Re: [Collection] Compilation of packages and ports (not in repositories)

Package heroes

PKGBUILD

# Maintainer (Arch): Steve Engledow <steve@offend.me.uk>
# Maintainer: Tobias Dausend <throgh@hyperbola.info>

pkgname=heroes
pkgver=0.21
_debver=$pkgver
_debrel=18
pkgrel=2
pkgdesc="An arena fighting game."
url='https://heroes.sourceforge.net'
arch=('i686' 'x86_64')
license=('GPL-2')
depends=('sdl' 'sdl_mixer')
makedepends=('quilt')
groups=('games')
source=("https://downloads.sourceforge.net/heroes/$pkgname-$pkgver.tar.gz"
        "https://downloads.sourceforge.net/heroes/$pkgname-data-1.5.tar.gz"
        "https://downloads.sourceforge.net/heroes/$pkgname-sound-tracks-1.0.tar.gz"
        "https://downloads.sourceforge.net/heroes/$pkgname-sound-effects-1.0.tar.gz"
        "https://downloads.sourceforge.net/heroes/$pkgname-hq-sound-tracks-1.0.tar.gz"
        "https://deb.debian.org/debian/pool/main/h/heroes/heroes_$_debver-$_debrel.debian.tar.xz")
sha512sums=('8a28f7c0af8f194fd3557293dd65d555f4cf40e236f776ed1ef7b75f032fa511bae750d9312ba62d183129f8a529c515178ecd40f719c85583c519d531191d30'
            'ec001cda314b43b4e98f784e86bfd29da1cbac75ae981cf9ba738de0e366b47a112a21f0382a8c02737968d295f292e42451250ff9fdaee068662d0f221821f1'
            'eefa299a12b9d0a72eb73b978eab3cce5a6bcafb28acf52981762b64b7d74b7128c8a7e8517b6dcbb5281be0481c4d2fdd01de8706aefe08263ba5de4f29efae'
            '7ac2d0353122839a1b3266c6bb91c8279beade9d41f87031e4116c0a27fc7979d7a8d64fe1eab77b39a4da5869179f0ce7b8a137134df70159d745b7a63156cf'
            '565229fb00ac06d1a3ea37335138ffe87564317eab4d96b069ecd70e276f92141d9c746bc0b2d2f0abdd47e60ca580e063a2cb265d068624b4f306ce9c37f7fc'
            'c558bf06f76e5e9c74f86d14ec36d351395b2b69de7eb5c4c3bc3e18e3911585f9eca7a0f46e6b6076dafe4abca972302eeb6f4173853bd5e946eb0785eea98e')

prepare() {
  cd "$pkgname-$pkgver"
  if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
    # Debian patches
    export QUILT_PATCHES=debian/patches
    export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
    export QUILT_DIFF_ARGS='--no-timestamps'

    mv "$srcdir"/debian .

    quilt push -av
  fi
}

build() {
  cd "$pkgname-$pkgver"
  LDFLAGS=-lm ./configure \
    --prefix=/usr \
    --bin=/usr/games \
    --datadir=/usr/share/games
  make

  cd "$srcdir/$pkgname-data-1.5"
  ./configure \
    --prefix=/usr \
    --datadir=/usr/share/games
  make

  cd "$srcdir/$pkgname-sound-tracks-1.0"
  ./configure \
    --prefix=/usr \
    --datadir=/usr/share/games
  make

  cd "$srcdir/$pkgname-sound-effects-1.0"
  ./configure \
    --prefix=/usr \
    --datadir=/usr/share/games
  make

  cd "$srcdir/$pkgname-hq-sound-tracks-1.0"
  ./configure \
    --prefix=/usr \
    --datadir=/usr/share/games
  make
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir/" install
  mv "$pkgdir/"usr/share/games/locale "$pkgdir/"usr/share
  install -Dm644 debian/$pkgname.desktop "$pkgdir"/usr/share/applications/$pkgname.desktop
  install -Dm644 debian/$pkgname.xpm "$pkgdir"/usr/share/pixmaps/$pkgname.xpm
  install -Dm644 COPYING -t "$pkgdir/usr/share/licenses/$pkgname"

  cd "$srcdir/$pkgname-data-1.5"
  make DESTDIR="$pkgdir/" install

  cd "$srcdir/$pkgname-sound-tracks-1.0"
  make DESTDIR="$pkgdir/" install

  cd "$srcdir/$pkgname-sound-effects-1.0"
  make DESTDIR="$pkgdir/" install

  cd "$srcdir/$pkgname-hq-sound-tracks-1.0"
  make DESTDIR="$pkgdir/" install
}
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

48

Re: [Collection] Compilation of packages and ports (not in repositories)

Package crimson-fields

PKGBUILD

# Maintainer (Arch): Winston Weinert <winston@ml1.net>
# Maintainer: Tobias Dausend <throgh@hyperbola.info>

pkgname=crimson-fields
_pkgname=crimson
pkgver=0.5.3
pkgrel=1
pkgdesc="Free and libre turn-based tactical game with a hex grid and multiplayer support"
arch=('i686' 'x86_64')
url='http://crimson.seul.org'
license=('GPL-2')
depends=('sdl' 'sdl_ttf' 'sdl_mixer' 'sdl_net')
groups=('games')
source=("http://crimson.seul.org/files/$_pkgname-$pkgver.tar.gz")
sha512sums=('56a0c8c3e271f6ca53baaee23c28b594033b2d3e4b22fb4cd58c9858dc2bda556a13d1204cdba607da0a4414affb455b1403dde73e385a1accdd5162ec9e0a89')

build() {
  cd "$srcdir/$_pkgname-$pkgver"

  ./configure \
    --prefix=/usr \
    --bindir=/usr/games \
    --datarootdir=/usr/share/games
  make
}

package() {
  cd "$srcdir/$_pkgname-$pkgver"

  make DESTDIR="$pkgdir/" install
  mv "$pkgdir"/usr/share/games/{applications,man,pixmaps} "$pkgdir"/usr/share
  install -Dm644 COPYING -t "$pkgdir"/usr/share/licenses/$pkgname
}
Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!