2023-08-08 20:22:11 +00:00
|
|
|
#!/bin/bash -e
|
2022-01-13 12:54:19 +00:00
|
|
|
|
2023-12-30 01:19:05 +00:00
|
|
|
VERSION=0.11.6
|
2022-01-13 12:54:19 +00:00
|
|
|
|
2023-09-29 12:58:36 +00:00
|
|
|
cd thirdparty/thorvg/ || true
|
2023-08-08 20:22:11 +00:00
|
|
|
rm -rf AUTHORS LICENSE inc/ src/ *.zip *.tar.gz tmp/
|
2022-01-13 12:54:19 +00:00
|
|
|
|
2023-08-08 20:22:11 +00:00
|
|
|
mkdir tmp/ && pushd tmp/
|
|
|
|
|
2023-09-29 12:58:36 +00:00
|
|
|
# Release
|
2023-08-08 20:22:11 +00:00
|
|
|
curl -L -O https://github.com/thorvg/thorvg/archive/v$VERSION.tar.gz
|
2023-09-29 12:58:36 +00:00
|
|
|
# Current Github main branch tip
|
|
|
|
#curl -L -O https://github.com/thorvg/thorvg/archive/refs/heads/main.tar.gz
|
|
|
|
|
2023-08-08 20:22:11 +00:00
|
|
|
tar --strip-components=1 -xvf *.tar.gz
|
|
|
|
rm *.tar.gz
|
2023-09-29 12:58:36 +00:00
|
|
|
|
|
|
|
# Install from local git checkout "thorvg-git" in the same directory
|
|
|
|
# as godot git checkout.
|
|
|
|
#d="../../../../thorvg-git"
|
|
|
|
#cp -r ${d}/AUTHORS ${d}/inc ${d}/LICENSE ${d}/src .
|
|
|
|
|
2023-08-08 20:22:11 +00:00
|
|
|
find . -type f -name 'meson.build' -delete
|
2022-01-13 12:54:19 +00:00
|
|
|
|
2023-08-08 20:22:11 +00:00
|
|
|
# Fix newline at end of file.
|
|
|
|
for source in $(find ./ -type f \( -iname \*.h -o -iname \*.cpp \)); do
|
|
|
|
sed -i -e '$a\' $source
|
|
|
|
done
|
2022-01-13 12:54:19 +00:00
|
|
|
|
2023-08-08 20:22:11 +00:00
|
|
|
cp -v AUTHORS LICENSE ..
|
|
|
|
cp -rv inc ../
|
2022-01-13 12:54:19 +00:00
|
|
|
|
2023-08-08 20:22:11 +00:00
|
|
|
cat << EOF > ../inc/config.h
|
|
|
|
#ifndef THORVG_CONFIG_H
|
|
|
|
#define THORVG_CONFIG_H
|
|
|
|
|
|
|
|
#define THORVG_SW_RASTER_SUPPORT
|
|
|
|
#define THORVG_SVG_LOADER_SUPPORT
|
2023-10-13 11:09:33 +00:00
|
|
|
#define THORVG_PNG_LOADER_SUPPORT
|
|
|
|
#define THORVG_JPG_LOADER_SUPPORT
|
2022-01-13 12:54:19 +00:00
|
|
|
|
2023-09-29 12:58:36 +00:00
|
|
|
// For internal debugging:
|
|
|
|
//#define THORVG_LOG_ENABLED
|
|
|
|
|
2022-01-13 12:54:19 +00:00
|
|
|
#define THORVG_VERSION_STRING "$VERSION"
|
|
|
|
#endif
|
|
|
|
EOF
|
2023-08-08 20:22:11 +00:00
|
|
|
|
|
|
|
mkdir ../src
|
2023-09-29 12:58:36 +00:00
|
|
|
cp -rv src/common ../src
|
|
|
|
cp -rv src/renderer ../src/
|
|
|
|
|
2023-08-08 20:22:11 +00:00
|
|
|
# Only sw_engine is enabled.
|
2023-09-29 12:58:36 +00:00
|
|
|
rm -rfv ../src/renderer/gl_engine
|
2023-08-08 20:22:11 +00:00
|
|
|
|
2023-10-13 11:09:33 +00:00
|
|
|
# Enabled embedded loaders: raw, JPEG, PNG.
|
2023-08-08 20:22:11 +00:00
|
|
|
mkdir ../src/loaders
|
|
|
|
cp -rv src/loaders/svg src/loaders/raw ../src/loaders/
|
2023-12-30 01:19:05 +00:00
|
|
|
cp -rv src/loaders/jpg ../src/loaders/
|
|
|
|
cp -rv src/loaders/png src/loaders/external_png ../src/loaders/
|
2023-08-08 20:22:11 +00:00
|
|
|
|
|
|
|
popd
|
2023-09-29 12:58:36 +00:00
|
|
|
rm -rf tmp
|
|
|
|
|