Tweak emulators/advancemame version 1.4
[dports.git] / emulators / vice / Makefile
1 # Created by: dchapes@ddm.on.ca
2 # $FreeBSD$
3
4 PORTNAME=       vice
5 PORTVERSION=    2.4
6 PORTREVISION=   7
7 CATEGORIES=     emulators
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}
11
12 MAINTAINER=     dinoex@FreeBSD.org
13 COMMENT=        Emulator for Commodore C64, C128, VIC20, PET, and CBM-II
14
15 LICENSE=        GPLv2
16
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
24
25 RESTRICTED=     ROMs are copyrighted by Commodore Business Machines
26
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
30 GNU_CONFIGURE=  yes
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
38 # libpcap or libnet
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
44
45 LMLINKS=        vice.1 x64.1 \
46                 vice.1 x128.1 \
47                 vice.1 xvic.1 \
48                 vice.1 xpet.1 \
49                 vice.1 xplus4.1 \
50                 vice.1 xcbm2.1
51
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 \
66
67 OPTIONS_DEFINE= SDL ASOUND PULSE DOCS
68 OPTIONS_SINGLE= GUI
69 OPTIONS_SINGLE_GUI=     GNOMEUI XAW3D XAW
70 OPTIONS_DEFAULT?=       GNOMEUI SDL
71 NO_OPTIONS_SORT=yes
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
78
79 GNOMEUI_CONFIGURE_ENABLE=       gnomeui
80 XAW3D_CONFIGURE_WITH=   xaw3d
81 XAW3D_LIB_DEPENDS=      libXaw3d.so:${PORTSDIR}/x11-toolkits/Xaw3d
82 SDL_USE=                SDL=sdl
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
89
90 .include <bsd.port.options.mk>
91
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 " "; } \
98         } }'
99 .endif
100
101 .if ${PORT_OPTIONS:MXAW3D}
102 GNOME_SUFFIX=   -xaw3d
103 CONFLICTS?=     vice-gnome-1.* vice-1.*
104 .endif
105
106 .if ${PORT_OPTIONS:MGNOMEUI}
107 GNOME_SUFFIX=   -gnome
108 USE_GNOME=      gtk20 vte
109 CONFLICTS?=     vice-1.* vice-xaw3d-1.*
110 .endif
111
112 .if ${PORT_OPTIONS:MXAW}
113 CONFLICTS?=     vice-xaw3d-1.* vice-gnome-1.*
114 USE_XORG+=      xaw
115 .endif
116
117 .if exists(${LOCALBASE}/bin/fc-cache)
118 PLIST_SUB+=             FCCACHE=""
119 PLIST_SUB+=             NOFCCACHE="@comment "
120 .else
121 PLIST_SUB+=             FCCACHE="@comment "
122 PLIST_SUB+=             NOFCCACHE=""
123 .endif
124
125 .if ${PORT_OPTIONS:MNLS}
126 USES+=          gettext
127 CONFIGURE_ARGS+=        --enable-nls --localedir=${LOCALBASE}/share/locale
128 # causes vice to crash:
129 #LDFLAGS+=              -lgettextlib
130 PLIST_SUB+=             NLS=""
131 .else
132 CONFIGURE_ARGS+=        --disable-nls
133 PLIST_SUB+=             NLS="@comment "
134 .endif
135
136 .if ${PORT_OPTIONS:MDOCS}
137 INFO+=          vice
138 .endif
139
140 .if ${PORT_OPTIONS:MSDL}
141 USE_SDL=        sdl
142 .endif
143
144 post-extract:
145         @${RM} -f ${WRKSRC}/doc/vice.info*
146
147 post-patch:
148         ${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" \
149                 ${WRKSRC}/man/vice.1
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|' \
154                 ${WRKSRC}/configure
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}"
158 .endfor
159 .if ! ${PORT_OPTIONS:MDOCS}
160         ${REINPLACE_CMD} -e 's| doc||' ${WRKSRC}/Makefile.in
161 .endif
162 .if ${PORT_OPTIONS:MXAW3D}
163 .for i in ${FIX_XAW}
164         ${REINPLACE_CMD} -e 's|X11/Xaw/|X11/Xaw3d/|' ${WRKSRC}/${i}
165 .endfor
166 .endif
167
168 pre-install:
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/
173 .endif
174 .if ${PORT_OPTIONS:MDOCS}
175         ${MKDIR} ${STAGEDIR}${DOCSDIR}
176 .endif
177
178 post-install:
179         ( cd ${STAGEDIR}${PREFIX}/man/man1 && ${__pmlinks1} )
180 .if ${PORT_OPTIONS:MDOCS}
181         ${LN} -sf vice_toc.html ${STAGEDIR}${DOCSDIR}/index.html
182 .endif
183
184 .include <bsd.port.mk>