-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·30 lines (22 loc) · 966 Bytes
/
build.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
#!/bin/bash
cp -r gtklib ../mnt
cp -r gtkapp ../mnt
cp -r tesseract-ocr ../mnt
cd ../mnt
# build the gtk app for windows target
PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_PATH="/app/gtklib/mingw64/lib/pkgconfig" RUSTFLAGS="-L /app/gtklib/mingw64/lib" cargo build --target=x86_64-pc-windows-gnu --bin live-ocr-translator --release
# copy the exe
cp target/x86_64-pc-windows-gnu/release/live-ocr-translator.exe gtkapp
# copy gdbus.exe and required dlls
cp gtklib/mingw64/bin/*.dll gtkapp
cp gtklib/mingw64/bin/gdbus.exe gtkapp
# compile schemas
glib-compile-schemas gtklib/mingw64/share/glib-2.0/schemas
# copy remaining required files
cp gtklib/mingw64/share/glib-2.0/schemas/gschemas.compiled gtkapp/share/glib-2.0/schemas/gschemas.compiled \
&& cp -r gtklib/mingw64/share/icons/* gtkapp/share/icons \
&& cp -r gtklib/mingw64/lib/gdk-pixbuf-2.0 gtkapp/lib \
&& cp -r assets gtkapp \
&& cp -a tesseract-ocr/. gtkapp
rm -r gtklib
rm -r tesseract-ocr