-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathh2xs.sh
executable file
·65 lines (55 loc) · 1013 Bytes
/
h2xs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
h2xs -n Graphics::Raylib::XS raylib.h \
-b5.8.0 -F-Wno-format -x -O -M'^(?x:
(?!GetDroppedFiles)
(?!LIGHTGRAY)
(?!GRAY)
(?!DARKGRAY)
(?!YELLOW)
(?!GOLD)
(?!ORANGE)
(?!PINK)
(?!RED)
(?!MAROON)
(?!GREEN)
(?!LIME)
(?!DARKGREEN)
(?!SKYBLUE)
(?!BLUE)
(?!DARKBLUE)
(?!PURPLE)
(?!VIOLET)
(?!DARKPURPLE)
(?!BEIGE)
(?!BROWN)
(?!DARKBROWN)
(?!WHITE)
(?!BLACK)
(?!BLANK)
(?!MAGENTA)
(?!RAYWHITE)
(?!RLAPI)
(?!CLITERAL)
(?!PI)
).*$'
echo 'mv Graphics-Raylib-XS XS'
rm -rd XS
mv Graphics-Raylib-XS XS
echo 'Patching generated .xs'
perl -pi -e 's/int format/int/g;s/arg3/format/g' XS/XS.xs
echo 'Patching Makefile.PL to use Alien'
perl -pi -e 'BEGIN{undef $/;}
s{
^WriteMakefile\(
(.*?)
^\);$
}{
use Alien::raylib;
WriteMakefile(
$1,
LIBS => [ Alien::raylib->libs,
"-L/usr/local/lib -l__cpu_model"],
INC => Alien::raylib->cflags,
dynamic_lib => { OTHERLDFLAGS => "-framework OpenGL -framework OpenAL" },
);
}xsm;' XS/Makefile.PL