Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removed Alien::DontPanic and Ford::Prefect, they are now on CPAN (mus…

…t document)
  • Loading branch information...
commit a374bafb0dfb498fbf4c7dbd29ca8a22fb5d115b 1 parent 9096192
Joel Berger jberger authored
38 examples/Alien-DontPanic/Build.PL
View
@@ -1,38 +0,0 @@
-use strict;
-use warnings;
-
-use lib '../../lib';
-
-use Alien::Base::ModuleBuild;
-
-my $builder = Alien::Base::ModuleBuild->new(
- module_name => 'Alien::DontPanic',
- dist_abstract => 'Test Module for Alien::Base',
- license => 'perl',
- configure_requires => {
- 'Alien::Base' => 0,
- },
- requires => {
- 'perl' => '5.8.1',
- 'Alien::Base' => 0,
- },
- dist_author => 'Joel A. Berger <joel.a.berger@gmail.com>',
- alien_name => 'dontpanic',
- alien_repository => {
- protocol => 'local',
- location => 'inc',
- pattern => qr/^dontpanic-([\d\.]+)\.tar\.gz$/,
- },
- alien_build_commands => [
- '%x make.pl --prefix=%s configure',
- '%x make.pl',
- '%x make.pl install'
- ],
-);
-$builder->create_build_script;
-
-# zz-example.t "do loads" this file, so hand it something:
-no warnings 'void';
-$builder;
-
-
4 examples/Alien-DontPanic/MANIFEST
View
@@ -1,4 +0,0 @@
-Build.PL
-inc/dontpanic-1.01.tar.gz
-lib/Alien/DontPanic.pm
-MANIFEST This list of files
BIN  examples/Alien-DontPanic/inc/dontpanic-1.01.tar.gz
View
Binary file not shown
159 examples/Alien-DontPanic/inc/dontpanic_source/make.pl
View
@@ -1,159 +0,0 @@
-#!/usr/bin/env perl
-
-use strict;
-use warnings;
-
-use Getopt::Long;
-use Data::Dumper;
-
-use File::chdir;
-use File::Spec;
-use File::Copy qw/copy/;
-use File::Basename;
-
-use ExtUtils::LibBuilder;
-
-my $config_file = 'config';
-my $base_config = {
- prefix => undef,
- clean => {
- src => [],
- '.' => [$config_file],
- },
- install => {
- lib => [],
- include => [qw/libdontpanic.h/],
- },
-};
-
-my $prefix = $CWD;
-GetOptions(
- 'prefix=s' => \$prefix,
-);
-
-my $action = shift || 'build';
-
-my $config = _load_options();
-
-my $sub = __PACKAGE__->can($action) or die "Unknown action: $action";
-$sub->();
-
-sub build {
- {
- local $CWD = 'src';
-
- my $libbuilder = ExtUtils::LibBuilder->new() or die "EU::LibBuilder object creation failed";
-
- # Compile
- my $o = $libbuilder->compile(
- source => 'libdontpanic.c',
- extra_compiler_flags => '-fPIC',
- );
- push @{ $config->{clean}{src} }, $o;
-
- # Link
- my $so = "libdontpanic$libbuilder->{libext}";
- my $soname = $^O eq 'darwin' ? '-install_name' : '-soname';
- my $ldflags = "-Wl,$soname,$so";
-
- if ( $ENV{LDFLAGS} ) {
- $ldflags .= $ENV{LDFLAGS};
- }
-
- $libbuilder->link(
- objects => [ $o ],
- extra_linker_flags => $ldflags,
- lib_file => $so,
- );
-
- push @{ $config->{clean}{src} }, $so;
- push @{ $config->{install}{lib} }, $so;
- }
-
- _store_options($config);
-}
-
-sub configure {
- local $base_config->{prefix} = $prefix;
- _store_options( $base_config );
-}
-
-sub install {
- die "Cannot install without running $0 configure"
- unless defined $config->{prefix};
-
- my %files = do {
- local $CWD = 'src';
- map {
- my $folder = $_;
- my @files = map {File::Spec->rel2abs($_)} @{$config->{install}{$folder}};
- ($folder, \@files)
- } keys %{ $config->{install} };
- };
-
- _check_mkdir($config->{prefix});
- local $CWD = $config->{prefix};
-
- foreach my $folder (keys %files) {
- _check_mkdir($folder);
- local $CWD = $folder;
- foreach my $file (@{$files{$folder}}) {
- copy $file, $CWD or die "Could not copy file $file";
- if ($file =~ /\.dylib$/) {
- my $filename = fileparse($file);
- $filename = File::Spec->rel2abs($filename);
- system("install_name_tool -id $filename $filename") == 0 or warn "Could not install dylib";
- }
- }
- _write_pc() if $folder eq 'lib';
- }
-
-}
-
-sub clean {
- foreach my $folder (keys %{$config->{clean}}) {
- local $CWD = $folder;
- unlink @{$config->{clean}{$folder}};
- }
-}
-
-sub _load_options {
- return $base_config unless -e $config_file;
-
- my $config = do $config_file;
- $config ||= $base_config;
- return $config;
-}
-
-sub _store_options {
- my $opts = shift;
- open my $fh, '>', $config_file or die "Could not open $config_file";
- print $fh Dumper $opts;
-}
-
-sub _write_pc {
- my $pc_file = 'dontpanic.pc';
- open my $fh, '>', $pc_file or die "Could not open $pc_file";
-
- my $prefix = $config->{prefix};
-
- print $fh <<END_PC;
-prefix=$prefix
-libdir=$prefix/lib
-includedir=$prefix/include
-
-Name: DontPanic
-Description: Test Library for Alien::Base
-Version: 1.01
-Libs: -L$prefix/lib -ldontpanic
-Cflags: -I$prefix/include
-END_PC
-}
-
-sub _check_mkdir {
- my $folder = shift;
- unless (-d $folder) {
- mkdir $folder or die "Could not create folder: $folder";
- }
-}
-
6 examples/Alien-DontPanic/inc/dontpanic_source/src/libdontpanic.c
View
@@ -1,6 +0,0 @@
-#include "libdontpanic.h"
-
-int answer () {
- return 42;
-}
-
1  examples/Alien-DontPanic/inc/dontpanic_source/src/libdontpanic.h
View
@@ -1 +0,0 @@
-int answer ();
12 examples/Alien-DontPanic/lib/Alien/DontPanic.pm
View
@@ -1,12 +0,0 @@
-package Alien::DontPanic;
-
-use strict;
-use warnings;
-
-our $VERSION = 0.01;
-$VERSION = eval $VERSION;
-
-use parent 'Alien::Base';
-
-1;
-
37 examples/Ford-Prefect/Build.PL
View
@@ -1,37 +0,0 @@
-use strict;
-use warnings;
-
-use Module::Build;
-use Alien::DontPanic;
-
-my $dontpanic = Alien::DontPanic->new;
-
-my $pc = $dontpanic->pkgconfig('dontpanic');
-
-my $cflags = $pc->keyword('Cflags');
-my $libs = $pc->keyword('Libs');
-
-my $builder = Module::Build->new(
- module_name => 'Ford::Prefect',
- dist_abstract => 'Part of the test framework for Alien::Base',
- dist_author => 'Joel Berger <joel.a.berger@gmail.com>',
- license => 'perl',
- requires => {
- 'perl' => '5.008',
- },
- configure_requires => {
- 'Module::Build' => 0.38,
- },
- build_requires => {
- 'ExtUtils::CBuilder' => 0,
- },
- extra_compiler_flags => $cflags,
- extra_linker_flags => $libs,
-);
-
-$builder->create_build_script;
-
-# for do-loading
-no warnings 'void';
-$builder;
-
4 examples/Ford-Prefect/MANIFEST
View
@@ -1,4 +0,0 @@
-Build.PL
-lib/Ford/Prefect.pm
-lib/Ford/Prefect.xs
-MANIFEST This list of files
19 examples/Ford-Prefect/lib/Ford/Prefect.pm
View
@@ -1,19 +0,0 @@
-package Ford::Prefect;
-
-use strict;
-use warnings;
-
-use Alien::DontPanic;
-
-our $VERSION = '0.01';
-$VERSION = eval $VERSION;
-
-#use XSLoader;
-#XSLoader::load;
-
-require DynaLoader;
-our @ISA = 'DynaLoader';
-__PACKAGE__->bootstrap($VERSION);
-
-1;
-
13 examples/Ford-Prefect/lib/Ford/Prefect.xs
View
@@ -1,13 +0,0 @@
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
-
-#include "libdontpanic.h"
-
-MODULE = Ford::Prefect PACKAGE = Ford::Prefect
-
-PROTOTYPES: DISABLE
-
-int
-answer ()
-
Please sign in to comment.
Something went wrong with that request. Please try again.