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.16.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
238 lines (167 sloc)
4.86 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.16.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 | |
# error signal-desktop@7.16.0: The engine "node" is incompatible with this module. Expected version "20.11.1". Got "20.15.1" | |
NODEVERSION=${NODEVMAP[${VERSION}]} | |
PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin | |
export PATH | |
PREFIX=/pkg/${PKG}-${VERSION}-${BUILD} | |
mkdir -p ${PREFIX} | |
BUILDDIR=/scratch/local2/${USER}/signal-build/${VERSION} | |
mkdir -p ${BUILDDIR} | |
# test -d ${BUILD_TMPDIR} && chmod -c -R u+rwx ${BUILD_TMPDIR} && rm -rf ${BUILD_TMPDIR} | |
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/44001df7f3be296a2a305769bc156b94/node-v3.0.0-29893-g7fe67b7078.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 | |
type npm | |
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 | |
SRCURL="https://beehive.molgen.mpg.de/4b759b1f90eca65adca160fdffea4c40/Signal-Desktop-v6.31.0-beta.1-1063-g1e57db6aa.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 checkout tags/v${VERSION} | |
# git checkout tags/v${VERSION}-beta.1 | |
git clean -d --force | |
git checkout tags/v${VERSION} | |
# allow higher node versions | |
#sed 's#"node": "#&>=#' -i package.json | |
# 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 | |
} |