1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-20 04:02:27 +00:00
freebsd-ports/emulators/mupen64plus-core/Makefile.common
Jose Alonso Cardenas Marquez 1fa5c449b1 - Update to 1.5
2009-01-14 02:03:05 +00:00

213 lines
6.1 KiB
Makefile

USE_DOS2UNIX= *.c *.cpp *.h *.H *.ini *.conf
DISTNAME= ${PORTNAME:S/m/M/:S/pl/Pl/}-${PORTVERSION:S/./-/g}-src
PATCHDIR= ${.CURDIR}/files
WRKSRC?= ${WRKDIR}/${DISTNAME}
EXTRACT_AFTER_ARGS= | ${TAR} -xf - "${DISTNAME}/Makefile" "${DISTNAME}/mupen64plus.desktop.in" \
"${DISTNAME}/pre.mk" "${DISTNAME}/release.mk" "${DISTNAME}/config/*" \
"${DISTNAME}/main/*" "${DISTNAME}/plugins/*" "${DISTNAME}/opengl/*"
.if ${PKGNAMESUFFIX} == "-base"
USE_GL= yes
USE_SDL= sdl
LIB_DEPENDS+= freetype.9:${PORTSDIR}/print/freetype2
. if defined(WITH_NOGUI)
USE_GNOME= #
MAKE_ENV+= GUI= NONE
. endif
.if defined(WITH_QT4)
USE_GNOME= #
USE_QT_VER= 4
BUILD_DEPENDS+= lrelease-qt4:${PORTSDIR}/devel/qt4-linguist
MAKE_ENV+= GUI= QT4
HAVE_QT4= yes
PLIST_SUB+= TRANSLATIONS=""
.else
PLIST_SUB+= TRANSLATIONS="@comment "
.endif
ALL_TARGET= mupen64plus
EXTRACT_AFTER_ARGS+= "${DISTNAME}/RELEASE" "${DISTNAME}/README" "${DISTNAME}/doc/*" "${DISTNAME}/lang/*" \
"${DISTNAME}/icons/*" "${DISTNAME}/memory/*" "${DISTNAME}/r4300/*" "${DISTNAME}/debugger/*" \
"${DISTNAME}/translations/*"
MAN1= mupen64plus.1
.else
EXTRA_PATCHES?= ${.CURDIR}/../mupen64plus-base/files/patch-Makefile \
${.CURDIR}/../mupen64plus-base/files/patch-pre.mk
PLIST= ${WRKDIR}/pkg-plist
.endif
.if ${PKGNAMESUFFIX} == "-dummyaudio"
ALL_TARGET= plugins/dummyaudio.so
EXTRACT_AFTER_ARGS+= "${DISTNAME}/dummy_audio/*"
.endif
.if ${PKGNAMESUFFIX} == "-dummyinput"
ALL_TARGET= plugins/dummyinput.so
EXTRACT_AFTER_ARGS+= "${DISTNAME}/dummy_input/*"
.endif
.if ${PKGNAMESUFFIX} == "-dummyvideo"
ALL_TARGET= plugins/dummyvideo.so
EXTRACT_AFTER_ARGS+= "${DISTNAME}/dummy_video/*"
.endif
.if ${PKGNAMESUFFIX} == "-sdlinput"
ALL_TARGET= plugins/blight_input.so
EXTRACT_AFTER_ARGS+= "${DISTNAME}/blight_input/*"
.endif
.if ${PKGNAMESUFFIX} == "-gln64"
ALL_TARGET= plugins/glN64.so
EXTRACT_AFTER_ARGS+= "${DISTNAME}/glN64/*"
.endif
.if ${PKGNAMESUFFIX} == "-sdlaudio"
ALL_TARGET= plugins/jttl_audio.so
EXTRACT_AFTER_ARGS+= "${DISTNAME}/jttl_audio/*"
.endif
.if ${PKGNAMESUFFIX} == "-sound"
ALL_TARGET= plugins/mupen64_audio.so
EXTRACT_AFTER_ARGS+= "${DISTNAME}/mupen64_audio/*"
.endif
.if ${PKGNAMESUFFIX} == "-input"
ALL_TARGET= plugins/mupen64_input.so
EXTRACT_AFTER_ARGS+= "${DISTNAME}/mupen64_input/*"
.endif
.if ${PKGNAMESUFFIX} == "-rsp"
ALL_TARGET= plugins/mupen64_hle_rsp_azimer.so
EXTRACT_AFTER_ARGS+= "${DISTNAME}/rsp_hle/*"
.endif
.if ${PKGNAMESUFFIX} == "-glide"
. if !defined(WITHOUT_YASM)
BUILD_DEPENDS= yasm:${PORTSDIR}/devel/yasm
MAKE_ENV+= ASM="${LOCALBASE}/bin/yasm"
. else
BUILD_DEPENDS= nasm:${PORTSDIR}/devel/nasm
MAKE_ENV+= ASM="${LOCALBASE}/bin/nasm"
. endif
ALL_TARGET= plugins/glide64.so
EXTRACT_AFTER_ARGS+= "${DISTNAME}/glide64/*"
.endif
.if ${PKGNAMESUFFIX} == "-rice"
ALL_TARGET= plugins/ricevideo.so
EXTRACT_AFTER_ARGS+= "${DISTNAME}/rice_video/*"
.endif
post-configure:
.for f in ${FIXFILES}
@${REINPLACE_CMD} -e 's|malloc.h|stdlib.h|' ${WRKSRC}/${f}
.endfor
post-extract:
.if ${PKGNAMESUFFIX} == "-base"
${GUNZIP_CMD} ${WRKSRC}/doc/${MAN1}.gz
.endif
.if ${PKGNAMESUFFIX} != "-base"
pre-install:
@${RM} -f ${PLIST}
. if ${PKGNAMESUFFIX} == "-glide"
@${ECHO_CMD} "%%DATADIR%%/config/${PLUGIN_NAME:S/g/G/}.ini" >> ${PLIST}
@${ECHO_CMD} "@dirrmtry %%DATADIR%%/config" >> ${PLIST}
. endif
. if ${PKGNAMESUFFIX} == "-rice"
@${ECHO_CMD} "%%DATADIR%%/config/${PLUGIN_NAME:S/r/R/:S/v/V/}.cfg" >> ${PLIST}
@${ECHO_CMD} "%%DATADIR%%/config/${PLUGIN_NAME:S/r/R/:S/v/V/}Linux.ini" >> ${PLIST}
@${ECHO_CMD} "@dirrmtry %%DATADIR%%/config" >> ${PLIST}
. endif
. if ${PKGNAMESUFFIX} == "-glN64"
@${ECHO_CMD} "%%DATADIR%%/config/${PLUGIN_NAME}.conf" >> ${PLIST}
@${ECHO_CMD} "@dirrmtry %%DATADIR%%/config" >> ${PLIST}
. endif
. if ${PKGNAMESUFFIX} == "-sdlaudio"
@${ECHO_CMD} "%%DATADIR%%/config/${PLUGIN_NAME}.conf" >> ${PLIST}
@${ECHO_CMD} "@dirrmtry %%DATADIR%%/config" >> ${PLIST}
. endif
. if ${PKGNAMESUFFIX} == "-sdlinput"
@${ECHO_CMD} "%%DATADIR%%/config/${PLUGIN_NAME}.conf" >> ${PLIST}
@${ECHO_CMD} "@dirrmtry %%DATADIR%%/config" >> ${PLIST}
. endif
@${ECHO_CMD} "%%DATADIR%%/plugins/${PLUGIN_NAME}.so" >> ${PLIST}
@${ECHO_CMD} "@dirrmtry %%DATADIR%%/plugins" >> ${PLIST}
@${ECHO_CMD} "@dirrmtry %%DATADIR%%" >> ${PLIST}
.endif
do-install:
.if ${PKGNAMESUFFIX} == "-base"
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin/
@${MKDIR} ${DATADIR}/config
${INSTALL_DATA} ${WRKSRC}/config/mupen64plus.conf ${DATADIR}/config/
@${MKDIR} ${DATADIR}/lang
${INSTALL_DATA} ${WRKSRC}/lang/* ${DATADIR}/lang/
@${MKDIR} ${DATADIR}/icons
@cd ${WRKSRC}/icons && \
${FIND} * -type d -exec ${MKDIR} "${DATADIR}/icons/{}" \; && \
${FIND} * -type f -exec ${INSTALL_DATA} "${WRKSRC}/icons/{}" "${DATADIR}/icons/" \;
@${MKDIR} ${DESKTOPDIR}
${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.desktop ${DESKTOPDIR}
${INSTALL_MAN} ${WRKSRC}/doc/${MAN1} ${PREFIX}/man/man1/
. if defined(HAVE_QT4)
@${MKDIR} ${DATADIR}/translations
${INSTALL_DATA} ${WRKSRC}/translations/*.qm ${DATADIR}/translations
. endif
. if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/RELEASE ${DOCSDIR}/RELEASE
. endif
.else
@${MKDIR} ${DATADIR}/plugins
. if ${PKGNAMESUFFIX} == "-glide"
@${MKDIR} ${DATADIR}/config
${INSTALL_DATA} ${WRKSRC}/config/${PLUGIN_NAME:S/g/G/}.ini ${DATADIR}/config/
. endif
. if ${PKGNAMESUFFIX} == "-rice"
@${MKDIR} ${DATADIR}/config
${INSTALL_DATA} ${WRKSRC}/config/${PLUGIN_NAME:S/r/R/:S/v/V/}.cfg ${DATADIR}/config/
${INSTALL_DATA} ${WRKSRC}/config/${PLUGIN_NAME:S/r/R/:S/v/V/}Linux.ini ${DATADIR}/config/
. endif
. if ${PKGNAMESUFFIX} == "-glN64"
@${MKDIR} ${DATADIR}/config
${INSTALL_DATA} ${WRKSRC}/config/${PLUGIN_NAME}.conf ${DATADIR}/config/
. endif
. if ${PKGNAMESUFFIX} == "-sdlaudio"
@${MKDIR} ${DATADIR}/config
${INSTALL_DATA} ${WRKSRC}/config/${PLUGIN_NAME}.conf ${DATADIR}/config/
. endif
. if ${PKGNAMESUFFIX} == "-sdlinput"
@${MKDIR} ${DATADIR}/config
${INSTALL_DATA} ${WRKSRC}/config/${PLUGIN_NAME}.conf ${DATADIR}/config/
. endif
${INSTALL_PROGRAM} ${WRKSRC}/plugins/${PLUGIN_NAME}.so ${DATADIR}/plugins/
.endif