Skip to content

Commit 6371690

Browse files
committed
Major fix: Use official MSYS2 GitHub Action for proper autotools setup
- Replace manual MSYS2 installation with msys2/setup-msys2@v2 action - Install complete base-devel group with all autotools - Add proper MSYS2 shell for verification steps - Update CMakeLists.txt to find MSYS2 in GitHub Actions location - Remove explicit PATH manipulation - let setup-msys2 handle environment - Should finally resolve autotools not found issues
1 parent 46b5b69 commit 6371690

File tree

2 files changed

+36
-17
lines changed

2 files changed

+36
-17
lines changed

.github/workflows/build-windows.yml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,41 @@ jobs:
3333
- name: Setup MSVC
3434
uses: microsoft/[email protected]
3535

36-
- name: Setup build tools
36+
- name: Setup MSYS2 with autotools
37+
uses: msys2/setup-msys2@v2
38+
with:
39+
msystem: MSYS
40+
install: >-
41+
base-devel
42+
autoconf
43+
automake
44+
libtool
45+
make
46+
pkgconf
47+
autoconf-archive
48+
mingw-w64-x86_64-gcc
49+
mingw-w64-x86_64-binutils
50+
mingw-w64-x86_64-pkg-config
51+
update: true
52+
53+
- name: Install NSIS
3754
run: |
3855
# Install NSIS for installer creation
3956
choco install nsis -y
40-
# Install MSYS2 for Unix tools (needed for atari800 autotools build)
41-
choco install msys2 -y
42-
# Initialize MSYS2 and install required packages for atari800 build
43-
C:\tools\msys64\usr\bin\bash.exe -lc "pacman -Syu --noconfirm"
44-
C:\tools\msys64\usr\bin\bash.exe -lc "pacman -S --noconfirm autoconf automake make pkgconf libtool autoconf-archive mingw-w64-x86_64-gcc mingw-w64-x86_64-binutils mingw-w64-x86_64-pkg-config"
45-
# Add tools to PATH
57+
# Add NSIS to PATH
4658
echo "C:\Program Files (x86)\NSIS" >> $GITHUB_PATH
47-
echo "C:\tools\msys64\usr\bin" >> $GITHUB_PATH
48-
echo "C:\tools\msys64\mingw64\bin" >> $GITHUB_PATH
4959
5060
- name: Verify MSYS2 setup
61+
shell: msys2 {0}
5162
run: |
5263
# Verify MSYS2 tools are available
53-
C:\tools\msys64\usr\bin\bash.exe -lc "which gcc && gcc --version"
54-
C:\tools\msys64\usr\bin\bash.exe -lc "which make && make --version"
55-
C:\tools\msys64\usr\bin\bash.exe -lc "which autoconf && autoconf --version"
56-
C:\tools\msys64\usr\bin\bash.exe -lc "which aclocal && aclocal --version"
57-
C:\tools\msys64\usr\bin\bash.exe -lc "which automake && automake --version"
64+
echo "=== Checking MSYS2 Tools ==="
65+
which gcc && gcc --version | head -1
66+
which make && make --version | head -1
67+
which autoconf && autoconf --version | head -1
68+
which aclocal && aclocal --version | head -1
69+
which automake && automake --version | head -1
70+
echo "=== MSYS2 Setup Complete ==="
5871
5972
- name: Create build directory
6073
run: mkdir build-release

CMakeLists.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,19 @@ set(ATARI800_LIBRARY "${ATARI800_SOURCE_DIR}/src/libatari800.a")
5151
# Configure platform-specific build commands for atari800
5252
if(WIN32)
5353
# Windows: Use MSYS2 environment for building atari800
54-
find_program(MSYS2_BASH bash.exe PATHS "C:/tools/msys64/usr/bin" "C:/msys64/usr/bin" DOC "MSYS2 bash executable")
54+
# The setup-msys2 GitHub Action creates MSYS2 at D:/a/_temp/msys64
55+
find_program(MSYS2_BASH bash.exe PATHS
56+
"D:/a/_temp/msys64/usr/bin"
57+
"C:/tools/msys64/usr/bin"
58+
"C:/msys64/usr/bin"
59+
DOC "MSYS2 bash executable")
5560
if(NOT MSYS2_BASH)
5661
message(FATAL_ERROR "MSYS2 bash not found. Please install MSYS2 or ensure it's in the expected location.")
5762
endif()
5863

59-
set(ATARI800_CONFIGURE_COMMAND ${MSYS2_BASH} -l -c "export PATH=/usr/bin:/mingw64/bin:$PATH && cd '<SOURCE_DIR>' && '${CMAKE_CURRENT_SOURCE_DIR}/scripts/configure-atari800.sh' '<SOURCE_DIR>'")
60-
set(ATARI800_BUILD_COMMAND ${MSYS2_BASH} -l -c "export PATH=/usr/bin:/mingw64/bin:$PATH && cd '<SOURCE_DIR>' && make -j4")
64+
message(STATUS "Found MSYS2 bash: ${MSYS2_BASH}")
65+
set(ATARI800_CONFIGURE_COMMAND ${MSYS2_BASH} -l -c "cd '<SOURCE_DIR>' && '${CMAKE_CURRENT_SOURCE_DIR}/scripts/configure-atari800.sh' '<SOURCE_DIR>'")
66+
set(ATARI800_BUILD_COMMAND ${MSYS2_BASH} -l -c "cd '<SOURCE_DIR>' && make -j4")
6167
else()
6268
# Unix/macOS: Use native tools
6369
set(ATARI800_CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/configure-atari800.sh <SOURCE_DIR>)

0 commit comments

Comments
 (0)