Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 300640

Summary: games-action/openlierox needs media-libs/libsdl[joystick]
Product: Gentoo Linux Reporter: Märt Bakhoff <mbakhoff>
Component: [OLD] GamesAssignee: Sebastian Pipping <sping>
Status: RESOLVED FIXED    
Severity: minor CC: albzey
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Märt Bakhoff 2010-01-11 22:37:14 UTC
openlierox fails to build without media-libs/libsdl[joystick]:

CMakeFiles/openlierox.dir/src/client/CInput.o: In function `updateAxisStates()':
CInput.cpp:(.text+0x13e): undefined reference to `SDL_JoystickGetAxis'
CInput.cpp:(.text+0x156): undefined reference to `SDL_JoystickGetAxis'
CInput.cpp:(.text+0x16e): undefined reference to `SDL_JoystickGetAxis'
CInput.cpp:(.text+0x186): undefined reference to `SDL_JoystickGetAxis'
CInput.cpp:(.text+0x19b): undefined reference to `SDL_JoystickGetAxis'

Reproducible: Always

Steps to Reproduce:
Comment 1 Sebastian Pipping gentoo-dev 2010-01-12 01:16:52 UTC
Märt, thanks for reporting!

Albert, anything we can do to not make it require joystick?
Comment 2 Albert Zeyer 2010-01-12 01:26:30 UTC
I wonder that it compiles fine but fails to link. So libsdl[-joystick] still contains all the joystick headers, i.e. defines unavailable functions? That seem to be another bug in libsdl[-joystick] then.

I don't know if there is some C preprocessor macro or something by SDL which states that joystick support was not compiled in (but as the headers already seem wrong, I guess there is not - or the libsdl ebuild is really messed up).

I see two options:

1. I add a custom preprocessor makro check into the OLX source, where you can disable joystick support. Then we can just pass this to CMake.

2. Or we just patch the source directly via the ebuild in case of no joystick.

Btw., another problem: In what case do you want to have joystick support? If that USE flag is set right now or if it was set for libsdl?
Comment 3 Albert Zeyer 2010-01-12 01:29:31 UTC
Or something like this:

joystick? (libsdl[joystick])
!joystick? (libsdl)

But it all will get messed up a bit... I wonder if it is worth or if we maybe just make it depending on libsdl[joystick] in all cases?
Comment 4 Sebastian Pipping gentoo-dev 2010-01-12 01:35:09 UTC
(In reply to comment #2)
> 1. I add a custom preprocessor makro check into the OLX source, where you can
> disable joystick support. Then we can just pass this to CMake.

That would be cool for the next release.  Any plans on a date yet?


> 2. Or we just patch the source directly via the ebuild in case of no joystick.

That would be cool before the next release unless that's coming around the corner in the next say 5 days.


> Btw., another problem: In what case do you want to have joystick support? If
> that USE flag is set right now or if it was set for libsdl?

There's a global use flag "joystick".

As you say, this is the way to:
  joystick? ( media-libs/libsdl[joystick] )
  !joystick? ( media-libs/libsdl )

Always depending on media-libs/libsdl[joystick] is a no-go as it makes some people recompile SDL for nothing.
Comment 5 Albert Zeyer 2010-01-12 02:03:59 UTC
It's unprobable that we make a new release in the next 5 days. (Not impossible though.)

Anyway, you can just take this patch (just applied to Git):
http://openlierox.git.sourceforge.net/git/gitweb.cgi?p=openlierox/openlierox;a=patch;h=cb6fec84b098472fb3a132f892de1be0080ad576;hp=089ba5b8b78d58050bd40e2739d7f732540af82a

I didn't added an option to CMake yet but you can just directly add it via CXX_FLAGS. Or should I add also a CMake option for it?
Comment 6 Sebastian Pipping gentoo-dev 2010-01-12 14:00:51 UTC
Anything that keeps the ebuild clean would be cool.  Putting it into CPPFLAGS/CXXFLAGS dirtier than necessary IMHO.  Thanks for working on it.
Comment 7 Albert Zeyer 2010-01-12 15:52:56 UTC
Then take also this patch. This one adds the option to CMake. Just pass DISABLE_JOYSTICK=Yes to it to disable it.

http://openlierox.git.sourceforge.net/git/gitweb.cgi?p=openlierox/openlierox;a=patch;h=6b4e0a3ebcc2f43e1918ff84ddb25f87accbcd78
Comment 8 Sebastian Pipping gentoo-dev 2010-01-12 16:34:24 UTC
Thanks!  All integrated now, closing.  Please re-open if needed.