summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
Diffstat (limited to 'games')
-rw-r--r--games/freetennis/Makefile27
-rw-r--r--games/freetennis/files/patch-Makefile4
-rw-r--r--games/freetennis/files/patch-freetennis.ml63
3 files changed, 79 insertions, 15 deletions
diff --git a/games/freetennis/Makefile b/games/freetennis/Makefile
index 4dc5dedf8f48..c44c0cca5137 100644
--- a/games/freetennis/Makefile
+++ b/games/freetennis/Makefile
@@ -11,18 +11,19 @@ WWW= https://freetennis.sourceforge.net/
LICENSE= GPLv2+
LICENSE_FILE= ${WRKSRC}/COPYING
-BUILD_DEPENDS= ocamlopt:lang/ocaml \
- ocaml-images>3.0:graphics/ocaml-images \
- ${OCAML_DEPENDS}
-RUN_DEPENDS= ${OCAML_DEPENDS}
-LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \
- libfreetype.so:print/freetype2
+BUILD_DEPENDS= ${OCAMLFIND_DEPEND} \
+ ${SA_DIR}/camlimages/META:graphics/ocaml-images \
+ ${SA_DIR}/lablGL/gl.ml:graphics/ocaml-lablgl \
+ ${SA_DIR}/lablgtk2/gtk.ml:x11-toolkits/ocaml-lablgtk2 \
+ ${SA_DIR}/sdl/sdl.mli:devel/ocaml-sdl
-OCAML_DEPENDS= ${LOCALBASE}/lib/ocaml/site-lib/lablgtk2/gtk.ml:x11-toolkits/ocaml-lablgtk2 \
- ${LOCALBASE}/lib/ocaml/lablGL/gl.ml:graphics/ocaml-lablgl \
- ${LOCALBASE}/lib/ocaml/site-lib/sdl/sdl.mli:devel/ocaml-sdl
+LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \
+ libfreetype.so:print/freetype2 \
+ libgtkgl-2.0.so:x11-toolkits/gtkglarea2 \
+ libharfbuzz.so:print/harfbuzz
USES= gettext gl gnome sdl tar:bzip2 xorg
+USE_OCAML= yes
USE_GNOME= atk cairo gdkpixbuf2 glib20 gtk20 pango
USE_GL= gl glu
USE_SDL= ttf mixer sdl
@@ -31,15 +32,15 @@ USE_XORG= x11 xext xmu
PLIST_FILES= bin/freetennis
PORTDATA= *
+SA_DIR= ${LOCALBASE}/${OCAML_SITELIBDIR}
+
post-patch:
@${REINPLACE_CMD} -e 's|sfxDir = "sfx"|sfxDir = "${DATADIR}/sfx"|; \
s|gfxDir = "graphics"|gfxDir = "${DATADIR}/graphics"|' \
${WRKSRC}/freetennis.ml
- @${REINPLACE_CMD} -Ee 's@(\+)(lablgtk2)@\1site-lib/\2@' \
- ${WRKSRC}/Makefile
do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/freetennis ${STAGEDIR}${PREFIX}/bin
- (cd ${WRKSRC} && ${COPYTREE_SHARE} "graphics sfx" ${STAGEDIR}${DATADIR})
+ @${INSTALL_PROGRAM} ${WRKSRC}/freetennis ${STAGEDIR}${PREFIX}/bin
+ @(cd ${WRKSRC} && ${COPYTREE_SHARE} "graphics sfx" ${STAGEDIR}${DATADIR})
.include <bsd.port.mk>
diff --git a/games/freetennis/files/patch-Makefile b/games/freetennis/files/patch-Makefile
index ec48c1eca801..9ea952a205c4 100644
--- a/games/freetennis/files/patch-Makefile
+++ b/games/freetennis/files/patch-Makefile
@@ -1,7 +1,7 @@
--- Makefile.orig 2005-11-21 21:20:33 UTC
+++ Makefile
-@@ -1,3 +1,3 @@
+@@ -1,3 +1,3 @@ all: freetennis.ml
# add -noassert for speedup
all: freetennis.ml
- ocamlopt -I +camlimages -I +lablGL -I +lablgtk2 -I +sdl -o freetennis bigarray.cmxa sdl.cmxa lablgtk.cmxa lablgl.cmxa ci_core.cmxa sdlmixer.cmxa sdlttf.cmxa unix.cmxa freetennis.ml
-+ ocamlopt -noassert -cclib -pthread -I +site-lib/camlimages -I +lablGL -I +lablgtk2 -I +site-lib/sdl -o freetennis bigarray.cmxa sdl.cmxa lablgtk.cmxa lablgl.cmxa camlimages_core.cmxa sdlmixer.cmxa sdlttf.cmxa unix.cmxa freetennis.ml
++ ocamlfind ocamlopt -linkpkg -noassert -package threads.posix -package bigarray -package camlimages.core -package lablgtk2.gl -package sdl.sdlmixer -package sdl.sdlttf -I +site-lib/lablGL -o freetennis lablgl.cmxa freetennis.ml
diff --git a/games/freetennis/files/patch-freetennis.ml b/games/freetennis/files/patch-freetennis.ml
new file mode 100644
index 000000000000..6bddc6ff45b8
--- /dev/null
+++ b/games/freetennis/files/patch-freetennis.ml
@@ -0,0 +1,63 @@
+--- freetennis.ml.orig 2005-11-21 21:20:33 UTC
++++ freetennis.ml
+@@ -764,13 +764,9 @@ module StringMap = Map.Make (String)
+ module StringMap = Map.Make (String)
+
+ (* "bool IntMap.t" is a map int -> bool *)
+-module IntMap = Map.Make (struct
+- type t = int
+- let compare = compare
+- end )
++module IntMap = Map.Make(Int)
+
+
+-
+ type leftOrRight = Right | Left
+
+ let oppositeDir d = match d with Right -> Left | Left -> Right
+@@ -2317,7 +2313,7 @@ let setAnim ~animName ~o ~restartIfSameAnimation =
+ let setAnim ~animName ~o ~restartIfSameAnimation =
+
+ let an , fr, st =
+- if 0 != (compare animName o.o3d_curAnimName) then
++ if 0 != (String.compare animName o.o3d_curAnimName) then
+ animName, 0, Animated 0.0
+ else
+ if restartIfSameAnimation then
+@@ -6641,6 +6637,7 @@ let _ =
+ else if !realisticPar && !newbiePar then
+ ArgumentError ("You cannot speficy both -realistic and -newbie. These are mutually exclusive flags.")
+ else
++ let compare = String.compare in
+ let translateName n =
+ if 0 = compare n "mats" then Some Mats
+ else if 0 = compare n "pete" then Some Pete
+@@ -6714,7 +6711,7 @@ let _ =
+ Server ( (soc, clientSocket), Unix.in_channel_of_descr clientSocket, Unix.out_channel_of_descr clientSocket)
+ )
+
+- else if 0 != compare !client "" then
++ else if 0 != String.compare !client "" then
+ let soc = Unix.socket Unix.PF_INET Unix.SOCK_STREAM 0 in
+ let inet_a = Unix.inet_addr_of_string !client in
+ print_endline "Connecting to server...";
+@@ -6913,7 +6910,7 @@ let _ =
+ assert (not (mem "CVS" l));
+ List.map (fun x -> dir ^ "/" ^ x) l in
+ let notCVS x =
+- 0 != (compare x "CVS") in
++ 0 != (String.compare x "CVS") in
+ addPath (filter notCVS (Array.to_list (Sys.readdir dir))) in
+ accumulate ~list:allFilesInDir ~f:makeTextureOfFile ~state:(handleOfTexture, nextFreeTextureIndex)
+
+@@ -7226,8 +7223,8 @@ let _ =
+ let filesWithIndices =
+ let files =
+ let notCVS x =
+- 0 != (compare x "CVS") in
+- List.sort compare (filter notCVS (Array.to_list (Sys.readdir d))) in
++ 0 != (String.compare x "CVS") in
++ List.sort String.compare (filter notCVS (Array.to_list (Sys.readdir d))) in
+ if List.length files != Array.length times then
+ (print_endline (d);
+ assert(false))