Skip to content

Commit bd8bf74

Browse files
committed
add libdovi
1 parent 566e9cc commit bd8bf74

7 files changed

Lines changed: 138 additions & 38 deletions

File tree

.github/workflows/build all libs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ on:
4545
- lcms2
4646
- shaderc
4747
- moltenvk
48+
- dovi
4849
- placebo
4950
- dvdread
5051
- dvdnav
@@ -145,6 +146,16 @@ jobs:
145146
fi
146147
fi
147148
149+
if [[ "$lib_name" == "dovi" ]]; then
150+
if [[ "$platform" == "android" ]]; then
151+
echo "Skip dovi for android"
152+
return
153+
elif [[ "$platform" == "all" ]]; then
154+
echo "Skip dovi for android"
155+
platform='apple'
156+
fi
157+
fi
158+
148159
if [[ "$lib_name" == "placebo" ]]; then
149160
if [[ "$platform" == "android" ]]; then
150161
echo "Skip placebo for android"
@@ -183,6 +194,7 @@ jobs:
183194
"lcms2"
184195
"shaderc"
185196
"moltenvk"
197+
"dovi"
186198
"placebo"
187199
"ijkffmpeg"
188200
"fftutorial"

.github/workflows/onestep.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# git describe --tags --always | awk -F - '{printf "RELEASE_VERSION=V1.0-%s",$NF}' | xargs > constants.env
66

77
set -e
8+
set -o pipefail
89

910
export LIB_NAME=$1
1011
export PLAT=$2

configs/libs/dovi.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#! /usr/bin/env bash
2+
#
3+
# Copyright (C) 2021 Matt Reach<qianlongxu@gmail.com>
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
export LIB_NAME='dovi'
19+
export LIPO_LIBS="libdovi"
20+
export LIB_DEPENDS_BIN="rust cargo-c"
21+
export GIT_LOCAL_REPO=extra/dovi
22+
export GIT_COMMIT=libdovi-3.3.2
23+
export GIT_WITH_SUBMODULE=0
24+
export REPO_DIR=dovi
25+
export GIT_REPO_VERSION=3.3.2
26+
27+
if [[ "$GIT_DOVI_UPSTREAM" != "" ]] ;then
28+
export GIT_UPSTREAM="$GIT_DOVI_UPSTREAM"
29+
else
30+
export GIT_UPSTREAM=https://github.com/quietvoid/dovi_tool.git
31+
fi

configs/libs/libplacebo.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

configs/libs/placebo.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ export LIB_NAME='placebo'
1919
export LIPO_LIBS="libplacebo"
2020
export LIB_DEPENDS_BIN="meson ninja"
2121
# placebo depends on lcms2 and shaderc (for SPIRV), vulkan backend uses MoltenVK
22-
export LIB_DEPENDS='lcms2 shaderc moltenvk'
23-
export GIT_LOCAL_REPO=extra/libplacebo
22+
export LIB_DEPENDS='lcms2 shaderc moltenvk dovi'
23+
export GIT_LOCAL_REPO=extra/placebo
2424
export GIT_COMMIT=v7.349.0
25-
export REPO_DIR=libplacebo
25+
export REPO_DIR=placebo
2626
export GIT_REPO_VERSION=v7.349.0
2727

2828
# you can export GIT_LIBPLACEB0_UPSTREAM=git@xx:yy/libplacebo.git use your mirror

do-compile/apple/dovi.sh

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#! /usr/bin/env bash
2+
#
3+
# Copyright (C) 2021 Matt Reach<qianlongxu@gmail.com>
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
set -e
19+
20+
THIS_DIR=$(DIRNAME=$(dirname "$0"); cd "$DIRNAME"; pwd)
21+
cd "$THIS_DIR"
22+
23+
echo "----------------------"
24+
echo "[*] configure $LIB_NAME"
25+
echo "----------------------"
26+
27+
cd $MR_BUILD_SOURCE
28+
29+
cd dolby_vision
30+
31+
build_dir="${MR_BUILD_SOURCE}/dolby_vision_build"
32+
rm -rf "$build_dir"
33+
mkdir -p "$build_dir"
34+
cd "$build_dir"
35+
36+
export CC="$MR_CC"
37+
export CXX="$MR_CXX"
38+
export CFLAGS="-fPIC $CFLAGS"
39+
export CXXFLAGS="-fPIC $CXXFLAGS"
40+
41+
if [[ "$MR_DEBUG" == "debug" ]]; then
42+
build_type="debug"
43+
else
44+
build_type="release"
45+
fi
46+
47+
echo "----------------------"
48+
echo "[*] compile $LIB_NAME"
49+
echo "---------------------"
50+
echo "CC: $MR_CC"
51+
echo "CFLAGS: $CFLAGS"
52+
echo "build_type: $build_type"
53+
echo "prefix: $MR_BUILD_PREFIX"
54+
echo "----------------------"
55+
56+
MANIFEST_PATH="${MR_BUILD_SOURCE}/dolby_vision/Cargo.toml"
57+
58+
arch_target() {
59+
local arch="$1"
60+
case "$arch" in
61+
arm64)
62+
echo "aarch64-apple-ios"
63+
;;
64+
arm64_simulator)
65+
echo "aarch64-apple-ios-sim"
66+
;;
67+
x86_64_simulator)
68+
echo "x86_64-apple-ios"
69+
;;
70+
*)
71+
echo "$arch-apple-ios"
72+
;;
73+
esac
74+
}
75+
76+
target=$(arch_target "$MR_ARCH")
77+
78+
cargo cinstall \
79+
--manifest-path="$MANIFEST_PATH" \
80+
--target="$target" \
81+
--prefix="$MR_BUILD_PREFIX" \
82+
--lib \
83+
--library-type=staticlib \
84+
--release \
85+
--no-default-features \
86+
--features capi
87+
88+
echo "----------------------"
89+
echo "[*] install $LIB_NAME"
90+
echo "----------------------"

do-compile/apple/meson-compatible.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ echo "[*] other meson flags: $MESON_OTHER_FLAGS"
2828
echo "----------------------"
2929

3030
# prepare build config
31-
CFG_FLAGS="--prefix=$MR_BUILD_PREFIX --default-library static"
31+
CFG_FLAGS="--prefix=${MR_BUILD_PREFIX} --default-library static --pkg-config-path=${PKG_CONFIG_LIBDIR}"
3232

3333
if [[ "$MR_DEBUG" == "debug" ]]; then
3434
CFG_FLAGS="$CFG_FLAGS --buildtype=debug"

0 commit comments

Comments
 (0)