summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2020-07-05 02:23:09 +0200
committerDavid Seifert <soap@gentoo.org>2020-07-05 02:23:09 +0200
commite14bf63ddbb50035dd50aff7099c1bc7c0918647 (patch)
tree028d04d0bd7fd6f68b1dc8cfd1ddccc40320a898 /media-libs/libjsw
parentx11-base/xorg-server: Pass CPP to build system (diff)
downloadgentoo-e14bf63ddbb50035dd50aff7099c1bc7c0918647.tar.gz
gentoo-e14bf63ddbb50035dd50aff7099c1bc7c0918647.tar.bz2
gentoo-e14bf63ddbb50035dd50aff7099c1bc7c0918647.zip
media-libs/libjsw: Fix build system
Closes: https://bugs.gentoo.org/724664 Package-Manager: Portage-2.3.103, Repoman-2.3.23 Signed-off-by: David Seifert <soap@gentoo.org>
Diffstat (limited to 'media-libs/libjsw')
-rw-r--r--media-libs/libjsw/files/libjsw-1.5.8-build.patch179
-rw-r--r--media-libs/libjsw/libjsw-1.5.8.ebuild36
2 files changed, 145 insertions, 70 deletions
diff --git a/media-libs/libjsw/files/libjsw-1.5.8-build.patch b/media-libs/libjsw/files/libjsw-1.5.8-build.patch
index d786195058c1..ebe7dfc93ef7 100644
--- a/media-libs/libjsw/files/libjsw-1.5.8-build.patch
+++ b/media-libs/libjsw/files/libjsw-1.5.8-build.patch
@@ -1,60 +1,17 @@
---- libjsw/Makefile.old 2010-03-22 17:03:21.000000000 +0100
-+++ libjsw/Makefile 2010-03-22 17:07:02.000000000 +0100
-@@ -51,10 +51,10 @@
- # to debug the program.
- #
-
--CFLAGS = -Wall -O2 -g
--CFLAGS += -ffast-math
-+CFLAGS += -fPIC
-+CXXFLAGS += -fPIC
-
--CPPFLAGS = -D__cplusplus
-+CPPFLAGS += -D__cplusplus
-
-
- # ########################################################################
-@@ -82,11 +82,9 @@
- OBJ_C = $(SRC_C:.c=.o)
- OBJ_CPP = $(SRC_CPP:.cpp=.o)
- .c.o:
-- @echo "Compiling module $*.o"
-- @+$(CC) -c $*.c $(INC_DIRS) $(CFLAGS)
-+ $(CC) -c $*.c $(INC_DIRS) $(CFLAGS)
- .cpp.o:
-- @echo "Compiling module $*.o"
-- @+$(CPP) -c $*.cpp $(INC_DIRS) $(CFLAGS) $(CPPFLAGS)
-+ $(CPP) -c $*.cpp $(INC_DIRS) $(CXXFLAGS) $(CPPFLAGS)
-
-
- # ########################################################################
-@@ -95,13 +93,7 @@
- $(LIB): prebuild modules postbuild
-
- modules: $(OBJ_C) $(OBJ_CPP)
-- @echo -n "Linking modules..."
-- @$(CC) $(OBJ_C) $(OBJ_CPP) -Wl,-soname=$(LIB) -shared -o $(LIB) $(LIBS) $(LIB_DIRS)
-- @echo -n " "
-- @$(RM) $(RMFLAGS) $(LIBPFX).so
-- @$(LINK) -s $(LIB) $(LIBPFX).so
-- @$(LINK) -s $(LIB) $(LIBPFX).so.1
-- @-$(LS) $(LSFLAGS) $(LIB)
-+ $(CPP) $(OBJ_C) $(OBJ_CPP) -o $(LIB) $(LDFLAGS) $(LIBS) $(LIB_DIRS)
-
- prebuild:
- @echo "Building library \"$(LIB)\"..."
---- jscalibrator/Makefile.old 2010-03-22 17:08:07.000000000 +0100
-+++ jscalibrator/Makefile 2010-03-22 17:11:26.000000000 +0100
-@@ -59,9 +59,6 @@
+--- a/jscalibrator/Makefile
++++ b/jscalibrator/Makefile
+@@ -59,10 +59,7 @@
#CFLAGS = -Wall -O -g \
# `gtk-config --cflags`
-CFLAGS = -Wall -O6 -fomit-frame-pointer -funroll-loops -ffast-math \
- `gtk-config --cflags`
-
- CPPFLAGS = -D__cplusplus
+-CPPFLAGS = -D__cplusplus
++CPPFLAGS =
+ # ########################################################################
@@ -76,7 +73,7 @@
# to the LIB line depending on what you have set in the CFLAGS line
# farther above.
@@ -82,21 +39,27 @@
# ########################################################################
-@@ -117,11 +114,9 @@
+@@ -111,17 +108,13 @@
+ RM = rm
+ RMFLAGS = -f
+
+-CC = cc
+-CPP = c++
+ BIN = jscalibrator
OBJ_C = $(SRC_C:.c=.o)
OBJ_CPP = $(SRC_CPP:.cpp=.o)
.c.o:
- @echo "Compiling module $*.o"
- @+$(CC) -c $*.c $(INC_DIRS) $(CFLAGS)
-+ $(CC) -c $*.c $(INC_DIRS) $(CFLAGS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(INC_DIRS) -c $< -o $@
.cpp.o:
- @echo "Compiling module $*.o"
- @+$(CPP) -c $*.cpp $(INC_DIRS) $(CFLAGS) $(CPPFLAGS)
-+ $(CPP) -c $*.cpp $(INC_DIRS) $(CXXFLAGS) $(CPPFLAGS)
++ $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(INC_DIRS) -c $< -o $@
# ########################################################################
-@@ -130,10 +125,7 @@
+@@ -130,10 +123,7 @@
$(BIN): prebuild modules postbuild
modules: $(OBJ_C) $(OBJ_CPP)
@@ -104,7 +67,115 @@
- @$(CC) $(OBJ_C) $(OBJ_CPP) -o $(BIN) $(LIBS) $(LIB_DIRS)
- @echo -n " "
- @-$(LS) $(LSFLAGS) $(BIN)
-+ $(CC) $(OBJ_C) $(OBJ_CPP) -o $(BIN) $(LDFLAGS) $(LIB_DIRS) $(LIBS)
++ $(CC) $(LDFLAGS) $(OBJ_C) $(OBJ_CPP) -o $(BIN) $(LIB_DIRS) $(LIBS)
prebuild:
@echo "Building program \"$(BIN)\"..."
+--- a/jswdemos/Makefile
++++ b/jswdemos/Makefile
+@@ -1,5 +1,5 @@
+ # Compiler flags
+-CFLAGS = -g -O2 -Wall
++CFLAGS += -Wall
+
+ # Libraries to link to
+ LIB = -ljsw
+@@ -10,10 +10,6 @@
+ # Include paths
+ INC_DIRS =
+
+-# Compiler
+-CC = gcc
+-CPP = g++
+-
+ # Utilities
+ RM = rm
+ RMFLAGS = -f
+@@ -25,22 +21,23 @@
+
+ axis:
+ @echo "Compiling program \"axis\""
+- @$(CC) axis.c -o axis $(CFLAGS) $(LIB) $(LIB_DIRS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) axis.c -o axis $(LIB) $(LIB_DIRS)
+
+ basic:
+ @echo "Compiling program \"basic\""
+- @$(CC) basic.c -o basic $(CFLAGS) $(LIB) $(LIB_DIRS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) basic.c -o basic $(LIB) $(LIB_DIRS)
+
+ button:
+ @echo "Compiling program \"button\""
+- @$(CC) button.c -o button $(CFLAGS) $(LIB) $(LIB_DIRS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) button.c -o button $(LIB) $(LIB_DIRS)
+
+ listing:
+ @echo "Compiling program \"listing\""
+- @$(CC) listing.c -o listing $(CFLAGS) $(LIB) $(LIB_DIRS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) listing.c -o listing $(LIB) $(LIB_DIRS)
++
+ waitbtn:
+ @echo "Compiling program \"waitbtn\""
+- @$(CC) waitbtn.c -o waitbtn $(CFLAGS) $(LIB) $(LIB_DIRS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) waitbtn.c -o waitbtn $(LIB) $(LIB_DIRS)
+
+ # Clean up intermediate files
+ clean:
+--- a/libjsw/Makefile
++++ b/libjsw/Makefile
+@@ -51,17 +51,15 @@
+ # to debug the program.
+ #
+
+-CFLAGS = -Wall -O2 -g
+-CFLAGS += -ffast-math
+-
+-CPPFLAGS = -D__cplusplus
++CFLAGS += -fPIC
++CXXFLAGS += -fPIC
+
+
+ # ########################################################################
+ # Dependant Libraries:
+ #
+ INC_DIRS =
+-LIBS = -shared
++LIBS = -shared -Wl,-soname,libjsw.so.1
+ LIB_DIRS =
+
+
+@@ -76,18 +74,13 @@
+ LS = ls
+ LSFLAGS = -s -h -c --color=auto
+
+-CC = cc
+-CPP = c++
+ LIB = $(LIBPFX).so.$(LIBVER)
+ OBJ_C = $(SRC_C:.c=.o)
+ OBJ_CPP = $(SRC_CPP:.cpp=.o)
+ .c.o:
+- @echo "Compiling module $*.o"
+- @+$(CC) -c $*.c $(INC_DIRS) $(CFLAGS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(INC_DIRS) -c $< -o $@
+ .cpp.o:
+- @echo "Compiling module $*.o"
+- @+$(CPP) -c $*.cpp $(INC_DIRS) $(CFLAGS) $(CPPFLAGS)
+-
++ $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(INC_DIRS) -c $< -o $@
+
+ # ########################################################################
+ # Build Rules:
+@@ -95,13 +88,7 @@
+ $(LIB): prebuild modules postbuild
+
+ modules: $(OBJ_C) $(OBJ_CPP)
+- @echo -n "Linking modules..."
+- @$(CC) $(OBJ_C) $(OBJ_CPP) -Wl,-soname=$(LIB) -shared -o $(LIB) $(LIBS) $(LIB_DIRS)
+- @echo -n " "
+- @$(RM) $(RMFLAGS) $(LIBPFX).so
+- @$(LINK) -s $(LIB) $(LIBPFX).so
+- @$(LINK) -s $(LIB) $(LIBPFX).so.1
+- @-$(LS) $(LSFLAGS) $(LIB)
++ $(CXX) $(LDFLAGS) $(OBJ_C) $(OBJ_CPP) -o $(LIB) $(LIBS) $(LIB_DIRS)
+
+ prebuild:
+ @echo "Building library \"$(LIB)\"..."
diff --git a/media-libs/libjsw/libjsw-1.5.8.ebuild b/media-libs/libjsw/libjsw-1.5.8.ebuild
index c025a7f50f9f..35a137e44220 100644
--- a/media-libs/libjsw/libjsw-1.5.8.ebuild
+++ b/media-libs/libjsw/libjsw-1.5.8.ebuild
@@ -1,8 +1,9 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
-inherit eutils multilib
+EAPI=7
+
+inherit toolchain-funcs
DESCRIPTION="provide a uniform API and user configuration for joysticks and game controllers"
HOMEPAGE="http://freshmeat.net/projects/libjsw/"
@@ -11,34 +12,37 @@ SRC_URI="http://wolfsinger.com/~wolfpack/packages/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ppc ~ppc64 x86"
-IUSE=""
-DEPEND=""
+PATCHES=(
+ "${FILESDIR}"/${P}-build.patch # 724664
+)
src_prepare() {
- cp include/jsw.h libjsw/
- epatch "${FILESDIR}"/${P}-build.patch
+ default
+
+ cp include/jsw.h libjsw/ || die
bunzip2 libjsw/man/* || die
}
+src_configure() {
+ tc-export CC CXX
+}
+
src_compile() {
- LDFLAGS+=" -Wl,-soname,libjsw.so.1"
- cd libjsw
- emake
- ln -s libjsw.so.${PV} libjsw.so
+ emake -C libjsw
}
src_install() {
- insinto /usr/include
- doins include/jsw.h
+ doheader include/jsw.h
dodoc README
- docinto jswdemos
- dodoc jswdemos/*
+ dodoc -r jswdemos
+ docompress -x /usr/share/doc/${PF}/jswdemos
- cd "${S}"/libjsw
+ cd libjsw || die
dolib.so libjsw.so.${PV}
dosym libjsw.so.${PV} /usr/$(get_libdir)/libjsw.so
dosym libjsw.so.${PV} /usr/$(get_libdir)/libjsw.so.1
+
doman man/*
}