Add games-util/joystick from portage, enable arm

jstest is useful for testing.

BUG=chromium-os:30273
TEST=emerge-$BOARD games-util/joystick

Change-Id: I5a79a5dbf5ea2e65899524f4c47a2f1cfecb3f05
Reviewed-on: https://gerrit.chromium.org/gerrit/21549
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Scott James Remnant <keybuk@chromium.org>
Tested-by: Scott James Remnant <keybuk@chromium.org>
This commit is contained in:
Scott James Remnant 2012-05-01 14:41:32 -07:00 committed by Gerrit
parent b82e83f427
commit 555ec26129
2 changed files with 113 additions and 0 deletions

View File

@ -0,0 +1,79 @@
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -20,13 +20,16 @@
# 02110-1301 USA.
MANPAGES = inputattach.1 jstest.1 jscal.1 fftest.1 \
- ffmvforce.1 ffset.1 ffcfstress.1 jscal-store.1 \
+ ffset.1 ffcfstress.1 jscal-store.1 \
jscal-restore.1
+ifneq ($(USE_SDL),no)
+MANPAGES += ffmvforce.1
+endif
PREFIX ?= /usr/local
install:
install -d $(DESTDIR)$(PREFIX)/share/man/man1
- install $(MANPAGES) $(DESTDIR)$(PREFIX)/share/man/man1
+ install -m 644 $(MANPAGES) $(DESTDIR)$(PREFIX)/share/man/man1
.PHONY: install
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -25,11 +25,19 @@
# Edit the options below to suit your needs
#
-CC = gcc
-CFLAGS = -g -O2 -Wall -I../linux/include
+CC ?= gcc
+PKG_CONFIG ?= pkg-config
+CFLAGS ?= -g -O2
+CFLAGS += -Wall
+CPPFLAGS += -I../linux/include
+SDL_CFLAGS = $(shell $(PKG_CONFIG) --cflags sdl)
+SDL_LIBS = $(shell $(PKG_CONFIG) --libs sdl)
-PROGRAMS = inputattach jstest jscal fftest ffmvforce ffset \
+PROGRAMS = inputattach jstest jscal fftest ffset \
ffcfstress jscal-restore jscal-store
+ifneq ($(USE_SDL),no)
+PROGRAMS += ffmvforce
+endif
PREFIX ?= /usr/local
@@ -40,27 +48,27 @@
$(RM) *.o *.swp $(PROGRAMS) *.orig *.rej map *~
ffcfstress: ffcfstress.c
- $(CC) -O2 -funsigned-char ffcfstress.c -lm -o ffcfstress
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -funsigned-char ffcfstress.c -lm -o ffcfstress
ffmvforce.o: ffmvforce.c
- $(CC) -c $(CFLAGS) $(CPPFLAGS) $^ -o $@ `sdl-config --cflags`
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $^ -o $@
ffmvforce: ffmvforce.o
- $(CC) $^ -o $@ $(LDFLAGS) -g -lm `sdl-config --libs`
+ $(CC) $^ -o $@ $(CFLAGS) $(LDFLAGS) -lm $(SDL_LIBS)
axbtnmap.o: axbtnmap.c axbtnmap.h
jscal.o: jscal.c axbtnmap.h
jscal: jscal.o axbtnmap.o
- $(CC) $(CFLAGS) $(CPPFLAGS) $^ -lm -o $@
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $^ -lm -o $@
jstest.o: jstest.c axbtnmap.h
jstest: jstest.o axbtnmap.o
gencodes: gencodes.c scancodes.h
- $(CC) $(CFLAGS) $(CPPFLAGS) gencodes.c -o gencodes
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) gencodes.c -o gencodes
jscal-restore: jscal-restore.in
sed "s^@@PREFIX@@^$(PREFIX)^g" < $^ > $@

View File

@ -0,0 +1,34 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-util/joystick/joystick-1.4.2.ebuild,v 1.4 2012/04/15 16:53:35 maekke Exp $
EAPI="4"
inherit eutils toolchain-funcs
MY_P="linuxconsoletools-${PV}"
DESCRIPTION="joystick testing utilities"
HOMEPAGE="http://sourceforge.net/projects/linuxconsole/ http://atrey.karlin.mff.cuni.cz/~vojtech/input/"
SRC_URI="mirror://sourceforge/linuxconsole/files/${MY_P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 arm ppc x86"
IUSE="sdl"
DEPEND="sdl? ( media-libs/libsdl[video] )
!<x11-libs/tslib-1.0-r2"
RDEPEND="${DEPEND}"
S=${WORKDIR}/${MY_P}
src_prepare() {
epatch "${FILESDIR}"/${P}-build.patch
export PREFIX=/usr
}
src_compile() {
tc-export CC PKG_CONFIG
export USE_SDL=$(usex sdl)
emake
}