Skip to content

Fix macOS cross compilation #134

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

Merged
merged 2 commits into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions build.libgit2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ SHORTSHA=${LIBGIT2SHA:0:7}
OS=`uname`
ARCH=`uname -m`
PACKAGEPATH="nuget.package/runtimes"
OSXARCHITECTURE="x86_64"
OSXARCHITECTURE=$ARCH

if [[ $OS == "Darwin" ]]; then
USEHTTPS="ON"
if [[ $ARCH == "arm64" ]]; then
OSXARCHITECTURE="arm64"
fi
USEHTTPS="ON"
if [[ $RID == "osx-arm64" ]]; then
OSXARCHITECTURE="arm64"
elif [[ $RID == "osx-x64" ]]; then
OSXARCHITECTURE="x86_64"
fi
else
USEHTTPS="OpenSSL-Dynamic"
USEHTTPS="OpenSSL-Dynamic"
fi

rm -rf libgit2/build
Expand All @@ -38,18 +40,14 @@ cmake --build .
popd

if [[ $RID == "" ]]; then
if [[ $ARCH == "x86_64" ]]; then
RID="unix-x64"
else
RID="unix-x86"
fi
echo "$(tput setaf 3)RID not defined. Falling back to '$RID'.$(tput sgr0)"
echo "$(tput setaf 3)RID not defined. Skipping copy to package path.$(tput sgr0)"
exit 0
fi

if [[ $OS == "Darwin" ]]; then
LIBEXT="dylib"
LIBEXT="dylib"
else
LIBEXT="so"
LIBEXT="so"
fi

rm -rf $PACKAGEPATH/$RID
Expand Down
6 changes: 3 additions & 3 deletions dockerbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ set -e
echo "building for $RID"

if [[ $RID =~ arm64 ]]; then
arch="arm64"
arch="arm64"
elif [[ $RID =~ arm ]]; then
arch="armhf"
arch="armhf"
else
arch="amd64"
arch="amd64"
fi

if [[ $RID == linux-musl* ]]; then
Expand Down