diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..16c2c540 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,94 @@ +name: CI +on: + push: + branches: [master, release-*] + tags: + - '[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+-*' + pull_request: + workflow_dispatch: +jobs: + build: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + env: + RID: ${{ matrix.name }} + strategy: + matrix: + include: + - os: windows-2022 + name: win-x86 + param: -x86 + - os: windows-2022 + name: win-x64 + param: -x64 + - os: windows-2022 + name: win-arm64 + param: -arm64 + - os: ubuntu-24.04 + name: linux-x64 + - os: ubuntu-24.04 + name: linux-arm + - os: ubuntu-24.04 + name: linux-arm64 + - os: ubuntu-24.04 + name: linux-ppc64le + - os: ubuntu-24.04 + name: linux-musl-x64 + - os: ubuntu-24.04 + name: linux-musl-arm + - os: ubuntu-24.04 + name: linux-musl-arm64 + - os: macos-14 + name: osx-x64 + - os: macos-14 + name: osx-arm64 + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v4.2.2 + with: + submodules: true + - name: Build Windows + if: runner.os == 'Windows' + run: ./build.libgit2.ps1 ${{ matrix.param }} + - name: Build macOS + if: runner.os == 'macOS' + run: ./build.libgit2.sh + - name: Setup QEMU + if: matrix.name == 'linux-musl-arm' || matrix.name == 'linux-musl-arm64' + run: docker run --rm --privileged multiarch/qemu-user-static:register --reset + - name: Build Linux + if: runner.os == 'Linux' + run: ./dockerbuild.sh + - name: Upload artifacts + uses: actions/upload-artifact@v4.4.3 + with: + name: ${{ matrix.name }} + path: nuget.package/runtimes/${{ matrix.name }} + package: + name: Create package + needs: build + runs-on: ubuntu-24.04 + env: + DOTNET_NOLOGO: true + steps: + - name: Checkout + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4.1.0 + with: + dotnet-version: 9.0.x + - name: Download artifacts + uses: actions/download-artifact@v4.1.8 + with: + path: nuget.package/runtimes/ + - name: Create package + run: dotnet pack nuget.package + - name: Upload NuGet package + uses: actions/upload-artifact@v4.4.3 + with: + name: NuGet package + path: ./nuget.package/*.nupkg diff --git a/.gitignore b/.gitignore index 202aff2c..87bac4fd 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ *.dylib *.so *.zip + +bin/ +obj/ +.vs/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 64c4ee70..00000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -git: - submodules: false - -language: c - -matrix: - include: - - os: linux - dist: trusty - sudo: required - env: RID=linux-x64 - - os: linux - dist: trusty - sudo: required - env: RID=rhel-x64 - - os: linux - dist: trusty - sudo: required - env: RID=fedora-x64 - - os: linux - dist: trusty - sudo: required - env: RID=debian.9-x64 - - os: linux - dist: trusty - sudo: required - env: RID=alpine-x64 - - os: osx - env: RID=osx - -branches: - only: - - master - - /^maint.*/ - -before_install: - - date -u - - uname -a - - env | grep -v "BINTRAY_API_KEY" | sort - - git submodule update --init - -install: true - -script: if [[ $RID == "osx" ]]; then ./build.libgit2.sh ; else ./dockerbuild.sh ; fi - -after_success: ./uploadbinaries.sh diff --git a/Dockerfile.alpine-x64 b/Dockerfile.alpine-x64 deleted file mode 100644 index 1264f3b0..00000000 --- a/Dockerfile.alpine-x64 +++ /dev/null @@ -1,7 +0,0 @@ -FROM alpine:3.7 -WORKDIR /nativebinaries -COPY . /nativebinaries/ - -RUN apk add --no-cache bash build-base cmake curl-dev openssl-dev - -CMD ["/bin/bash", "-c", "./build.libgit2.sh"] diff --git a/Dockerfile.debian.9-x64 b/Dockerfile.debian.9-x64 deleted file mode 100644 index 1d45f939..00000000 --- a/Dockerfile.debian.9-x64 +++ /dev/null @@ -1,7 +0,0 @@ -FROM debian:9 -WORKDIR /nativebinaries -COPY . /nativebinaries/ - -RUN apt update && apt -y install cmake gcc libcurl4-openssl-dev libssl-dev pkg-config zlib1g-dev - -CMD ["/bin/bash", "-c", "./build.libgit2.sh"] diff --git a/Dockerfile.fedora-x64 b/Dockerfile.fedora-x64 deleted file mode 100644 index e23af04c..00000000 --- a/Dockerfile.fedora-x64 +++ /dev/null @@ -1,7 +0,0 @@ -FROM fedora:26 -WORKDIR /nativebinaries -COPY . /nativebinaries/ - -RUN yum -y install cmake gcc libcurl-devel make openssl-devel - -CMD ["/bin/bash", "-c", "./build.libgit2.sh"] diff --git a/Dockerfile.linux-x64 b/Dockerfile.linux-x64 deleted file mode 100644 index 3a5c69c5..00000000 --- a/Dockerfile.linux-x64 +++ /dev/null @@ -1,7 +0,0 @@ -FROM ubuntu:14.04 -WORKDIR /nativebinaries -COPY . /nativebinaries/ - -RUN apt update && apt -y install cmake libcurl4-openssl-dev libssl-dev pkg-config - -CMD ["/bin/bash", "-c", "./build.libgit2.sh"] diff --git a/Dockerfile.rhel-x64 b/Dockerfile.rhel-x64 deleted file mode 100644 index 332752d2..00000000 --- a/Dockerfile.rhel-x64 +++ /dev/null @@ -1,7 +0,0 @@ -FROM centos:7 -WORKDIR /nativebinaries -COPY . /nativebinaries/ - -RUN yum -y install cmake gcc libcurl-devel make openssl-devel - -CMD ["/bin/bash", "-c", "./build.libgit2.sh"] diff --git a/README.md b/README.md index 35dd0fb9..a6f68879 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # LibGit2Sharp.NativeBinaries **[Libgit2Sharp][lg2s]** is a managed wrapper around **[libgit2][lg2]**, and as -such requires compilation of libgit2 for your platform. +such requires compilation of libgit2 for your platform. LibGit2Sharp makes this easy by distributing, and leveraging as a dependency, the **[LibGit2Sharp.NativeBinaries][lg2s-nb]** NuGet package. @@ -9,113 +9,100 @@ the **[LibGit2Sharp.NativeBinaries][lg2s-nb]** NuGet package. This package contains the compiled versions of the libgit2 native library for the following platforms: - - Windows (x86/amd64) - - Mac OS X (x86/amd64) - - Linux (amd64) - -**Note:** Due to the large number of distributions, the Linux support is -currently *experimental*. Would you encounter any issue with it, please open an -**[issue][tracker]**. + - Windows (x86, x64, arm64) + - macOS (x64, arm64) + - Linux + - glibc: (x64, arm, arm64, ppc64le) + - musl: (x64, arm, arm64) [lg2s-nb]: https://www.nuget.org/packages/LibGit2Sharp.NativeBinaries [lg2]: https://libgit2.github.com/ [lg2s]: http://libgit2sharp.com/ - [tracker]: https://github.com/libgit2/libgit2sharp.nativebinaries/issues -## How to build your own native binaries +## Script overview -If you need to build your own native binaries for some reason, you can -do so easily with the scripts in this repository: +The following scripts are used to build libgit2 and update this repo. -1. Clone the `LibGit2Sharp.NativeBinaries` repository. Do so recursively - to ensure that the `libgit2` submodule is initialized automatically: +### build.libgit2.ps1 - `git clone --recursive https://github.com/libgit2/libgit2sharp.nativebinaries` +This script builds Windows libgit2 binaries. It requires Visual Studio 2019 to run. - (If you have already cloned this repository (which seems quite - likely since you are reading this file!) then you can simply run - `git submodule init` followed by `git submodule update`.) +To build x86 binaries: -2. Update the included libgit2 sources and configuration files to the - version of libgit2 you want to build. For example, to build - commit `1a2b3c4`: +``` +build.libgit2.ps1 -x86 +``` - `UpdateLibgit2ToSha.ps1 1a2b3c4` +To build x64 binaries: - Or you can specify references. To build the remote's `master` branch: +``` +build.libgit2.ps1 -x64 +``` - `UpdateLibgit2ToSha.ps1 master` +To build arm64 binaries: -3. Build the libgit2 binaries. For Windows, this requires a Visual Studio - installation, and will compile both x86 and amd64 variants. (See - "Notes on Visual Studio", below). Run the build PowerShell script, - specifying the version number of Visual Studio as the first argument. - For example, to build with Visual Studio 2013 (aka "Visual Studio 12.0"): +``` +build.libgit2.ps1 -arm64 +``` - `build.libgit2.ps1 12` +Multiple architecture parameters can be specified to build multiple binaries with a single execution of the script. - For Linux, this will build only the architecture that you're running - (x86 or amd64). For Mac OS X, this will build a fat library that - includes both x86 and amd64. Run the shell script: +See the script for additional parameters. - `build.libgit2.sh` +### build.libgit2.sh -4. Create the NuGet package from the built binaries. You will need to - specify the version number of the resultant NuGet package that you - want to generate. Note that you may wish to provide a suffix to - disambiguate your custom package from the official, published NuGet - packages. For example, if you are building a product called - `fooproduct` then that may be a helpful suffix. +This script builds Linux and macOS binaries. It can be invoked directly, but for Linux binaries, `dockerbuild.sh` should be used instead. - To build a NuGet package at version `1.2.3-foo`: +### dockerbuild.sh - `buildpackage.ps1 1.2.3-foo` +This script will build one of the Dockerfiles in the repo. It chooses which one to run based on the value of the `RID` environment variable. Using docker to build the Linux binaries for the various RIDs ensures that a specific environment and distro is used. - And the result will be a NuGet package in the current directory: +### UpdateLibgit2ToSha.ps1 - `LibGit2Sharp.NativeBinaries.1.2.3-foo.nupkg` +This script is used to update the libgit2 submodule and update the references within the project to the correct libgit2 revision. - Note that the `-foo` suffix technically makes this a "prerelease" - package, according to NuGet, which may be further help in avoiding - any mixups with the official packages, but may also require you to - opt-in to prerelease packages in your NuGet package manager. +You can update to a specific commit: -## Specifying custom DLL names +``` +UpdateLibgit2ToSha.ps1 1a2b3c4 +``` -If you want to redistribute a LibGit2Sharp that uses a custom libgit2, -you may want to change the name of the libgit2 shared library file to -disambiguate it from other installations. This may be useful if you -are running as a plugin inside a larger process and wish to avoid -conflicting with other plugins who may wish to use LibGit2Sharp and -want to ensure that *your* version of libgit2 is loaded into memory -and available to you. +Or you can specify references: -For example, if your plugin names if `fooplugin`, you may wish to -distribute a DLL named `git2-fooplugin.dll`. You can specify the -custom DLL name as the second argument to the update and build scripts: +``` +UpdateLibgit2ToSha.ps1 master +``` - UpdateLibgit2ToSha.ps1 1a2b3c4 git2-fooplugin - build.libgit2.sh 14 git2-fooplugin +## Building the package locally -Then build the NuGet package as described above, making sure to provide -a helpful suffix to ensure that your NuGet package will not be confused -with the official packages. +After running the appropriate build script(s) to create binaries, the NuGet package needs to be created. -### Notes on Visual Studio +First, to use the same version locally that will be generated via CI, install the [minver-cli](https://www.nuget.org/packages/minver-cli) dotnet tool: -Visual Studio is required to build the native binaries, however you -do not need to install a *paid* version of Visual Studio. libgit2 -can be compiled using [Visual Studio Community](https://www.visualstudio.com/en-us/products/visual-studio-community-vs), -which is free for building open source applications. +``` +dotnet tool install --global minver-cli +``` + +Once that is installed, running the `minver` command will output a version: + +``` +MinVer: Using { Commit: 2453a6d, Tag: '2.0.312', Version: 2.0.312, Height: 3 }. +MinVer: Calculated version 2.0.313-alpha.0.3. +2.0.313-alpha.0.3 +``` + +To create the package, use the the following command: -You need to specify the actual version number (not the marketing name) -of Visual Studio. (For example, "Visual Studio 2013" is the name of the -product, but its actual version number is "12.0".) A handy guide: - -| Marketing Name | Version Number -|--------------------|--------------- -| Visual Studio 2010 | 10 -| Visual Studio 2012 | 11 -| Visual Studio 2013 | 12 -| Visual Studio 2015 | 14 -| Visual Studio 2017 | 15 +``` +nuget.exe Pack nuget.package/NativeBinaries.nuspec -Version -NoPackageAnalysis +``` + +Where `` is the version from the MinVer tool or manually chosen version. + + +## Notes on Visual Studio + +Visual Studio 2019 is required to build the Windows native binaries, however you +do not need to install a *paid* version of Visual Studio. libgit2 +can be compiled using [Visual Studio Community](https://visualstudio.microsoft.com/vs/community/), +which is free for building open source applications. diff --git a/UpdateLibgit2ToSha.ps1 b/UpdateLibgit2ToSha.ps1 index fa6aa3ff..a3111d3d 100644 --- a/UpdateLibgit2ToSha.ps1 +++ b/UpdateLibgit2ToSha.ps1 @@ -6,8 +6,7 @@ #> Param( - [string]$sha = 'HEAD', - [string]$libgit2Name = '' + [string]$sha = 'HEAD' ) Set-StrictMode -Version Latest @@ -82,18 +81,15 @@ Push-Location $libgit2Directory Pop-Location - if (![string]::IsNullOrEmpty($libgit2Name)) { - $binaryFilename = $libgit2Name - } else { - $binaryFilename = "git2-" + $sha.Substring(0,7) - } + $binaryFilename = "git2-" + $sha.Substring(0,7) Set-Content -Encoding ASCII (Join-Path $projectDirectory "nuget.package\libgit2\libgit2_hash.txt") $sha + Copy-Item -Path (Join-Path $libgit2Directory "COPYING") -Destination (Join-Path $projectDirectory "nuget.package\libgit2\libgit2.license.txt") + $buildProperties = @" - `$(MSBuildAllProjects);`$(MSBuildThisFileFullPath) `$(MSBuildThisFileFullPath) $sha $binaryFilename @@ -103,69 +99,33 @@ Push-Location $libgit2Directory Set-Content -Encoding UTF8 (Join-Path $projectDirectory "nuget.package\build\LibGit2Sharp.NativeBinaries.props") $buildProperties - $net461BuildProperties = @" + $net46BuildProperties = @" - `$(MSBuildAllProjects);`$(MSBuildThisFileFullPath) `$(MSBuildThisFileFullPath) $sha $binaryFilename - - lib\win32\x64\$binaryFilename.dll - PreserveNewest - - - lib\win32\x64\$binaryFilename.pdb - PreserveNewest - - - lib\win32\x86\$binaryFilename.dll - PreserveNewest - - - lib\win32\x86\$binaryFilename.pdb - PreserveNewest - - - lib\osx\lib$binaryFilename.dylib - PreserveNewest - - - lib\linux-x64\lib$binaryFilename.so - PreserveNewest - - - lib\rhel-x64\lib$binaryFilename.so - PreserveNewest - - - lib\fedora-x64\lib$binaryFilename.so - PreserveNewest - - - lib\debian.9-x64\lib$binaryFilename.so - PreserveNewest - - - lib\alpine-x64\lib$binaryFilename.so - PreserveNewest - - - LibGit2Sharp.dll.config - PreserveNewest - + + + + + "@ - Set-Content -Encoding UTF8 (Join-Path $projectDirectory "nuget.package\build\net461\LibGit2Sharp.NativeBinaries.props") $net461BuildProperties + Set-Content -Encoding UTF8 (Join-Path $projectDirectory "nuget.package\build\net46\LibGit2Sharp.NativeBinaries.props") $net46BuildProperties $dllConfig = @" - + + + + + "@ diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 0b289443..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 1.0.{build} - -branches: - only: - - master - - /^maint.*/ - -skip_tags: true - -install: -- git submodule update --init - -build_script: -- ps: .\build.libgit2.ps1 -vs 12 - -after_build: -- ps: | - $pre = $true - if (($env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null) -and ($env:APPVEYOR_REPO_BRANCH -eq "master")) - { - $pre = $false - } - .\buildpackage.ps1 $env:APPVEYOR_BUILD_VERSION -pre:$pre - -test: off - -artifacts: -- path: '*.nupkg' diff --git a/build.libgit2.ps1 b/build.libgit2.ps1 index badec8e0..9c86db2c 100644 --- a/build.libgit2.ps1 +++ b/build.libgit2.ps1 @@ -1,19 +1,24 @@ <# .SYNOPSIS Builds a version of libgit2 and copies it to the nuget packaging directory. -.PARAMETER vs - Version of Visual Studio project files to generate. Cmake supports "10" (default), "11" and "12". .PARAMETER test If set, run the libgit2 tests on the desired version. .PARAMETER debug - If set, build the "Debug" configuration of libgit2, rather than "RelWithDebInfo" (default). + If set, build the "Debug" configuration of libgit2, rather than "Release" (default). +.PARAMETER x86 + If set, the x86 version will be built. +.PARAMETER x64 + If set, the x64 version will be built. +.PARAMETER arm64 + If set, the arm64 version will be built. #> Param( - [string]$vs = '10', - [string]$libgit2Name = '', [switch]$test, - [switch]$debug + [switch]$debug, + [switch]$x86, + [switch]$x64, + [switch]$arm64 ) Set-StrictMode -Version Latest @@ -22,19 +27,15 @@ $projectDirectory = Split-Path $MyInvocation.MyCommand.Path $libgit2Directory = Join-Path $projectDirectory "libgit2" $x86Directory = Join-Path $projectDirectory "nuget.package\runtimes\win-x86\native" $x64Directory = Join-Path $projectDirectory "nuget.package\runtimes\win-x64\native" +$arm64Directory = Join-Path $projectDirectory "nuget.package\runtimes\win-arm64\native" $hashFile = Join-Path $projectDirectory "nuget.package\libgit2\libgit2_hash.txt" $sha = Get-Content $hashFile +$binaryFilename = "git2-" + $sha.Substring(0,7) -if (![string]::IsNullOrEmpty($libgit2Name)) { - $binaryFilename = $libgit2Name -} else { - $binaryFilename = "git2-" + $sha.Substring(0,7) -} - -$build_clar = 'OFF' -if ($test.IsPresent) { $build_clar = 'ON' } +$build_tests = 'OFF' +if ($test.IsPresent) { $build_tests = 'ON' } -$configuration = "RelWithDebInfo" +$configuration = "Release" if ($debug.IsPresent) { $configuration = "Debug" } function Run-Command([scriptblock]$Command, [switch]$Fatal, [switch]$Quiet) { @@ -101,38 +102,63 @@ function Assert-Consistent-Naming($expected, $path) { } try { + if ((!$x86.isPresent -and !$x64.IsPresent) -and !$arm64.IsPresent) { + Write-Output -Stderr "Error: usage $MyInvocation.MyCommand [-x86] [-x64] [-arm64]" + Exit + } + Push-Location $libgit2Directory $cmake = Find-CMake $ctest = Join-Path (Split-Path -Parent $cmake) "ctest.exe" - Write-Output "Building 32-bit..." - Run-Command -Quiet { & remove-item build -recurse -force } + Run-Command -Quiet { & remove-item build -recurse -force -ErrorAction Ignore } Run-Command -Quiet { & mkdir build } cd build - Run-Command -Quiet -Fatal { & $cmake -G "Visual Studio $vs" -D ENABLE_TRACE=ON -D "BUILD_CLAR=$build_clar" -D "LIBGIT2_FILENAME=$binaryFilename" -DSTDCALL=ON .. } - Run-Command -Quiet -Fatal { & $cmake --build . --config $configuration } - if ($test.IsPresent) { Run-Command -Quiet -Fatal { & $ctest -V . } } - cd $configuration - Assert-Consistent-Naming "$binaryFilename.dll" "*.dll" - Run-Command -Quiet { & rm *.exp } - Run-Command -Quiet { & rm $x86Directory\* } - Run-Command -Quiet { & mkdir -fo $x86Directory } - Run-Command -Quiet -Fatal { & copy -fo * $x86Directory -Exclude *.lib } - - Write-Output "Building 64-bit..." - cd .. - Run-Command -Quiet { & mkdir build64 } - cd build64 - Run-Command -Quiet -Fatal { & $cmake -G "Visual Studio $vs Win64" -D THREADSAFE=ON -D ENABLE_TRACE=ON -D "BUILD_CLAR=$build_clar" -D "LIBGIT2_FILENAME=$binaryFilename" -DSTDCALL=ON ../.. } - Run-Command -Quiet -Fatal { & $cmake --build . --config $configuration } - if ($test.IsPresent) { Run-Command -Quiet -Fatal { & $ctest -V . } } - cd $configuration - Assert-Consistent-Naming "$binaryFilename.dll" "*.dll" - Run-Command -Quiet { & rm *.exp } - Run-Command -Quiet { & rm $x64Directory\* } - Run-Command -Quiet { & mkdir -fo $x64Directory } - Run-Command -Quiet -Fatal { & copy -fo * $x64Directory -Exclude *.lib } + + if ($x86.IsPresent) { + Write-Output "Building x86..." + Run-Command -Fatal { & $cmake -A Win32 -D USE_SSH=exec -D USE_HTTPS=Schannel -D "BUILD_TESTS=$build_tests" -D "BUILD_CLI=OFF" -D "LIBGIT2_FILENAME=$binaryFilename" .. } + Run-Command -Fatal { & $cmake --build . --config $configuration } + if ($test.IsPresent) { Run-Command -Quiet -Fatal { & $ctest -V . } } + cd $configuration + Assert-Consistent-Naming "$binaryFilename.dll" "*.dll" + Run-Command -Quiet { & rm *.exp } + Run-Command -Quiet { & rm $x86Directory\* -ErrorAction Ignore } + Run-Command -Quiet { & mkdir -fo $x86Directory } + Run-Command -Quiet -Fatal { & copy -fo * $x86Directory -Exclude *.lib } + cd .. + } + + if ($x64.IsPresent) { + Write-Output "Building x64..." + Run-Command -Quiet { & mkdir build64 } + cd build64 + Run-Command -Fatal { & $cmake -A x64 -D USE_SSH=exec -D USE_HTTPS=Schannel -D "BUILD_TESTS=$build_tests" -D "BUILD_CLI=OFF" -D "LIBGIT2_FILENAME=$binaryFilename" ../.. } + Run-Command -Fatal { & $cmake --build . --config $configuration } + if ($test.IsPresent) { Run-Command -Quiet -Fatal { & $ctest -V . } } + cd $configuration + Assert-Consistent-Naming "$binaryFilename.dll" "*.dll" + Run-Command -Quiet { & rm *.exp } + Run-Command -Quiet { & rm $x64Directory\* -ErrorAction Ignore } + Run-Command -Quiet { & mkdir -fo $x64Directory } + Run-Command -Quiet -Fatal { & copy -fo * $x64Directory -Exclude *.lib } + } + + if ($arm64.IsPresent) { + Write-Output "Building arm64..." + Run-Command -Quiet { & mkdir buildarm64 } + cd buildarm64 + Run-Command -Fatal { & $cmake -A ARM64 -D USE_SSH=exec -D USE_HTTPS=Schannel -D "BUILD_TESTS=$build_tests" -D "BUILD_CLI=OFF" -D "LIBGIT2_FILENAME=$binaryFilename" ../.. } + Run-Command -Fatal { & $cmake --build . --config $configuration } + if ($test.IsPresent) { Run-Command -Quiet -Fatal { & $ctest -V . } } + cd $configuration + Assert-Consistent-Naming "$binaryFilename.dll" "*.dll" + Run-Command -Quiet { & rm *.exp } + Run-Command -Quiet { & rm $arm64Directory\* -ErrorAction Ignore } + Run-Command -Quiet { & mkdir -fo $arm64Directory } + Run-Command -Quiet -Fatal { & copy -fo * $arm64Directory -Exclude *.lib } + } Write-Output "Done!" } diff --git a/build.libgit2.sh b/build.libgit2.sh index 80c6950e..3ac9e48e 100755 --- a/build.libgit2.sh +++ b/build.libgit2.sh @@ -1,7 +1,24 @@ #!/bin/bash +set -e + LIBGIT2SHA=`cat ./nuget.package/libgit2/libgit2_hash.txt` SHORTSHA=${LIBGIT2SHA:0:7} +OS=`uname` +ARCH=`uname -m` +PACKAGEPATH="nuget.package/runtimes" +OSXARCHITECTURE=$ARCH + +if [[ $OS == "Darwin" ]]; then + USEHTTPS="ON" + if [[ $RID == "osx-arm64" ]]; then + OSXARCHITECTURE="arm64" + elif [[ $RID == "osx-x64" ]]; then + OSXARCHITECTURE="x86_64" + fi +else + USEHTTPS="OpenSSL-Dynamic" +fi rm -rf libgit2/build mkdir libgit2/build @@ -10,39 +27,29 @@ pushd libgit2/build export _BINPATH=`pwd` cmake -DCMAKE_BUILD_TYPE:STRING=Release \ - -DBUILD_CLAR:BOOL=OFF \ - -DUSE_SSH=OFF \ - -DENABLE_TRACE=ON \ + -DBUILD_TESTS:BOOL=OFF \ + -DUSE_SSH=exec \ -DLIBGIT2_FILENAME=git2-$SHORTSHA \ - -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \ + -DCMAKE_OSX_ARCHITECTURES=$OSXARCHITECTURE \ + -DUSE_HTTPS=$USEHTTPS \ + -DUSE_BUNDLED_ZLIB=ON \ .. cmake --build . popd -OS=`uname` -ARCH=`uname -m` - -PACKAGEPATH="nuget.package/runtimes" - 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 mkdir -p $PACKAGEPATH/$RID/native cp libgit2/build/libgit2-$SHORTSHA.$LIBEXT $PACKAGEPATH/$RID/native - -exit $? diff --git a/buildpackage.ps1 b/buildpackage.ps1 deleted file mode 100644 index 12fee1ce..00000000 --- a/buildpackage.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -Param( - [Parameter(Mandatory=$true)] - [string]$version, - [switch]$pre -) - -$buildDate = (Get-Date).ToUniversalTime().ToString("yyyyMMddHHmmss") -$versionSuffix = "" -if ($pre.IsPresent) { $versionSuffix = "-pre$BuildDate" } - -.\nuget.exe Pack nuget.package\NativeBinaries.nuspec -Version $version$versionSuffix -NoPackageAnalysis diff --git a/docker/linux b/docker/linux new file mode 100644 index 00000000..7e4131a9 --- /dev/null +++ b/docker/linux @@ -0,0 +1,9 @@ +FROM kmturley/crossbuild +ARG ARCH='amd64' +ENV CROSS_TRIPLE=${ARCH} +RUN apt update && apt -y install pkg-config + +WORKDIR /nativebinaries +COPY . /nativebinaries/ + +CMD ["/bin/bash", "-c", "./build.libgit2.sh"] diff --git a/docker/musl b/docker/musl new file mode 100644 index 00000000..1cfa1e4e --- /dev/null +++ b/docker/musl @@ -0,0 +1,8 @@ +ARG ARCH='amd64' +FROM multiarch/alpine:${ARCH}-v3.13 +RUN apk add --no-cache bash build-base cmake + +WORKDIR /nativebinaries +COPY . /nativebinaries/ + +CMD ["/bin/bash", "-c", "./build.libgit2.sh"] \ No newline at end of file diff --git a/dockerbuild.sh b/dockerbuild.sh index d3195565..c42fa150 100755 --- a/dockerbuild.sh +++ b/dockerbuild.sh @@ -1,8 +1,27 @@ #!/bin/bash -docker build -t $RID -f Dockerfile.$RID . +set -e +echo "building for $RID" -docker run -it -e RID=$RID --name=$RID $RID +if [[ $RID =~ arm64 ]]; then + arch="arm64" +elif [[ $RID =~ arm ]]; then + arch="armhf" +elif [[ $RID =~ ppc64le ]]; then + arch="powerpc64le" +else + arch="amd64" +fi + +if [[ $RID == linux-musl* ]]; then + dockerfile="docker/musl" +else + dockerfile="docker/linux" +fi + +docker buildx build -t $RID -f $dockerfile --build-arg ARCH=$arch . + +docker run -t -e RID=$RID --name=$RID $RID docker cp $RID:/nativebinaries/nuget.package/runtimes nuget.package diff --git a/download.build.artifacts.and.package.ps1 b/download.build.artifacts.and.package.ps1 deleted file mode 100644 index 969e3261..00000000 --- a/download.build.artifacts.and.package.ps1 +++ /dev/null @@ -1,162 +0,0 @@ -Param( - [string]$ref = "master", - [switch]$verbose = $False -) - -Set-StrictMode -Version Latest -$ErrorActionPreference = "Stop" - -$PSDefaultParameterValues['Invoke-RestMethod:SkipHeaderValidation'] = $true -$PSDefaultParameterValues['Invoke-WebRequest:SkipHeaderValidation'] = $true - -function Invoke-RestMethod-Ex($url, $downloadLocation) { - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - - $irmParams = @{ - } - - Write-Host -ForegroundColor "White" "-> Get $url" - - $proxy = [System.Net.WebRequest]::GetSystemWebProxy() - if ($proxy) { - $proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials - $proxyUri = $proxy.GetProxy("$url") - - if ("$proxyUri" -ne "$url") { - $irmParams.Proxy = "$proxyUri" - $irmParams.ProxyUseDefaultCredentials = $true - } - } - - if ($downloadLocation) { - $irmParams.OutFile = "$downloadLocation" - } - - $output = Invoke-RestMethod @irmParams -Method "Get" -Uri "$url" - - if ($verbose) { - Write-Host -ForegroundColor "Gray" "output = $(ConvertTo-Json $output)" - } - - return $output -} - -function Extract-BuildIdentifier($statuses, $forContext) { - - $status = $statuses | where { $_.context -eq $forContext } | select -First 1 - - if (($status -eq $null) -or ("success".CompareTo($status.state) -ne 0)) { - throw "No successful status has been found for context `"$forContext`"." - } - - $buildNumber = $status.target_url.Split("/")[-1] - - return $buildNumber -} - -function Download-AppVeyor-Artifacts($statuses, $downloadLocation) { - $prOrBranch = "branch" - - if ($ref.StartsWith("pull/")) { - $prOrBranch = "pr" - } - - $buildIdentifier = Extract-BuildIdentifier $statuses "continuous-integration/appveyor/$prOrBranch" - - Write-Host -ForegroundColor "Yellow" "Retrieving AppVeyor build `"$buildIdentifier`"" - $build = Invoke-RestMethod-Ex "https://ci.appveyor.com/api/projects/libgit2/libgit2sharp-nativebinaries/build/$buildIdentifier" - - $jobId = $build.build.jobs[0].jobId - - Write-Host -ForegroundColor "Yellow" "Retrieving AppVeyor job `"$jobId`" artifacts" - $artifacts = Invoke-RestMethod-Ex "https://ci.appveyor.com/api/buildjobs/$jobId/artifacts" - - ForEach ($artifact in $artifacts) { - $artifactFileName = $artifacts[0].fileName - $localArtifactPath = "$downloadLocation\$artifactFileName" - - Write-Host -ForegroundColor "Yellow" "Downloading `"$artifactFileName`"" - Invoke-RestMethod-Ex "https://ci.appveyor.com/api/buildjobs/$jobId/artifacts/$artifactFileName" $localArtifactPath - } -} - -function Download-Travis-Artifacts($statuses, $downloadLocation) { - $prOrBranch = "push" - - if ($ref.StartsWith("pull/")) { - $prOrBranch = "pr" - } - - $buildIdentifier = Extract-BuildIdentifier $statuses "continuous-integration/travis-ci/$prOrBranch" - - Write-Host -ForegroundColor "Yellow" "Retrieving Travis build `"$buildIdentifier`"" - $build = Invoke-RestMethod-Ex "https://api.travis-ci.org/builds/$buildIdentifier" - - $buildNumber = $build.number - - Write-Host -ForegroundColor "Yellow" "Retrieving Bintray version `"$buildNumber`" artifact list" - $files = Invoke-RestMethod-Ex "https://api.bintray.com/packages/libgit2/compiled-binaries/libgit2/versions/$buildNumber/files" - - ForEach ($file in $files) { - $artifactFileName = $file.name - $localArtifactPath = "$downloadLocation\$artifactFileName" - - Write-Host -ForegroundColor "Yellow" "Downloading `"$artifactFileName`"" - Invoke-RestMethod-Ex "https://dl.bintray.com/libgit2/compiled-binaries/$artifactFileName" $localArtifactPath - } -} - -###################################################### - -$root = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition - -$path = [System.IO.Path]::Combine($env:Temp, [System.IO.Path]::GetRandomFileName()) -Write-Host -ForegroundColor "Yellow" "Creating temporary folder at `"$path`"" -New-Item "$path" -type Directory > $null - -if ($ref.StartsWith("pull/")) { - $pr = $ref.Replace("pull/", "") - Write-Host -ForegroundColor "Yellow" "Retrieving pull request information for pull request $pr" - - $prData = Invoke-RestMethod-Ex "https://api.github.com/repos/libgit2/libgit2sharp.nativebinaries/pulls/$pr" - $statusesUrl = $prData.statuses_url -} -else { - $statusesUrl = "https://api.github.com/repos/libgit2/libgit2sharp.nativebinaries/commits/$ref/statuses" -} - -Write-Host -ForegroundColor "Yellow" "Retrieving LibGit2Sharp.NativeBinaries latest CI statuses of `"$ref`"" -$statuses = Invoke-RestMethod-Ex $statusesUrl - -Download-AppVeyor-Artifacts $statuses $path -Download-Travis-Artifacts $statuses $path - -Write-Host -ForegroundColor "Yellow" "Build artifacts have been downloaded at `"$path`"" - -$package = Get-ChildItem -Path $path -Filter "*.nupkg" -$binaries = Get-ChildItem -Path $path -Filter "*.zip" - -Write-Host -ForegroundColor "Yellow" "Extracting build artifacts" -Add-Type -assembly "System.IO.Compression.Filesystem" -[IO.Compression.ZipFile]::ExtractToDirectory("$($package.FullName)", "$($package.FullName).ext") - -ForEach ($binary in $binaries) { - [IO.Compression.ZipFile]::ExtractToDirectory("$($binary.FullName)", "$($package.FullName).ext") -} - -Write-Host -ForegroundColor "Yellow" "Building final NuGet package" -Push-location "$($package.FullName).ext" -Remove-Item -Path ".\_rels\" -Recurse -Remove-Item -Path ".\package\" -Recurse -Remove-Item -Path '.\`[Content_Types`].xml' -& "$root/Nuget.exe" pack "LibGit2Sharp.NativeBinaries.nuspec" -OutputDirectory "$path" -NoPackageAnalysis -Verbosity "detailed" - -$newPackage = Get-ChildItem -Path $path -Filter "*.nupkg" -Pop-Location - -Write-Host -ForegroundColor "Yellow" "Copying package `"$($newPackage.Name)`" to `"$root`"" - -Move-Item -Path "$($newPackage.FullName)" -Destination "$root\$($newPackage.Name)" - -Write-Host -ForegroundColor "Yellow" "Removing temporary folder" -Remove-Item "$path" -Recurse diff --git a/libgit2 b/libgit2 index b0d9952c..5853918c 160000 --- a/libgit2 +++ b/libgit2 @@ -1 +1 @@ -Subproject commit b0d9952c318a3d1b8917e06ad46b9110c0c28831 +Subproject commit 5853918c4c6a7b12f8becf4bd11ff4362ebb9020 diff --git a/nuget.exe b/nuget.exe deleted file mode 100644 index 856263de..00000000 Binary files a/nuget.exe and /dev/null differ diff --git a/nuget.package/LibGit2Sharp.NativeBinaries.csproj b/nuget.package/LibGit2Sharp.NativeBinaries.csproj new file mode 100644 index 00000000..5d72ef07 --- /dev/null +++ b/nuget.package/LibGit2Sharp.NativeBinaries.csproj @@ -0,0 +1,29 @@ + + + + netstandard2.0 + true + false + true + LibGit2Sharp contributors + libgit2\libgit2.license.txt + https://github.com/libgit2/libgit2sharp.nativebinaries + libgit2\libgit2.png + Native binaries for LibGit2Sharp + true + $(MSBuildThisFileDirectory) + $(NoWarn);NU5127 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nuget.package/NativeBinaries.nuspec b/nuget.package/NativeBinaries.nuspec deleted file mode 100644 index 360bfb72..00000000 --- a/nuget.package/NativeBinaries.nuspec +++ /dev/null @@ -1,14 +0,0 @@ - - - - LibGit2Sharp.NativeBinaries - 1.0.155 - LibGit2Sharp contributors - nulltoken - https://raw.githubusercontent.com/libgit2/libgit2/master/COPYING - https://github.com/libgit2/libgit2sharp.nativebinaries - https://raw.githubusercontent.com/libgit2/libgit2sharp/master/square-logo.png - false - Native binaries for LibGit2Sharp - - diff --git a/nuget.package/build/LibGit2Sharp.NativeBinaries.props b/nuget.package/build/LibGit2Sharp.NativeBinaries.props index f6a42b34..fd3c7ad2 100644 --- a/nuget.package/build/LibGit2Sharp.NativeBinaries.props +++ b/nuget.package/build/LibGit2Sharp.NativeBinaries.props @@ -1,8 +1,7 @@ - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) $(MSBuildThisFileFullPath) - b0d9952c318a3d1b8917e06ad46b9110c0c28831 - git2-b0d9952 + 5853918c4c6a7b12f8becf4bd11ff4362ebb9020 + git2-5853918 diff --git a/nuget.package/build/net46/LibGit2Sharp.NativeBinaries.props b/nuget.package/build/net46/LibGit2Sharp.NativeBinaries.props new file mode 100644 index 00000000..b9049c40 --- /dev/null +++ b/nuget.package/build/net46/LibGit2Sharp.NativeBinaries.props @@ -0,0 +1,14 @@ + + + $(MSBuildThisFileFullPath) + 5853918c4c6a7b12f8becf4bd11ff4362ebb9020 + git2-5853918 + + + + + + + + + diff --git a/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props b/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props deleted file mode 100644 index 54db2589..00000000 --- a/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props +++ /dev/null @@ -1,54 +0,0 @@ - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - $(MSBuildThisFileFullPath) - b0d9952c318a3d1b8917e06ad46b9110c0c28831 - git2-b0d9952 - - - - lib\win32\x64\git2-b0d9952.dll - PreserveNewest - - - lib\win32\x64\git2-b0d9952.pdb - PreserveNewest - - - lib\win32\x86\git2-b0d9952.dll - PreserveNewest - - - lib\win32\x86\git2-b0d9952.pdb - PreserveNewest - - - lib\osx\libgit2-b0d9952.dylib - PreserveNewest - - - lib\linux-x64\libgit2-b0d9952.so - PreserveNewest - - - lib\rhel-x64\libgit2-b0d9952.so - PreserveNewest - - - lib\fedora-x64\libgit2-b0d9952.so - PreserveNewest - - - lib\debian.9-x64\libgit2-b0d9952.so - PreserveNewest - - - lib\alpine-x64\libgit2-b0d9952.so - PreserveNewest - - - LibGit2Sharp.dll.config - PreserveNewest - - - diff --git a/nuget.package/buildMultiTargeting/LibGit2Sharp.NativeBinaries.props b/nuget.package/buildMultiTargeting/LibGit2Sharp.NativeBinaries.props new file mode 100644 index 00000000..5a6b0742 --- /dev/null +++ b/nuget.package/buildMultiTargeting/LibGit2Sharp.NativeBinaries.props @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/nuget.package/libgit2/LibGit2Sharp.dll.config b/nuget.package/libgit2/LibGit2Sharp.dll.config index 803b54d6..95f4b0bc 100644 --- a/nuget.package/libgit2/LibGit2Sharp.dll.config +++ b/nuget.package/libgit2/LibGit2Sharp.dll.config @@ -1,4 +1,8 @@ - - + + + + + + diff --git a/nuget.package/libgit2/libgit2.license.txt b/nuget.package/libgit2/libgit2.license.txt index d1ca4d40..80788a3e 100644 --- a/nuget.package/libgit2/libgit2.license.txt +++ b/nuget.package/libgit2/libgit2.license.txt @@ -365,7 +365,7 @@ Public License instead of this License. The bundled ZLib code is licensed under the ZLib license: -Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler + (C) 1995-2022 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -388,43 +388,148 @@ Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler ---------------------------------------------------------------------- -The priority queue implementation is based on code licensed under the -Apache 2.0 license: +The Clar framework is licensed under the ISC license: - Copyright 2010 Volkan Yazıcı - Copyright 2006-2010 The Apache Software Foundation +Copyright (c) 2011-2015 Vicent Marti -The full text of the Apache 2.0 license is available at: +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. - http://www.apache.org/licenses/LICENSE-2.0 +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ---------------------------------------------------------------------- -The Clay framework is licensed under the MIT license: +The bundled PCRE implementation (deps/pcre2/) is licensed under the +PCRE2 Licence. -Copyright (C) 2011 by Vicent Marti +PCRE2 is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Releases 10.00 and above of PCRE2 are distributed under the terms of the "BSD" +licence, as specified below, with one exemption for certain binary +redistributions. The documentation for PCRE2, supplied in the "doc" directory, +is distributed under the same terms as the software itself. The data in the +testdata directory is not copyrighted and is in the public domain. -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The basic library functions are written in C and are freestanding. Also +included in the distribution is a just-in-time compiler that can be used to +optimize pattern matching. This is an optional feature that can be omitted when +the library is built. The just-in-time compiler is separately licensed under the +"2-clause BSD" licence. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. + +COPYRIGHT +--------- + +### The basic library functions + + Written by: Philip Hazel + Email local part: Philip.Hazel + Email domain: gmail.com + + Retired from University of Cambridge Computing Service, + Cambridge, England. + + Copyright (c) 1997-2007 University of Cambridge + Copyright (c) 2007-2024 Philip Hazel + All rights reserved. + +### PCRE2 Just-In-Time compilation support + + Written by: Zoltan Herczeg + Email local part: hzmester + Email domain: freemail.hu + + Copyright (c) 2010-2024 Zoltan Herczeg + All rights reserved. + +### Stack-less Just-In-Time compiler + + Written by: Zoltan Herczeg + Email local part: hzmester + Email domain: freemail.hu + + Copyright (c) 2009-2024 Zoltan Herczeg + All rights reserved. + +The code in the `deps/sljit` directory has its own LICENSE file. + +### All other contributions + +Many other contributors have participated in the authorship of PCRE2. As PCRE2 +has never required a Contributor Licensing Agreement, or other copyright +assignment agreement, all contributions have copyright retained by each +original contributor or their employer. + + +THE "BSD" LICENCE +----------------- + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notices, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notices, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +* Neither the name of the University of Cambridge nor the names of any + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + + +EXEMPTION FOR BINARY LIBRARY-LIKE PACKAGES +------------------------------------------ + +The second condition in the BSD licence (covering binary redistributions) does +not apply all the way down a chain of software. If binary package A includes +PCRE2, it must respect the condition, but if package B is software that +includes package A, the condition is not imposed on package B unless it uses +PCRE2 independently. ---------------------------------------------------------------------- -The regex library (deps/regex/) is licensed under the GNU LGPL +The bundled winhttp definition files (deps/winhttp/) are licensed under +the GNU LGPL (available at the end of this file). + +Copyright (C) 2007 Francois Gouget + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + +---------------------------------------------------------------------- GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 @@ -928,3 +1033,450 @@ necessary. Here is a sample; alter the names: Ty Coon, President of Vice That's all there is to it! + +---------------------------------------------------------------------- + +The bundled SHA1 collision detection code is licensed under the MIT license: + +MIT License + +Copyright (c) 2017: + Marc Stevens + Cryptology Group + Centrum Wiskunde & Informatica + P.O. Box 94079, 1090 GB Amsterdam, Netherlands + marc@marc-stevens.nl + + Dan Shumow + Microsoft Research + danshu@microsoft.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +---------------------------------------------------------------------- + +The bundled wildmatch code is licensed under the BSD license: + +Copyright Rich Salz. +All rights reserved. + +Redistribution and use in any form are permitted provided that the +following restrictions are are met: + +1. Source distributions must retain this entire copyright notice + and comment. +2. Binary distributions must include the acknowledgement ``This + product includes software developed by Rich Salz'' in the + documentation or other materials provided with the + distribution. This must not be represented as an endorsement + or promotion without specific prior written permission. +3. The origin of this software must not be misrepresented, either + by explicit claim or by omission. Credits must appear in the + source and documentation. +4. Altered versions must be plainly marked as such in the source + and documentation and must not be misrepresented as being the + original software. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +---------------------------------------------------------------------- + +Portions of the OpenSSL headers are included under the OpenSSL license: + +Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) +All rights reserved. + +This package is an SSL implementation written +by Eric Young (eay@cryptsoft.com). +The implementation was written so as to conform with Netscapes SSL. + +This library is free for commercial and non-commercial use as long as +the following conditions are aheared to. The following conditions +apply to all code found in this distribution, be it the RC4, RSA, +lhash, DES, etc., code; not just the SSL code. The SSL documentation +included with this distribution is covered by the same copyright terms +except that the holder is Tim Hudson (tjh@cryptsoft.com). + +Copyright remains Eric Young's, and as such any Copyright notices in +the code are not to be removed. +If this package is used in a product, Eric Young should be given attribution +as the author of the parts of the library used. +This can be in the form of a textual message at program startup or +in documentation (online or textual) provided with the package. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + "This product includes cryptographic software written by + Eric Young (eay@cryptsoft.com)" + The word 'cryptographic' can be left out if the rouines from the library + being used are not cryptographic related :-). +4. If you include any Windows specific code (or a derivative thereof) from + the apps directory (application code) you must include an acknowledgement: + "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +The licence and distribution terms for any publically available version or +derivative of this code cannot be changed. i.e. this code cannot simply be +copied and put under another distribution licence +[including the GNU Public Licence.] + +==================================================================== +Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- + +The xoroshiro256** implementation is licensed in the public domain: + +Written in 2018 by David Blackman and Sebastiano Vigna (vigna@acm.org) + +To the extent possible under law, the author has dedicated all copyright +and related and neighboring rights to this software to the public domain +worldwide. This software is distributed without any warranty. + +See . + +---------------------------------------------------------------------- + +The built-in SHA256 support (src/hash/rfc6234) is taken from RFC 6234 +under the following license: + +Copyright (c) 2011 IETF Trust and the persons identified as +authors of the code. All rights reserved. + +Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following +conditions are met: + +- Redistributions of source code must retain the above + copyright notice, this list of conditions and + the following disclaimer. + +- Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + +- Neither the name of Internet Society, IETF or IETF Trust, nor + the names of specific contributors, may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- + +The built-in git_fs_path_basename_r() function is based on the +Android implementation, BSD licensed: + +Copyright (C) 2008 The Android Open Source Project +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +---------------------------------------------------------------------- + +The bundled ntlmclient code is licensed under the MIT license: + +Copyright (c) Edward Thomson. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +---------------------------------------------------------------------- + +Portions of this software derived from Team Explorer Everywhere: + +Copyright (c) Microsoft Corporation + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------------------------- + +Portions of this software derived from the LLVM Compiler Infrastructure: + +Copyright (c) 2003-2016 University of Illinois at Urbana-Champaign. +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +--------------------------------------------------------------------------- + +Portions of this software derived from Unicode, Inc: + +Copyright 2001-2004 Unicode, Inc. + +Disclaimer + +This source code is provided as is by Unicode, Inc. No claims are +made as to fitness for any particular purpose. No warranties of any +kind are expressed or implied. The recipient agrees to determine +applicability of information provided. If this file has been +purchased on magnetic or optical media from Unicode, Inc., the +sole remedy for any claim will be exchange of defective media +within 90 days of receipt. + +Limitations on Rights to Redistribute This Code + +Unicode, Inc. hereby grants the right to freely use the information +supplied in this file in the creation of products supporting the +Unicode Standard, and to make copies of this file in any form +for internal or external distribution as long as this notice +remains attached. + +--------------------------------------------------------------------------- + +Portions of this software derived from sheredom/utf8.h: + +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to + +--------------------------------------------------------------------------- + +Portions of this software derived from RFC 1320: + +Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved. + +License to copy and use this software is granted provided that it +is identified as the "RSA Data Security, Inc. MD4 Message-Digest +Algorithm" in all material mentioning or referencing this software +or this function. + +License is also granted to make and use derivative works provided +that such works are identified as "derived from the RSA Data +Security, Inc. MD4 Message-Digest Algorithm" in all material +mentioning or referencing the derived work. + +RSA Data Security, Inc. makes no representations concerning either +the merchantability of this software or the suitability of this +software for any particular purpose. It is provided "as is" +without express or implied warranty of any kind. + +These notices must be retained in any copies of any part of this +documentation and/or software. + +---------------------------------------------------------------------- + +The bundled llhttp dependency is licensed under the MIT license: + +Copyright Fedor Indutny, 2018. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/nuget.package/libgit2/libgit2.png b/nuget.package/libgit2/libgit2.png new file mode 100644 index 00000000..b758c5bc Binary files /dev/null and b/nuget.package/libgit2/libgit2.png differ diff --git a/nuget.package/libgit2/libgit2_hash.txt b/nuget.package/libgit2/libgit2_hash.txt index 1c6a4a99..5ec9c056 100644 --- a/nuget.package/libgit2/libgit2_hash.txt +++ b/nuget.package/libgit2/libgit2_hash.txt @@ -1 +1 @@ -b0d9952c318a3d1b8917e06ad46b9110c0c28831 +5853918c4c6a7b12f8becf4bd11ff4362ebb9020 diff --git a/uploadbinaries.sh b/uploadbinaries.sh deleted file mode 100755 index e6eb33aa..00000000 --- a/uploadbinaries.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -if [ $TRAVIS_SECURE_ENV_VARS == "true" ]; then - -pushd nuget.package - -zip -r binaries.zip runtimes - -BINTRAY_API_USER="nulltoken" - -curl -T binaries.zip -u$BINTRAY_API_USER:$BINTRAY_API_KEY https://api.bintray.com/content/libgit2/compiled-binaries/libgit2/$TRAVIS_BUILD_NUMBER/binaries-$RID-$TRAVIS_BUILD_NUMBER.zip?publish=1 - -printf "\n\n-> https://dl.bintray.com/libgit2/compiled-binaries/binaries-%s-%s.zip\n\n" "$RID" "$TRAVIS_BUILD_NUMBER" - -popd - -fi