From 020da8b5868eaab618880e9ffba8f5df5d1ba534 Mon Sep 17 00:00:00 2001 From: Ioannis Tsakpinis Date: Thu, 28 Oct 2021 21:59:33 +0300 Subject: [PATCH 1/2] LWJGL CI Configuration --- .appveyor.yml | 37 ------- .gitattributes | 2 + .github/workflows/lwjgl.yml | 209 ++++++++++++++++++++++++++++++++++++ .gitmodules | 9 ++ .travis.yml | 21 ---- CMakeLists.txt | 9 ++ Makefile.am | 6 +- Makefile.unix | 2 +- libopusenc | 1 + ogg | 1 + opus_headers.mk | 16 ++- opus_sources.mk | 16 ++- opusfile | 1 + 13 files changed, 268 insertions(+), 62 deletions(-) delete mode 100644 .appveyor.yml create mode 100644 .github/workflows/lwjgl.yml create mode 100644 .gitmodules delete mode 100644 .travis.yml create mode 160000 libopusenc create mode 160000 ogg create mode 160000 opusfile diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index a0f4a776e..000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,37 +0,0 @@ -image: Visual Studio 2015 -configuration: -- Debug -- DebugDLL -- DebugDLL_fixed -- Release -- ReleaseDLL -- ReleaseDLL_fixed - -platform: -- Win32 -- x64 - -environment: - api_key: - secure: kR3Ac0NjGwFnTmXdFrR8d6VXjdk5F7L4F/BilC4nvaM= - -build: - project: win32\VS2015\opus.sln - parallel: true - verbosity: minimal - -after_build: -- cd %APPVEYOR_BUILD_FOLDER% -- 7z a opus.zip win32\VS2015\%PLATFORM%\%CONFIGURATION%\opus.??? include\*.h - -test_script: -- cd %APPVEYOR_BUILD_FOLDER%\win32\VS2015\%PLATFORM%\%CONFIGURATION% -- test_opus_api.exe -- test_opus_decode.exe -- test_opus_encode.exe - -artifacts: -- path: opus.zip - -on_success: -- ps: if ($env:api_key -and "$env:configuration/$env:platform" -eq "ReleaseDLL_fixed/x64") { Start-AppveyorBuild -ApiKey $env:api_key -ProjectSlug 'opus-tools' } diff --git a/.gitattributes b/.gitattributes index 649c81005..839fea55c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,6 +3,8 @@ update_version export-ignore +* -text + *.bat eol=crlf *.sln eol=crlf *.vcxproj eol=crlf diff --git a/.github/workflows/lwjgl.yml b/.github/workflows/lwjgl.yml new file mode 100644 index 000000000..28f40458a --- /dev/null +++ b/.github/workflows/lwjgl.yml @@ -0,0 +1,209 @@ +name: LWJGL Build + +on: + push: + branches: + - master + +env: + AWS_DEFAULT_REGION: us-east-1 + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + S3_PARAMS: --cache-control "public,must-revalidate,proxy-revalidate,max-age=0" + OPUS_PARAMS: --disable-extra-programs --disable-doc --disable-hardening --disable-stack-protector --enable-custom-modes + +jobs: + linux: + name: Linux + runs-on: ubuntu-latest + container: + image: centos:7 + strategy: + fail-fast: false + matrix: + ARCH: [x64] + include: + - ARCH: x64 + steps: + - run: | + yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm + yum -y install git + name: Upgrade git + - uses: actions/checkout@v3 + with: + fetch-depth: 3 + submodules: true + - run: | + yum -y install epel-release + yum -y update + name: Configure yum + - run: | + yum -y install centos-release-scl + yum -y install devtoolset-11-gcc-c++ + yum -y install autoconf automake libtool awscli + name: Install build dependencies + - run: | + source scl_source enable devtoolset-11 || true + cd ogg + ./autogen.sh + ./configure + name: Configure ogg + - run: | + source scl_source enable devtoolset-11 || true + ./autogen.sh + ./configure ${{env.OPUS_PARAMS}} + name: Configure build + - run: | + source scl_source enable devtoolset-11 || true + make + strip .libs/libopus.so + name: Build + - run: aws s3 cp .libs/libopus.so s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ $S3_PARAMS + name: Upload artifact + - run: | + git config --global --add safe.directory $PWD + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libopus.so.git + aws s3 cp libopus.so.git s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ $S3_PARAMS + name: Upload git revision + + linux-cross: + name: Linux Cross + runs-on: ubuntu-latest + container: + image: ubuntu:18.04 + strategy: + fail-fast: false + matrix: + ARCH: [arm32, arm64, mips64] + include: + # ----- + - ARCH: arm32 + PACKAGES: gcc-arm-linux-gnueabihf libc6-dev-armhf-cross + CC: CC=arm-linux-gnueabihf-gcc + HOST: arm-unknown-linux-gnueabihf + STRIP: arm-linux-gnueabihf-strip + # ----- + - ARCH: arm64 + PACKAGES: gcc-aarch64-linux-gnu libc6-dev-arm64-cross + CC: CC=aarch64-linux-gnu-gcc + HOST: aarch64-unknown-linux-gnu + STRIP: aarch64-linux-gnu-strip + # ----- + - ARCH: mips64 + PACKAGES: gcc-mips64el-linux-gnuabi64 libc6-dev-mips64el-cross + CC: CC=mips64el-linux-gnuabi64-gcc + HOST: mips64el-unknown-linux-gnu + STRIP: mips64el-linux-gnuabi64-strip + steps: + - run: | + apt-get -y update + apt-get -y install software-properties-common wget + apt-get -y install --reinstall ca-certificates + apt-get -y update + apt-get -y upgrade + wget https://apt.kitware.com/keys/kitware-archive-latest.asc + apt-key add kitware-archive-latest.asc + add-apt-repository -y 'deb https://apt.kitware.com/ubuntu/ bionic main' + add-apt-repository -y ppa:git-core/ppa + apt-get -y update + DEBIAN_FRONTEND=noninteractive apt-get -yq install awscli git + name: Upgrade git + - uses: actions/checkout@v3 + with: + fetch-depth: 3 + submodules: true + - run: DEBIAN_FRONTEND=noninteractive apt-get -yq install autoconf make libtool ${{matrix.PACKAGES}} + name: Install dependencies + - run: | + cd ogg + ./autogen.sh + ./configure --host=${{matrix.HOST}} + name: Configure ogg + - run: | + ./autogen.sh + ${{matrix.CC}} ./configure ${{env.OPUS_PARAMS}} --host=${{matrix.HOST}} + name: Configure build + - run: | + make + ${{matrix.STRIP}} .libs/libopus.so + name: Build + - run: aws s3 cp .libs/libopus.so s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ $S3_PARAMS + name: Upload artifact + - run: | + git config --global --add safe.directory $(pwd) + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libopus.so.git + aws s3 cp libopus.so.git s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ $S3_PARAMS + name: Upload git revision + + macos: + name: macOS + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + ARCH: [x64, arm64] + include: + - ARCH: x64 + CC: CFLAGS="-O2 -mmacosx-version-min=10.9" LDFLAGS=-mmacosx-version-min=10.9 + HOST: x86_64 + CMAKE_PARAMS: -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 + - ARCH: arm64 + CC: SDKROOT=$(xcrun -sdk macosx11.1 --show-sdk-path) MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version) CFLAGS="-O2 -target aarch64-apple-darwin -arch arm64 -mmacosx-version-min=11.0" LDFLAGS="-target aarch64-apple-darwin -arch arm64 -mmacosx-version-min=11.0" + HOST: aarch64 + CMAKE_PARAMS: -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_TOOLCHAIN_FILE=../XCompile-lwjgl.cmake -DSYSTEM_NAME=Darwin -DSYSTEM_PROCESSOR=aarch64 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 3 + submodules: true + - run: brew install automake + name: Install dependencies + - run: | + ./autogen.sh + ${{matrix.CC}} ./configure ${{env.OPUS_PARAMS}} --target ${{matrix.ARCH}}-apple-darwin20 --host=${{matrix.HOST}}-apple-darwin20 + name: Configure build + - run: | + ${{matrix.CC}} make + strip -u -r .libs/libopus.dylib + name: Build + - run: aws s3 cp .libs/libopus.dylib s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/ $S3_PARAMS + name: Upload artifact + - run: | + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libopus.dylib.git + aws s3 cp libopus.dylib.git s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/ $S3_PARAMS + name: Upload git revision + + windows: + name: Windows + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + ARCH: [x86, x64, arm64] + include: + - ARCH: x86 + PLATFORM: Win32 + - ARCH: x64 + PLATFORM: x64 + - ARCH: arm64 + PLATFORM: ARM64 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 3 + submodules: true + - run: cmake -B build -G "Visual Studio 17 2022" -A ${{matrix.PLATFORM}} -DOPUS_INSTALL_PKG_CONFIG_MODULE=OFF -DOPUS_INSTALL_CMAKE_CONFIG_MODULE=OFF -DOPUS_HARDENING=OFF -DOPUS_STACK_PROTECTOR=OFF -DOPUS_BUILD_SHARED_LIBRARY=ON -DOPUS_CUSTOM_MODES=ON + shell: cmd + name: Configure build + - run: cmake --build build --parallel --config Release + shell: cmd + name: Build + - run: aws s3 cp build\Release\opus.dll s3://lwjgl-build/nightly/windows/${{matrix.ARCH}}/ ${{env.S3_PARAMS}} + shell: cmd + name: Upload artifact + - run: | + git log --first-parent --pretty=format:%%H HEAD~2..HEAD~1 > opus.dll.git + aws s3 cp opus.dll.git s3://lwjgl-build/nightly/windows/${{matrix.ARCH}}/ ${{env.S3_PARAMS}} + shell: cmd + name: Upload git revision + diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..9e5b9410b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "opusfile"] + path = opusfile + url = ../../xiph/opusfile.git +[submodule "ogg"] + path = ogg + url = ../../xiph/ogg.git +[submodule "libopusenc"] + path = libopusenc + url = ../../xiph/libopusenc.git diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 821c813ec..000000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: c - -compiler: - - gcc - - clang - -os: - - linux - - osx - -env: - - CONFIG="" - - CONFIG="--enable-assertions" - - CONFIG="--enable-fixed-point" - - CONFIG="--enable-fixed-point --disable-float-api" - - CONFIG="--enable-fixed-point --enable-assertions" - -script: - - ./autogen.sh - - ./configure $CONFIG - - make distcheck diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d824cdcf..600fa266f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -270,6 +270,9 @@ set_target_properties(opus target_include_directories( opus PUBLIC $ + $ + $ + $ $ $ PRIVATE ${CMAKE_CURRENT_BINARY_DIR} @@ -279,6 +282,12 @@ target_include_directories( target_link_libraries(opus PRIVATE ${OPUS_REQUIRED_LIBRARIES}) target_compile_definitions(opus PRIVATE OPUS_BUILD) +target_compile_definitions(opus PRIVATE OUTSIDE_SPEEX) +target_compile_definitions(opus PRIVATE RANDOM_PREFIX=lwjgl) +target_compile_definitions(opus PRIVATE RESAMPLE_FULL_SINC_TABLE=1) +target_compile_definitions(opus PRIVATE OPE_BUILD) +target_compile_definitions(opus PRIVATE PACKAGE_NAME="opus") +target_compile_definitions(opus PRIVATE PACKAGE_VERSION="${PACKAGE_VERSION}") if(OPUS_FIXED_POINT_DEBUG) target_compile_definitions(opus PRIVATE FIXED_DEBUG) diff --git a/Makefile.am b/Makefile.am index 492fc09da..03f68c711 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,7 +10,11 @@ lib_LTLIBRARIES = libopus.la DIST_SUBDIRS = doc AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/celt -I$(top_srcdir)/silk \ - -I$(top_srcdir)/silk/float -I$(top_srcdir)/silk/fixed $(NE10_CFLAGS) + -I$(top_srcdir)/silk/float -I$(top_srcdir)/silk/fixed $(NE10_CFLAGS) \ + -I$(top_srcdir)/libopusenc/include \ + -I$(top_srcdir)/ogg/include \ + -I$(top_srcdir)/opusfile/include \ + -DOUTSIDE_SPEEX -DRANDOM_PREFIX=lwjgl -DRESAMPLE_FULL_SINC_TABLE=1 -DOPE_BUILD include celt_sources.mk include silk_sources.mk diff --git a/Makefile.unix b/Makefile.unix index 90a48f0cc..7ac845865 100644 --- a/Makefile.unix +++ b/Makefile.unix @@ -45,7 +45,7 @@ ldflags-from-ldlibdirs = $(addprefix -L,$(1)) ldlibs-from-libs = $(addprefix -l,$(1)) WARNINGS = -Wall -W -Wstrict-prototypes -Wextra -Wcast-align -Wnested-externs -Wshadow -CFLAGS += -O2 -g $(WARNINGS) -DOPUS_BUILD +CFLAGS += -O2 $(WARNINGS) -DOPUS_BUILD CINCLUDES = include silk celt ifdef FIXED_POINT diff --git a/libopusenc b/libopusenc new file mode 160000 index 000000000..f51c3aa43 --- /dev/null +++ b/libopusenc @@ -0,0 +1 @@ +Subproject commit f51c3aa431c2f0f8fccd8926628b5f330292489f diff --git a/ogg b/ogg new file mode 160000 index 000000000..3069cc2bb --- /dev/null +++ b/ogg @@ -0,0 +1 @@ +Subproject commit 3069cc2bb44160982cdb21b2b8f0660c76b17572 diff --git a/opus_headers.mk b/opus_headers.mk index 27596f2a4..568812b63 100644 --- a/opus_headers.mk +++ b/opus_headers.mk @@ -6,4 +6,18 @@ src/opus_private.h \ src/analysis.h \ src/mapping_matrix.h \ src/mlp.h \ -src/tansig_table.h +src/tansig_table.h \ +libopusenc/include/opusenc.h \ +libopusenc/src/arch.h \ +libopusenc/src/ogg_packer.h \ +libopusenc/src/opus_header.h \ +libopusenc/src/picture.h \ +libopusenc/src/resample_sse.h \ +libopusenc/src/speex_resampler.h \ +libopusenc/src/unicode_support.h \ +ogg/include/ogg/ogg.h \ +ogg/include/ogg/os_types.h \ +ogg/src/crctable.h \ +opusfile/include/opusfile.h \ +opusfile/src/internal.h \ +opusfile/src/winerrno.h diff --git a/opus_sources.mk b/opus_sources.mk index 44153b570..656cd1b74 100644 --- a/opus_sources.mk +++ b/opus_sources.mk @@ -8,7 +8,21 @@ src/opus_multistream_decoder.c \ src/repacketizer.c \ src/opus_projection_encoder.c \ src/opus_projection_decoder.c \ -src/mapping_matrix.c +src/mapping_matrix.c \ +libopusenc/src/ogg_packer.c \ +libopusenc/src/opus_header.c \ +libopusenc/src/opusenc.c \ +libopusenc/src/picture.c \ +libopusenc/src/resample.c \ +libopusenc/src/unicode_support.c \ +ogg/src/bitwise.c \ +ogg/src/framing.c \ +opusfile/src/http.c \ +opusfile/src/info.c \ +opusfile/src/internal.c \ +opusfile/src/opusfile.c \ +opusfile/src/stream.c \ +opusfile/src/wincerts.c OPUS_SOURCES_FLOAT = \ src/analysis.c \ diff --git a/opusfile b/opusfile new file mode 160000 index 000000000..c429fe1a3 --- /dev/null +++ b/opusfile @@ -0,0 +1 @@ +Subproject commit c429fe1a3c058a071ec4406982169592a2c4833b From d4a3d4b3388ef07d338ea6f5db3ee6ddde8a8582 Mon Sep 17 00:00:00 2001 From: Glavo Date: Sat, 7 Oct 2023 14:05:52 +0800 Subject: [PATCH 2/2] Build for Linux RISC-V 64 --- .github/workflows/lwjgl.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lwjgl.yml b/.github/workflows/lwjgl.yml index 28f40458a..2305a25c2 100644 --- a/.github/workflows/lwjgl.yml +++ b/.github/workflows/lwjgl.yml @@ -70,30 +70,40 @@ jobs: name: Linux Cross runs-on: ubuntu-latest container: - image: ubuntu:18.04 + image: ${{matrix.CONTAINER}} strategy: fail-fast: false matrix: - ARCH: [arm32, arm64, mips64] + ARCH: [arm32, arm64, mips64, riscv64] include: # ----- - ARCH: arm32 + CONTAINER: ubuntu:18.04 PACKAGES: gcc-arm-linux-gnueabihf libc6-dev-armhf-cross CC: CC=arm-linux-gnueabihf-gcc HOST: arm-unknown-linux-gnueabihf STRIP: arm-linux-gnueabihf-strip # ----- - ARCH: arm64 + CONTAINER: ubuntu:18.04 PACKAGES: gcc-aarch64-linux-gnu libc6-dev-arm64-cross CC: CC=aarch64-linux-gnu-gcc HOST: aarch64-unknown-linux-gnu STRIP: aarch64-linux-gnu-strip # ----- - ARCH: mips64 + CONTAINER: ubuntu:18.04 PACKAGES: gcc-mips64el-linux-gnuabi64 libc6-dev-mips64el-cross CC: CC=mips64el-linux-gnuabi64-gcc HOST: mips64el-unknown-linux-gnu STRIP: mips64el-linux-gnuabi64-strip + # ----- + - ARCH: riscv64 + CONTAINER: ubuntu:20.04 + PACKAGES: gcc-riscv64-linux-gnu libc6-dev-riscv64-cross + CC: CC=riscv64-linux-gnu-gcc + HOST: riscv64-unknown-linux-gnu + STRIP: riscv64-linux-gnu-strip steps: - run: | apt-get -y update @@ -105,6 +115,9 @@ jobs: apt-key add kitware-archive-latest.asc add-apt-repository -y 'deb https://apt.kitware.com/ubuntu/ bionic main' add-apt-repository -y ppa:git-core/ppa + name: Update apt repositories + if: ${{ matrix.CONTAINER == 'ubuntu:18.04' }} + - run: | apt-get -y update DEBIAN_FRONTEND=noninteractive apt-get -yq install awscli git name: Upgrade git