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

fix(buildlibs.sh): Small changes to the buildlibs.sh script to provide macOS compatibility #110

Merged
merged 7 commits into from
Sep 7, 2023
12 changes: 8 additions & 4 deletions files/bin/buildlibs.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#!/bin/bash
OS=$(uname -o 2>/dev/null)
if [[ ${?} != 0 ]] ; then
# Older macOS/OSX versions of uname don't support -o
OS=$(uname -s)
fi

set -eEu
set -o pipefail

ARCH=$(uname -m)
OS=$(uname -o)

if [[ ${ARCH} = "x86_64" ]] ; then
NIMARCH=amd64
Expand All @@ -21,8 +25,7 @@ else
fi

DEPS_DIR=${DEPS_DIR:-${HOME}/.local/c0}

PKG_LIBS=${1}/lib/${OS}-${NIMARCH}
PKG_LIBS=${1:-"./files/deps"}/lib/${OS}-${NIMARCH}
Copy link
Contributor Author

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

Copy link
Contributor

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.

MY_LIBS=${DEPS_DIR}/libs
SRC_DIR=${DEPS_DIR}/src
MUSL_DIR=${DEPS_DIR}/musl
Expand Down Expand Up @@ -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*
Copy link
Contributor

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?

rm *.bakconf4mbak
colorln CYAN "Cooking up some gumbo"
mkdir build
cd build
Expand Down