-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathbuild_libhdr10plus.sh
More file actions
executable file
·48 lines (39 loc) · 1.67 KB
/
build_libhdr10plus.sh
File metadata and controls
executable file
·48 lines (39 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# libhdr10plus ビルドスクリプト
#
# 使い方:
# ./build_libhdr10plus.sh [インストール先ディレクトリ]
#
# 前提条件:
# sudo apt install libssl-dev
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
# . $HOME/.cargo/env
# cargo install cargo-c
set -e
HDR10PLUS_TAG=libhdr10plus-2.1.5
HDR10PLUS_SRC=hdr10plus_tool
# スクリプトのあるディレクトリ(ソースをダウンロードする場所)
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# インストール先(引数で指定、省略時はスクリプトディレクトリ/build_libhdr10plus)
INSTALL_DIR="${1:-${SCRIPT_DIR}/build_libhdr10plus}"
INSTALL_DIR="$(mkdir -p "$INSTALL_DIR" && cd "$INSTALL_DIR" && pwd)"
echo "libhdr10plus build script"
echo " Source dir: ${SCRIPT_DIR}"
echo " Install dir: ${INSTALL_DIR}"
# ソースのダウンロード(スクリプトディレクトリで行う)
cd "${SCRIPT_DIR}"
if [ ! -e "${HDR10PLUS_SRC}" ]; then
echo "Cloning hdr10plus_tool ${HDR10PLUS_TAG}..."
git clone --depth 1 --branch "${HDR10PLUS_TAG}" https://github.com/quietvoid/hdr10plus_tool.git "${HDR10PLUS_SRC}"
fi
# ビルド & インストール
echo "Building libhdr10plus..."
cd "${SCRIPT_DIR}/${HDR10PLUS_SRC}/hdr10plus"
if ! cargo cinstall --release --prefix="$INSTALL_DIR"; then
echo "ERROR: cargo cinstall failed while building libhdr10plus-rs." >&2
exit 1
fi
# 静的リンクのため .so を削除して .a だけ残す
echo "Removing shared libraries (keeping static only)..."
find "${INSTALL_DIR}" -name "libhdr10plus-rs.so*" -delete 2>/dev/null || true
echo "libhdr10plus installed to: ${INSTALL_DIR}"