Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
pkg-scripts/signal-desktop-7.49.0-0.build.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
170 lines (111 sloc)
3.11 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash -x | |
{ | |
umask 022 | |
set -u | |
set -x | |
set -e | |
export PS4="+ $0:\${LINENO} " | |
umask 022 | |
PKG=signal-desktop | |
VERSION=7.49.0 | |
BUILD=0 | |
declare -A NODEVMAP | |
NODEVMAP["7.37.0"]="20.18.1" # good | |
NODEVMAP["7.49.0"]="22.14.0" # laut .nvmrc | |
NODEVERSION=${NODEVMAP[${VERSION}]} | |
PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin | |
export PATH | |
PREFIX=/pkg/${PKG}-${VERSION}-${BUILD} | |
mkdir -vp ${PREFIX} | |
cat >${PREFIX}/profile <<EOF | |
PATH=$PREFIX/bin:\$PATH | |
EOF | |
BUILDDIR=/scratch/local2/${USER}/signal-build/${VERSION} | |
mkdir -p ${BUILDDIR} | |
TMPDIR=${BUILDDIR}/tmp | |
mkdir -p ${TMPDIR} | |
export TMPDIR | |
HOME=${BUILDDIR}/home | |
mkdir -p ${HOME} | |
export HOME | |
_CLEANUP=( | |
${HOME}/.cache/node-gyp | |
${HOME}/.cache/pip | |
${HOME}/.npm | |
${HOME}/.config/configstore | |
) | |
for i in "${_CLEANUP[@]}"; do | |
test -d $i && chmod -c -R u+rwx $i && rm -rf $i && echo "removed $i" | |
done | |
cat >${HOME}/.wgetrc <<'_EOW_' | |
#http_proxy = beehive:3128 | |
#https_proxy = beehive:3128 | |
#ftp_proxy = beehive:3128 | |
check-certificate = quiet | |
_EOW_ | |
git config --global advice.detachedHead false | |
git config --global http.sslVerify false | |
git config --global pack.threads 24 | |
exec </dev/null | |
NODEPREFIX=/scratch/local2/${USER}/signal-build/node-${NODEVERSION} | |
pushd ${BUILDDIR} | |
if [ ! -d ${NODEPREFIX} ]; then | |
SRCURL="https://beehive.molgen.mpg.de/cd5d5f3c85b3e6acab5eb340a1d3ce26/node-v22.14.0.tar.gz" | |
BUILD_PKG=node-v${NODEVERSION} | |
mkdir -p ${NODEPREFIX} | |
cat >${NODEPREFIX}/profile <<-EOF | |
PATH=${NODEPREFIX}/bin:\$PATH | |
npm_config_cache=${NODEPREFIX}/cache | |
EOF | |
test -e "${BUILD_PKG}.tar.gz" || wget -nv "${SRCURL}" -O "${BUILD_PKG}.tar.gz" | |
test -d "${BUILD_PKG}" || mkdir -pv "${BUILD_PKG}" && tar -xf "${BUILD_PKG}.tar.gz" --strip-components=1 -C "${BUILD_PKG}" | |
. "${PREFIX}/profile" | |
pushd "${BUILD_PKG}" | |
CFLAGS='-O2 -fPIC' \ | |
./configure --prefix=${NODEPREFIX} | |
make -j $(nproc) | |
make install | |
popd | |
fi | |
PATH=${NODEPREFIX}/bin:$PATH | |
pushd ${PREFIX} | |
npm install corepack | |
type corepack | |
corepack enable pnpm | |
popd | |
if [ ! -e bin/git-lfs ]; then | |
mkdir -p bin | |
pushd bin | |
wget "https://beehive.molgen.mpg.de/f07153c9add38691457af31d5ef60d89/git-lfs" | |
chmod -v 755 git-lfs | |
popd | |
fi | |
PATH=${BUILDDIR}/bin:$PATH | |
export PATH | |
############ git-lfs installed ############ | |
# now go for signal | |
# git clone https://github.com/signalapp/Signal-Desktop.git | |
# ( cd Signal-Desktop; git describe ) | |
# tar cf | |
SRCURL="https://beehive.molgen.mpg.de/5e30813e2a495011b61a3ed1db9176ce/Signal-Desktop-v6.31.0-beta.1-2018-g07b966eb0.tar" | |
PKGARC=${SRCURL##*/} | |
test -e ${PKGARC} || wget -nv ${SRCURL} | |
test -d Signal-Desktop || mkdir Signal-Desktop && tar -x --directory=Signal-Desktop --strip-components=1 -f ${PKGARC} | |
pushd Signal-Desktop | |
git-lfs install | |
git clean -d --force | |
git checkout tags/v${VERSION} | |
pnpm --prefix ./sticker-creator/ install | |
pnpm install | |
pnpm --prefix ./sticker-creator/ run build | |
pnpm run build | |
popd | |
find ${BUILDDIR} -perm -700 ! -perm -005 -exec chmod o+rx '{}' ';' | |
cp -ax ${BUILDDIR}/Signal-Desktop/release/linux-unpacked/. ${PREFIX}/ | |
mkdir -p ${PREFIX}/bin | |
cat >${PREFIX}/bin/signal-desktop <<__EOS__ | |
#!/bin/sh | |
exec ${PREFIX}/signal-desktop "\$@" | |
__EOS__ | |
chmod 755 ${PREFIX}/bin/signal-desktop | |
} |