1 # Created by: dchapes@ddm.on.ca
8 MASTER_SITES= http://www.zimmers.net/anonftp/pub/cbm/crossplatform/emulators/VICE/ \
9 ftp://ftp.zimmers.net/pub/cbm/crossplatform/emulators/VICE/
10 PKGNAMESUFFIX?= ${GNOME_SUFFIX}${PKGNAMESUFFIX2}
12 MAINTAINER= dinoex@FreeBSD.org
13 COMMENT= Emulator for Commodore C64, C128, VIC20, PET, and CBM-II
17 BUILD_DEPENDS= bdftopcf:${PORTSDIR}/x11-fonts/bdftopcf \
18 mkfontdir:${PORTSDIR}/x11-fonts/mkfontdir \
19 mkfontscale:${PORTSDIR}/x11-fonts/mkfontscale
20 LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png \
21 libgif.so:${PORTSDIR}/graphics/giflib \
22 libmp3lame.so:${PORTSDIR}/audio/lame \
23 libavcodec.so:${PORTSDIR}/multimedia/ffmpeg
25 RESTRICTED= ROMs are copyrighted by Commodore Business Machines
27 USES= iconv:patch gmake pkgconfig makeinfo
28 USE_XORG= xpm ice sm xext xv xt x11 xmu
29 USE_XORG+= xrender xinerama xi xrandr xcursor xcomposite xdamage xfixes
31 MAKE_ENV+= MAKEINFOFLAGS="--no-split"
32 CFLAGS+= -I${LOCALBASE}/include
33 LDFLAGS+= -L${LOCALBASE}/lib
34 CPPFLAGS+= -I${LOCALBASE}/include
35 CONFIGURE_ARGS+= --enable-fullscreen --enable-ipv6 \
36 --disable-dependency-tracking
37 #CONFIGURE_ARGS+= --enable-ethernet
39 #CONFIGURE_ARGS+= --enable-sdlui
40 #CONFIGURE_ARGS+= --enable-gp2x
41 #CONFIGURE_ARGS+= --enable-wiz
42 #CONFIGURE_ARGS+= --enable-parsid
43 #CONFIGURE_ARGS+= --enable-memmap
45 LMLINKS= vice.1 x64.1 \
52 FIX_XAW= src/arch/unix/x11/xaw/about.c \
53 src/arch/unix/x11/xaw/uicartridge.c \
54 src/arch/unix/x11/xaw/uiedisk.c \
55 src/arch/unix/x11/xaw/uimenu.c \
56 src/arch/unix/x11/xaw/uipalcontrol.c \
57 src/arch/unix/x11/xaw/uiscreenshot.c \
58 src/arch/unix/x11/xaw/uisnapshot.c \
59 src/arch/unix/x11/xaw/uivsidcontrol.c \
60 src/arch/unix/x11/xaw/x11ui.c \
61 src/arch/unix/x11/xaw/widgets/FileSel.c \
62 src/arch/unix/x11/xaw/widgets/FileSelP.h \
63 src/arch/unix/x11/xaw/widgets/MultiList.h \
64 src/arch/unix/x11/xaw/widgets/MultiListP.h \
65 src/arch/unix/x11/xaw/widgets/ScrList.c \
67 OPTIONS_DEFINE= SDL ASOUND PULSE DOCS
69 OPTIONS_SINGLE_GUI= GNOMEUI XAW3D XAW
70 OPTIONS_DEFAULT?= GNOMEUI SDL
72 GNOMEUI_DESC= use gnomeui toolkit
73 XAW3D_DESC= use Xaw3d library
74 XAW_DESC= use plain Xaw library
75 SDL_DESC= build with SDL sound system support
76 ASOUND_DESC= build with asound support
77 PULSE_DESC= build with pulseaudio support
79 GNOMEUI_CONFIGURE_ENABLE= gnomeui
80 XAW3D_CONFIGURE_WITH= xaw3d
81 XAW3D_LIB_DEPENDS= libXaw3d.so:${PORTSDIR}/x11-toolkits/Xaw3d
83 SDL_CONFIGURE_ON= --with-sdlsound
84 SDL_CPPFLAGS= -I${LOCALBASE}/include/SDL
85 ASOUND_CONFIGURE_OFF= --without-alsa
86 ASOUND_LIB_DEPENDS= libasound.so:${PORTSDIR}/audio/alsa-lib
87 PULSE_CONFIGURE_OFF= --without-pulse
88 PULSE_LIB_DEPENDS= libpulse.so:${PORTSDIR}/audio/pulseaudio
90 .include <bsd.port.options.mk>
92 .if !defined(BUILDING_INDEX)
93 __pmlinks1!= ${ECHO_CMD} '${LMLINKS:S/ / /}' | ${AWK} \
94 '{ if (NF % 2 != 0) { print "broken"; exit; } \
95 for (i=1; i<=NF; i++) { \
96 if ( i % 2 == 0) { print " " $$i " ;"; } \
97 else { printf "${LN} -s " $$i " "; } \
101 .if ${PORT_OPTIONS:MXAW3D}
103 CONFLICTS?= vice-gnome-1.* vice-1.*
106 .if ${PORT_OPTIONS:MGNOMEUI}
109 CONFLICTS?= vice-1.* vice-xaw3d-1.*
112 .if ${PORT_OPTIONS:MXAW}
113 CONFLICTS?= vice-xaw3d-1.* vice-gnome-1.*
117 .if exists(${LOCALBASE}/bin/fc-cache)
118 PLIST_SUB+= FCCACHE=""
119 PLIST_SUB+= NOFCCACHE="@comment "
121 PLIST_SUB+= FCCACHE="@comment "
122 PLIST_SUB+= NOFCCACHE=""
125 .if ${PORT_OPTIONS:MNLS}
127 CONFIGURE_ARGS+= --enable-nls --localedir=${LOCALBASE}/share/locale
128 # causes vice to crash:
129 #LDFLAGS+= -lgettextlib
132 CONFIGURE_ARGS+= --disable-nls
133 PLIST_SUB+= NLS="@comment "
136 .if ${PORT_OPTIONS:MDOCS}
140 .if ${PORT_OPTIONS:MSDL}
145 @${RM} -f ${WRKSRC}/doc/vice.info*
148 ${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" \
150 ${REINPLACE_CMD} -e 's|^localedir.*|localedir = $$(DESTDIR)${LOCALBASE}/share/locale|' \
151 ${WRKSRC}/po/Makefile.in.in
152 ${REINPLACE_CMD} -e 's|lungif|lgif|g' -e 's|== "x|= "x|' \
153 -e 's|"DATADIRNAME"/locale|share/locale|' \
155 .for i in da.po de.po fr.po hu.po it.po nl.po pl.po sv.po tr.po
156 ${MV} "${WRKSRC}/po/${i}" "${WRKSRC}/po/${i}.latin"
157 ${ICONV_CMD} -f latin1 -t utf-8 < "${WRKSRC}/po/${i}.latin" > "${WRKSRC}/po/${i}"
159 .if ! ${PORT_OPTIONS:MDOCS}
160 ${REINPLACE_CMD} -e 's| doc||' ${WRKSRC}/Makefile.in
162 .if ${PORT_OPTIONS:MXAW3D}
164 ${REINPLACE_CMD} -e 's|X11/Xaw/|X11/Xaw3d/|' ${WRKSRC}/${i}
169 ${MKDIR} ${STAGEDIR}${PREFIX}/lib/vice/fonts
170 .if exists(${LOCALBASE}/bin/fc-cache)
171 ${INSTALL_DATA} ${WRKSRC}/data/fonts/vice-cbm.bdf \
172 ${STAGEDIR}${PREFIX}/lib/vice/fonts/
174 .if ${PORT_OPTIONS:MDOCS}
175 ${MKDIR} ${STAGEDIR}${DOCSDIR}
179 ( cd ${STAGEDIR}${PREFIX}/man/man1 && ${__pmlinks1} )
180 .if ${PORT_OPTIONS:MDOCS}
181 ${LN} -sf vice_toc.html ${STAGEDIR}${DOCSDIR}/index.html
184 .include <bsd.port.mk>