Merge branch 'main' of codeberg.org:gwh/slackbuilds

This commit is contained in:
Gwenhael Le Moine 2024-02-21 13:16:37 +01:00
commit fa98a10e81
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
2 changed files with 131 additions and 37 deletions

77
d/uxn/SlackBuild Executable file
View file

@ -0,0 +1,77 @@
#!/bin/bash
# variables
VERSION=${VERSION:-"latest"}
BUILD=${BUILD:-1}
TAG=gwh
TMP=/tmp/$TAG
CWD=$(pwd)
PRGNAM=$(basename $CWD)
PKG=$TMP/pkg-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
ARCH=noarch
REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/_repositories/$PRGNAM}
PREFIX=${PREFIX:-/usr}
# nettoyage préalable
rm -fr "$PKG" "${TMP:?}/$PRGNAM"
mkdir -p "$PKG"
# mise en place
[ ! -e "$REPOSITORY" ] && git clone https://git.sr.ht/~rabbits/uxn "$REPOSITORY"
cd "$REPOSITORY" || exit 1
git pull --all
cp -R "$REPOSITORY" "$TMP/"
cd "$TMP/$PRGNAM" || exit 1
[ "$VERSION" == "latest" ] && VERSION=$(git tag --sort=-taggerdate | head -n1)
[ "$VERSION" == "" ] && VERSION=trunk
[ "$VERSION" == "trunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" || git checkout $VERSION
./build.sh --no-run
mkdir -p "$PKG$PREFIX/bin"
cp bin/uxn{asm,cli,emu} "$PKG$PREFIX/bin/"
mkdir -p "$PKG$PREFIX/share/$PRGNAM/"
cp bin/*.rom "$PKG$PREFIX/share/$PRGNAM/"
mkdir -p "$PKG$PREFIX/doc/$PRGNAM"
cp -R LICENSE README.md "$PKG$PREFIX/doc/$PRGNAM"
# correction
cd "$PKG" || exit 1
chown -R root:root ./*
# embaumement
mkdir -p "$PKG/install"
cat <<EOF > "$PKG/install/slack-desc"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
$PRGNAM: $PRGNAM (An assembler and emulator for the Uxn stack-machine)
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: https://git.sr.ht/~rabbits/uxn
$PRGNAM:
EOF
# empaquetage
/sbin/makepkg --linkadd y --chown n --prepend "$OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz"

View file

@ -28,7 +28,7 @@
cd "$(dirname "$0")" || exit 1 cd "$(dirname "$0")" || exit 1
PKGNAM=emacs PKGNAM=emacs
BUILD=${BUILD:-9} BUILD=${BUILD:-11}
TAG=${TAG:-gwh} TAG=${TAG:-gwh}
OUTPUT=${OUTPUT:-/tmp} OUTPUT=${OUTPUT:-/tmp}
@ -37,6 +37,37 @@ NUMJOBS=${NUMJOBS:-" -j$(( $(nproc) + 1 )) "}
TMP=${TMP:-/tmp/$TAG} TMP=${TMP:-/tmp/$TAG}
PKG=$TMP/package-$PKGNAM PKG=$TMP/package-$PKGNAM
# Build Emacs with native compilation. This has better performance, but the
# installed package is larger. Pass NATIVECOMP=NO to do a normal build.
NATIVECOMP=${NATIVECOMP:-YES}
# When building with native compilation, link to the X11 libraries. This option
# is only for native compilation builds -- regular builds will include both
# an X11 and non-X11 version of Emacs.
WITHX=${WITHX:-YES}
# Pass this variable set to "--with-pgtk" to use GTK+3 without linking to X11
# libraries. This might be suitable if you're going to run under Wayland.
PGTK_OPTION=${PGTK_OPTION:-"--with-pgtk"}
# Set the X related options. The default X_TOOLKIT will be GTK+3, but you may
# set the X_TOOLKIT variable to any of these: gtk, gtk2, gtk3, lucid, athena, motif.
if [ "$WITHX" = "YES" ]; then
if [ "$PGTK_OPTION" = "--with-pgtk" ]; then
X_TOOLKIT=gtk3
fi
X_OPTIONS="--with-x --with-x-toolkit=${X_TOOLKIT:-gtk3}"
else
X_OPTIONS="--with-x=no"
fi
# Set the proper options for native compilation or not:
if [ "$NATIVECOMP" = "YES" ]; then
PDUMPER=${PDUMPER:-"--with-dumping=pdumper --with-native-compilation"}
else
PDUMPER=${PDUMPER:-"--with-pdumper=no --with-dumping=unexec --without-native-compilation"}
fi
# Automatically determine the architecture we're building on: # Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then if [ -z "$ARCH" ]; then
case "$(uname -m)" in case "$(uname -m)" in
@ -49,7 +80,6 @@ if [ -z "$ARCH" ]; then
fi fi
VERSION=${VERSION:-latest} VERSION=${VERSION:-latest}
UI=${UI:-pgtk} # pgtk or x11 or nox
PREFIX=${PREFIX:-/usr} PREFIX=${PREFIX:-/usr}
@ -127,13 +157,10 @@ sed -i "s/#define SYSTEM_PURESIZE_EXTRA 0/#define SYSTEM_PURESIZE_EXTRA 100000/g
make autoloads make autoloads
) )
PDUMPER=${PDUMPER:-"--with-pdumper=yes --with-dumping=pdumper"} CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
GWH_OPTIONS="--with-tree-sitter \ ./configure \
--enable-link-time-optimization \ --prefix=${PREFIX} \
--with-native-compilation=aot"
CONFIGURE_OPTIONS="--prefix=${PREFIX} \
--sysconfdir=/etc \ --sysconfdir=/etc \
--localstatedir=/var \ --localstatedir=/var \
--program-prefix="" \ --program-prefix="" \
@ -142,37 +169,18 @@ CONFIGURE_OPTIONS="--prefix=${PREFIX} \
--infodir=${PREFIX}/info \ --infodir=${PREFIX}/info \
--without-gconf \ --without-gconf \
--without-gsettings \ --without-gsettings \
--without-android \
--with-modules \ --with-modules \
$X_OPTIONS \
$PGTK_OPTION \
$PDUMPER \ $PDUMPER \
$GWH_OPTIONS \ --build=${ARCH}-slackware-linux || exit 1
--build=${ARCH}-slackware-linux"
X11_OPTIONS="--with-x \ if [ "$NATIVECOMP" = "YES" ]; then
--with-x-toolkit=${X_TOOLKIT:-gtk3}" make NATIVE_FULL_AOT=1 bootstrap $NUMJOBS || make NATIVE_FULL_AOT=1 || exit 1
PGTK_OPTIONS="--with-pgtk" else
NOX_OPTIONS="--with-x=no" make $NUMJOBS || make || exit 1
fi
case $UI in make install DESTDIR=$PKG || exit 1
pgtk)
GUI_OPTIONS=$PGTK_OPTIONS
;;
nox)
GUI_OPTIONS=$NOX_OPTIONS
;;
x11)
GUI_OPTIONS=$X11_OPTIONS
;;
esac
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
$CONFIGURE_OPTIONS \
$GUI_OPTIONS || exit 1
make $NUMJOBS || make || exit 1
make install DESTDIR="$PKG" || exit 1
# Seems like this nonsense is finally obsolete: # Seems like this nonsense is finally obsolete:
if [ -d "$PKG/var/games/emacs" ]; then if [ -d "$PKG/var/games/emacs" ]; then
@ -244,5 +252,14 @@ if [ ! -e usr/bin/ctags ]; then
fi fi
EOF EOF
# Tag packages that use a toolkit other than default (currently gtk3):
if [ -z "$UI" ] && [ -n "$X_TOOLKIT" ]; then
if [ "$PGTK_OPTION" = "--with-pgtk" ]; then
UI="_pgtk"
else
UI="_$X_TOOLKIT"
fi
fi
cd "$PKG" || exit 1 cd "$PKG" || exit 1
/sbin/makepkg -l y -c n "$OUTPUT/$PKGNAM-${VERSION}_$UI-$ARCH-$BUILD$TAG.txz" /sbin/makepkg -l y -c n "$OUTPUT/$PKGNAM-${VERSION}_$UI-$ARCH-$BUILD$TAG.txz"