From 98d88aaca091ebfd1a61a7ea19c55483e3b516a1 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 12 Feb 2020 20:28:58 +0000 Subject: [PATCH] yunohost-admin build: Misc tweaks to workaround the weird issue in npm from vanilla debian buster, use nvm instead --- images/make-images | 9 +++++---- scripts/pbuilder/hooks/D80patch-yunohost-admin | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/images/make-images b/images/make-images index c455570..429eaa3 100755 --- a/images/make-images +++ b/images/make-images @@ -35,15 +35,16 @@ function build_image() if [ "$ARCH" == "amd64" ]; then - #chroot $CHROOT wget -q -O /tmp/setup_nodejs https://deb.nodesource.com/setup_4.x - chroot $CHROOT wget -q -O /tmp/setup_nodejs https://deb.nodesource.com/setup_6.x - chroot $CHROOT bash /tmp/setup_nodejs - chroot $CHROOT apt install -y nodejs + chroot $CHROOT wget https://github.com/tj/n/archive/v4.1.0.tar.gz + chroot $CHROOT tar -xvzf v4.1.0.tar.gz + chroot $CHROOT /bin/bash -c "cd n-4.1.0; make install" + chroot $CHROOT n 10 # We take nodjes version 10 because idk fi chroot $CHROOT apt clean cd $CHROOT + echo "Now creating tarball with the filesystem ..." tar -czf $INIT_DIR/${DISTRIB}-${ARCH}.tgz ./* echo "" diff --git a/scripts/pbuilder/hooks/D80patch-yunohost-admin b/scripts/pbuilder/hooks/D80patch-yunohost-admin index 4782c86..3547bc6 100755 --- a/scripts/pbuilder/hooks/D80patch-yunohost-admin +++ b/scripts/pbuilder/hooks/D80patch-yunohost-admin @@ -9,7 +9,13 @@ if ls -d /build/yunohost-admin* >dev/null 2>&1 then echo "======================================================" - /usr/bin/apt-get install git nodejs -y + DIST="$(cat /etc/os-release | grep CODENAME= | cut -d = -f 2)" + if [ "$DIST" != "buster" ] + then + /usr/bin/apt-get install git nodejs -y + else + /usr/bin/apt-get install git -y + fi echo "========================" echo "Patching debian/rules ..." echo "========================" @@ -44,7 +50,12 @@ EOF mkdir /nonexistent chown pbuilder:pbuilder /nonexistent cd /build/yunohost-admin*/src - su pbuilder -c "npm install" + if [ "$DIST" != "buster" ] + then + su pbuilder -c "npm install" + else + su pbuilder -c "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin npm install" + fi echo "======================================================" fi