The shell option "set -e" has a tricky, but standard, behaviour:
Anything called on the left side of a || or && token ignores "set -e",
so failure in a command in a subshell called on the left side of "|| die"
does not prevent the execution of the following commands in the subshell.
Adding explicit "|| die" calls after each command that could fail (and
should interrupt the process) works around this behaviour, by emulating
the intuitive "set -e" behaviour.
Treat premake like any other dependency and package it separately, this
makes it much easier to bump it in future by making it easier to track
modifications if any.
Moving it to libraries as it is handled the same as other packages. An
argument could be made to have it in build due to it's special nature.
The issue with that approach would be how to handle clean-workspace.sh.
If we split it out we would need a separate clean-premake.sh script and
if we have it cleaned by clean-workspace we through away the download
and already built binary.
Also bump version to 5.0.0-beta2 and backport patch for macOS fix
instead of the Makefile changes. The same fix is needed for gcc-14
(reported upstream), so add a patch injecting unistd.h for Unixes.
Fixes: #6816Fixes: #6632
Refs: #6847
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Instead of fetching the whole svn repo containing all current
dependencies into source, fetch them individually into subdirectories of
source.
Adds a wrapper script to each package to place the build output where
it's currently expected.
This allows adding and removing dependencies as well as changing origin
of those packages on a case by case basis.
It's recommended to run "git clean -dxf libraries/source" to free up
extra space and remove untracked files no longer covered by changes in
.gitignore.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This removes the remaining bashisms and changes the shebang.
Also remove command chaining in subshells as this allows for comments
to go where they belong and shellcheck directives to be more specific.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Change all non posix constructs except for stacked pushd/popd for the
sake of reviewability.
The reminder will be done in a separate commit.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This updates shell scripts to use a consistent style that can be enforced
via pre-commit hook.
As for choosing tabs over spaces, some arguments are:
- tabs can help people with visual impairment
- tabs allow for indenting heredocs in bash
- tabs are the default for the tool shfmt
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>