66#
77# This program is free software: you can redistribute it and/or modify
88# it under the terms of the GNU General Public License as published by
9- # the Free Software Foundation, either version 3 of the License, or
10- # (at your option) any later version.
9+ # the Free Software Foundation, version 3.
1110#
1211# This program is distributed in the hope that it will be useful,
1312# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -26,22 +25,16 @@ clang -v
2625SDK=${SDK:- " /opt/friction" }
2726SRC=${SDK} /src
2827DIST=${DIST:- " /mnt" }
29- MKJOBS=${MKJOBS:- 32 }
28+ MKJOBS=${MKJOBS:- 4 }
3029
3130NINJA_V=1.11.1
32- # GN_V=82d673ac
31+ CMAKE_V=3.26.3
3332UNWIND_V=1.4.0
34- # GPERF_V=4df0b85
35- # SKIA_V=4c434dbee3
33+ SKIA_V=386256b297e93bbe06ee82abdcc701357d9ccd99
34+ SKIA_URL=https://github.com/friction2d/skia
3635
3736NINJA_BIN=${SDK} /bin/ninja
38- # GN_BIN=${SDK}/bin/gn
39-
40- # GPERF_DIR=${SDK}/gperftools
41- # GPERF_LIB=${GPERF_DIR}/.libs/libtcmalloc.a
42-
43- # SKIA_DIR=${SDK}/skia
44- # SKIA_LIB=${SKIA_DIR}/out/build/libskia.a
37+ CMAKE_BIN=${SDK} /bin/cmake
4538
4639STATIC_CFLAGS=" -fPIC"
4740DEFAULT_CFLAGS=" -I${SDK} /include"
@@ -76,30 +69,41 @@ if [ ! -f "${NINJA_BIN}" ]; then
7669 cp -a ninja ${NINJA_BIN}
7770fi # ninja
7871
79- # gn
80- # if [ ! -f "${GN_BIN }" ]; then
81- # cd ${SRC}
82- # GN_SRC=gn -${GN_V }
83- # rm -rf ${GN_SRC } || true
84- # tar xf ${DIST}/${GN_SRC }.tar.xz
85- # cd ${GN_SRC }
86- # python build/gen.py
87- # ${NINJA_BIN} -C out
88- # cp -a out/gn ${GN_BIN}
89- # fi # gn
72+ # cmake
73+ if [ ! -f " ${CMAKE_BIN } " ]; then
74+ cd ${SRC}
75+ CMAKE_SRC=cmake -${CMAKE_V }
76+ rm -rf ${CMAKE_SRC } || true
77+ tar xf ${DIST} /ffmpeg/ ${CMAKE_SRC } .tar.gz
78+ cd ${CMAKE_SRC }
79+ ./configure ${COMMON_CONFIGURE} --parallel= ${MKJOBS} -- -DCMAKE_USE_OPENSSL=OFF
80+ make -j ${MKJOBS}
81+ make install
82+ fi # cmake
9083
9184# skia
92- # if [ ! -f "${SKIA_LIB}" ]; then
93- # cd ${SRC}
94- # SKIA_SRC=skia-${SKIA_V}
95- # rm -rf ${SKIA_SRC} || true
96- # rm -rf ${SKIA_DIR} || true
97- # tar xf ${DIST}/${SKIA_SRC}.tar.xz
98- # mv ${SKIA_SRC} ${SKIA_DIR}
99- # cd ${SKIA_DIR}
100- # ${GN_BIN} gen out/build --args='is_official_build=true is_debug=false cc="clang" cxx="clang++" extra_cflags=["-Wno-error"] target_os="linux" target_cpu="x64" skia_use_system_expat=false skia_use_system_freetype2=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false skia_use_system_icu=false skia_use_system_harfbuzz=false skia_use_dng_sdk=false'
101- # ${NINJA_BIN} -C out/build -j${MKJOBS} skia
102- # fi # skia
85+ if [ ! -f " ${SDK} /lib/libskia.a" ]; then
86+ cd ${SRC}
87+ rm -rf skia-${SKIA_V} || true
88+ git clone ${SKIA_URL} skia-${SKIA_V}
89+ cd skia-${SKIA_V}
90+ git checkout ${SKIA_V}
91+ git submodule update -i --recursive
92+ mkdir build
93+ cd build
94+ cmake -G Ninja \
95+ -DCMAKE_INSTALL_PREFIX=${SDK} \
96+ -DCMAKE_CXX_COMPILER=clang++ \
97+ -DCMAKE_C_COMPILER=clang \
98+ -DSKIA_USE_SYSTEM_LIBS=OFF \
99+ -DSKIA_SYNC_EXTERNAL=ON \
100+ -DSKIA_STATIC=ON \
101+ -DSKIA_USE_EGL=ON \
102+ -DLINUX_DEPLOY=ON \
103+ ..
104+ cmake --build .
105+ cp -a libskia.a ${SDK} /lib/
106+ fi # skia
103107
104108# libunwind
105109if [ ! -f " ${SDK} /lib/pkgconfig/libunwind.pc" ]; then
@@ -113,22 +117,4 @@ if [ ! -f "${SDK}/lib/pkgconfig/libunwind.pc" ]; then
113117 make install
114118fi # libunwind
115119
116- # gperftools
117- # if [ ! -f "${GPERF_LIB}" ]; then
118- # cd ${SRC}
119- # GPERF_SRC=gperftools-${GPERF_V}
120- # rm -rf ${GPERF_SRC} || true
121- # rm -rf ${GPERF_DIR} || true
122- # tar xf ${DIST}/${GPERF_SRC}.tar.xz
123- # mv ${GPERF_SRC} ${GPERF_DIR}
124- # cd ${GPERF_DIR}
125- # ./autogen.sh
126- # CC=clang CXX=clang++ \
127- # CFLAGS="${DEFAULT_CFLAGS}" \
128- # CXXFLAGS="${DEFAULT_CFLAGS}" \
129- # LDFLAGS="${DEFAULT_LDFLAGS} -lunwind" \
130- # ./configure ${STATIC_CONFIGURE} --enable-libunwind
131- # make -j${MKJOBS}
132- # fi # gperftools
133-
134120echo " SDK PART 1 DONE"
0 commit comments