From a3eecc98e298f41bf5fd50aeac508cb5e43ea10c Mon Sep 17 00:00:00 2001 From: Alexey Dokuchaev Date: Thu, 21 Jan 2016 10:05:35 +0000 Subject: [PATCH] - Update `games/mvdsv' port to version 0.30 - Do not set DISTNAME, let the framework pick it for us - Stop "configuring" the build, the most substantial part of which was to determine system endianness (by compiling and running simple program); this is not just bogus, but does not work with anticipated cross-builds - Unbreak the build of `games/qwdtools' slave port --- games/mvdsv/Makefile | 16 +++---- games/mvdsv/distinfo | 4 +- games/mvdsv/files/patch-Makefile.BSD | 33 -------------- .../mvdsv/files/patch-build_make_Makefile.BSD | 33 ++++++++++++++ games/mvdsv/files/patch-src_bothdefs.h | 27 +++++++++++ .../patch-tools_qwdtools_source_Makefile.BSD | 45 +++++++++++++++++++ games/qwdtools/Makefile | 5 ++- 7 files changed, 118 insertions(+), 45 deletions(-) delete mode 100644 games/mvdsv/files/patch-Makefile.BSD create mode 100644 games/mvdsv/files/patch-build_make_Makefile.BSD create mode 100644 games/mvdsv/files/patch-src_bothdefs.h create mode 100644 games/mvdsv/files/patch-tools_qwdtools_source_Makefile.BSD diff --git a/games/mvdsv/Makefile b/games/mvdsv/Makefile index f54ce1c23959..bc5eeb64f285 100644 --- a/games/mvdsv/Makefile +++ b/games/mvdsv/Makefile @@ -2,11 +2,10 @@ # $FreeBSD$ PORTNAME?= mvdsv -PORTVERSION= 0.29 +PORTVERSION= 0.30 DISTVERSIONPREFIX= v PORTEPOCH= 2 CATEGORIES?= games -DISTNAME= mvdsv_${PORTVERSION}-sources MAINTAINER= danfe@FreeBSD.org COMMENT?= Enhanced QuakeWorld server with multi-view demos capability @@ -16,9 +15,9 @@ LICENSE= GPLv2 USE_GITHUB= yes GH_ACCOUNT= deurk -HAS_CONFIGURE= yes -CONFIGURE_ARGS= ${OPSYS} ${ARCH:C/.*(64)/\1/} -ALL_TARGET= ${PORTNAME} +BUILD_WRKSRC?= ${WRKSRC}/build/make +MAKEFILE= Makefile.BSD +MAKE_ARGS= UNAME=${OPSYS} PLIST_FILES= bin/${PORTNAME} @@ -38,10 +37,11 @@ KQUEUE_MAKE_ARGS_OFF= -DNOKQUEUE ASM_MAKE_ARGS_OFF= -DWITHOUT_X86_ASM post-patch: - @${REINPLACE_CMD} -e 's,gcc,${CC},' ${WRKSRC}/configure - @${REINPLACE_CMD} -e 's,^inline ,,' ${WRKSRC}/source/sv_sys_unix.c + @${REINPLACE_CMD} -e 's,^inline ,,' ${WRKSRC}/src/sv_sys_unix.c + @${REINPLACE_CMD} -e '/#include/s,/source,/src,' \ + ${WRKSRC}/tools/qwdtools/source/defs.h do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin + ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin .include diff --git a/games/mvdsv/distinfo b/games/mvdsv/distinfo index c3007ee79132..78d0b56be540 100644 --- a/games/mvdsv/distinfo +++ b/games/mvdsv/distinfo @@ -1,2 +1,2 @@ -SHA256 (mvdsv_0.29-sources_GH0.tar.gz) = 7d7d73da029315b0ab3761b9dcbf97eefb7640d0e3868fbe4763fc20550b5f12 -SIZE (mvdsv_0.29-sources_GH0.tar.gz) = 696126 +SHA256 (deurk-mvdsv-v0.30_GH0.tar.gz) = 6ebcca9b9807f72eda090ee618587e4b7b6d0f51447f59aec86eae4d4e218486 +SIZE (deurk-mvdsv-v0.30_GH0.tar.gz) = 664943 diff --git a/games/mvdsv/files/patch-Makefile.BSD b/games/mvdsv/files/patch-Makefile.BSD deleted file mode 100644 index 78a3039b17ff..000000000000 --- a/games/mvdsv/files/patch-Makefile.BSD +++ /dev/null @@ -1,33 +0,0 @@ ---- ./Makefile.BSD.orig 2009-09-24 22:16:17.000000000 +0200 -+++ ./Makefile.BSD 2013-05-05 23:13:58.797891197 +0200 -@@ -97,7 +97,7 @@ - ${SV_DIR}/pcre/get.o \ - ${SV_DIR}/pcre/pcre.o - --.if ${USE_ASM} == ${ASM} -+.if defined(ASM) && ${USE_ASM} == ${ASM} - SV_ASM_OBJS = \ - ${SV_DIR}/bothtoolsa.o \ - ${SV_DIR}/math.o -@@ -119,7 +119,7 @@ - ${QWDTOOLS_DIR}/sync.o \ - ${QWDTOOLS_DIR}/tools.o - --.if ${USE_ASM} == ${ASM} -+.if defined(ASM) && ${USE_ASM} == ${ASM} - QWDTOOLS_ASM_OBJS = \ - ${SV_DIR}/bothtoolsa.o - .endif -@@ -129,10 +129,10 @@ - ############################################################################# - - .c.o: -- ${CC} ${DO_CFLAGS} -c $< -o $*.o -+ ${CC} ${DO_CFLAGS} -c $< -o $@ - - .s.o: -- ${CC} ${DO_CFLAGS} -DELF -x assembler-with-cpp -c $< -o $*.o -+ ${CC} ${DO_CFLAGS} -DELF -x assembler-with-cpp -c $< -o $@ - - all: mvdsv qwdtools - ${STRIP} ${STRIP_FLAGS} mvdsv qwdtools diff --git a/games/mvdsv/files/patch-build_make_Makefile.BSD b/games/mvdsv/files/patch-build_make_Makefile.BSD new file mode 100644 index 000000000000..8abf5b0aad1b --- /dev/null +++ b/games/mvdsv/files/patch-build_make_Makefile.BSD @@ -0,0 +1,33 @@ +--- build/make/Makefile.BSD.orig 2011-10-06 07:24:17 UTC ++++ build/make/Makefile.BSD +@@ -17,7 +17,7 @@ SV_DIR = ../../src + # for gcc its like: make mvdsv FORCE32BITFLAGS=-m32 + # configure script add FORCE32BITFLAGS=-m32 + +-DO_CFLAGS = ${CFLAGS} -Wall -pipe -pthread -funsigned-char -DUSE_PR2 -D${BYTE_ORDER}Q__ ${FORCE32BITFLAGS} ++DO_CFLAGS = ${CFLAGS} -Wall -pipe -pthread -funsigned-char -DUSE_PR2 ${FORCE32BITFLAGS} + + .if !defined(NOKQUEUE) && (${UNAME} == "FreeBSD" || ${UNAME} == "DragonFly") + DO_CFLAGS += -DKQUEUE +@@ -94,7 +94,7 @@ SV_OBJS = \ + ${SV_DIR}/pcre/get.o \ + ${SV_DIR}/pcre/pcre.o + +-.if ${USE_ASM} == ${ASM} ++.if defined(ASM) && ${USE_ASM} == ${ASM} + SV_ASM_OBJS = \ + ${SV_DIR}/bothtoolsa.o \ + ${SV_DIR}/math.o +@@ -105,10 +105,10 @@ SV_ASM_OBJS = \ + ############################################################################# + + .c.o: +- ${CC} ${DO_CFLAGS} -c $< -o $*.o ++ ${CC} ${DO_CFLAGS} -c $< -o $@ + + .s.o: +- ${CC} ${DO_CFLAGS} -DELF -x assembler-with-cpp -c $< -o $*.o ++ ${CC} ${DO_CFLAGS} -DELF -x assembler-with-cpp -c $< -o $@ + + all: mvdsv + ${STRIP} ${STRIP_FLAGS} mvdsv diff --git a/games/mvdsv/files/patch-src_bothdefs.h b/games/mvdsv/files/patch-src_bothdefs.h new file mode 100644 index 000000000000..b4dc2a7703b7 --- /dev/null +++ b/games/mvdsv/files/patch-src_bothdefs.h @@ -0,0 +1,27 @@ +--- src/bothdefs.h.orig 2011-10-06 07:24:17 UTC ++++ src/bothdefs.h +@@ -174,21 +174,21 @@ float FloatSwap (float f); + } /* extern "C" */ + #endif + +-#ifdef __BIG_ENDIAN__Q__ ++#if _BYTE_ORDER == _BIG_ENDIAN + #define BigShort(x) (x) + #define BigLong(x) (x) + #define BigFloat(x) (x) + #define LittleShort(x) ShortSwap(x) + #define LittleLong(x) LongSwap(x) + #define LittleFloat(x) FloatSwap(x) +-#elif defined(__LITTLE_ENDIAN__Q__) ++#elif _BYTE_ORDER == _LITTLE_ENDIAN + #define BigShort(x) ShortSwap(x) + #define BigLong(x) LongSwap(x) + #define BigFloat(x) FloatSwap(x) + #define LittleShort(x) (x) + #define LittleLong(x) (x) + #define LittleFloat(x) (x) +-#elif defined(__PDP_ENDIAN__Q__) ++#elif _BYTE_ORDER == _PDP_ENDIAN + int LongSwapPDP2Big (int l); + int LongSwapPDP2Lit (int l); + float FloatSwapPDP2Big (float f); diff --git a/games/mvdsv/files/patch-tools_qwdtools_source_Makefile.BSD b/games/mvdsv/files/patch-tools_qwdtools_source_Makefile.BSD new file mode 100644 index 000000000000..a2a3cacdabf3 --- /dev/null +++ b/games/mvdsv/files/patch-tools_qwdtools_source_Makefile.BSD @@ -0,0 +1,45 @@ +--- tools/qwdtools/source/Makefile.BSD.orig 2011-10-06 07:24:17 UTC ++++ tools/qwdtools/source/Makefile.BSD +@@ -12,18 +12,14 @@ + # + + MAINDIR = ../../.. +-SV_DIR = $(MAINDIR)/source ++SV_DIR = $(MAINDIR)/src + QWDTOOLS_DIR = $(MAINDIR)/tools/qwdtools/source + + # To compile qwdtools as 32bit on 64bit target platform use next: + # for gcc its like: make qwdtools FORCE32BITFLAGS=-m32 + # configure script add FORCE32BITFLAGS=-m32 + +-DO_CFLAGS = ${CFLAGS} -Wall -pipe -pthread -funsigned-char -DUSE_PR2 -D${BYTE_ORDER}Q__ ${FORCE32BITFLAGS} +- +-.if !defined(NOKQUEUE) && (${UNAME} == "FreeBSD" || ${UNAME} == "DragonFly") +-DO_CFLAGS += -DKQUEUE +-.endif ++DO_CFLAGS = ${CFLAGS} -Wall -pipe -pthread -funsigned-char -DUSE_PR2 ${FORCE32BITFLAGS} + + WITH_OPTIMIZED_CFLAGS = YES + +@@ -60,7 +56,7 @@ QWDTOOLS_OBJS = \ + ${QWDTOOLS_DIR}/sync.o \ + ${QWDTOOLS_DIR}/tools.o + +-.if ${USE_ASM} == ${ASM} ++.if defined(ASM) && ${USE_ASM} == ${ASM} + QWDTOOLS_ASM_OBJS = \ + ${SV_DIR}/bothtoolsa.o + .endif +@@ -70,10 +66,10 @@ QWDTOOLS_ASM_OBJS = \ + ############################################################################# + + .c.o: +- ${CC} ${DO_CFLAGS} -c $< -o $*.o ++ ${CC} ${DO_CFLAGS} -c $< -o $@ + + .s.o: +- ${CC} ${DO_CFLAGS} -DELF -x assembler-with-cpp -c $< -o $*.o ++ ${CC} ${DO_CFLAGS} -DELF -x assembler-with-cpp -c $< -o $@ + + all: qwdtools + ${STRIP} ${STRIP_FLAGS} qwdtools diff --git a/games/qwdtools/Makefile b/games/qwdtools/Makefile index a29841fd7993..22b41aaca828 100644 --- a/games/qwdtools/Makefile +++ b/games/qwdtools/Makefile @@ -7,8 +7,9 @@ COMMENT= Convert QuakeWorld demos from QWD format to MVD format DESCR= ${.CURDIR}/pkg-descr PKGMESSAGE= /nonexistent +BUILD_WRKSRC= ${WRKSRC}/tools/qwdtools/source +GH_PROJECT= mvdsv + MASTERDIR= ${.CURDIR}/../mvdsv -BROKEN= fails to patch - .include "${MASTERDIR}/Makefile"