forked from cory/tildefriends
Add libsodium to the tree and build what's needed from source.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3859 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
125
deps/libsodium/.github/workflows/ci.yml
vendored
Normal file
125
deps/libsodium/.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,125 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, stable, next]
|
||||
pull_request:
|
||||
branches: [master, stable, next]
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
tcc:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Update packages list
|
||||
run: sudo apt-get update
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install -y build-essential libtool autoconf automake tcc
|
||||
|
||||
- name: Autogen
|
||||
run: ./autogen.sh -s
|
||||
|
||||
- name: Compilation with tcc
|
||||
run: |
|
||||
env CC=tcc CFLAGS='-w' CPPFLAGS="-DDEV_MODE=1" ./configure --prefix=/tmp --disable-dependency-tracking --disable-shared || cat config.log
|
||||
make -j $(nproc) && make check && make install
|
||||
env CC=tcc CPPFLAGS='-I/tmp/include' LDFLAGS='-L/tmp/lib' LD_LIBRARY_PATH='/tmp/lib' ./test/constcheck.sh
|
||||
make uninstall
|
||||
make distclean
|
||||
|
||||
regular:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Update packages list
|
||||
run: sudo apt-get update
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install -y build-essential libtool autoconf automake
|
||||
|
||||
- name: Autogen
|
||||
run: ./autogen.sh -s
|
||||
|
||||
- name: C99 compat check
|
||||
run: |
|
||||
env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking
|
||||
make -j $(nproc) CFLAGS='-g0' > /dev/null && cp src/libsodium/.libs/libsodium.so lib.so && make clean > /dev/null && make CFLAGS='-g0' CPPFLAGS='-DDEV_MODE=1 -DSODIUM_C99\(X\)=' > /dev/null && cp src/libsodium/.libs/libsodium.so lib-oldc.so && cmp lib.so lib-oldc.so && echo No binary changes && make clean > /dev/null
|
||||
make distcheck
|
||||
make distclean > /dev/null
|
||||
|
||||
- name: Regular compilation
|
||||
run: |
|
||||
env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking --enable-minimal
|
||||
make -j $(nproc)
|
||||
make check
|
||||
( echo '#include <sodium.h>' ; echo 'int main(void) { return sodium_init(); }' ) > /tmp/main.c && gcc -DDEV_MODE=1 -Isrc/libsodium/include -Isrc/libsodium/include/sodium $(find src -name '*.c' -o -name '*.S') /tmp/main.c
|
||||
make distclean > /dev/null
|
||||
|
||||
check-globals:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Update packages list
|
||||
run: sudo apt-get update
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install -y build-essential libtool autoconf automake
|
||||
|
||||
- name: Autogen
|
||||
run: ./autogen.sh -s
|
||||
|
||||
- name: Check globals
|
||||
run: |
|
||||
if [ -x test/rename-globals.sh ]; then test/rename-globals.sh; fi
|
||||
|
||||
other-comp:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Update packages list
|
||||
run: sudo apt-get update
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install -y build-essential libtool autoconf automake clang
|
||||
|
||||
- name: Autogen
|
||||
run: ./autogen.sh -s
|
||||
|
||||
- name: Compilation with g++
|
||||
run: |
|
||||
env CC=g++ CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking
|
||||
make -j $(nproc) check
|
||||
make clean > /dev/null
|
||||
|
||||
- name: Compilation with clang
|
||||
run: |
|
||||
env CC=clang CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking
|
||||
make -j $(nproc) check
|
||||
make clean > /dev/null
|
||||
|
||||
other-arch:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Update packages list
|
||||
run: sudo apt-get update
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install -y build-essential libtool autoconf automake gcc-powerpc-linux-gnu
|
||||
|
||||
- name: Autogen
|
||||
run: ./autogen.sh -s
|
||||
|
||||
- name: Big-Endian PowerPC compilation
|
||||
run: |
|
||||
env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking --host=powerpc-linux-gnu
|
||||
make -j $(nproc)
|
||||
make clean > /dev/null
|
30
deps/libsodium/.github/workflows/codeql-analysis.yml
vendored
Normal file
30
deps/libsodium/.github/workflows/codeql-analysis.yml
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
name: "CodeQL scan"
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: "0 17 * * 2"
|
||||
|
||||
jobs:
|
||||
CodeQL-Build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: cpp
|
||||
|
||||
- run: |
|
||||
./autogen.sh -s
|
||||
env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking
|
||||
make -j $(nproc) check
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
360
deps/libsodium/.github/workflows/dotnet-core.yml
vendored
Normal file
360
deps/libsodium/.github/workflows/dotnet-core.yml
vendored
Normal file
@ -0,0 +1,360 @@
|
||||
name: .NET Package
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- stable
|
||||
- next
|
||||
|
||||
jobs:
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: buildbase.bat
|
||||
run: buildbase.bat ..\vs2022\libsodium.sln 17
|
||||
working-directory: builds/msvc/build/
|
||||
shell: cmd
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build-win-x64
|
||||
path: bin/x64/Release/v143/dynamic/libsodium.dll
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build-win-x86
|
||||
path: bin/Win32/Release/v143/dynamic/libsodium.dll
|
||||
|
||||
build-linux-glibc:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ubuntu:16.04
|
||||
steps:
|
||||
- name: Set up build environment
|
||||
run: |
|
||||
apt-get update && apt-get install -y build-essential
|
||||
- uses: actions/checkout@v1
|
||||
- name: configure
|
||||
run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build
|
||||
- name: make
|
||||
run: make
|
||||
- name: make check
|
||||
run: make check
|
||||
- name: make install
|
||||
run: make install
|
||||
- name: strip
|
||||
run: strip --strip-all .libsodium-build/lib/libsodium.so
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build-linux-x64
|
||||
path: .libsodium-build/lib/libsodium.so
|
||||
|
||||
build-linux-glibc-arm64:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ubuntu:16.04
|
||||
steps:
|
||||
- name: Set up build environment
|
||||
run: |
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
cat <<-EOF | tee /etc/apt/sources.list.d/arm64.list >/dev/null
|
||||
deb [arch=arm64] http://ports.ubuntu.com/ xenial main restricted
|
||||
deb [arch=arm64] http://ports.ubuntu.com/ xenial-updates main restricted
|
||||
deb [arch=arm64] http://ports.ubuntu.com/ xenial universe
|
||||
deb [arch=arm64] http://ports.ubuntu.com/ xenial-updates universe
|
||||
deb [arch=arm64] http://ports.ubuntu.com/ xenial multiverse
|
||||
deb [arch=arm64] http://ports.ubuntu.com/ xenial-updates multiverse
|
||||
deb [arch=arm64] http://ports.ubuntu.com/ xenial-backports main restricted universe multiverse
|
||||
EOF
|
||||
|
||||
sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list
|
||||
|
||||
dpkg --add-architecture arm64
|
||||
|
||||
apt-get update && apt-get install -y build-essential qemu-user qemu-user-static gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libstdc++6:arm64
|
||||
|
||||
- uses: actions/checkout@v1
|
||||
- name: configure
|
||||
run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build --host=aarch64-linux-gnu
|
||||
- name: make
|
||||
run: make -j $(nproc)
|
||||
|
||||
- name: make check
|
||||
# Disable make check on this platform
|
||||
if: ${{ false }}
|
||||
run: |
|
||||
make check
|
||||
|
||||
- name: make install
|
||||
run: make install
|
||||
|
||||
- name: strip
|
||||
run: aarch64-linux-gnu-strip --strip-all .libsodium-build/lib/libsodium.so
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build-linux-arm64
|
||||
path: .libsodium-build/lib/libsodium.so
|
||||
|
||||
build-linux-glibc-arm:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Set up build environment
|
||||
run: |
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
cat <<-EOF | sudo tee /etc/apt/sources.list.d/armhf.list >/dev/null
|
||||
deb [arch=armhf] http://ports.ubuntu.com/ focal main restricted
|
||||
deb [arch=armhf] http://ports.ubuntu.com/ focal-updates main restricted
|
||||
deb [arch=armhf] http://ports.ubuntu.com/ focal universe
|
||||
deb [arch=armhf] http://ports.ubuntu.com/ focal-updates universe
|
||||
deb [arch=armhf] http://ports.ubuntu.com/ focal multiverse
|
||||
deb [arch=armhf] http://ports.ubuntu.com/ focal-updates multiverse
|
||||
deb [arch=armhf] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse
|
||||
EOF
|
||||
|
||||
sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list
|
||||
|
||||
sudo dpkg --add-architecture armhf
|
||||
|
||||
sudo apt-get update && sudo apt-get install -y build-essential qemu-user qemu-user-static gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libstdc++6:armhf
|
||||
|
||||
- uses: actions/checkout@v1
|
||||
- name: configure
|
||||
run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build --host=arm-linux-gnueabihf
|
||||
- name: make
|
||||
run: make -j $(nproc)
|
||||
|
||||
- name: make check
|
||||
run: |
|
||||
make check
|
||||
|
||||
- name: make install
|
||||
run: make install
|
||||
|
||||
- name: strip
|
||||
run: arm-linux-gnueabihf-strip --strip-all .libsodium-build/lib/libsodium.so
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build-linux-arm
|
||||
path: .libsodium-build/lib/libsodium.so
|
||||
|
||||
build-linux-musl:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: alpine:3.15
|
||||
steps:
|
||||
- name: Set up build environment
|
||||
run: |
|
||||
apk update
|
||||
apk add alpine-sdk ca-certificates
|
||||
- uses: actions/checkout@v1
|
||||
- name: configure
|
||||
run: ./configure --disable-dependency-tracking --prefix=$PWD/.libsodium-build
|
||||
- name: make
|
||||
run: make
|
||||
- name: make check
|
||||
run: make check
|
||||
- name: make install
|
||||
run: make install
|
||||
- name: strip
|
||||
run: strip --strip-all .libsodium-build/lib/libsodium.so
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build-linux-musl-x64
|
||||
path: .libsodium-build/lib/libsodium.so
|
||||
|
||||
build-macos-x64:
|
||||
runs-on: macos-11
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: configure
|
||||
run: env CFLAGS="-O2 -arch x86_64 -mmacosx-version-min=10.10" LDFLAGS="-arch x86_64 -mmacosx-version-min=10.10" ./configure --host=arm-apple-darwin20 --prefix=$PWD/.libsodium-build
|
||||
- name: make
|
||||
run: make
|
||||
- name: make check
|
||||
run: make check
|
||||
- name: make install
|
||||
run: make install
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build-osx-x64
|
||||
path: .libsodium-build/lib/libsodium.dylib
|
||||
|
||||
build-macos-arm64:
|
||||
runs-on: macos-11
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: configure
|
||||
run: env CFLAGS="-O2 -arch arm64 -mmacosx-version-min=10.10" LDFLAGS="-arch arm64 -mmacosx-version-min=10.10" ./configure --host=arm-apple-darwin20 --prefix=$PWD/.libsodium-build
|
||||
- name: make
|
||||
run: make
|
||||
- name: make install
|
||||
run: make install
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build-osx-arm64
|
||||
path: .libsodium-build/lib/libsodium.dylib
|
||||
|
||||
pack:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build-windows
|
||||
- build-linux-glibc
|
||||
- build-linux-glibc-arm
|
||||
- build-linux-glibc-arm64
|
||||
- build-linux-musl
|
||||
- build-macos-x64
|
||||
- build-macos-arm64
|
||||
container:
|
||||
image: mcr.microsoft.com/dotnet/sdk:5.0
|
||||
env:
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
|
||||
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: build-win-x64
|
||||
path: .libsodium-pack/runtimes/win-x64/native/
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: build-win-x86
|
||||
path: .libsodium-pack/runtimes/win-x86/native/
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: build-linux-x64
|
||||
path: .libsodium-pack/runtimes/linux-x64/native/
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: build-linux-arm64
|
||||
path: .libsodium-pack/runtimes/linux-arm64/native/
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: build-linux-arm
|
||||
path: .libsodium-pack/runtimes/linux-arm/native/
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: build-linux-musl-x64
|
||||
path: .libsodium-pack/runtimes/linux-musl-x64/native/
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: build-osx-x64
|
||||
path: .libsodium-pack/runtimes/osx-x64/native/
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: build-osx-arm64
|
||||
path: .libsodium-pack/runtimes/osx-arm64/native/
|
||||
- name: Copy files
|
||||
run: cp AUTHORS ChangeLog LICENSE packaging/dotnet-core/libsodium.pkgproj .libsodium-pack/
|
||||
- name: Create NuGet package
|
||||
run: dotnet pack -c Release .libsodium-pack/libsodium.pkgproj
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: nuget-package
|
||||
path: .libsodium-pack/bin/Release/*.nupkg
|
||||
|
||||
build-test-binaries:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- pack
|
||||
container:
|
||||
image: mcr.microsoft.com/dotnet/sdk:5.0
|
||||
env:
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
|
||||
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: nuget-package
|
||||
path: .libsodium-pack/
|
||||
- name: dotnet new
|
||||
run: dotnet new console -n Tests -o .libsodium-test/
|
||||
- name: dotnet add package libsodium
|
||||
run: dotnet add .libsodium-test/Tests.csproj package libsodium -s $PWD/.libsodium-pack
|
||||
- name: Copy files
|
||||
run: cp -f packaging/dotnet-core/test.cs .libsodium-test/Program.cs
|
||||
- name: dotnet publish linux-x64
|
||||
run: dotnet publish -c Release -r linux-x64 --self-contained true -p:PublishTrimmed=true
|
||||
working-directory: .libsodium-test/
|
||||
- name: dotnet publish linux-arm
|
||||
run: dotnet publish -c Release -r linux-arm --self-contained true -p:PublishTrimmed=true
|
||||
working-directory: .libsodium-test/
|
||||
- name: dotnet publish linux-arm64
|
||||
run: dotnet publish -c Release -r linux-arm64 --self-contained true -p:PublishTrimmed=true
|
||||
working-directory: .libsodium-test/
|
||||
- name: Move Build Output
|
||||
run: |
|
||||
mkdir .libsodium-builds
|
||||
mv .libsodium-test/bin/Release/net5.0/linux-arm/publish .libsodium-builds/linux-arm
|
||||
mv .libsodium-test/bin/Release/net5.0/linux-arm64/publish .libsodium-builds/linux-arm64
|
||||
mv .libsodium-test/bin/Release/net5.0/linux-x64/publish .libsodium-builds/linux-x64
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: test-builds
|
||||
path: .libsodium-builds/*
|
||||
|
||||
run-test-binaries-os-versions:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build-test-binaries
|
||||
strategy:
|
||||
matrix:
|
||||
# CentOS 7 and Debian 9 use an older GCC version; make sure we can run on those platforms.
|
||||
arch: [ 'centos:7', 'debian:9' ]
|
||||
container:
|
||||
image: ${{ matrix.arch }}
|
||||
env:
|
||||
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
|
||||
steps:
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: test-builds
|
||||
path: .libsodium-builds/
|
||||
- name: Run x64 tests
|
||||
run: |
|
||||
chmod +x .libsodium-builds/linux-x64/Tests
|
||||
.libsodium-builds/linux-x64/Tests
|
||||
|
||||
run-test-binaries-cross-plat:
|
||||
runs-on: ubuntu-20.04
|
||||
needs:
|
||||
- build-test-binaries
|
||||
env:
|
||||
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [x64, arm, arm64]
|
||||
steps:
|
||||
- name: Set up build environment
|
||||
run: |
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
cat <<-EOF | sudo tee /etc/apt/sources.list.d/multiarch.list >/dev/null
|
||||
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal main restricted
|
||||
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates main restricted
|
||||
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal universe
|
||||
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates universe
|
||||
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal multiverse
|
||||
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates multiverse
|
||||
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse
|
||||
EOF
|
||||
|
||||
sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list
|
||||
|
||||
sudo dpkg --add-architecture armhf
|
||||
sudo dpkg --add-architecture arm64
|
||||
|
||||
sudo apt-get update && sudo apt-get install -y qemu-user qemu-user-static libstdc++6:armhf libstdc++6:arm64
|
||||
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: test-builds
|
||||
path: .libsodium-builds/
|
||||
|
||||
- name: Run ${{ matrix.arch }}
|
||||
run: |
|
||||
chmod +x .libsodium-builds/linux-${{ matrix.arch }}/Tests
|
||||
.libsodium-builds/linux-${{ matrix.arch }}/Tests
|
Reference in New Issue
Block a user