-
Notifications
You must be signed in to change notification settings - Fork 2
/
deps.sh
executable file
·124 lines (111 loc) · 4.22 KB
/
deps.sh
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Required dependencies:
# sudo apt install cmake meson ninja-build clang yasm libpng-dev libjpeg-dev cargo rustc
# Required dependencies for BUILD_TESTING=ON:
# sudo apt install libgtest-dev
set -e
mkdir third_party
pushd third_party
git clone https://github.com/AOMediaCodec/libavif.git
pushd libavif
git checkout bb24db03cd99befe09c87b602e36f24d75a980d1 # v1.1.1
cmake -S . -B build \
-DAVIF_BUILD_APPS=ON \
-DAVIF_BUILD_EXAMPLES=OFF \
-DAVIF_BUILD_TESTS=OFF \
-DAVIF_CODEC_AOM=LOCAL \
-DAVIF_CODEC_DAV1D=LOCAL \
-DAVIF_LIBYUV=LOCAL \
-DAVIF_LIBSHARPYUV=LOCAL \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DBUILD_SHARED_LIBS=ON
cmake --build build --parallel
popd
git clone https://chromium.googlesource.com/webm/libwebp
pushd libwebp
git checkout a443170fc0ebdfc3abbf89ac81f35e7eb656a3da # v1.4.0
cmake -S . -B build \
-DWEBP_BUILD_CWEBP=ON \
-DWEBP_BUILD_DWEBP=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DBUILD_SHARED_LIBS=ON
cmake --build build --parallel
# This file creates errors when referenced by CMAKE_PREFIX_PATH below.
mv build/WebPConfig.cmake build/WebPConfig.cmake.bck
popd
git clone https://chromium.googlesource.com/codecs/libwebp2
pushd libwebp2
git checkout 425411e8016acc4497d23999e168bf38970c3afb
cmake -S . -B build \
-DCMAKE_PREFIX_PATH="../libwebp/src/;../libwebp/build/" \
-DWP2_BUILD_TESTS=OFF \
-DWP2_BUILD_EXTRAS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DBUILD_SHARED_LIBS=ON
cmake --build build --parallel
popd
# DEVTOOLS=ON for Butteraugli and SSIMULACRA2 metrics binaries. See
# https://github.com/cloudinary/ssimulacra2/blob/d2be72505ddc5c92aeb30f4a7f3ab53db45b314b/build_ssimulacra_from_libjxl_repo
git clone https://github.com/libjxl/libjxl.git
pushd libjxl
# https://github.com/libjxl/libjxl/releases/tag/v0.11.0
git checkout 4df1e9eccdf86b8df4c0c7c08f529263906f9c4f
./deps.sh
# DEVTOOLS=ON for metric binaries. See
# https://github.com/cloudinary/ssimulacra2/blob/d2be72505ddc5c92aeb30f4a7f3ab53db45b314b/build_ssimulacra_from_libjxl_repo
cmake -S . -B build \
-DBUILD_TESTING=OFF \
-DJPEGXL_ENABLE_BENCHMARK=OFF \
-DJPEGXL_ENABLE_EXAMPLES=OFF \
-DJPEGXL_ENABLE_JPEGLI=OFF \
-DJPEGXL_ENABLE_OPENEXR=OFF \
-DJPEGXL_ENABLE_DEVTOOLS=ON \
-DJPEGXL_ENABLE_JPEGLI=ON -DJPEGXL_ENABLE_JPEGLI_LIBJPEG=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DBUILD_SHARED_LIBS=ON
cmake --build build --parallel
popd
git clone https://github.com/kornelski/dssim.git
pushd dssim
# https://github.com/kornelski/dssim/releases/tag/3.2.3
git checkout 14995bc19a6ac75abf6e171cdfb17f26ad980879
cargo build --release
popd
git clone https://github.com/libjpeg-turbo/libjpeg-turbo.git libjpeg_turbo
pushd libjpeg_turbo
git checkout e287a35762cba20e2253efb3260007289a2f2186
cmake -S . -B build
cmake --build build --parallel
popd
git clone https://github.com/webmproject/sjpeg.git
pushd sjpeg
git checkout 4578abf18ed8b81290c6fe5c23eb7a58c8f38212
cmake -S . -B build \
-DSJPEG_BUILD_EXAMPLES=OFF \
-DBUILD_SHARED_LIBS=ON
cmake --build build --parallel
popd
git clone https://github.com/mozilla/mozjpeg.git
pushd mozjpeg
git checkout 6c9f0897afa1c2738d7222a0a9ab49e8b536a267
cmake -S . -B build -DWITH_TURBOJPEG=OFF
cmake --build build --parallel
popd
popd