Skip to content

Commit

Permalink
Create a setup script for Windows that creates cabal.project.local
Browse files Browse the repository at this point in the history
  • Loading branch information
yutotakano committed Aug 10, 2024
1 parent 13037df commit d9216e1
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 87 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/windows-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
run: cabal update

- name: Build project
run: cabal build
run: |
win_setup.bat
cabal build
- name: Create a zip with exe file and assets
run: |
Expand Down
6 changes: 0 additions & 6 deletions HaskellGameJamTemplate.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ maintainer: changeme@ed.ac.uk
-- copyright:

category: Game
build-type: Custom

custom-setup
setup-depends: base >= 4.10.0.0,
Cabal >= 3.6,
directory ^>= 1.3.0.0

executable Game
ghc-options: -Wall
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ On Linux/OSX, SDL2 is found in the system package manager.
On Linux, run: apt-get install libsdl2-dev
On OSX, run: brew install sdl2

For Windows, SDL2 development libraries are provided within the repository, and
Setup.hs (run automatically during the build process) should find them.
For Windows, SDL2 development libraries are provided within the repository.
Run `win_setup.bat` to create a file that specifies where to find these libraries.
78 changes: 0 additions & 78 deletions Setup.hs

This file was deleted.

3 changes: 3 additions & 0 deletions cabal.project.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package sdl2
extra-lib-dirs: "G:\\Projects\\Programming\\yutotakano\\HaskellGameJamTemplate\\sdl2_win_mingw\\lib"
extra-include-dirs: "G:\\Projects\\Programming\\yutotakano\\HaskellGameJamTemplate\\sdl2_win_mingw\\include\\SDL2"
11 changes: 11 additions & 0 deletions win_setup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@echo off

rem Create a cabal.project.local file containing the path to the local SDL2 libraries

(
echo.package sdl2
echo. extra-lib-dirs: "%cd:\=\\%\\sdl2_win_mingw\\lib"
echo. extra-include-dirs: "%cd:\=\\%\\sdl2_win_mingw\\include\\SDL2"
)>"cabal.project.local"
echo Setup complete! Try running 'cabal run' to build the project.
echo If you encounter problems, try asking Discord.

0 comments on commit d9216e1

Please sign in to comment.