Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build for Linux RISC-V 64 #5

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions .appveyor.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

update_version export-ignore

* -text

*.bat eol=crlf
*.sln eol=crlf
*.vcxproj eol=crlf
Expand Down
222 changes: 222 additions & 0 deletions .github/workflows/lwjgl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
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: ${{matrix.CONTAINER}}
strategy:
fail-fast: false
matrix:
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
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
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
- 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

9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ set_target_properties(opus
target_include_directories(
opus
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libopusenc/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/ogg/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/opusfile/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/opus>
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
Expand All @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile.unix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions libopusenc
Submodule libopusenc added at f51c3a
1 change: 1 addition & 0 deletions ogg
Submodule ogg added at 3069cc
16 changes: 15 additions & 1 deletion opus_headers.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 15 additions & 1 deletion opus_sources.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions opusfile
Submodule opusfile added at c429fe