Skip to content

Commit 92e52df

Browse files
committed
CI: Fix build for Fhex 3
1 parent 2cf21ab commit 92e52df

File tree

3 files changed

+39
-8
lines changed

3 files changed

+39
-8
lines changed

.github/workflows/windows.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,54 @@ jobs:
1717
runs-on: windows-latest
1818
strategy:
1919
matrix:
20-
python-version: [3.6]
20+
python-version: [3.9]
2121
steps:
2222
- uses: actions/checkout@v2
2323
- uses: actions/setup-python@v2
2424
- name: Install Qt
2525
uses: jurplel/install-qt-action@v2
2626
with:
27-
arch: win64_mingw73
27+
arch: win64_mingw81
2828
modules: qtcharts
29+
- name: Install Keystone
30+
shell: bash
31+
run: |
32+
mkdir lib
33+
curl -L https://github.com/keystone-engine/keystone/releases/download/0.9.2/keystone-0.9.2-win64.zip -o keystone.zip
34+
unzip keystone.zip
35+
echo "Installing Keystone along MinGW and QT - in $Qt5_Dir"
36+
cd keystone-*
37+
mv *.dll ../lib
38+
cp -rv include/* $Qt5_Dir/include
39+
cd ..
40+
rm -rf keystone.zip keystone-*
41+
- name: Install Capstone
42+
shell: bash
43+
run: |
44+
curl -L https://github.com/aquynh/capstone/releases/download/4.0.2/capstone-4.0.2-win64.zip -o capstone.zip
45+
unzip capstone.zip
46+
echo "Installing Capstone along MinGW and QT - in $Qt5_Dir"
47+
cd capstone-*
48+
mv *.dll ../lib
49+
cp -rv include/* $Qt5_Dir/include
50+
cd ..
51+
rm -rf capstone.zip capstone-*
2952
- name: Call qmake
3053
shell: cmd
3154
# Inspired by https://github.com/jurplel/install-qt-action/blob/master/.github/workflows/test.yml
3255
run: |
3356
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
3457
qmake fhex.pro
3558
- name: Compile the project with make
36-
run: make
59+
run: |
60+
dir
61+
make -j
3762
- name: Add required MinGW DLLs
3863
shell: cmd
3964
# We will also need visual studio tools here to find out the dependencies (dumpbin)
4065
run: |
4166
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
42-
python36 bundle-exe-with-dlls.py
67+
python bundle-exe-with-dlls.py
4368
- name: Add QT dependencies with WinDeploy
4469
shell: cmd
4570
# Disabled angle and opengl since we don't do 3D graphics here (yet?)

bundle-exe-with-dlls.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
# Determine the destination directory
66
dest_dir="fhex-{}-{}".format(time.strftime("%Y%m%d%H%M%S"), os.environ['GITHUB_SHA'])
77
# Set it as an environment variable (for the next steps)
8-
print("::set-env name=BUNDLE_DIR::{}".format(dest_dir))
8+
with open(os.environ['GITHUB_ENV'], 'a') as f:
9+
f.writelines([
10+
"BUNDLE_DIR=%s" % dest_dir,
11+
])
912

1013
os.mkdir(dest_dir)
1114

@@ -25,8 +28,11 @@
2528
if dep[-4:] != ".dll":
2629
continue
2730
# Find the DLL
28-
dll_path = os.popen("where {}".format(dep)).readlines()
29-
dll_path = dll_path[0].strip()
31+
dll_path = 'lib/%s' % dep
32+
# If not found in our custom lib directory, ask the system
33+
if not os.path.isfile(dll_path):
34+
dll_path = os.popen("where {}".format(dep)).readlines()
35+
dll_path = dll_path[0].strip()
3036
# If it's in system 32, it's safe to assume it's provided by Windows
3137
if dll_path.lower().startswith("c:\\windows\\system32"):
3238
print("Skipping {}", dll_path)

fhex.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ HEADERS += \
4646
src/core/hexeditor.h \
4747
src/qhexedit.h
4848

49-
QMAKE_LFLAGS += -lkeystone -lcapstone
49+
QMAKE_LFLAGS += -lkeystone -lcapstone -L./lib

0 commit comments

Comments
 (0)