Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using /bin/sh and changing mktemp call to make it work on FreeBSD, too #157

Closed
probonopd opened this issue Oct 12, 2021 · 5 comments

Comments

@probonopd
Copy link

Would it be possible to change #! /bin/bash to #! /bin/sh in all scripts that end up in the AppImages? This would improve compatibility, e.g., with FreeBSD, where /bin/bash does not exist (even if you install bash from Ports).

This line in apprun-hooks/linuxdeploy-plugin-gtk.sh breaks on FreeBSD and possibly on other systems:

CACHEDIR="$(mktemp --tmpdir --directory .AppRun.XXXXXXXX)"

If I change this for testing to

CACHEDIR=$(mktemp  -d  "/tmp/.AppRun.XXXXXXXX")

then the application runs.

The culprit is:

FreeBSD% mktemp --tmpdir --directory .AppRun.XXXXXXXX
mktemp: illegal option -- -
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix 

As per https://www.freebsd.org/cgi/man.cgi?mktemp, mktemp -d "/tmp/.AppRun.XXXXXXXX" works for me on FreeBSD but I have not tested it on Linux.

image

Reference:
geany/geany#1303

@azubieta
Copy link
Contributor

bash is capable of running all sh scripts but the opposite is not possible AFAIK.

A workaround would be embedding bash, mksquashfs and env binaries.

@probonopd
Copy link
Author

probonopd commented Oct 14, 2021

I am "only" talking about the scripts that become part of the produced AppImage (apprun-hooks). So that the produced AppImage doesn't need bash.

@azubieta
Copy link
Contributor

azubieta commented Oct 15, 2021

If the apprun-hooks or other scripts bundled inside the AppImage use a bash feature that is not available in sh it will fail.

By the way, appimage-builder doesn't use apprun-hooks scripts, those are a linuxdeploy feature. appimage-builder uses an all mighty AppRun binary 😄

@probonopd
Copy link
Author

Oops. Sorry for the noise. I totally screwed this. Sorry!

@azubieta
Copy link
Contributor

No worries 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants