-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix(buildlibs.sh): Small changes to the buildlibs.sh script to provide macOS compatibility #110
Conversation
…s for macOS compatability
…ndefined value error
files/bin/buildlibs.sh
Outdated
@@ -21,8 +21,7 @@ else | |||
fi | |||
|
|||
DEPS_DIR=${DEPS_DIR:-${HOME}/.local/c0} | |||
|
|||
PKG_LIBS=${1}/lib/${OS}-${NIMARCH} | |||
PKG_LIBS=${1:-"./files/deps"}/lib/${OS}-${NIMARCH} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a huge fan of the default string I have provided here but not sure what would be better. V open to suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather blow up if the variable isn't provided, if we actually need to do something here. Generally, nobody should need to run this manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hope you don't mind me just pushing to your branch, I just changed the way you were dealing with no argument from having a default to bombing if not provided.
files/bin/buildlibs.sh
Outdated
@@ -21,8 +21,7 @@ else | |||
fi | |||
|
|||
DEPS_DIR=${DEPS_DIR:-${HOME}/.local/c0} | |||
|
|||
PKG_LIBS=${1}/lib/${OS}-${NIMARCH} | |||
PKG_LIBS=${1:-"./files/deps"}/lib/${OS}-${NIMARCH} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather blow up if the variable isn't provided, if we actually need to do something here. Generally, nobody should need to run this manually.
files/bin/buildlibs.sh
Outdated
@@ -223,7 +226,8 @@ function ensure_gumbo { | |||
if ! copy_from_package libgumbo.a ; then | |||
ensure_musl | |||
get_src sigil-gumbo https://github.com/Sigil-Ebook/sigil-gumbo/ | |||
sed -i '/examples/d' CMake* | |||
sed -i.bakconf4mbak '/examples/d' CMake* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assume this is some leftover stuff?
macOS uses BSD
sed
which errors out with the attempted usage of-i
for 'inplace'.The provided alternative is pretty gross but is cross-platform in terms of BSD & GNU. Replaced whole sed approach with just dumping ased
CMakelists.txt
file of predefined structure.The provision of a default argument to the
${1}
variable was needed to avoid an unset parameter error on macOS, I expect the root cause here to be whatever the version of bash macOS is using and whatever vintage it is vs current bash mainline.Older versions of macOS/OSX ship with a version of
uname
that doesn't not support the-o
switch for collecting OS version, it instead uses-s
. Fix triesuname -o
first and if that fails falls back touname -s
.