Skip to content

Commit

Permalink
Add ppc64le support
Browse files Browse the repository at this point in the history
Signed-off-by: David Christensen <[email protected]>
  • Loading branch information
David Christensen authored and bording committed Nov 23, 2024
1 parent 534c111 commit d5926f0
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 5 deletions.
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-24.04
name: linux-arm
- os: ubuntu-24.04
name: linux-ppc64le
- os: ubuntu-24.04
name: linux-musl-ppc64le
- os: macos-13
name: osx-x64
- os: macos-13
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'
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>

0 comments on commit d5926f0

Please sign in to comment.