Skip to content

Support macOS frameworks; update CI workflows for alr v2(.0.1). #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ jobs:
uses: actions/checkout@v4
-
name: alire-project/setup-alire
uses: alire-project/setup-alire@v2
uses: alire-project/setup-alire@v3
-
name: Install toolchain
run: |
alr --non-interactive config --global --set toolchain.assistant false
alr --non-interactive toolchain --install gnat_native
alr --non-interactive toolchain --install gprbuild
alr --non-interactive settings --global --set toolchain.assistant false
alr --non-interactive toolchain --select gnat_native
alr --non-interactive toolchain --select gprbuild
-
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/ci-macos-fw.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---

name: CI macOS (Frameworks)

on:
workflow_dispatch:
pull_request:

jobs:
build:
name: CI on macOS (Frameworks)

runs-on: macos-12

steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: alire-project/setup-alire
uses: alire-project/setup-alire@v3
-
name: Install toolchain
run: |
alr --non-interactive settings --global --set toolchain.assistant false
alr --non-interactive toolchain --select gnat_native
alr --non-interactive toolchain --select gprbuild
-
name: Disable Homebrew
run: rm -f $(which brew)
shell: bash
-
name: Install SDL2.framework to ~/Library/Frameworks
uses: BrettDong/setup-sdl2-frameworks@main
-
name: Copy SDL2.framework to /Library/Frameworks
run: sudo cp -pR ~/Library/Frameworks/SDL2.framework /Library/Frameworks
shell: bash
-
name: Build and run
run: |
alr --non-interactive build
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
---

name: CI macOS
name: CI macOS (Homebrew)

on:
workflow_dispatch:
pull_request:

jobs:
build:
name: CI on macOS
name: CI on macOS (Homebrew)

runs-on: macos-latest
runs-on: macos-12

steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: alire-project/setup-alire
uses: alire-project/setup-alire@v2
uses: alire-project/setup-alire@v3
-
name: Install toolchain
run: |
alr --non-interactive config --global --set toolchain.assistant false
alr --non-interactive toolchain --install gnat_native
alr --non-interactive toolchain --install gprbuild
alr --non-interactive settings --global --set toolchain.assistant false
alr --non-interactive toolchain --select gnat_native
alr --non-interactive toolchain --select gprbuild
-
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/ci-macos-mp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---

name: CI macOS (Macports)

on:
workflow_dispatch:
pull_request:

jobs:
build:
name: CI on macOS (Macports)

runs-on: macos-12

steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: alire-project/setup-alire
uses: alire-project/setup-alire@v3
-
name: Install toolchain
run: |
alr --non-interactive settings --global --set toolchain.assistant false
alr --non-interactive toolchain --select gnat_native
alr --non-interactive toolchain --select gprbuild
-
name: Disable Homebrew
run: rm -f $(which brew)
shell: bash
-
name: Install MacPorts
uses: melusina-org/setup-macports@v1
-
name: Build and run
run: |
alr --non-interactive build
6 changes: 2 additions & 4 deletions .github/workflows/ci-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ jobs:
uses: actions/checkout@v4
-
name: alire-project/setup-alire
uses: alire-project/setup-alire@v2
uses: alire-project/setup-alire@v3
-
name: Install toolchain
run: |
alr --non-interactive config --global --set toolchain.assistant false
alr --non-interactive toolchain --install gnat_native
alr --non-interactive toolchain --install gprbuild
alr --non-interactive settings --global --set toolchain.assistant false
alr --non-interactive toolchain --select gnat_native
alr --non-interactive toolchain --select gprbuild
-
Expand Down
8 changes: 4 additions & 4 deletions alire.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ project-files = ["build/gnat/sdlada.gpr"] #, "build/gnat/"]
[gpr-set-externals.'case(os)']
linux = { SDL_PLATFORM = "linux" }
windows = { SDL_PLATFORM = "windows" }
macos = { SDL_PLATFORM = "macosx" }
# [gpr-set-externals.'case(distribution)']
# homebrew = { SDL_PLATFORM = "macos_homebrew" }
# macports = { SDL_PLATFORM = "macos_ports" }
[gpr-set-externals.'case(os)'.macos.'case(distribution)']
homebrew = { SDL_PLATFORM = "macos_homebrew" }
macports = { SDL_PLATFORM = "macos_ports" }
'...' = { SDL_PLATFORM = "macosx" }

[[actions]]
type = "pre-build"
Expand Down
4 changes: 4 additions & 0 deletions build/gnat/sdlada.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ library project SDLAda is
"-I/opt/local/include",
"-D_REENTRANT");

when "macosx" =>
C_Switches := C_Switches & ("-F/Library/Frameworks",
"-D_THREAD_SAFE");

when others =>
null;
end case;
Expand Down
4 changes: 2 additions & 2 deletions src/link/macosx/sdl_linker.ads
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
package SDL_Linker is
pragma Pure;

Options : constant String := "-F/Library/Frameworks -framework SDL2";
end SDL_Linker;
Options : constant String := "-Wl,-F/Library/Frameworks,-framework,SDL2";
end SDL_Linker;
2 changes: 1 addition & 1 deletion src/link/nix/sdl_linker.ads
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ package SDL_Linker is
pragma Pure;

Options : constant String := "-lSDL2";
end SDL_Linker;
end SDL_Linker;
Loading