USE_DOS2UNIX= *.c *.cpp *.h *.H *.ini DISTNAME= ${PORTNAME}_src-${MUPEN64VERSION} PATCHDIR= ${.CURDIR}/files WRKSRC?= ${WRKDIR}/${DISTNAME} EXTRACT_AFTER_ARGS= | ${TAR} -xf - ${DISTNAME}/Makefile ${DISTNAME}/config.h \ ${DISTNAME}/main ${DISTNAME}/plugins .if defined(HAVE_GTK2) .include <${PORTSDIR}/Mk/bsd.gnome.mk> USE_GNOME= pkgconfig gtk20 .else .include <${PORTSDIR}/Mk/bsd.gnome.mk> USE_GNOME= gtk12 .endif .if ${PKGNAMESUFFIX} == "-base" USE_GL= yes USE_SDL= sdl . if defined(HAVE_VCR) LIB_DEPENDS= aviplay.0:${PORTSDIR}/multimedia/avifile . endif ALL_TARGET= mupen64 mupen64_nogui EXTRACT_AFTER_ARGS+= ${DISTNAME}/README.vcr ${DISTNAME}/doc ${DISTNAME}/lang ${DISTNAME}/logo.xpm \ ${DISTNAME}/memory ${DISTNAME}/mupen64.ini ${DISTNAME}/r4300 \ ${DISTNAME}/whatsnew.txt .else EXTRA_PATCHES?= ${.CURDIR}/../mupen64-base/files/patch-Makefile PLIST= ${WRKDIR}/pkg-plist .endif .if ${PKGNAMESUFFIX} == "-dummyaudio" ALL_TARGET= plugins/dummyaudio.so EXTRACT_AFTER_ARGS+= ${DISTNAME}/dummy_audio .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} == "-softgfx" ALL_TARGET= plugins/mupen64_soft_gfx.so EXTRACT_AFTER_ARGS+= ${DISTNAME}/mupen64_soft_gfx .endif .if ${PKGNAMESUFFIX} == "-rsp" ALL_TARGET= plugins/mupen64_hle_rsp_azimer.so EXTRACT_AFTER_ARGS+= ${DISTNAME}/Makefile ${DISTNAME}/rsp_hle .endif .if ${PKGNAMESUFFIX} == "-glide" ALL_TARGET= plugins/Glide64.so MD5_FILE= ${.CURDIR}/distinfo DISTNAME= ${PKGNAMESUFFIX:S/-//:S/$/64/}-${PORTVERSION:S/$/.SP8/} EXTRACT_AFTER_ARGS+= ${DISTNAME} EXTRA_PATCHES= # .endif .if ${PKGNAMESUFFIX} == "-tr64" ALL_TARGET= plugins/tr64gl.so MD5_FILE= ${.CURDIR}/distinfo DISTNAME= ${PKGNAMESUFFIX:S/-//}_ogl_gtk2-${PORTVERSION} EXTRACT_AFTER_ARGS+= ${PKGNAMESUFFIX:S/-//}_ogl-${PORTVERSION} EXTRA_PATCHES= # WRKSRC= ${WRKDIR}/${PKGNAMESUFFIX:S/-//}_ogl-${PORTVERSION} .endif post-configure: @${REINPLACE_CMD} -i "" -e 's|^#undef WITH_HOME|#define WITH_HOME \"${PREFIX}/\"|g' ${WRKSRC}/config.h .if !defined(HAVE_GTK2) @${REINPLACE_CMD} -i "" -e 's|^#define GTK2_SUPPORT 1|#undef GTK2_SUPPORT|g' ${WRKSRC}/config.h .endif .if defined(HAVE_VCR) . if ${PKGNAMESUFFIX} != "-glide" @${REINPLACE_CMD} -i "" -e 's|^#undef VCR_SUPPORT|#define VCR_SUPPORT 1|g' ${WRKSRC}/config.h . endif .endif .for f in ${FIXFILES} @${REINPLACE_CMD} -e 's|malloc.h|stdlib.h|' ${WRKSRC}/${f} @${REINPLACE_CMD} -e 's|(GLvoid)|(void)|' ${WRKSRC}/${f} .endfor .if ${PKGNAMESUFFIX} != "-base" pre-install: @${RM} -f ${PLIST} . if ${PKGNAMESUFFIX} == "-glide" @${ECHO_CMD} "%%DATADIR%%/plugins/${PLUGIN_NAME}.ini" >> ${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" @${MKDIR} ${DATADIR}/lang ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin/ ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME}_nogui ${PREFIX}/bin/ ${INSTALL_DATA} ${WRKSRC}/mupen64.ini ${DATADIR} ${INSTALL_DATA} ${WRKSRC}/lang/* ${DATADIR}/lang/ . if !defined(NOPORTDOCS) ${MKDIR} ${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/whatsnew.txt ${DOCSDIR}/whatsnew.txt ${INSTALL_DATA} ${WRKSRC}/README.vcr ${DOCSDIR}/README.vcr ${INSTALL_DATA} ${WRKSRC}/doc/readme.pdf ${DOCSDIR}/readme.pdf . endif .else @${MKDIR} ${DATADIR}/plugins . if ${PKGNAMESUFFIX} == "-glide" ${INSTALL_DATA} ${WRKSRC}/${PLUGIN_NAME}.ini ${DATADIR}/plugins/ . endif ${INSTALL_PROGRAM} ${WRKSRC}/plugins/${PLUGIN_NAME}.so ${DATADIR}/plugins/ .endif