summaryrefslogtreecommitdiffstats
path: root/thirdparty/thorvg/update-thorvg.sh
diff options
context:
space:
mode:
authorMartin Capitanio <capnm@capitanio.org>2023-08-08 22:22:11 +0200
committerMartin Capitanio <capnm@capitanio.org>2023-08-09 17:15:59 +0200
commitac9e259d3ed9df6a096d7383299bf544cb4d8ee4 (patch)
treef8f127b38976f1a765ebc80827c42eede825db21 /thirdparty/thorvg/update-thorvg.sh
parent11ea4dc46647693eb41179b641b3c4f261b4fef4 (diff)
downloadredot-engine-ac9e259d3ed9df6a096d7383299bf544cb4d8ee4.tar.gz
Update ThorVG to v0.10.0
- Release Notes: https://github.com/thorvg/thorvg/releases/tag/v0.10.0 - API change ARGB8888_STRAIGHT -> ARGB8888S - SVG-SCsub: Enable static ThorVG object linking - SVG-SCsub: avoid building unused ThorVG parts - update-thorvg.sh: add v0.10.0 and copy only the Godot relevant code
Diffstat (limited to 'thirdparty/thorvg/update-thorvg.sh')
-rwxr-xr-xthirdparty/thorvg/update-thorvg.sh58
1 files changed, 37 insertions, 21 deletions
diff --git a/thirdparty/thorvg/update-thorvg.sh b/thirdparty/thorvg/update-thorvg.sh
index 4eb7bf47ed..f57824872b 100755
--- a/thirdparty/thorvg/update-thorvg.sh
+++ b/thirdparty/thorvg/update-thorvg.sh
@@ -1,31 +1,47 @@
-VERSION=0.9.0
-rm -rf AUTHORS inc LICENSE src *.zip
-curl -L -O https://github.com/thorvg/thorvg/archive/v$VERSION.zip
-bsdtar --strip-components=1 -xvf *.zip
-rm *.zip
-rm -rf .github docs pc res test tools tvgcompat .git* *.md *.txt wasm_build.sh CODEOWNERS
-find . -type f -name 'meson.build' -delete
-rm -rf src/bin src/bindings src/examples src/wasm
-rm -rf src/lib/gl_engine src/loaders/external_jpg src/loaders/png
-cat << EOF > inc/config.h
-#ifndef THORVG_CONFIG_H
-#define THORVG_CONFIG_H
+#!/bin/bash -e
-#define THORVG_SW_RASTER_SUPPORT 1
+VERSION=0.10.0
-#define THORVG_SVG_LOADER_SUPPORT 1
+rm -rf AUTHORS LICENSE inc/ src/ *.zip *.tar.gz tmp/
-#define THORVG_PNG_LOADER_SUPPORT 1
+mkdir tmp/ && pushd tmp/
+
+curl -L -O https://github.com/thorvg/thorvg/archive/v$VERSION.tar.gz
+tar --strip-components=1 -xvf *.tar.gz
+rm *.tar.gz
+find . -type f -name 'meson.build' -delete
-#define THORVG_TVG_LOADER_SUPPORT 1
+# Fix newline at end of file.
+for source in $(find ./ -type f \( -iname \*.h -o -iname \*.cpp \)); do
+ sed -i -e '$a\' $source
+done
-#define THORVG_TVG_SAVER_SUPPORT 1
+cp -v AUTHORS LICENSE ..
+cp -rv inc ../
-#define THORVG_JPG_LOADER_SUPPORT 1
+cat << EOF > ../inc/config.h
+#ifndef THORVG_CONFIG_H
+#define THORVG_CONFIG_H
+
+#define THORVG_SW_RASTER_SUPPORT
+
+#define THORVG_SVG_LOADER_SUPPORT
#define THORVG_VERSION_STRING "$VERSION"
#endif
EOF
-for source in $(find ./ -type f \( -iname \*.h -o -iname \*.cpp \)); do
- sed -i -e '$a\' $source
-done
+
+mkdir ../src
+cp -rv src/lib ../src/
+# Only sw_engine is enabled.
+rm -rfv ../src/lib/gl_engine
+
+# Only svg loader is enabled.
+mkdir ../src/loaders
+cp -rv src/loaders/svg src/loaders/raw ../src/loaders/
+
+# Future versions
+# cp -rv src/utils ../src
+
+popd
+rm -rf tmp/