diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16085b8..9929e57 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,9 @@ jobs: os: windows-latest - perl-version: '5.30' os: macos-latest + - perl-version: '5.30' + os: macos-latest + apple-glx: true steps: - uses: actions/checkout@v2 - name: 'ci-dist: target-setup-perl' @@ -32,6 +35,11 @@ jobs: perl-version: ${{ matrix.perl-version }} - name: Install dependencies uses: Perl-GPU/devops/github-actions/install-dep-opengl-modern-dep@main + - name: 'Use XQuartz/GLX' + if: matrix.apple-glx + run: | + echo "OGLM_APPLE_GLX=1" >> $GITHUB_ENV + brew install --cask xquartz - name: 'ci-dist: target-all' uses: Perl-GPU/devops/github-actions/ci-dist@main with: diff --git a/Makefile.PL b/Makefile.PL index 52c893c..06cd216 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -13,11 +13,17 @@ if ( $^O eq 'MSWin32' ) { } elsif ( $^O eq 'cygwin' ) { $libs = '-lGL -lX11'; } elsif ( $^O eq 'darwin' ) { - $DYNS = { 'OTHERLDFLAGS' => '-framework OpenGL' }; $define .= " -Wno-compound-token-split-by-macro -DGL_SILENCE_DEPRECATION"; + if ( $ENV{OGLM_APPLE_GLX} ) { + $define .= " -DGLEW_APPLE_GLX -I/opt/X11/include"; + $libs = '-L/opt/X11/lib -lglut'; + } else { + $DYNS = { 'OTHERLDFLAGS' => '-framework OpenGL' }; + } } else { $libs = '-lGL -lX11'; } + my %buildargs = ( !$libs ? () : (LIBS => $libs), DEFINE => $define,