From 5c88b3ea7900008ae3c0f882f4a33b5b908898a3 Mon Sep 17 00:00:00 2001 From: Dmitry Karasik Date: Mon, 23 Feb 2026 14:43:39 -0300 Subject: [PATCH 1/3] second shot at XQuartz/OpenGL support with suggested env As agreed in https://github.com/Perl-GPU/OpenGL-Modern/pull/66, here's the next iteration that would allow linking the module with XQuartz libraries. The intended use is this: env: OGLM_ADD_DEFINE: '-DGLEW_APPLE_GLX -I/opt/X11/include' OGLM_ADD_LIBS: '-L/opt/X11/lib -lglut' OGLM_REPLACE_OTHERLDFLAGS: '' --- Makefile.PL | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile.PL b/Makefile.PL index 52c893c..c69138a 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -18,6 +18,11 @@ if ( $^O eq 'MSWin32' ) { } else { $libs = '-lGL -lX11'; } + +$define .= ' ' . $ENV{OGLM_ADD_DEFINE} if defined $ENV{OGLM_ADD_DEFINE}; +$libs .= ' ' . $ENV{OGLM_ADD_LIBS} if defined $ENV{OGLM_ADD_LIBS}; +$DYNS->{OTHERLDFLAGS} = $ENV{OGLM_REPLACE_OTHERLDFLAGS} if defined $ENV{OGLM_REPLACE_OTHERLDFLAGS}; + my %buildargs = ( !$libs ? () : (LIBS => $libs), DEFINE => $define, From 6933b9faff95b7776b0fad342f0ff799fe7808c0 Mon Sep 17 00:00:00 2001 From: Dmitry Karasik Date: Sun, 1 Mar 2026 10:45:27 -0300 Subject: [PATCH 2/3] CI for XQuartz/GLX --- .github/workflows/ci.yml | 8 ++++++++ Makefile.PL | 13 +++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) 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 c69138a..fd3c6cf 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -13,16 +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' }; + $define .= " -Wno-compound-token-split-by-macro -DGL_SILENCE_DEPRECATION"; + } } else { $libs = '-lGL -lX11'; } -$define .= ' ' . $ENV{OGLM_ADD_DEFINE} if defined $ENV{OGLM_ADD_DEFINE}; -$libs .= ' ' . $ENV{OGLM_ADD_LIBS} if defined $ENV{OGLM_ADD_LIBS}; -$DYNS->{OTHERLDFLAGS} = $ENV{OGLM_REPLACE_OTHERLDFLAGS} if defined $ENV{OGLM_REPLACE_OTHERLDFLAGS}; - my %buildargs = ( !$libs ? () : (LIBS => $libs), DEFINE => $define, From 0d1afac6b6037fb9046a71b1cb8c5fba2d32bf29 Mon Sep 17 00:00:00 2001 From: Dmitry Karasik Date: Fri, 6 Mar 2026 06:12:04 -0300 Subject: [PATCH 3/3] use macos specific cc flags consistently --- Makefile.PL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.PL b/Makefile.PL index fd3c6cf..06cd216 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -13,12 +13,12 @@ if ( $^O eq 'MSWin32' ) { } elsif ( $^O eq 'cygwin' ) { $libs = '-lGL -lX11'; } elsif ( $^O eq 'darwin' ) { + $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' }; - $define .= " -Wno-compound-token-split-by-macro -DGL_SILENCE_DEPRECATION"; } } else { $libs = '-lGL -lX11';