Skip to content

Commit

Permalink
aarch64: build rav1e
Browse files Browse the repository at this point in the history
  • Loading branch information
hadfl committed Jan 17, 2025
1 parent 7284df5 commit f374adb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 28 deletions.
30 changes: 11 additions & 19 deletions build/ffmpeg/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# http://www.illumos.org/license/CDDL.
# }}}

# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.
# Copyright 2025 OmniOS Community Edition (OmniOSce) Association.

. ../../lib/build.sh

Expand All @@ -31,14 +31,10 @@ set_clangver

# The rav1e ABI changes frequently. Lock the version
# pulled into each build of ffmpeg.
# TODO: since the build framework checks whether the package is installed on
# the host system rather than the sysroot for cross-builds, this won't break
# cross-building ffmpeg even when rav1e is not present in the sysroot
# we should fix the framework to be able to handle arch specific build-time
# dependencies
RAV1EVER=`pkg_ver rav1e`
RAV1EVER=${RAV1EVER%.*}
BUILD_DEPENDS_IPS="=ooce/multimedia/rav1e@$RAV1EVER"
RUN_DEPENDS_IPS="$BUILD_DEPENDS_IPS"

OPREFIX=$PREFIX
PREFIX+="/$PROG"
Expand Down Expand Up @@ -67,24 +63,17 @@ CONFIGURE_OPTS="
--enable-libwebp
--enable-gpl
--enable-libx264
--enable-libx265
--enable-gnutls
"
CONFIGURE_OPTS[i386]="
--enable-libx265
--disable-librav1e
--libdir=$OPREFIX/lib
"
CONFIGURE_OPTS[amd64]="
--enable-libx265
--enable-librav1e
--libdir=$OPREFIX/lib/amd64
"
CONFIGURE_OPTS[aarch64]="
--enable-cross-compile
--disable-asm
--disable-libx265
--disable-librav1e
--libdir=$OPREFIX/lib
--enable-librav1e
"

pre_configure() {
Expand All @@ -95,17 +84,20 @@ pre_configure() {
--cxx=$CXX
"

CONFIGURE_OPTS[$arch]+="
--libdir=$OPREFIX/${LIBDIRS[$arch]}
"

# to find x264.h for builtin check
CPPFLAGS+=" -I${SYSROOT[$arch]}$OPREFIX/include"

LDFLAGS[$arch]+=" -Wl,-R$OPREFIX/${LIBDIRS[$arch]}"

if ! cross_arch $arch; then
RUN_DEPENDS_IPS="$BUILD_DEPENDS_IPS"
return
fi
! cross_arch $arch && return

CONFIGURE_OPTS[$arch]+="
--enable-cross-compile
--disable-asm
--sysroot=${SYSROOT[$arch]}
--host-cc=/opt/gcc-$DEFAULT_GCC_VER/bin/gcc
"
Expand Down
18 changes: 9 additions & 9 deletions build/rav1e/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# http://www.illumos.org/license/CDDL.
# }}}

# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.
# Copyright 2025 OmniOS Community Edition (OmniOSce) Association.

. ../../lib/build.sh

Expand All @@ -31,16 +31,17 @@ set_arch 64
# illumos strip removes symbol tables from archives
export STRIP=$GNUBIN/strip

build() {
note -n "Building $PROG"
build_rust
post_build() {
typeset arch=$1

note -n "Building $PROG C-API"
_destdir=$DESTDIR
cross_arch $arch && _destdir+=.$arch

pushd $TMPDIR/$BUILDDIR >/dev/null

logcmd $CARGO cinstall --release --library-type=cdylib \
--destdir=$DESTDIR --prefix=$PREFIX --libdir=$PREFIX/lib/amd64 \
logcmd $CARGO cinstall --release --target=${RUSTTRIPLETS[$arch]} \
--library-type=cdylib --destdir=$_destdir --prefix=$PREFIX \
--libdir=$PREFIX/${LIBDIRS[$arch]} \
|| logerr "C-API build failed"

popd >/dev/null
Expand All @@ -50,9 +51,8 @@ init
download_source $PROG v$VER
patch_source
prep_build
build
build_rust
install_rust
strip_install
make_package
clean_up

Expand Down
1 change: 1 addition & 0 deletions doc/baseline.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ extra.omnios ooce/multimedia/dav1d
extra.omnios ooce/multimedia/dcraw
extra.omnios ooce/multimedia/ffmpeg
extra.omnios ooce/multimedia/minidlna
extra.omnios ooce/multimedia/rav1e
extra.omnios ooce/multimedia/x264
extra.omnios ooce/multimedia/x265
extra.omnios ooce/network/fping
Expand Down
1 change: 1 addition & 0 deletions doc/pkglist.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ ooce/library/libtpms
ooce/developer/autoconf-archive
ooce/terminal/starship
ooce/util/diffr
ooce/multimedia/rav1e
###############################################################################
.SYSROOT
ooce/audio/flac
Expand Down

0 comments on commit f374adb

Please sign in to comment.