Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
AppImage based EBuilds not working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
jgehrig
n00b
n00b


Joined: 15 Nov 2009
Posts: 17

PostPosted: Wed Oct 04, 2023 4:10 pm    Post subject: AppImage based EBuilds not working Reply with quote

There are a few packages I prefer to pull in via ebuild, usually due to long build times, propriety code, etc.

In the past, I wrote some basic ebuild scripts to download, write menu entries, copy to /opt, and symlink the packages. For a long time, these ebuild scripts worked fine.

However, it looks like a change in portage broke my scripts at some point. The scripts now result in an invalid AppImage installed to /opt. It looks like some sort of stripping, or preprocessing is going on during the copy. I've tried various commands/techniques for copying the file from within the ebuild with no success.

Here is an example ebuild script:
Code:

EAPI=8

APPIMAGE_BIN="Nextcloud-${PV}-x86_64.AppImage"
SYM_BIN_NAME="nextcloud"

inherit desktop xdg-utils

DESCRIPTION="Desktop Syncing Client for Nextcloud"
HOMEPAGE="https://github.com/nextcloud/desktop"
SRC_URI="https://github.com/nextcloud-releases/desktop/releases/latest/download/${APPIMAGE_BIN}"

RESTRICT="mirror"

LICENSE="CC-BY-3.0 GPL-2"
SLOT="0"
KEYWORDS="amd64"

src_unpack() {
        local EXTRACT_DIR="squashfs-root"
        local EXTRACT_DEST="${P}"

        cp "${DISTDIR}/${APPIMAGE_BIN}" "${WORKDIR}"

        chmod +x "${APPIMAGE_BIN}" \
                || die "Failed to add execute permissions to bundle"

        "${WORKDIR}/${APPIMAGE_BIN}" --appimage-extract >/dev/null 2>/dev/null \
                || die "Failed to extract AppImage bundle"

        mv "${EXTRACT_DIR}" "${EXTRACT_DEST}" \
                || die "Failed to move AppImage bundle to destination"
}

src_install() {
        doicon Nextcloud.png
        domenu com.nextcloud.desktopclient.nextcloud.desktop

        exeinto /opt/${PN}
        doexe ../${APPIMAGE_BIN}
        dosym /opt/${PN}/${APPIMAGE_BIN} usr/bin/${SYM_BIN_NAME}
}

pkg_postinst() {
        xdg_desktop_database_update
}


Everything works fine, except the `doexe` command results in a AppImage that is modified and smaller than the original. It will not run. Everything works if the AppImage is manually copied over to portage's working directory mid-build or to /opt after the merge.

Any ideas on how to resolve this? Or is this simply an un-supported workflow for portage?

Thanks!
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1849

PostPosted: Wed Oct 04, 2023 4:46 pm    Post subject: Reply with quote

All 'doexe' does is ensures the target directory and source file exists and runs:
Code:
install ${EXEOPTIONS} "${mysrc}" "${ED%/}/${__E_EXEDESTTREE#/}"

Where defaults are: EXEOPTIONS="-m0755" ED=${DISTDIR} __E_EXEDESTTREE=""
__E_EXEDESTTREE is affected by 'exeinto'
EXEOPTIONS affected by 'exeopts'

See its source

Perhaps your unpack has caused the file to change itself?
Back to top
View user's profile Send private message
arran4
n00b
n00b


Joined: 19 Sep 2003
Posts: 9
Location: Melbourne, Australia

PostPosted: Mon Jun 24, 2024 11:03 am    Post subject: Reply with quote

I had to add:
Code:

RESTRICT="strip"


To my ebuilds to get around the stripping:
Code:

 * QA Notice: Pre-stripped files found:
 * /usr/bin/appimagetool
strip: x86_64-pc-linux-gnu-strip --strip-unneeded -N __gentoo_check_ldflags__ -R .comment -R .GCC.command.line -R .note.gnu.gold-version
   /usr/bin/appimagetool

Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum