public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Ulrich Mueller <ulm@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [RFC] [PATCH] appimage.eclass: new eclass
Date: Sun, 07 Oct 2018 11:54:52 +0200	[thread overview]
Message-ID: <w6gva6eytcj.fsf@kph.uni-mainz.de> (raw)
In-Reply-To: <20181006111750.34898-1-hilobakho@gmail.com> (Mykyta Holubakha's message of "Sat, 6 Oct 2018 14:17:50 +0300")

[-- Attachment #1: Type: text/plain, Size: 4304 bytes --]

>>>>> On Sat, 06 Oct 2018, Mykyta Holubakha wrote:

> Signed-off-by: Mykyta Holubakha <hilobakho@gmail.com>

> I'm proposing to add a new eclass: appimage.eclass, to facilitate
> extraction off AppImage bundles. The rationale is that some upstreams
> have migrated to distributing their proprietary software exclusively as
> AppImage bundles. (for instance dev-util/staruml-bin).

Ask upstream to use a friendlier package format?

> An example ebuild can be seen at https://git.io/fx3Mg

> I'd like to ask the following questions:

> 1. Can I put myself and proxy-maint under @MAINTAINER (or do I need to
> find a gentoo dev)?

You should contact proxy-maintainers in any case, because somebody needs
to commit it for you.

> 2. Are we OK with executing AppImage bundles downloaded from the
> Internet (an alternative would be to implement a proper extractor
> program, which would unpack the images without executing them, and add
> it to DEPENDs).

These are ELF binaries unpacking an included ISO 9660 image, right?
Not sure if it's a good idea to execute those in src_unpack. Won't they
require external dependencies to run?

I have also looked at staruml-bin-3.0.2.ebuild (your example above) and
I believe that it is highly problematic from a license point of view.
The distfile includes bundled LGPL libraries without including their
source, which means that it cannot be distributed.

> ---
>  eclass/appimage.eclass | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 69 insertions(+)
>  create mode 100644 eclass/appimage.eclass

> diff --git a/eclass/appimage.eclass b/eclass/appimage.eclass
> new file mode 100644
> index 00000000000..454bdedc07b
> --- /dev/null
> +++ b/eclass/appimage.eclass
> @@ -0,0 +1,69 @@
> +# Copyright 2018 Gentoo Foundation

This should be "Gentoo Authors" by the new copyright policy.

> +# Distributed under the terms of the GNU General Public License v2
> +
> +# @ECLASS: appimage.eclass
> +# @MAINTAINER:
> +# maintainer-wanted@gentoo.org
> +# @AUTHOR:
> +# Mykyta Holubakha <hilobakho@gmail.com>
> +# @BLURB: convenience eclass for extracting AppImage bundles
> +# @DESCRIPTION:
> +# This eclass provides a src_unpack function to extract AppImage bundles
> +
> +case "${EAPI:-0}" in

The quotes are not needed.

> +	6|7)
> +		;;
> +	*)
> +		die "EAPI ${EAPI:-0} is not supported"
> +		;;
> +esac
> +
> +EXPORT_FUNCTIONS src_unpack
> +
> +# @VARIABLE: APPIMAGE_EXTRACT_DIR
> +# @DEFAULT_UNSET: squashfs_root

@DEFAULT_UNSET doesn't take any parameters.

> +# @DESCRIPTION:
> +# This variable specifies the directory, in which the AppImage bundle
> +# is expected to be extracted.
> +
> +# @VARIABLE: APPIMAGE_EXTRACT_DEST
> +# @DEFAULT_UNSET: ${P}
> +# @DESCRIPTION:
> +# This variable specifies the directory, to which the extracted image
> +# will be moved.
> +
> +# @FUNCTION: appimage_src_unpack
> +# @DESCRIPTION:
> +# Unpack all the AppImage bundles from ${A} (with .appimage extension).
> +# Other files are passed to regular unpack.
> +appimage_src_unpack() {
> +	debug-print-function ${FUNCNAME} "${@}"
> +
> +	local extract_dir="${APPIMAGE_EXTRACT_DIR:-squashfs-root}"
> +	local extract_dest="${APPIMAGE_EXTRACT_DEST:-${P}}"
> +
> +	local f
> +	for f in ${A}
> +	do
> +		case "${f}" in

No quotes here.

> +			*.appimage|*.AppImage)
> +				cp "${DISTDIR}/${f}" "${WORKDIR}"

Add "|| die".

> +				debug-print "${FUNCNAME}: unpacking bundle ${f} to ${extract_dest}"
> +				chmod +x "${f}" \
> +					|| die "Failed to add execute permissions to bundle"
> +				"${WORKDIR}/${f}" --appimage-help >/dev/null 2>/dev/null \
> +					|| die "Invalid AppImage bundle"
> +				"${WORKDIR}/${f}" --appimage-extract >/dev/null 2>/dev/null \
> +					|| die "Failed to extract AppImage bundle"

See above, presumably it would be better to use an external tool for
extraction.

> +				rm -f "${f}" || die "Failed to remove bundle copy"
> +				mv "${extract_dir}" "${extract_dest}" \
> +					|| die "Failed to move AppImage bundle to destination"
> +				;;
> +			*)
> +				debug-print "${FUNCNAME}: falling back to unpack for ${f}"
> +				unpack "${f}"
> +				;;
> +		esac
> +	done
> +}
> +
> -- 
> 2.15.1



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  parent reply	other threads:[~2018-10-07  9:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-06 11:17 [gentoo-dev] [RFC] [PATCH] appimage.eclass: new eclass Mykyta Holubakha
2018-10-07  9:32 ` Andrew Savchenko
2018-10-07  9:54 ` Ulrich Mueller [this message]
2018-10-07 10:24 ` Mikle Kolyada
2018-10-07 13:24 ` Bernd Waibel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=w6gva6eytcj.fsf@kph.uni-mainz.de \
    --to=ulm@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox