################################################################# # # Flatpak specific functions. # # Author: Tina Müller # ################################################################ # # Copyright © 2020 SUSE LLC # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, see . # ################################################################ recipe_setup_flatpak() { echo $BUILD_ROOT pwd TOPDIR=/usr/src/packages set -x "$DO_INIT_TOPDIR" && rm -rf "$BUILD_ROOT$TOPDIR" for i in OTHER SOURCES FLATPAK_ROOT ; do mkdir -p "$BUILD_ROOT$TOPDIR/$i" done chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR" if test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir ; then mv "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/ else cp -p "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/ fi set +x } recipe_prepare_flatpak() { : } # Variables: # $BUILD_ROOT is the chroot # $TOPDIR/SOURCES includes the sources # $RECIPEFILE the name of the flatpak.(yaml|json) config file recipe_build_flatpak() { echo "===================== recipe_build_flatpak ($@)" set -e mkdir -p "$BUILD_ROOT/var/lib/flatpak/runtime" cd "$BUILD_ROOT/var/lib/flatpak/runtime" # Unpack the tarfiles installed by the rpms local pkg set -x for i in ../tars/*.tar.gz; do echo "Unpacking $i" pkg="$(basename $i)" pkg="${pkg/-*}" [[ -d $pkg ]] || tar xf $i done # env | sort set -x # perl -v # perl -wE'use JSON::PP 99' || true # perl -wE'use YAML::XS 99' || true # perl -wE'use YAML::PP 99' || true # perl -wE'use URI 99' || true ls -l $BUILD_ROOT$TOPDIR/SOURCES cd "$BUILD_ROOT$TOPDIR/FLATPAK_ROOT" cp $BUILD_ROOT$TOPDIR/SOURCES/* . local FLATPAK_FILE="$TOPDIR/SOURCES/$RECIPEFILE" local FLATPAK_APP=$(perl -I$BUILD_DIR -MBuild::Flatpak -e 'Build::Flatpak::show' -- "$BUILD_ROOT$FLATPAK_FILE" name) local FLATPAK_REPO=/tmp/flatpakrepo local FLATPAK_REMOTE=https://dl.flathub.org/repo/flathub.flatpakrepo export FLATPAK_REPO export FLATPAK_REMOTE export FLATPAK_APP export FLATPAK_FILE export TOPDIR modprobe fuse chroot "$BUILD_ROOT" su -c "flatpak list" $BUILD_DIR/call-flatpak-builder --root "$BUILD_ROOT" set +x set +e BUILD_SUCCEEDED=true } recipe_resultdirs_flatpak() { : } recipe_cleanup_flatpak() { : } # Local Variables: # mode: Shell-script # End: