Shit's too overcomplicated for nothing, simplify some mystic mess

This commit is contained in:
Alexandre Aubin 2020-05-11 01:33:27 +00:00
parent 827ef9e423
commit 1f81193659
7 changed files with 20 additions and 89 deletions

View file

@ -3,9 +3,9 @@
# For some reason, building chroots for buster from stretch requires libdebian-installer4 0.119 instead of 0.110, c.f. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=904699 ... installed it by manually downloading and dpkg -i the .deb # For some reason, building chroots for buster from stretch requires libdebian-installer4 0.119 instead of 0.110, c.f. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=904699 ... installed it by manually downloading and dpkg -i the .deb
readonly DISTRIB=buster readonly DISTRIB=buster
readonly INIT_DIR=$PWD readonly INIT_DIR=$PWD
#readonly ARCHS="amd64" readonly ARCHS="amd64"
#readonly ARCHS="i386 armhf armel arm64" #readonly ARCHS="i386 armhf armel arm64"
readonly ARCHS="arm64" #readonly ARCHS="arm64"
function main() function main()
{ {
@ -32,14 +32,12 @@ function build_chroot()
chroot $CHROOT apt update chroot $CHROOT apt update
chroot $CHROOT apt dist-upgrade chroot $CHROOT apt dist-upgrade
chroot $CHROOT apt install -y build-essential debhelper cmake wget devscripts chroot $CHROOT apt install -y build-essential debhelper cmake wget devscripts git
if [ "$ARCH" == "amd64" ]; if [ "$ARCH" == "amd64" ];
then then
chroot $CHROOT wget https://github.com/tj/n/archive/v4.1.0.tar.gz # This is for building yunohost-admin
chroot $CHROOT tar -xvzf v4.1.0.tar.gz chroot $CHROOT apt install npm nodejs
chroot $CHROOT /bin/bash -c "cd n-4.1.0; make install"
chroot $CHROOT n 10 # We take nodjes version 10 because idk
fi fi
chroot $CHROOT apt clean chroot $CHROOT apt clean

View file

@ -1,6 +0,0 @@
# ARM-specific configuration
DEBOOTSTRAP=debootstrap
#DEBOOTSTRAPOPTS=( '--variant=buildd' )
ARCHITECTURE=arm64

View file

@ -1,6 +0,0 @@
# ARM-specific configuration
DEBOOTSTRAP=debootstrap
#DEBOOTSTRAPOPTS=( '--variant=buildd' )
ARCHITECTURE=armel

View file

@ -1,6 +0,0 @@
# ARM-specific configuration
DEBOOTSTRAP=debootstrap
#DEBOOTSTRAPOPTS=( '--variant=buildd' )
ARCHITECTURE=armhf

View file

@ -1,9 +0,0 @@
# NodeJS-specific configuration
[[ -n ${OTHERMIRROR} ]] && OTHERMIRROR+=" | "
OTHERMIRROR+="deb https://deb.nodesource.com/node_4.x ${DISTRIBUTION} main"
[[ -n ${EXTRAPACKAGES} ]] && EXTRAPACKAGES+=" "
EXTRAPACKAGES+="apt-transport-https ca-certificates"
APTKEYRINGS=("${APTKEYRINGS[@]}" "/etc/pbuilder/keyrings/nodesource.gpg")

View file

@ -13,9 +13,6 @@ then
if [ "$DIST" != "buster" ] if [ "$DIST" != "buster" ]
then then
/usr/bin/apt-get install git nodejs -y /usr/bin/apt-get install git nodejs -y
else
/usr/bin/apt-get install git -y
fi
echo "========================" echo "========================"
echo "Patching debian/rules ..." echo "Patching debian/rules ..."
echo "========================" echo "========================"
@ -44,6 +41,7 @@ index b031511..477f27c 100755
rm -rf src/dist rm -rf src/dist
EOF EOF
patch -p1 < rules.patch patch -p1 < rules.patch
fi
echo "========================" echo "========================"
echo "Starting npm install ..." echo "Starting npm install ..."
echo "========================" echo "========================"

View file

@ -10,72 +10,34 @@ sendxmpppy "Starting build ${package}/${version} for arch=$arch ..."
source /home/vinaigrette/config/config source /home/vinaigrette/config/config
source /home/vinaigrette/scripts/package_helpers.sh source /home/vinaigrette/scripts/package_helpers.sh
# Build only binary-only limited to architecture dependent packages if [[ $arch == all ]]; then arch=$DEFAULT_ARCH; fi
DEBBUILDOPTS="-B"
if [[ $arch == $DEFAULT_ARCH ]]; then if [[ $arch == $DEFAULT_ARCH ]]; then
# Build architecture independent packages too # Build architecture independent packages too
DEBBUILDOPTS="-b" DEBBUILDOPTS="-b"
elif [[ $arch == all ]]; then else
# Build architecture independent packages too on default arch # Build only binary-only limited to architecture dependent packages
arch=$DEFAULT_ARCH DEBBUILDOPTS="-B"
DEBBUILDOPTS="-b"
fi fi
## Retrieve the number of processors for parallel building # Format needed pbuilder arguments
## N.B. : disabled by Alex on Feb 12 2020 because this makes some build fail on buster for some reason.. DSC_FILE="${package}_${version}.dsc"
#if [ -x /usr/bin/getconf ]; then BASE_TGZ="${PBUILDER_CHROOTS}/${codename}-${arch}.tgz"
# JOBS=`getconf _NPROCESSORS_CONF`
#else
# JOBS=1
#fi
#DEBBUILDOPTS="$DEBBUILDOPTS -j$JOBS"
echo "######################" echo "######################"
echo " Starting build ... " echo " Starting build ... "
echo "######################" echo "######################"
# Format needed pbuilder arguments echo "Running 'pbuilder build --basetgz $BASE_TGZ --debbuildopts $DEBBUILDOPTS $DSC_FILE"
DSC_FILE="${package}_${version}.dsc"
BASE_TGZ="${PBUILDER_CHROOTS}/${codename}-${arch}.tgz"
EXTRA_OPTS=()
CONFIGFILE=""
# Use specific conf for nodejs builds pbuilder build \
if [[ $package == "yunohost-admin" ]]; --basetgz "$BASE_TGZ" \
then --architecture $arch \
CONFIGFILE="--configfile $PBUILDER_CONF/nodejs.conf" --debbuildopts "$DEBBUILDOPTS" \
fi $DSC_FILE
if [[ $arch == "armhf" ]];
then
CONFIGFILE="--configfile $PBUILDER_CONF/armhf.conf"
fi
if [[ $arch == "armel" ]];
then
CONFIGFILE="--configfile $PBUILDER_CONF/armel.conf"
fi
if [[ $arch == "arm64" ]];
then
CONFIGFILE="--configfile $PBUILDER_CONF/arm64.conf"
fi
echo "Running 'pbuilder build --basetgz "${BASE_TGZ}" --debbuildopts "${DEBBUILDOPTS}" ${CONFIGFILE} "${EXTRA_OPTS[@]}" $DSC_FILE"
pbuilder build \
--basetgz "${BASE_TGZ}" \
--debbuildopts "${DEBBUILDOPTS}" \
${CONFIGFILE} \
"${EXTRA_OPTS[@]}" \
$DSC_FILE
exit_code=$? exit_code=$?
if [[ $exit_code != 0 ]]; [[ $exit_code == 0 ]] || sendxmpppy "Building ${package}/${version} for arch=$arch failed ?!"
then
sendxmpppy "Building ${package}/${version} for arch=$arch failed ?!"
fi
exit $exit_code exit $exit_code