-
Notifications
You must be signed in to change notification settings - Fork 62
86 lines (84 loc) · 4.06 KB
/
windows.yml
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
76
77
78
79
80
81
82
83
84
85
86
name: MinGW Windows Nightly Build
on:
push:
branches:
- master
jobs:
mingw:
runs-on: ubuntu-latest
container:
image: registry.fedoraproject.org/fedora:33
options: --privileged
steps:
- uses: actions/checkout@v4
- name: Download dependencies 📥
run: |
dnf install -y "dnf-command(config-manager)" curl git patch
dnf install -y gcc-c++ meson
dnf install -y mingw64-filesystem mingw64-gcc-c++
dnf install -y mingw64-winpthreads-static
dnf install -y mingw64-gtkmm30 mingw64-gtksourceviewmm3 mingw64-jsoncpp mingw64-zlib mingw64-fontconfig mingw64-librsvg2
dnf install -y adwaita-icon-theme gtk-update-icon-cache
- name: Install Rust 🦀
run: |
export RUSTUP_HOME=/usr/rustup \
CARGO_HOME=/usr/cargo \
PATH=/usr/cargo/bin:$PATH
curl --proto '=https' --tlsv1.2 -sSf -o /tmp/rustup-init.sh https://sh.rustup.rs
sh /tmp/rustup-init.sh -y --no-modify-path -t x86_64-pc-windows-gnu
- name: Build uutils coreutils 🍷
run: |
export RUSTUP_HOME=/usr/rustup \
CARGO_HOME=/usr/cargo \
PATH=/usr/cargo/bin:$PATH
git clone https://github.com/uutils/coreutils.git && cd coreutils
git checkout $(git describe --abbrev=0 --tags)
cargo build --target=x86_64-pc-windows-gnu --release -p uu_mkdir -p uu_touch -p uu_mv -p uu_rm
- name: Install cLaTeXMath 🖋
run: |
dnf config-manager --add-repo https://download.opensuse.org/repositories/home:sp1rit:mingw/Fedora_33/home:sp1rit:mingw.repo
dnf install -y mingw64-clatexmath mingw64-clatexmath-static
- name: Configure 🔧
run: meson --prefix=/ --cross-file=/usr/share/mingw/toolchain-mingw64.meson --default-library shared bin-x86_64-w64-mingw32
- name: Compile 🎲
run: ninja -C bin-x86_64-w64-mingw32
- name: Build Windows-compatible directory 📁
run: |
mkdir dist
DESTDIR="$PWD/dist/" ninja -C bin-x86_64-w64-mingw32 install
#cp $(x86_64-w64-mingw32-objdump -p dist/bin/notekit.exe | grep "DLL Name" | awk '{print $3}' | grep -vE '(KERNEL|msvcrt)' | sed "s|^|/usr/x86_64-w64-mingw32/sys-root/mingw/bin/|" | tr "\n" " ") dist/bin/
# fuck it, we'll ship the whole bin/ folder for now
cp -r /usr/x86_64-w64-mingw32/sys-root/mingw/bin/* dist/bin/
mv dist/share/ dist/bin/
mv dist/bin/share/notekit/{data,sourceview} dist/bin/
# copy share dir from mingw root to release
cp -r /usr/x86_64-w64-mingw32/sys-root/mingw/share/* dist/bin/share/
# copy clatexmath to direct path, as it's autodetection does not work
cp -r dist/bin/share/clatexmath/ dist/bin/data/latex
# add gtk-pixbuf libs
mkdir dist/bin/lib/
cp -r /usr/x86_64-w64-mingw32/sys-root/mingw/lib/gdk-pixbuf-2.0 dist/bin/lib/
# I'd advise against patching auto-generated files, however to run gtk-pixbuf-query-loaders.exe we'd need wine
sed 's|^"\.\./lib/|"./lib/|' -i dist/bin/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
# add Adwaita icons
cp -r /usr/share/icons/Adwaita/ dist/bin/data/icons/
# generate icon cache for notekit icons
gtk-update-icon-cache dist/bin/data/icons/hicolor/
# recompile gsettings schema cache
glib-compile-schemas dist/bin/share/glib-2.0/schemas/gnome
# add rust uutils coreutils
cp coreutils/target/x86_64-pc-windows-gnu/release/{mkdir,touch,mv,rm}.exe dist/bin/
# add notesbase folder and put README.md into it
mkdir dist/bin/notesbase
cp README.md dist/bin/notesbase
cp LICENSE dist/
#
mv dist/bin/ dist/notekit/
pushd dist/
zip -9r notekit_mingw.zip notekit/ LICENSE
popd
- name: Upload nightly Windows build 📤
uses: actions/upload-artifact@v2
with:
name: NoteKit - Windows x86_64 nightly build
path: dist/notekit_mingw.zip