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.28.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
247 lines (176 sloc)
5.16 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 | |
umask 022 | |
PKG=signal-desktop | |
VERSION=7.28.0 | |
BUILD=0 | |
declare -A NODEVMAP | |
NODEVMAP["6.44.1"]="18.17.1" # good | |
NODEVMAP["6.46.0"]="18.17.1" # good | |
NODEVMAP["6.47.0"]="18.18.2" # bad | |
NODEVMAP["6.48.1"]="18.18.2" # bad | |
NODEVMAP["7.0.0"]="18.18.2" # bad | |
NODEVMAP["7.1.1"]="18.18.2" # bad | |
NODEVMAP["7.2.1"]="20.9.0" # good | |
NODEVMAP["7.3.1"]="20.9.0" # good | |
NODEVMAP["7.4.0"]="20.9.0" # good | |
NODEVMAP["7.5.0"]="20.9.0" # nach zwei mal good | |
NODEVMAP["7.5.1"]="20.9.0" # good | |
NODEVMAP["7.16.0"]="20.11.1" # good | |
NODEVMAP["7.28.0"]="20.17.0" # good | |
NODEVMAP["7.29.0-beta.1"]="20.17.0" # good | |
# error signal-desktop@7.16.0: The engine "node" is incompatible with this module. Expected version "20.11.1". Got "20.15.1" | |
# error signal-desktop@7.29.0-beta.1: The engine "node" is incompatible with this module. Expected version "20.17.0". Got "20.11.1" | |
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 http.proxy http://beehive:3128 | |
git config --global https.proxy https://beehive.molgen.mpg.de:3128 | |
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} | |
SRCURL="https://beehive.molgen.mpg.de/8996b90d5544c80c6ddc91efbcacc72f/node-v3.0.0-30761-g019efe1453.tar" | |
PKGARC=${SRCURL##*/} | |
pushd ${BUILDDIR} | |
if [ ! -d ${NODEPREFIX} ]; then | |
# git tar file schon da ? wget it | |
test -e "${PKGARC}" || wget -nv "${SRCURL}" | |
test -d node-git || mkdir node-git && tar -x --directory=node-git --strip-components=1 -f ${PKGARC} | |
pushd node-git | |
# im node git, version auschecken | |
git clean -d --force | |
git checkout "v${NODEVERSION}" | |
# bauen nach | |
CFLAGS='-O2 -fPIC' \ | |
./configure \ | |
--prefix=${NODEPREFIX} | |
make -j $(nproc) | |
make install | |
popd | |
fi | |
PATH=${NODEPREFIX}/bin:$PATH | |
type node | |
node --version | |
type npm | |
npm --version | |
pushd ${PREFIX} | |
npm install yarn | |
rm -f ${NODEPREFIX}/bin/yarn | |
ln -sv ${PREFIX}/node_modules/yarn/bin/yarn ${NODEPREFIX}/bin/yarn | |
popd | |
type yarn | |
############ node / npm / yarn installed ############ | |
# get git lfs organized | |
#go get github.com/git-lfs/git-lfs | |
#cd ${HOME}/go/src/github.com/git-lfs/git-lfs | |
#make | |
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, git describe, tar cf | |
SRCURL[0]="https://beehive.molgen.mpg.de/6754c1d4c92fcfd3c1adc6929c93f46a/Signal-Desktop-v6.31.0-beta.1-1447-g76a77a9b7.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} | |
pwd | |
cd Signal-Desktop | |
git-lfs install | |
git clean -d --force | |
git checkout tags/v${VERSION} | |
# allow higher node versions | |
#sed 's#"node": "#&>=#' -i package.json | |
# dirty... | |
rm -v patches/socks-proxy-agent+8.0.1.patch | |
mv -v patches/@types+express+4.17.18.patch patches/@types+express+4.17.21.patch | |
# workaround https://github.com/yarnpkg/yarn/issues/7584 | |
cat >$HOME/.yarnrc <<EOF0 | |
unsafe-disable-integrity-migration false | |
EOF0 | |
echo $PATH | |
type npm | |
npm --version | |
npm config set color false | |
#npm config set proxy http://beehive:3128 | |
#npm config set https-proxy https://beehive.molgen.mpg.de:3128 | |
type node | |
node --version | |
type yarn | |
yarn --version | |
# yarn install --frozen-lockfile | |
pushd sticker-creator | |
yarn install | |
popd | |
mkdir -pv ${HOME}/.config/yarn/global | |
touch ${HOME}/.config/yarn/global/.yarnclean | |
yarn install --ignore-engines | |
yarn generate | |
yarn prepare-beta-build | |
yarn build || yarn build | |
find ${BUILDDIR} -perm -700 ! -perm -005 -exec chmod o+rx '{}' ';' | |
false && { | |
for e in signal-desktop signal-desktop-beta ; do | |
[ -e ${BUILDDIR}/Signal-Desktop/release/linux-unpacked/$e ] && \ | |
cp -ax ${BUILDDIR}/Signal-Desktop/release/linux-unpacked/$e ${PREFIX}/ | |
done | |
for e in \ | |
'*.so' \ | |
'*.pak' \ | |
'*.bin' \ | |
icudtl.dat \ | |
locales \ | |
resources \ | |
; do | |
cp -ax ${BUILDDIR}/Signal-Desktop/release/linux-unpacked/$e ${PREFIX}/ | |
done | |
} | |
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 | |
exit | |
} |