-
Notifications
You must be signed in to change notification settings - Fork 1
/
builder.sh
executable file
·75 lines (60 loc) · 2.25 KB
/
builder.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
#!/bin/sh
############################################################################
# Copyright (c) 2020-2023 Silvio Clecio (silvioprog) <[email protected]>
#
# SPDX-License-Identifier: MIT
############################################################################
set -e
workdir=/sagui/libsagui
dist=/sagui/output
cmake_cmd="cmake -Wno-dev"
clean() {
cd $workdir
rm -rf ./build
mkdir build
cd build
}
version=$(curl -s https://raw.githubusercontent.com/risoflora/libsagui/main/include/sagui.h | sed -n 's/#define SG_VERSION_\(.*\) \([0-9]\)/\2/p' | tr '\n' '.' | sed 's/.$//')
git clone https://github.com/risoflora/libsagui.git libsagui
# linux_amd64
clean
$cmake_cmd -DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=./Output ..
make package
cp "libsagui-$version.tar.gz" "$dist/libsagui-$version-linux_amd64.tar.gz"
# linux_amd64 (TLS)
$cmake_cmd -DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=./Output -DSG_HTTPS_SUPPORT=ON ..
make package
cp "libsagui-$version.tar.gz" "$dist/libsagui_tls-$version-linux_amd64.tar.gz"
# windows_amd64
clean
$cmake_cmd -DMINGW64=ON -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-mingw32-Linux.cmake" ..
make package
cp "libsagui-$version.zip" "$dist/libsagui-$version-windows_amd64.zip"
# windows_amd64 (TLS)
$cmake_cmd -DMINGW64=ON -DSG_HTTPS_SUPPORT=ON ..
make package
cp "libsagui-$version.zip" "$dist/libsagui_tls-$version-windows_amd64.zip"
# windows_386
clean
$cmake_cmd -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-mingw32-Linux.cmake" ..
make package
cp "libsagui-$version.zip" "$dist/libsagui-$version-windows_386.zip"
# windows_386 (TLS)
$cmake_cmd -DSG_HTTPS_SUPPORT=ON ..
make package
cp "libsagui-$version.zip" "$dist/libsagui_tls-$version-windows_386.zip"
# gnutls (i686)
gnutls_version=$(mingw32-pkg-config gnutls --modversion)
zip -9 "$dist/gnutls-${gnutls_version}-mingw_386.zip" /usr/i686-w64-mingw32/sys-root/mingw/bin/*.dll
# gnutls (x86_64)
gnutls_version=$(mingw64-pkg-config gnutls --modversion)
zip -9 "$dist/gnutls-${gnutls_version}-mingw_amd64.zip" /usr/x86_64-w64-mingw32/sys-root/mingw/bin/*.dll
# docs
clean
$cmake_cmd -DSG_BUILD_HTML=ON -DSG_HTTPS_SUPPORT=ON ..
make doc
optipng -o7 docs/html/*.png
cp -r docs/html $dist/
# checksums
cd $dist/
sha256sum ./*.tar.gz ./*.zip >"libsagui-${version}_checksums.txt"