Skip to content
Permalink
master
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 248 lines (174 sloc) 4.96 KB
#! /bin/bash -x
{
set -u
PKG=signal-desktop
VERSION=7.5.1
BUILD=0
PREFIX=/pkg/$PKG-$VERSION-$BUILD
PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin
export PATH
set -xe
umask 022
set -u
set -x
set -e
umask 022
PKG=signal-desktop
VERSION=7.5.1
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
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/770742704ce7b3e571b257f1192acac9/node-v3.0.0-29201-g3790d524c1.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/045393109ca7c563c4c87dadfd57cf79/Signal-Desktop-v6.31.0-beta.1-778-g72169820e.tar"
SRCURL="https://beehive.molgen.mpg.de/5f54bb6c2239c6a68e28ddd3cea0c111/Signal-Desktop-v6.31.0-beta.1-778-g72169820e.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
}