From a948039c0dda4641120f407d2e3b439eee5caeb7 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Wed, 2 Jan 2013 19:41:33 +0000 Subject: [PATCH] - Use aclocal to find the aclocal directory as pointed out by scott on the ML - Add another patch: disable window centering and a leftover PrinttoStream call - Add a version of sdl-config that is hybrid-aware --- media-libs/libsdl/libsdl-1.2-hg.bep | 5 +- media-libs/libsdl/patches/libsdl-1.2-hg.patch | 33 ++++++++ media-libs/libsdl/sdl-config | 77 +++++++++++++++++++ 3 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 media-libs/libsdl/sdl-config diff --git a/media-libs/libsdl/libsdl-1.2-hg.bep b/media-libs/libsdl/libsdl-1.2-hg.bep index 5f34e4af3..217a36dae 100644 --- a/media-libs/libsdl/libsdl-1.2-hg.bep +++ b/media-libs/libsdl/libsdl-1.2-hg.bep @@ -7,7 +7,7 @@ STATUS_HAIKU="stable" DEPEND="" BUILD { cd libsdl-1.2-hg - cp /boot/common/data/aclocal/libtool.m4 acinclude + cp `aclocal --print-ac-dir`/libtool.m4 acinclude ./autogen.sh MANDIR=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man LIBDIR=`finddir B_COMMON_LIB_DIRECTORY` @@ -15,13 +15,14 @@ BUILD { --datarootdir=`finddir B_COMMON_DATA_DIRECTORY` \ --libdir=$LIBDIR \ --mandir=$MANDIR - cp /boot/common/bin/libtool libtool + cp /boot/common/bin/libtool . make } INSTALL { cd libsdl-1.2-hg make install + cp ../../sdl-config `which sdl-config` } TEST { diff --git a/media-libs/libsdl/patches/libsdl-1.2-hg.patch b/media-libs/libsdl/patches/libsdl-1.2-hg.patch index 04e43a4fa..acc475381 100644 --- a/media-libs/libsdl/patches/libsdl-1.2-hg.patch +++ b/media-libs/libsdl/patches/libsdl-1.2-hg.patch @@ -16,3 +16,36 @@ SDL_MaskSignals(&omask); return (-1); } +diff -r 9cff1c7c0fff src/video/bwindow/SDL_sysvideo.cc +--- libsdl-1.2-hg/src/video/bwindow/SDL_sysvideo.cc dim. juin 03 05:03:45 2012 -0400 ++++ b/src/video/bwindow/SDL_sysvideo.cc sam. juin 09 11:01:28 2012 +0200 +@@ -456,14 +456,6 @@ + // printf("Going windowed\n"); + SDL_Win->SetFullScreen(fullscreen); + +- // Calculate offsets for centering the window (in window mode) and for +- // dentering the bitmap (in full screen mode). +- BRect bounds = bscreen.Frame(); +- bounds.PrintToStream(); +- int32 cx = (bounds.IntegerWidth() - width)/2; +- int32 cy = (bounds.IntegerHeight() - height)/2; +- +- // printf ("cx = %d, cy = %d\n", cx, cy); + if (!SDL_Win->IsFullScreen()) { + // printf("Doing not fullscreen stuff.\n"); + // We are not in full screen mode, so we want to change the window +@@ -471,9 +463,13 @@ + SDL_Win->ResizeTo(width, height); + + // And also center the window and reset the drawing offset. +- SDL_Win->MoveTo(cx, cy); + SDL_Win->SetXYOffset(0, 0); + } else { ++ // Calculate offsets for centering the bitmap ++ BRect bounds = bscreen.Frame(); ++ int32 cx = (bounds.IntegerWidth() - width)/2; ++ int32 cy = (bounds.IntegerHeight() - height)/2; ++ + // printf("Doing fullscreen stuff."); + // Center the bitmap whenever we are in full screen mode. + SDL_Win->SetXYOffset(cx, cy); diff --git a/media-libs/libsdl/sdl-config b/media-libs/libsdl/sdl-config new file mode 100644 index 000000000..7e19ca3a8 --- /dev/null +++ b/media-libs/libsdl/sdl-config @@ -0,0 +1,77 @@ +#!/bin/sh + +libDir=`finddir B_SYSTEM_LIB_DIRECTORY` + +# Determine which GCC we're running +if [ -f "$libDir"/libsupc++.so ] ; then + HAIKU_GCC_VERSION=4 +else + HAIKU_GCC_VERSION=2 +fi + +SETGCC_OUTPUT=`setgcc` +CURRENT_COMPILER=${SETGCC_OUTPUT: -1:1} + +if [ $CURRENT_COMPILER == $HAIKU_GCC_VERSION ] ; then + libdir=`finddir B_COMMON_LIB_DIRECTORY` +else + libdir=`finddir B_COMMON_LIB_DIRECTORY`/gcc$CURRENT_COMPILER +fi + +prefix=/boot/common +exec_prefix=${prefix} +exec_prefix_set=no + +#usage="\ +#Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]" +usage="\ +Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]" + +if test $# -eq 0; then + echo "${usage}" 1>&2 + exit 1 +fi + +while test $# -gt 0; do + case "$1" in + -*=*) optarg=`echo "$1" | LC_ALL="C" sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case $1 in + --prefix=*) + prefix=$optarg + if test $exec_prefix_set = no ; then + exec_prefix=$optarg + fi + ;; + --prefix) + echo $prefix + ;; + --exec-prefix=*) + exec_prefix=$optarg + exec_prefix_set=yes + ;; + --exec-prefix) + echo $exec_prefix + ;; + --version) + echo 1.2.15 + ;; + --cflags) + echo -I${prefix}/include/SDL -D_GNU_SOURCE=1 + ;; +# --libs) +# echo -L$libdir -lSDL +# ;; +# --static-libs) + --libs|--static-libs) + echo -L$libdir -lSDL -liconv -lGL -lroot -lbe -lmedia -lgame -ldevice -ltextencoding + ;; + *) + echo "${usage}" 1>&2 + exit 1 + ;; + esac + shift +done