2023-08-08 22:22:11 +02:00
|
|
|
#!/bin/bash -e
|
2022-01-13 13:54:19 +01:00
|
|
|
|
2023-09-18 14:49:04 +02:00
|
|
|
VERSION=0.10.7
|
2022-01-13 13:54:19 +01:00
|
|
|
|
2023-08-08 22:22:11 +02:00
|
|
|
rm -rf AUTHORS LICENSE inc/ src/ *.zip *.tar.gz tmp/
|
2022-01-13 13:54:19 +01:00
|
|
|
|
2023-08-08 22:22:11 +02:00
|
|
|
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
|
2022-01-13 13:54:19 +01:00
|
|
|
|
2023-08-08 22:22:11 +02: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 13:54:19 +01:00
|
|
|
|
2023-08-08 22:22:11 +02:00
|
|
|
cp -v AUTHORS LICENSE ..
|
|
|
|
cp -rv inc ../
|
2022-01-13 13:54:19 +01:00
|
|
|
|
2023-08-08 22:22:11 +02:00
|
|
|
cat << EOF > ../inc/config.h
|
|
|
|
#ifndef THORVG_CONFIG_H
|
|
|
|
#define THORVG_CONFIG_H
|
|
|
|
|
|
|
|
#define THORVG_SW_RASTER_SUPPORT
|
|
|
|
|
|
|
|
#define THORVG_SVG_LOADER_SUPPORT
|
2022-01-13 13:54:19 +01:00
|
|
|
|
|
|
|
#define THORVG_VERSION_STRING "$VERSION"
|
|
|
|
#endif
|
|
|
|
EOF
|
2023-08-08 22:22:11 +02:00
|
|
|
|
|
|
|
mkdir ../src
|
2023-09-18 14:49:04 +02:00
|
|
|
cp -rv src/lib src/utils ../src/
|
2023-08-08 22:22:11 +02:00
|
|
|
# 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/
|