Alien-IUP
view release on metacpan or search on metacpan
inc/My/Builder/Unix.pm view on Meta::CPAN
if ($^O eq 'solaris') {
warn "###WARN### skipping iup_mglplot on Solaris (fails to compile)";
@iuptargets = grep { $_ !~ /^iup_mglplot$/ } @iuptargets;
}
}
my $ftgl_target = 1;
unless ($has{l_GL} && $has{l_GLU} && $has{gl} && $has{glx} && $has{glu}) {
warn "###WARN### OpenGL libraries not found or not complete\n";
warn "- required headers: GL/gl.h GL/glx.h GL/glu.h\n";
warn "- required libraries: libGL libGLU\n";
my $skip = $ENV{TRAVIS} ? 'y' : $self->prompt("Skip OpenGL related IUP/CD components?", 'y');
if (lc($skip) eq 'y') {
@cdtargets = grep { $_ !~ /^(cd_ftgl|cdgl)$/ } @cdtargets;
@iuptargets = grep { $_ !~ /^(iup_mglplot|iup_plot|iupglcontrols|iupgl)$/ } @iuptargets;
$ftgl_target = 0;
}
}
@iuptargets = grep { $_ !~ /^(iupweb)$/ } @iuptargets unless $has{webkit};
#store debug info into ConfigData
$self->config_data('info_has', \%has);
$self->config_data('info_lib_details', \%has_details);
$self->config_data('info_imtargets', \@imtargets);
$self->config_data('info_cdtargets', \@cdtargets);
$self->config_data('info_iuptargets', \@iuptargets);
my @makeopts = qw[NO_DYNAMIC=Yes USE_NODEPEND=Yes];
#my @makeopts = qw[NO_STATIC=Yes USE_NODEPEND=Yes];
#On solaris, some tools like 'ar' are not in the default PATH, but in /usr/???/bin
if ($^O eq 'solaris') {
my ($ar, $ranlib);
for (qw[/usr/ccs/bin /usr/xpg4/bin /usr/sfw/bin /usr/xpg6/bin /usr/gnu/bin /opt/gnu/bin /usr/bin]) {
$ar = "$_/ar" if (!$ar && -x "$_/ar");
$ranlib = "$_/ranlib" if (!$ranlib && -x "$_/ranlib");
}
push @makeopts, "AR=$ar" if $ar;
push @makeopts, "RANLIB=$ranlib" if $ranlib;
}
#choose GUI subsystem, priorities if multiple subsystems detected: 1. GTK, 2. X11/Motif
my @libs;
my @build_opts;
my $build_target;
push(@build_opts, 'GTK3') if ($has{gtk3} && $has{gdk3} && $has{cairo} && $has{Xlib});
push(@build_opts, 'GTK2') if ($has{gtk} && $has{gdk} && $has{cairo} && $has{Xlib});
push(@build_opts, 'X11/Motif') if ($has{Xlib} && $has{Xm});
if (scalar(@build_opts) == 1) {
$build_target = $build_opts[0];
}
elsif (scalar(@build_opts) > 1) {
my $n = 1;
my $msg = "\nYou have the following build options available:\n" .
join("\n", map ($n++ . ") $_", @build_opts)) .
"\nWhat do you wanna build?";
my $i = $ENV{TRAVIS} ? 1 : $self->prompt($msg, 1);
$build_target = $build_opts[$i-1];
die "###ERROR### Wrong selection!" unless $build_target;
}
else {
warn "###WARNING### No supported GUI subsystem detected!\n";
}
if ($self->notes('build_debug_info') || ( !$build_target && $ENV{AUTOMATED_TESTING} ) ) {
foreach (sort keys %has) {
my $msg = "has: $has{$_} - $_";
$msg .= "; version=" . $has_details{$_}->{version} if $has_details{$_}->{version};
$msg .= "; prefix=" . $has_details{$_}->{prefix} if $has_details{$_}->{prefix};
print STDERR $msg, "\n";
}
print STDERR "Dumping some pkg-info:\n";
print STDERR "[gtk2 cflags] " . $self->run_stdout2str(qw[pkg-config --cflags gtk+-2.0]) . "\n";
print STDERR "[gtk2 libs ] " . $self->run_stdout2str(qw[pkg-config --libs gtk+-2.0]) . "\n";
print STDERR "[gtk3 cflags] " . $self->run_stdout2str(qw[pkg-config --cflags gtk+-3.0]) . "\n";
print STDERR "[gtk3 libs ] " . $self->run_stdout2str(qw[pkg-config --libs gtk+-3.0]) . "\n";
for my $pkg (qw[gtk+-2.0 gtk+-3.0 gl glu glut x11 xt xext xmu]) {
print STDERR "[prefix $pkg] " . $self->run_stdout2str(qw[pkg-config --variable=prefix], $pkg) . "\n";
print STDERR "[libdir $pkg] " . $self->run_stdout2str(qw[pkg-config --variable=libdir], $pkg) . "\n";
print STDERR "[includedir $pkg] " . $self->run_stdout2str(qw[pkg-config --variable=includedir], $pkg) . "\n";
}
print STDERR "Brute force lookup:\n";
my $re = qr/\/(Xlib.h|Xm.h|gtk.h|cairo.h|glu.h|glut.h|gl.h|freetype.h|gtkprintunixdialog.h|jasper.h|jas_image.h|lib(X11|GL|Xm|freetype)\.[^\d]*)$/;
print STDERR "[/usr ] $_\n" foreach ($self->find_file('/usr', $re));
print STDERR "[/lib ] $_\n" foreach ($self->find_file('/usr', $re));
print STDERR "[/opt ] $_\n" foreach ($self->find_file('/opt', $re));
print STDERR "[/sw ] $_\n" foreach ($self->find_file('/sw', $re));
print STDERR "[/System ] $_\n" foreach ($self->find_file('/System', $re));
print STDERR "[/Library] $_\n" foreach ($self->find_file('/Library', $re));
print STDERR "[/Network] $_\n" foreach ($self->find_file('/Network', $re));
}
unless ($build_target) {
warn <<'MARKER';
###FATAL### No supported GUI subsystem (GTK3, GTK2, X11/Motif) detected! (gonna exit)
### for GTK3 you need: gtk+-3.0, gdk-3.0, cairo + X11/Xlib.h
### for GTK2 you need: gtk+-2.0, gdk-2.0, cairo + X11/Xlib.h
### for X11/Motif you need: -lXm, -lX11 + Xm/Xm.h, X11/Xlib.h
###
### on Debian/Ubuntu you need to install:
### $ aptitude install libgtk-2-dev libcairo2-dev libx11-dev libglu-dev freeglut3-dev
### $ aptitude install libgtk-3-dev libcairo2-dev libx11-dev libglu-dev freeglut3-dev
### or
### $ sudo apt-get install libgtk-2-dev libcairo2-dev libx11-dev libglu-dev freeglut3-dev
### $ sudo apt-get install libgtk-3-dev libcairo2-dev libx11-dev libglu-dev freeglut3-dev
###
### on RedHat/CentOS/Fedora you need to install:
### $ yum install gtk2-devel cairo-devel libX11-devel libGLU-devel freeglut-devel
###
### on FreeBSD you need to install:
### $ pkg install gtk2 cairo freeglut
###
MARKER
die;
}
$self->config_data('info_gui_driver', $build_target);
( run in 1.020 second using v1.01-cache-2.11-cpan-f0fbb3f571b )