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

Add ppc64le support #159

Closed
Closed
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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:
name: linux-musl-arm64
- os: ubuntu-20.04
name: linux-arm
- os: ubuntu-20.04
name: linux-ppc64le
- os: ubuntu-20.04
name: linux-musl-ppc64le
- os: macos-11
name: osx-x64
- os: macos-11
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile.linux
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM bording/crossbuild
ARG ARCH='amd64'
ENV CROSS_TRIPLE=${ARCH}
ARG CC_ARCH='amd64'
bording marked this conversation as resolved.
Show resolved Hide resolved
ENV CROSS_TRIPLE=${CC_ARCH}
RUN apt update && apt -y install pkg-config

WORKDIR /nativebinaries
COPY . /nativebinaries/

CMD ["/bin/bash", "-c", "./build.libgit2.sh"]
CMD ["/bin/bash", "-c", "./build.libgit2.sh"]
2 changes: 1 addition & 1 deletion Dockerfile.linux-musl
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ RUN apk add --no-cache bash build-base cmake
WORKDIR /nativebinaries
COPY . /nativebinaries/

CMD ["/bin/bash", "-c", "./build.libgit2.sh"]
CMD ["/bin/bash", "-c", "./build.libgit2.sh"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ the following platforms:

- Windows (x86, x64, arm64)
- macOS (x64, arm64)
- Linux (x64, arm, arm64) for both musl and glibc
- Linux (x64, arm, arm64, ppc64le) for both musl and glibc

[lg2s-nb]: https://www.nuget.org/packages/LibGit2Sharp.NativeBinaries
[lg2]: https://libgit2.github.com/
Expand Down
1 change: 1 addition & 0 deletions UpdateLibgit2ToSha.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Push-Location $libgit2Directory
<dllmap os="linux" cpu="x86-64" wordsize="64" dll="$binaryFilename" target="lib/linux-x64/lib$binaryFilename.so" />
<dllmap os="linux" cpu="arm" wordsize="32" dll="$binaryFilename" target="lib/linux-arm/lib$binaryFilename.so" />
<dllmap os="linux" cpu="armv8" wordsize="64" dll="$binaryFilename" target="lib/linux-arm64/lib$binaryFilename.so" />
<dllmap os="linux" cpu="ppc64le" wordsize="64" dll="$binaryFilename" target="lib/linux-ppc64le/lib$binaryFilename.so" />
<dllmap os="osx" cpu="x86-64" wordsize="64" dll="$binaryFilename" target="lib/osx-x64/lib$binaryFilename.dylib" />
<dllmap os="osx" cpu="armv8" wordsize="64" dll="$binaryFilename" target="lib/osx-arm64/lib$binaryFilename.dylib" />
</configuration>
Expand Down
11 changes: 10 additions & 1 deletion dockerbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@ echo "building for $RID"

if [[ $RID =~ arm64 ]]; then
arch="arm64"
cc_arch="arm64"
elif [[ $RID =~ arm ]]; then
arch="armhf"
cc_arch="armhf"
elif [[ $RID == linux-ppc64le ]]; then
arch="ppc64le"
cc_arch="powerpc64le"
elif [[ $RID == linux-musl-ppc64le ]]; then
arch="ppc64le"
cc_arch="ppc64le"
else
arch="amd64"
cc_arch="amd64"
fi

if [[ $RID == linux-musl* ]]; then
Expand All @@ -17,7 +26,7 @@ else
dockerfile="Dockerfile.linux"
fi

docker buildx build -t $RID -f $dockerfile --build-arg ARCH=$arch .
docker buildx build -t $RID -f $dockerfile --build-arg ARCH=$arch --build-arg CC_ARCH=$cc_arch .

docker run -t -e RID=$RID --name=$RID $RID

Expand Down
1 change: 1 addition & 0 deletions nuget.package/libgit2/LibGit2Sharp.dll.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<dllmap os="linux" cpu="x86-64" wordsize="64" dll="git2-a418d9d" target="lib/linux-x64/libgit2-a418d9d.so" />
<dllmap os="linux" cpu="arm" wordsize="32" dll="git2-a418d9d" target="lib/linux-arm/libgit2-a418d9d.so" />
<dllmap os="linux" cpu="armv8" wordsize="64" dll="git2-a418d9d" target="lib/linux-arm64/libgit2-a418d9d.so" />
<dllmap os="linux" cpu="ppc64le8" wordsize="64" dll="git2-a418d9d" target="lib/linux-ppc64le/libgit2-a418d9d.so" />
<dllmap os="osx" cpu="x86-64" wordsize="64" dll="git2-a418d9d" target="lib/osx-x64/libgit2-a418d9d.dylib" />
<dllmap os="osx" cpu="armv8" wordsize="64" dll="git2-a418d9d" target="lib/osx-arm64/libgit2-a418d9d.dylib" />
</configuration>