You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.1 KiB

#!/bin/bash
DIST=debian/buster # 06 Jul 2019 fin : 01 juin 2024 # cp: failed to preserve ownership for 'debian/ruby-gio2//usr/lib/ruby/vendor_ruby/gio2': Invalid argument
#DIST=debian/bullseye # 14 Aug 2021 fin : 15 Aug 2026
#DIST=ubuntu/bionic # 18.04 LTS fin : Avril 2023 # E: Unable to find a source package for ruby-gnome
#DIST=ubuntu/focal # 20.04 LTS fin : Avril 2025
#DIST=ubuntu/jammy # 22.04 LTS din : Avril 2027
ID=$(echo $DIST|cut -d '/' -f 1)
VERSION_CODENAME=$(echo $DIST|cut -d '/' -f 2)
case $ID in
debian) DEB_SRC=http://deb.debian.org/debian
DEB_SRC_SEC=http://ftp.fr.debian.org/debian/
DEB_SRC_LIST="
deb-src $DEB_SRC $VERSION_CODENAME main contrib non-free
deb-src $DEB_SRC_SEC $VERSION_CODENAME-updates main contrib non-free
"
;;
ubuntu) DEB_SRC=http://archive.ubuntu.com/ubuntu
DEB_SRC_SEC=http://security.ubuntu.com/ubuntu/
DEB_SRC_SEC_NAME= $VERSION_CODENAME-security
DEB_SRC_LIST="
deb-src $DEB_SRC $VERSION_CODENAME main restricted universe
deb-src $DEB_SRC $VERSION_CODENAME-updates main restricted universe
deb-src $DEB_SRC_SEC $VERSION_CODENAME-security main restricted universe
"
;;
esac
CACHE=/tmp/vte/$DIST
[ ! -d $CACHE ] && mkdir -p $CACHE
echo "CACHE: $CACHE"
cat << EOF > $CACHE/build.def
Bootstrap: docker
From: $ID:$VERSION_CODENAME
%post
echo "$DEB_SRC_LIST" >> /etc/apt/sources.list
cat /etc/apt/sources.list
export DEBIAN_FRONTEND=noninteractive
apt-get -y update
apt-get -y install dpkg-dev lsb-release
apt-get -y build-dep ruby-gnome2
apt-get -y install libvte-dev
%environment
export LC_ALL=C
EOF
set -x
export SINGULARITY_CACHEDIR=$CACHE
# (userns not supported by buil !
singularity build -F --fakeroot $CACHE/out.sif $CACHE/build.def
cat << EOF > $CACHE/compile.sh
#!/bin/bash
#set -e #
set -x
rm -Rf $CACHE/tmp
mkdir -p $CACHE/tmp
cd $CACHE/tmp
apt-get source ruby-gtk2
cd \$(find . -maxdepth 1 -type d -name 'ruby-gnome*')
dpkg-buildpackage -us -uc
cd vte
ruby extconf.rb
make
EOF
chmod 755 $CACHE/compile.sh
singularity exec -u $CACHE/out.sif $CACHE/compile.sh
VTE=$(find $CACHE/tmp -name 'vte.so')
echo vte : $VTE