Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' into experimental
Conflicts:
	Changes
	README
	lib/Alien/SDL.pm
  • Loading branch information
jtpalmer committed Feb 8, 2014
2 parents 53c8459 + 840d24a commit e3c4cfc
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 38 deletions.
25 changes: 25 additions & 0 deletions .travis.yml
@@ -0,0 +1,25 @@
language: perl
perl:
- "5.8"
- "5.10"
- "5.12"
- "5.14"
- "5.16"
- "5.18"

before_install:
# install tiff
- sudo apt-get update
# - sudo apt-get -y purge ruby libtiff4 libtiff4-dev libtiffxx0c2 zlib1g-dev
# - sudo apt-get autoremove
- cat ./cpan-deps | cpanm --sudo --notest

install:
- perl ./Build.PL --travis
- ./Build
- sudo ./Build install

script: prove -v

notifications:
irc: irc.perl.org#sdl
17 changes: 15 additions & 2 deletions Build.PL
Expand Up @@ -6,6 +6,10 @@ use File::Spec::Functions qw(catdir catfile);
use Config;
use My::Utility qw(check_config_script check_prebuilt_binaries check_prereqs_libs check_prereqs_tools $source_packs);

use Getopt::Long;
my ( $ans, $travis ) = 0;
GetOptions( "travis" => \$travis );

print "Welcome to Alien::SDL module installation\n";
print "-----------------------------------------\n";
print "checking operating system... $^O\n";
Expand Down Expand Up @@ -209,8 +213,17 @@ else {

$prompt_string .= "[" . $i++ . "] " . $c->{title} . "\n";
}
$prompt_string .= "\nWhat way do you wanna go?";
my $ans = $build->prompt($prompt_string, $recommended_candidate);

# select option '1' for travis
if ( defined $travis and $travis == 1 ) {
$ans = 1;
}

# or prompt user for build option
else {
$prompt_string .= "\nWhat way do you wanna go?";
$ans = $build->prompt( $prompt_string, $recommended_candidate );
}

if($ans > 0 && $ans < scalar(@candidates)) {
$choice = $candidates[$ans - 1];
Expand Down
3 changes: 3 additions & 0 deletions Changes
Expand Up @@ -6,6 +6,9 @@ TODO
- fixed spelling and grammar in docs
- check for available libs when using --with-sdl-config option

1.440 Sun Aug 12 2012
- patch for File::Temp->tempfile -> File::Temp::tempfile (#244) [FROGGS]

1.439_1 Sun Aug 12 2012
- added patch for SDL::GFX::ImageFilter::MMX_detect (by Steve Langasek, ubuntu bug 1029981) [FROGGS]
- source code build option is now only available when SDL itself can/will be built [FROGGS]
Expand Down
53 changes: 23 additions & 30 deletions README
Expand Up @@ -2,14 +2,13 @@ NAME
Alien::SDL - building, finding and using SDL binaries

VERSION
Version 1.439_1
Version 1.440

SYNOPSIS
Alien::SDL tries (in given order) during its installation:

* When given "--with-sdl-config" option use specified sdl-config
script to locate SDL libs.

* When given `--with-sdl-config' option use specified sdl-config script
to locate SDL libs.
perl Build.PL --with-sdl-config=/opt/sdl/bin/sdl-config

or using default script name 'sdl-config' by running:
Expand All @@ -19,17 +18,14 @@ SYNOPSIS
IMPORTANT NOTE: Using --with-sdl-config avoids considering any other
build methods; no prompt with other available build options.

* Locate an already installed SDL via 'sdl-config' script.

* Check for SDL libs in directory specified by SDL_INST_DIR variable.
In this case the module performs SDL library detection via
'$SDL_INST_DIR/bin/sdl-config' script.

* Locate an already installed SDL via 'sdl-config' script.
* Check for SDL libs in directory specified by SDL_INST_DIR variable. In
this case the module performs SDL library detection via
'$SDL_INST_DIR/bin/sdl-config' script.
SDL_INST_DIR=/opt/sdl perl ./Build.PL

* Download prebuilt SDL binaries (if available for your platform).

* Build SDL binaries from source codes (if possible on your system).
* Download prebuilt SDL binaries (if available for your platform).
* Build SDL binaries from source codes (if possible on your system).

Later you can use Alien::SDL in your module that needs to link agains
SDL and/or related libraries like this:
Expand All @@ -49,28 +45,25 @@ SYNOPSIS
DESCRIPTION
Please see Alien for the manifesto of the Alien namespace.

In short "Alien::SDL" can be used to detect and get configuration
In short `Alien::SDL' can be used to detect and get configuration
settings from an installed SDL and related libraries. Based on your
platform it offers the possibility to download and install prebuilt
binaries or to build SDL & co. from source codes.

The important facts:

* The module does not modify in any way the already existing SDL
installation on your system.

* If you reinstall SDL libs on your system you do not need to
reinstall Alien::SDL (providing that you use the same directory for
the new installation).

* The prebuild binaries and/or binaries built from sources are always
installed into perl module's 'share' directory.

* If you use prebuild binaries and/or binaries built from sources it
happens that some of the dynamic libraries (*.so, *.dll) will not
automaticly loadable as they will be stored somewhere under perl
module's 'share' directory. To handle this scenario Alien::SDL
offers some special functionality (see below).
* The module does not modify in any way the already existing SDL
installation on your system.
* If you reinstall SDL libs on your system you do not need to reinstall
Alien::SDL (providing that you use the same directory for the new
installation).
* The prebuild binaries and/or binaries built from sources are always
installed into perl module's 'share' directory.
* If you use prebuild binaries and/or binaries built from sources it
happens that some of the dynamic libraries (*.so, *.dll) will not
automaticly loadable as they will be stored somewhere under perl
module's 'share' directory. To handle this scenario Alien::SDL offers
some special functionality (see below).

METHODS
config()
Expand Down Expand Up @@ -136,7 +129,7 @@ METHODS

BUGS
Please post issues and bugs at
<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Alien-SDL>
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Alien-SDL

AUTHOR
Kartik Thakore
Expand Down
20 changes: 20 additions & 0 deletions cpan-deps
@@ -0,0 +1,20 @@
Archive::Extract
Capture::Tiny
Cwd
Digest::SHA
Exporter
ExtUtils::CBuilder
ExtUtils::Command
File::Copy
File::Fetch
File::Find
File::Path
File::ShareDir
File::Spec
File::Spec::Functions
File::Temp
File::Which
Getopt::Long
Module::Build
Test::More
Text::Patch
6 changes: 3 additions & 3 deletions inc/My/Utility.pm
Expand Up @@ -43,7 +43,7 @@ my $prebuilt_binaries = [
'http://froggs.de/libsdl/Win32_SDL-1.2.14-extended-bin_20100704.zip',
],
sha1sum => '98409ddeb649024a9cc1ab8ccb2ca7e8fe804fd8',
arch_re => qr/^MSWin32-x86-multi-thread$/,
arch_re => qr/^MSWin32-x86-multi-thread(-64int)?$/,
os_re => qr/^MSWin32$/,
cc_re => qr/gcc/,
},
Expand All @@ -55,7 +55,7 @@ my $prebuilt_binaries = [
'http://froggs.de/libsdl/Win32_SDL-1.2.14-extended-bin_20111205.zip',
],
sha1sum => '553b7e21bb650d047ec9f2a5f650c67d76430e61',
arch_re => qr/^MSWin32-x86-multi-thread$/,
arch_re => qr/^MSWin32-x86-multi-thread(-64int)?$/,
os_re => qr/^MSWin32$/,
cc_re => qr/gcc/,
},
Expand Down Expand Up @@ -496,7 +496,7 @@ sub check_header {
my ($cflags, @header) = @_;
print STDERR "Testing header(s): " . join(', ', @header) . "\n";
my $cb = ExtUtils::CBuilder->new(quiet => 1);
my ($fs, $src) = File::Temp->tempfile('XXXXaa', SUFFIX => '.c', UNLINK => 1);
my ($fs, $src) = File::Temp::tempfile('aaXXXX', SUFFIX => '.c', UNLINK => 1);
my $inc = '';
$inc .= "#include <$_>\n" for @header;
syswrite($fs, <<MARKER); # write test source code
Expand Down
6 changes: 3 additions & 3 deletions lib/Alien/SDL.pm
Expand Up @@ -16,11 +16,11 @@ Alien::SDL - building, finding and using SDL binaries
=head1 VERSION
Version 1.439_1
Version 1.440
=cut

our $VERSION = '1.439_1';
our $VERSION = '1.440';
$VERSION = eval $VERSION;

=head1 SYNOPSIS
Expand Down Expand Up @@ -240,7 +240,7 @@ sub check_header {
}

my $cb = ExtUtils::CBuilder->new( quiet => 1, config => $config );
my ($fs, $src) = File::Temp->tempfile('XXXXaa', SUFFIX => '.c', UNLINK => 1);
my ($fs, $src) = File::Temp::tempfile('aaXXXX', SUFFIX => '.c', UNLINK => 1);
my $inc = '';
my $i = 0;
foreach (@header) {
Expand Down

0 comments on commit e3c4cfc

Please sign in to comment.