From 5c18b68f6f5b412dfac41600ae1cbc18d4ff4abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Belin?= Date: Fri, 27 Sep 2024 00:46:01 +0200 Subject: [PATCH] Try to fix the macOS compilation --- .github/workflows/ci.yaml | 2 +- src/setup_hashlink/Setup.hx | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 02168e1..b3b5285 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,7 +33,7 @@ jobs: runs-on: ${{matrix.platform}} strategy: matrix: - platform: [ubuntu-latest, windows-latest] + platform: [macos-latest, ubuntu-latest, windows-latest] steps: - uses: cedx/setup-hashlink@main - run: hl --version diff --git a/src/setup_hashlink/Setup.hx b/src/setup_hashlink/Setup.hx index 106f8ec..a15c900 100644 --- a/src/setup_hashlink/Setup.hx +++ b/src/setup_hashlink/Setup.hx @@ -89,9 +89,17 @@ class Setup { /** Compiles the HashLink sources on the macOS platform. **/ function compileMacOs(): Promise { - final commands = ["brew bundle", "make", "sudo make codesign_osx", "sudo make install"]; + final prefix = "/usr/local"; + final commands = [ + "brew bundle", + "make", + "sudo make codesign_osx", + "sudo make install", + 'sudo install_name_tool -change libhl.dylib $prefix/lib/libhl.dylib $prefix/bin/hl' + ]; + commands.iter(command -> Sys.command(command)); - return Promise.resolve("/usr/local"); + return Promise.resolve(prefix); } /** Determines the name of the single subfolder in the specified `directory`. **/