| 1 |
use Config; |
| 2 |
use ExtUtils::CXX; |
| 3 |
use ExtUtils::MakeMaker; |
| 4 |
|
| 5 |
my $lddlflags = $Config{lddlflags}; |
| 6 |
|
| 7 |
sub manifest_resources { |
| 8 |
open my $manifest, "MANIFEST" or die "Couldn't open MANIFEST: $!"; |
| 9 |
map { chomp; $_ } grep /^resources\//, <$manifest> |
| 10 |
} |
| 11 |
|
| 12 |
print <<EOF; |
| 13 |
|
| 14 |
*** opengl 1.1 is required to run this client |
| 15 |
*** opengl 1.2 is recommended to run this client |
| 16 |
*** opengl 2.0 helps some more.... |
| 17 |
|
| 18 |
*** other dependencies: |
| 19 |
*** pango-1.12.3, glib-2.10 |
| 20 |
*** libsdl-1.2.10, libSDL_mixer, libSDL_image |
| 21 |
|
| 22 |
*** Pod::POM, Compress::LZF, BDB, Deliantra, EV, AnyEvent perl modules |
| 23 |
|
| 24 |
*** HINT: Debian/Ubuntu users might have some luck with: |
| 25 |
*** apt-get install perl libpango1.0-dev libglib2.0-dev libsdl1.2-dev |
| 26 |
*** apt-get install libsdl-mixer1.2-dev libsdl-image1.2-dev |
| 27 |
*** apt-get install libwww-perl libdb5.3-dev |
| 28 |
*** apt-get install libanyevent-perl |
| 29 |
|
| 30 |
EOF |
| 31 |
|
| 32 |
if ($^O =~ /win32/i or $^O =~ /mswin/) { |
| 33 |
print <<EOF; |
| 34 |
*** microsoft compatibility forced us to only support manual configuration |
| 35 |
*** by editing Makefile.PL. complain to microsoft. |
| 36 |
|
| 37 |
EOF |
| 38 |
$INC = "-I/gtk/include -I/gtk/include/pango-1.0 -I/gtk/include/glib-2.0 -I/gtk/lib/glib-2.0/include/ -I/gtk/include/freetype2"; |
| 39 |
$LIBS = "-L/gtk/lib -lSDL -lSDL_image -lSDL_mixer -lpango-1.0 -lpangoft2-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lfreetype -lfontconfig -lopengl32 -lwininet", |
| 40 |
} else { |
| 41 |
$INC = join " ", qx<sdl-config --cflags>, qx<pkg-config pangoft2 --cflags>; |
| 42 |
$LIBS = join "", map " $_ ", |
| 43 |
qx<sdl-config --libs>, |
| 44 |
"-lSDL_image -lSDL_mixer", |
| 45 |
qx<pkg-config pangoft2 --libs>, |
| 46 |
"-L/usr/X11/lib"; |
| 47 |
|
| 48 |
$LIBS .= " -lGL" unless $^O =~ /darwin/i; # sigh... os x is so borked |
| 49 |
|
| 50 |
$_ =~ s/\n/ /g for $INC, $LIBS; |
| 51 |
|
| 52 |
# for extra horrid macosx joys |
| 53 |
$lddlflags .= " $1" while $LIBS =~ s/ (-Wl,\S+) / /; |
| 54 |
} |
| 55 |
|
| 56 |
extutils_cxx { |
| 57 |
WriteMakefile( |
| 58 |
dist => { |
| 59 |
PREOP => 'pod2text bin/deliantra | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
| 60 |
COMPRESS => 'gzip -9v', |
| 61 |
SUFFIX => '.gz', |
| 62 |
}, |
| 63 |
NAME => "Deliantra::Client", |
| 64 |
INC => $INC, |
| 65 |
LIBS => [$LIBS], |
| 66 |
LDDLFLAGS => $lddlflags, |
| 67 |
EXE_FILES => [qw(bin/deliantra)], |
| 68 |
VERSION_FROM => "DC.pm", |
| 69 |
PREREQ_PM => { |
| 70 |
common::sense => 3.6, |
| 71 |
BDB => 1.83, |
| 72 |
Deliantra => 1.31, |
| 73 |
Time::HiRes => 0, |
| 74 |
EV => 3.42, |
| 75 |
Guard => 1, |
| 76 |
AnyEvent => 4.331, |
| 77 |
Compress::LZF => 3.41, |
| 78 |
Pod::POM => 0.27, |
| 79 |
LWP => 0, |
| 80 |
JSON::XS => 2.2222, |
| 81 |
IO::AIO => 4, |
| 82 |
AnyEvent::AIO => 1, |
| 83 |
Coro => 6, |
| 84 |
Coro::EV => 0, |
| 85 |
Urlader => 1, |
| 86 |
}, |
| 87 |
depend => { |
| 88 |
"Client.o" => 'glfunc.h pangoopengl.h pango-font.c pango-fontmap.c pango-render.c texcache.c rendercache.c', |
| 89 |
}, |
| 90 |
clean => { FILES => 'docwiki.pst' }, |
| 91 |
PM => { |
| 92 |
'Client.pm' => '$(INST_LIBDIR)/Client.pm', |
| 93 |
'DC.pm' => '$(INST_LIBDIR)/Client/private/DC.pm', |
| 94 |
'DC/Main.pm' => '$(INST_LIBDIR)/Client/private/DC/Main.pm', |
| 95 |
'DC/Protocol.pm' => '$(INST_LIBDIR)/Client/private/DC/Protocol.pm', |
| 96 |
'DC/Audio.pm' => '$(INST_LIBDIR)/Client/private/DC/Audio.pm', |
| 97 |
'DC/OpenGL.pm' => '$(INST_LIBDIR)/Client/private/DC/OpenGL.pm', |
| 98 |
'DC/Texture.pm' => '$(INST_LIBDIR)/Client/private/DC/Texture.pm', |
| 99 |
'DC/DB.pm' => '$(INST_LIBDIR)/Client/private/DC/DB.pm', |
| 100 |
'DC/UI.pm' => '$(INST_LIBDIR)/Client/private/DC/UI.pm', |
| 101 |
'DC/MessageDistributor.pm' => '$(INST_LIBDIR)/Client/private/DC/MessageDistributor.pm', |
| 102 |
'DC/UI/Canvas.pm' => '$(INST_LIBDIR)/Client/private/DC/UI/Canvas.pm', |
| 103 |
'DC/UI/Dockable.pm' => '$(INST_LIBDIR)/Client/private/DC/UI/Dockable.pm', |
| 104 |
'DC/UI/Dockbar.pm' => '$(INST_LIBDIR)/Client/private/DC/UI/Dockbar.pm', |
| 105 |
'DC/UI/Inventory.pm' => '$(INST_LIBDIR)/Client/private/DC/UI/Inventory.pm', |
| 106 |
'DC/UI/SpellList.pm' => '$(INST_LIBDIR)/Client/private/DC/UI/SpellList.pm', |
| 107 |
'DC/UI/Canvas.pm' => '$(INST_LIBDIR)/Client/private/DC/UI/Canvas.pm', |
| 108 |
'DC/UI/ChatView.pm' => '$(INST_LIBDIR)/Client/private/DC/UI/ChatView.pm', |
| 109 |
'DC/Item.pm' => '$(INST_LIBDIR)/Client/private/DC/Item.pm', |
| 110 |
'DC/Pod.pm' => '$(INST_LIBDIR)/Client/private/DC/Pod.pm', |
| 111 |
'DC/MapWidget.pm' => '$(INST_LIBDIR)/Client/private/DC/MapWidget.pm', |
| 112 |
'DC/Macro.pm' => '$(INST_LIBDIR)/Client/private/DC/Macro.pm', |
| 113 |
'docwiki.pst' => '$(INST_LIBDIR)/Client/private/resources/docwiki.pst', |
| 114 |
(map +($_ => "\$(INST_LIBDIR)/Client/private/$_"), manifest_resources), |
| 115 |
} |
| 116 |
); |
| 117 |
}; |
| 118 |
|
| 119 |
sub MY::postamble { |
| 120 |
my $self = shift; |
| 121 |
|
| 122 |
# try to add MANIFEST to CONFIGDEP |
| 123 |
s/^CONFIGDEP = /CONFIGDEP = MANIFEST /m |
| 124 |
for @{ $self->{RESULT} }; |
| 125 |
|
| 126 |
my $pods = join " ", <pod/*.pod>; |
| 127 |
|
| 128 |
<<EOF |
| 129 |
|
| 130 |
all :: docwiki.pst |
| 131 |
|
| 132 |
docwiki.pst: bin/pod2wiki $pods |
| 133 |
\$(PERL) -Mlib=. bin/pod2wiki $pods |
| 134 |
|
| 135 |
EOF |
| 136 |
} |
| 137 |
|