Skip to content

Commit fcf1b28

Browse files
committed
add yml
1 parent 4c73e3f commit fcf1b28

File tree

4 files changed

+91
-3
lines changed

4 files changed

+91
-3
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: windows-x64 (msys2 mingw64, mintty runtime)
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: ["**"]
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
submodules: recursive
17+
18+
- name: Setup MSYS2 (mingw64)
19+
uses: msys2/setup-msys2@v2
20+
with:
21+
msystem: MINGW64
22+
update: true
23+
install: >-
24+
mingw-w64-x86_64-toolchain
25+
mingw-w64-x86_64-cmake
26+
mingw-w64-x86_64-ninja
27+
mingw-w64-x86_64-ncurses
28+
zip
29+
30+
- name: Configure
31+
shell: msys2 {0}
32+
run: |
33+
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
34+
35+
- name: Build
36+
shell: msys2 {0}
37+
run: |
38+
cmake --build build
39+
40+
- name: Package (exe + dlls)
41+
shell: msys2 {0}
42+
run: |
43+
set -euxo pipefail
44+
mkdir -p dist
45+
46+
# 1) binary
47+
if [ -f build/StrucTTY.exe ]; then
48+
cp build/StrucTTY.exe dist/
49+
elif [ -f build/StrucTTY ]; then
50+
cp build/StrucTTY dist/StrucTTY.exe
51+
else
52+
echo "ERROR: StrucTTY binary not found"
53+
find build -maxdepth 3 -type f -name "*.exe" -o -name "StrucTTY*" || true
54+
exit 1
55+
fi
56+
57+
find build -type f \( -name "libgemmi*.dll" -o -name "gemmi*.dll" \) -print -exec cp -n {} dist/ \; || true
58+
59+
ldd dist/StrucTTY.exe | awk '{print $3}' | grep -E '^/mingw64/bin/.*\.dll$' | xargs -r -I{} cp -n {} dist/
60+
61+
if [ -d /mingw64/share/terminfo ]; then
62+
cp -r /mingw64/share/terminfo dist/terminfo
63+
fi
64+
65+
cat > dist/run_structty.sh <<'SH'
66+
#!/usr/bin/env bash
67+
set -e
68+
export PATH="$(cd "$(dirname "$0")" && pwd):$PATH"
69+
if [ -d "$(dirname "$0")/terminfo" ]; then
70+
export TERMINFO="$(cd "$(dirname "$0")" && pwd)/terminfo"
71+
fi
72+
exec "$(dirname "$0")/StrucTTY.exe" "$@"
73+
SH
74+
chmod +x dist/run_structty.sh
75+
76+
# licenses
77+
cp -n LICENSE dist/ || true
78+
cp -n THIRD_PARTY_NOTICES.md dist/ || true
79+
cp -r third_party_licenses dist/ || true
80+
81+
cd dist
82+
zip -r ../StrucTTY-windows-x64.zip .
83+
84+
- name: Upload artifact
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: StrucTTY-windows-x64
88+
path: StrucTTY-windows-x64.zip

src/structty.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include <iostream>
2-
#include <ncurses.h>
2+
#include <curses.h>
33
#include <unistd.h>
44
#include "Protein.hpp"
55
#include "Parameters.hpp"

src/visualization/Panel.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <string>
66
#include <sstream>
77
#include <iostream>
8-
#include <ncurses.h>
8+
#include <curses.h>
99
#include <cstring>
1010

1111
struct Entry {

src/visualization/Screen.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <cmath>
1010
#include <iostream>
1111
#include <unordered_map>
12-
#include <ncurses.h>
12+
#include <curses.h>
1313
#include <cstdlib>
1414
#include <algorithm> // clamp, max
1515
#include <limits> // numeric_limits

0 commit comments

Comments
 (0)