Skip to content

Commit bf47f0e

Browse files
committed
add ExtUtils::Depends support in addition to OpenGL::Config
1 parent 7f279c2 commit bf47f0e

File tree

6 files changed

+29
-4
lines changed

6 files changed

+29
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
with:
3838
target-setup-perl: false
3939
target-install-dist-perl-deps: true
40+
dist-perl-deps-configure: ExtUtils::Depends
4041
build-enable-graphical-display: true
4142
target-test-release-testing: true
4243
target-test: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
# Explicitly skip these generated files
1414
lib/OpenGL/Config.pm
15+
lib/OpenGL/Install/Files.pm
1516
Makefile
1617
Makefile.old
1718
META.yml

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
- add glpErrorString
22
- add _o aliases for all functions taking OpenGL::Array args
33
- use OpenGL::Modern for _c and simple bindings
4+
- add ExtUtils::Depends support in addition to OpenGL::Config, including "use Inline with => 'OpenGL'
45

56
0.7006 2025-04-14
67
- incorporate Acme::MITHALDU::BleedingOpenGL changes - thanks @wchristian

MANIFEST.SKIP

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040

4141
^.*.tar.gz
4242
^.git
43-
^lib/OpenGL/Config.pm
43+
^lib/OpenGL/Config\.pm
44+
^lib/OpenGL/Install/Files\.pm
4445
^Makefile$
4546
^MYMETA.json
4647
^MYMETA.yml

Makefile.PL

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ use strict;
22
use warnings;
33
use ExtUtils::MakeMaker;
44
use ExtUtils::Liblist;
5+
use ExtUtils::Depends;
56
use Config;
67
use File::Spec::Functions;
8+
use File::Path qw(make_path);
79

810
# Supported windowing interfaces
911
our $is_valid_interface =
@@ -145,12 +147,24 @@ my $build_config =
145147

146148
print "MakeMaker configuration:\n DEFINE=$DEFS\n INC=$INCS\n LIBS=$LIBS\n\n" if $verbose;
147149

148-
close(CONF) if (open(CONF,">", "lib/OpenGL/Config.pm")); # empty Config.pm
150+
{ open my $fh, ">", "lib/OpenGL/Config.pm"; } # empty Config.pm
151+
my $eud = ExtUtils::Depends->new('OpenGL');
152+
$eud->set_inc(grep $_, $INCS, $DEFS);
153+
$eud->set_libs($LIBS) if $LIBS;
154+
$eud->add_typemaps('typemap');
155+
$eud->add_pm(map {
156+
(my $nl = $_) =~ s#^lib/##; $_=>"\$(INST_LIB)/$nl"
157+
} glob 'lib/OpenGL.pm lib/OpenGL/*.pm lib/OpenGL/Shader/*.pm');
158+
$eud->add_xs(glob 'lib/OpenGL/*.xs');
159+
make_path('lib/OpenGL/Install');
160+
$eud->save_config('lib/OpenGL/Install/Files.pm');
161+
my %eud_vars = $eud->get_makefile_vars;
149162
WriteMakefile(
150163
NAME => 'OpenGL',
151164
VERSION_FROM=> 'lib/OpenGL.pm',
152165
CONFIGURE_REQUIRES => {
153166
'ExtUtils::MakeMaker' => 0,
167+
'ExtUtils::Depends' => '0.8002',
154168
},
155169
PREREQ_PM => {
156170
'OpenGL::Modern' => '0.0401',
@@ -188,8 +202,10 @@ WriteMakefile(
188202
"utils/glversion$Config{exe_ext} ".
189203
"utils/glversion$Config{obj_ext}"
190204
},
191-
%$build_config,
192-
INC => $INCS . ' -I'.curdir(),
205+
!defined($DYNS) ? () : (dynamic_lib => $DYNS),
206+
!defined($OPTS) ? () : (OPTIMIZE => $OPTS),
207+
%eud_vars,
208+
INC => $eud_vars{INC} . ' -I'.curdir(),
193209
); # Generate the Makefile
194210
WriteConfigPM( $build_config ); # Regenerate final Config.pm
195211

lib/OpenGL.pm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4598,4 +4598,9 @@ sub glpCheckExtension
45984598
return 0;
45994599
}
46004600

4601+
sub Inline {
4602+
require OpenGL::Install::Files;
4603+
goto &OpenGL::Install::Files::Inline;
4604+
}
4605+
46014606
1;

0 commit comments

Comments
 (0)