slackbuilds/xap/openrgb/SlackBuild

97 lines
2.7 KiB
Text
Raw Normal View History

2024-05-05 23:13:24 +02:00
#!/bin/bash
# variables
TAG=gwh
TMP=/tmp/$TAG
CWD=$(pwd)
OUTPUT=/tmp
PRGNAM=$(basename "$CWD")
PKG=$TMP/pkg-$PRGNAM
ARCH=$(uname -m)
2024-09-02 13:58:57 +02:00
BUILD=2
VERSION=${VERSION:-latest}
REPOSITORY=/home/installs/SlackBuilds/_repositories/$PRGNAM
2024-05-05 23:13:24 +02:00
rm -fr "$PKG" "${TMP:?}"/"$PRGNAM"
mkdir -p "$PKG"
# mise en place
[ ! -e "$REPOSITORY" ] && git clone https://gitlab.com/CalcProgrammer1/OpenRGB.git "$REPOSITORY"
cd "$REPOSITORY" || exit 1
git pull --all
cp -R "$REPOSITORY" "$TMP"/"$PRGNAM"
cd "$TMP"/"$PRGNAM"/ || exit 1
2024-05-27 07:53:51 +02:00
[ "$VERSION" == "latest" ] && VERSION=$(git tag --sort=-version:refname | head -n1)
[ "$VERSION" == "" ] && VERSION=trunk
[ "$VERSION" == "trunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" #|| git checkout $VERSION
2024-09-02 13:58:57 +02:00
# Override default udev rule location since it would put it in a
# non-standard location in Slackware
sed -i 's|$$PREFIX/lib/udev/|/lib/udev/|g' OpenRGB.pro
sed -i 's|/usr/lib/udev/|/lib/udev/|' README.md ResourceManager.cpp
# This fixes breakage if someone is running experimental versions (master branch)
# It does not affect the current release
sed -i '/.*certs\.h/'d dependencies/hueplusplus-1.?.0/src/EntertainmentMode.cpp
qmake6 DOCS_DIR=/usr/doc/"$PRGNAM" MAN_DIR=/usr/man/man1 OpenRGB.pro
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
2024-08-25 21:01:33 +02:00
make -j $(nproc)
make INSTALL_ROOT="$PKG" install
find "$PKG" -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
find "$PKG"/usr/man -type f -exec gzip -9 {} \;
for i in $( find "$PKG"/usr/man -type l ) ; do ln -s "$( readlink "$i" ).gz" "$i.gz" ; rm "$i" ; done
2024-05-05 23:13:24 +02:00
# correction
cd "$PKG" || exit 1
chown -R root:root ./*
# embaumement
mkdir -p "$PKG"/install
cat <<EOF > "$PKG"/install/doinst.sh
udevadm control --reload-rules
udevadm trigger
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
if [ -x /usr/bin/update-mime-database ]; then
/usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi
if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
if [ -x /usr/bin/gtk-update-icon-cache ]; then
/usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
fi
fi
EOF
cat <<EOF > "$PKG"/install/slack-desc
|-----handy-ruler------------------------------------------------------|
$PRGNAM: $PRGNAM (LEDs control)
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: https://www.openrgb.org/
$PRGNAM: REQUIRES: mbedtls
2024-05-05 23:13:24 +02:00
EOF
# empaquetage
cd "$PKG" || exit 1
/sbin/makepkg --linkadd y --chown n --prepend "$OUTPUT/$PRGNAM-${VERSION}-$ARCH-$BUILD$TAG.txz"