Skip to content

Use /bin/sh and make mktemp use compatible with non-GNU #22

@probonopd

Description

@probonopd

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions