freebsd-ports/emulators/mupen64plus-core/Makefile.common

129 lines
4.1 KiB
Makefile
Raw Normal View History

USES+= dos2unix
DOS2UNIX_GLOB= *.c *.cpp *.h *.H *.ini *.conf
DISTNAME= ${PORTNAME}-bundle-src-${PORTVERSION}
PATCHDIR= ${.CURDIR}/files
BUILD_WRKSRC?= ${WRKSRC}/source/${PORTNAME}${PKGNAMESUFFIX}/projects/unix
WRKSRC?= ${WRKDIR}/${DISTNAME}
EXTRACT_AFTER_ARGS?= "${DISTNAME}/source/${PORTNAME}-core/*" \
"${DISTNAME}/source/${PORTNAME}${PKGNAMESUFFIX}/*"
.if ${PKGNAMESUFFIX} == "-core"
LIB_DEPENDS+= libfreetype.so:print/freetype2 \
libpng.so:graphics/png \
libminizip.so:archivers/minizip
2009-01-14 03:03:05 +01:00
.else
PLIST= ${WRKDIR}/pkg-plist
.endif
.if ${PKGNAMESUFFIX} == "-video-rice"
LIB_DEPENDS+= libpng.so:graphics/png
.endif
2013-10-04 19:18:44 +02:00
.if ${PKGNAMESUFFIX} == "-video-glide64mk"
LIB_DEPENDS+= libboost_thread.so:devel/boost-libs
2013-10-04 19:18:44 +02:00
.endif
.if ${PKGNAMESUFFIX} != "-core"
2013-10-04 19:18:44 +02:00
post-patch:
@cd ${BUILD_WRKSRC} && ${REINPLACE_CMD} -e 's|gcc|${CC}|g' -e \
2015-06-15 05:27:50 +02:00
's|g++|${CXX}|g' -e 's|sdl-config|${SDL2_CONFIG}|g' Makefile
2013-10-04 19:18:44 +02:00
. if ${PKGNAMESUFFIX} == "-video-glide64mk2"
@cd ${WRKSRC}/source/${PORTNAME}${PKGNAMESUFFIX}/src && \
${REINPLACE_CMD} -e 's|#include <thread>||g' \
GlideHQ/TxQuantize.cpp GlideHQ/TxFilter.cpp && \
${REINPLACE_CMD} -e 's|(FxU32)NULL|(uintptr_t)NULL|g' \
Glide64/Main.cpp
. endif
. if ${PKGNAMESUFFIX} == "-video-glide64"
2014-03-24 05:49:02 +01:00
@cd ${WRKSRC}/${PORTNAME}${PKGNAMESUFFIX}/src && \
${REINPLACE_CMD} -e 's|__builtin_ia32_loadups|_mm_loadu_ps|g' -e \
's|__builtin_ia32_storeups|_mm_storeu_ps|g' \
3dmath.cpp && \
${REINPLACE_CMD} -e 's|\"G64_VERSION|\" G64_VERSION|g' -e \
's|FxU32|uintptr_t|g' \
Main.cpp
. endif
2009-01-06 22:54:58 +01:00
pre-install:
@${RM} ${PLIST}
. if ${PKGNAMESUFFIX} == "-video-rice"
@${ECHO_CMD} "%%DATADIR%%/RiceVideoLinux.ini" >> ${PLIST}
. endif
. if ${PKGNAMESUFFIX} == "-video-glide64"
@${ECHO_CMD} "%%DATADIR%%/Glide64.ini" >> ${PLIST}
. endif
2013-10-04 19:18:44 +02:00
. if ${PKGNAMESUFFIX} == "-video-glide64mk2"
@${ECHO_CMD} "%%DATADIR%%/Glide64mk2.ini" >> ${PLIST}
. endif
. if ${PKGNAMESUFFIX} == "-input-sdl"
@${ECHO_CMD} "%%DATADIR%%/InputAutoCfg.ini" >> ${PLIST}
. endif
. if ${PKGNAMESUFFIX} == "-ui-console"
@${ECHO_CMD} "man/man6/mupen64plus.6.gz" >> ${PLIST}
. endif
. if ${PKGNAMESUFFIX} != "-ui-console"
@${ECHO_CMD} "lib/${PORTNAME}/${PORTNAME}${PKGNAMESUFFIX}.so" >> ${PLIST}
. else
@${ECHO_CMD} "bin/${PORTNAME}" >> ${PLIST}
. endif
2014-11-13 15:32:39 +01:00
@${ECHO_CMD} "@dir %%DATADIR%%" >> ${PLIST}
.else
2014-03-24 01:22:02 +01:00
post-patch:
@cd ${BUILD_WRKSRC} && ${REINPLACE_CMD} -e 's|gcc|${CC}|g' -e \
's|g++|${CXX}|g' Makefile
.endif
do-install:
@${MKDIR} ${STAGEDIR}${DATADIR}
.if ${PKGNAMESUFFIX} == "-core"
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/libmupen64plus.so.2.0.0 \
${STAGEDIR}${PREFIX}/lib/libmupen64plus.so.2.0.0
${INSTALL_DATA} ${WRKSRC}/source/${PORTNAME}${PKGNAMESUFFIX}/data/* \
${STAGEDIR}${DATADIR}
2009-01-06 22:54:58 +01:00
@${MKDIR} ${STAGEDIR}${PREFIX}/include/${PORTNAME}
${INSTALL_DATA} ${WRKSRC}/source/${PORTNAME}${PKGNAMESUFFIX}/src/api/m64p_*.h \
${STAGEDIR}${PREFIX}/include/${PORTNAME}
2009-01-06 22:54:58 +01:00
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/source/${PORTNAME}${PKGNAMESUFFIX}/RELEASE \
${STAGEDIR}${DOCSDIR}/RELEASE
${LN} -sf ${PREFIX}/lib/libmupen64plus.so.2.0.0 ${STAGEDIR}${PREFIX}/lib/libmupen64plus.so.2
.else
. if ${PKGNAMESUFFIX} == "-ui-console"
${INSTALL_MAN} ${WRKSRC}/source/${PORTNAME}${PKGNAMESUFFIX}/doc/mupen64plus.6 ${STAGEDIR}${PREFIX}/man/man6/
. endif
. if ${PKGNAMESUFFIX} == "-video-rice"
${INSTALL_DATA} ${WRKSRC}/source/${PORTNAME}${PKGNAMESUFFIX}/data/RiceVideoLinux.ini ${STAGEDIR}${DATADIR}
. endif
. if ${PKGNAMESUFFIX} == "-video-glide64"
${INSTALL_DATA} ${WRKSRC}/${PORTNAME}${PKGNAMESUFFIX}/data/Glide64.ini ${STAGEDIR}${DATADIR}
. endif
2013-10-04 19:18:44 +02:00
. if ${PKGNAMESUFFIX} == "-video-glide64mk2"
${INSTALL_DATA} ${WRKSRC}/source/${PORTNAME}${PKGNAMESUFFIX}/data/Glide64mk2.ini ${STAGEDIR}${DATADIR}
2013-10-04 19:18:44 +02:00
. endif
. if ${PKGNAMESUFFIX} == "-input-sdl"
${INSTALL_DATA} ${WRKSRC}/source/${PORTNAME}${PKGNAMESUFFIX}/data/InputAutoCfg.ini ${STAGEDIR}${DATADIR}
. endif
. if ${PKGNAMESUFFIX} != "-ui-console"
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/${PORTNAME}${PKGNAMESUFFIX}.so ${STAGEDIR}${PREFIX}/lib/${PORTNAME}
. else
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
. endif
.endif