Alien-SDL2

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

  }
  #### check what options we have for our platform
  my $rv;
  my @candidates = ();

  # sdl2-config script
  push @candidates, $rv if $rv = check_config_script("sdl2-config");

  if( $build->can_build_binaries_from_sources || scalar(@candidates) ) {
    for(qw(pthread SDL2
           z jpeg tiff png SDL2_image
           ogg vorbis vorbisfile SDL2_mixer
           freetype SDL2_ttf
           SDL2_gfx)) {
      $have_libs{$_} = check_prereqs_libs($_);
    }
  }

  # prebuilt binaries (windows only)
  push @candidates, @{$rv} if $rv = check_prebuilt_binaries($build->os_type);

Changes  view on Meta::CPAN

Revision history for Perl module Alien::SDL2

0.002 17/08/2013 
    - Added patch for compiling libtiff 4.0.3 with jpeg-9 on Debian/Ubuntu machines
    - Added travis integration for continous testing [mtj++]
    - Fixed /usr/include => /usr/lib & /usr/lib64 bug where on Unix 64 /usr/lib was being excluded in the file path search for existing libraries
    - Fixed depreciated File::Temp::tempfile calls (Updated to File::Temp 0.23)
    - Updated libraries to first official release of SDL2 [kmx]
    - Added patch for png [kmx]

0.001 XXX
    - initial version by kmx

MANIFEST  view on Meta::CPAN

Changes
inc/My/Builder.pm
inc/My/Builder/Unix.pm
inc/My/Builder/Windows.pm
inc/My/Utility.pm
lib/Alien/SDL2.pm
LICENSE
MANIFEST			This list of files
META.json
META.yml
patches/libpng-1.6.3-hack.patch
patches/libtiff.4.0.3.tiffio.h.patch
patches/libvorbis-1.3.3-configure.patch
README
t/001_load.t
t/002_config.t
t/003_check_header.t
t/004_get_header_version.t
t/005_havelib.t
t/release-pod-coverage.t
t/release-pod-syntax.t

README  view on Meta::CPAN


    Returns a list of full paths to directories with shared libraries (*.so,
    *.dll) that will be required for running the resulting binaries you have
    linked with SDL2 libs.

        Alien::SDL2->config('ld_shlib_map');

    Returns a reference to hash of value pairs '<libnick>' =>
    '<full_path_to_shlib'>, where '<libnick>' is shortname for SDL2 related
    library like: SDL2, SDL2_gfx, SDL2_net, SDL2_sound ... + some non-SDL2
    shortnames e.g. smpeg, jpeg, png.

    NOTE: config('ld_<something>') return an empty list/hash if you have
    decided to use SDL2 libraries already installed on your system. This
    concerns 'sdl2-config' detection.

  check_header()
    This function checks the availability of given header(s) when using
    compiler options provided by "Alien::SDL2->config('cflags')".

        Alien::SDL2->check_header('SDL2.h');

inc/My/Builder.pm  view on Meta::CPAN

  # set ld_paths and ld_shlib_map
  my %tmp = ();
  my %shlib_map = ();
  foreach my $full (@shlibs) {
    my ($v, $d, $f) = splitpath($full);
    $tmp{ catpath($v, $d, '') } = 1;
    # available shared libs detection
    if ($f =~ /smpeg/) {
      $shlib_map{smpeg} = $full unless $shlib_map{smpeg};
    }
    elsif ($f =~ /^(lib)?(png12)/) {
      $shlib_map{png12} = $full unless $shlib_map{png12}; # what if it isnt png12?
    }
    elsif ($f =~ /^(lib)?(intl|z|tiff|jpeg|png|ogg|vorbis|vorbisfile|freetype|FLAC|mikmod)[^a-zA-Z]/) {
      $shlib_map{$2} = $full unless $shlib_map{$2};
    }
    elsif ($f =~ /^(lib)?(SDL2_[a-zA-Z]{2,8})[^a-zA-Z0-9]/) {
      # sort of dark magic how to detect SDL2_<something> related shlib
      $shlib_map{$2} = $full unless $shlib_map{$2};
    }
    elsif ($f =~ /^(lib)?(SDL2)/) {
      # '*SDL2*' that did not pass previous test is probably core 'SDL2'
      $shlib_map{SDL2} = $full unless $shlib_map{SDL2};
    }
  };

  $cfg->{ld_shared_libs} = [ @shlibs ];
  $cfg->{ld_paths}       = [ keys %tmp ];
  $cfg->{ld_shlib_map}   = \%shlib_map;

  my $have_libs = $self->notes('have_libs');
  for(qw(pthread  z jpeg tiff png ogg vorbis vorbisfile freetype
         pangoft2 pango gobject gmodule glib fontconfig expat )) {
    if( !$shlib_map{$_} && $have_libs->{$_}->[0] ) {
      next unless defined $have_libs->{$_}->[1];
      push @{ $cfg->{ld_shared_libs} }, $have_libs->{$_}->[1];
      $shlib_map{$_} = $have_libs->{$_}->[1];
    }
  }

  $self->config_data('config', $cfg);
}

inc/My/Builder/Unix.pm  view on Meta::CPAN

  my $self = shift;
  return 1; # yes we can
}

sub build_binaries {
  my( $self, $build_out, $build_src ) = @_;
  my $bp = $self->notes('build_params');
  my $make = $self->_get_make;

  foreach my $pack (@{$bp->{members}}) {
    if($pack->{pack} =~ m/^tiff|png|ogg|vorbis|z$/ && check_prereqs_libs($pack->{pack})->[0]) {
      print "SKIPPING package '" . $pack->{dirname} . "' (already installed)...\n";
    }
    else {
      print "BUILDING package '" . $pack->{dirname} . "'...\n";
      my $srcdir    = catfile($build_src, $pack->{dirname});
      my $prefixdir = rel2abs($build_out);
      $self->config_data('build_prefix', $prefixdir); # save it for future Alien::SDL::ConfigData

      chdir $srcdir;

inc/My/Utility.pm  view on Meta::CPAN

        version => '4.0.3',
        dirname => 'tiff-4.0.3',
        url => [
          'ftp://ftp.remotesensing.org/pub/libtiff/tiff-4.0.3.tar.gz',
        ],
        sha1sum  => '652e97b78f1444237a82cbcfe014310e776eb6f0',
        patches => ['libtiff.4.0.3.tiffio.h.patch'],
        prereq_libs => [],
      },
      {
        pack => 'png',
        version => '1.6.3',
        dirname => 'libpng-1.6.3',
        url => [
          'http://downloads.sourceforge.net/libpng/libpng-1.6.3.tar.gz',
        ],
        sha1sum  => 'b8b7b911909c09d71324536aaa7750104d170c77',
        patches => ['libpng-1.6.3-hack.patch'],
        prereq_libs => ['z'],
      },
      {
        pack => 'freetype',
        version => '2.5.0.1',
        dirname => 'freetype-2.5.0.1',
        url => [
          'http://www.mirrorservice.org/sites/download.savannah.gnu.org/releases/freetype/freetype-2.5.0.1.tar.gz',
        ],
        sha1sum  => '2d539b375688466a8e7dcc4260ab21003faab08c',

inc/My/Utility.pm  view on Meta::CPAN

      {
        pack => 'SDL2_image',
        version => '2.0.0',
        dirname => 'SDL2_image-2.0.0',
        url => [
          'http://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.0.tar.gz',
          'http://strawberryperl.com/package/kmx/sdl/src/SDL2_image-2.0.0.tar.gz',
        ],
        sha1sum  => '20b1b0db9dd540d6d5e40c7da8a39c6a81248865',
        patches => [],
        prereq_libs => ['SDL2', 'jpeg', 'tiff', 'png'],
      },
      {
        pack => 'ogg',
        version => '1.3.1',
        dirname => 'libogg-1.3.1',
        url => [
          'http://downloads.xiph.org/releases/ogg/libogg-1.3.1.tar.gz',
          'http://strawberryperl.com/package/kmx/sdl/src/libogg-1.3.1.tar.gz',
        ],
        sha1sum  => '270685c2a3d9dc6c98372627af99868aa4b4db53',

lib/Alien/SDL2.pm  view on Meta::CPAN

    Alien::SDL2->config('ld_paths');

Returns a list of full paths to directories with shared libraries (*.so, *.dll)
that will be required for running the resulting binaries you have linked with
SDL2 libs.

    Alien::SDL2->config('ld_shlib_map');

Returns a reference to hash of value pairs '<libnick>' => '<full_path_to_shlib'>,
where '<libnick>' is shortname for SDL2 related library like: SDL2, SDL2_gfx, SDL2_net,
SDL2_sound ... + some non-SDL2 shortnames e.g. smpeg, jpeg, png.

NOTE: config('ld_<something>') return an empty list/hash if you have decided to
use SDL2 libraries already installed on your system. This concerns 'sdl2-config'
detection.

=head2 check_header()

This function checks the availability of given header(s) when using compiler
options provided by "Alien::SDL2->config('cflags')".

patches/libpng-1.6.3-hack.patch  view on Meta::CPAN

--- libpng-1.6.3/pnglibconf.dfn	2013-08-17 21:36:54.489625300 +0200
+++ libpng-1.6.3/pnglibconf.dfn	2013-08-09 20:26:03.377019200 +0200
@@ -0,0 +1,6623 @@
+/*- pnglibconf.dfn intermediate file
+ * generated from scripts/pnglibconf.dfa
+ */
+ PNG_DFN "/* pnglibconf.h - library build configuration */" 
+ PNG_DFN "" 
+ PNG_DFN "/* libpng version 1.6.3 - July 18, 2013 */" 
+ PNG_DFN "" 
+ PNG_DFN "/* Copyright (c) 1998-2012 Glenn Randers-Pehrson */" 
+ PNG_DFN "" 
+ PNG_DFN "/* This code is released under the libpng license. */" 
+ PNG_DFN "/* For conditions of distribution and use, see the disclaimer */" 
+ PNG_DFN "/* and license in png.h */" 
+ PNG_DFN "" 
+ PNG_DFN "/* pnglibconf.h */" 
+ PNG_DFN "/* Machine generated file: DO NOT EDIT */" 
+ PNG_DFN "/* Derived from: scripts/pnglibconf.dfa */" 
+ PNG_DFN "#ifndef PNGLCONF_H" 
+ PNG_DFN "#define PNGLCONF_H" 
+#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
+# include "config.h"
+#endif
+#ifdef PNG_USER_CONFIG
+# include "pngusr.h"
+#endif
+#ifdef __WATCOMC__
+# ifndef PNG_API_RULE
+# define PNG_API_RULE 2 /* Use Watcom calling conventions */
+# endif
+#endif
+/*# include <zlib.h>*/
+#ifdef PNG_SETJMP_NOT_SUPPORTED
+#   define PNG_NO_SETJMP
+#endif



( run in 1.187 second using v1.01-cache-2.11-cpan-df04353d9ac )