aboutsummaryrefslogtreecommitdiffstats
path: root/emulators/hatari/Makefile
blob: ec391411bb8a4b7e9421e801c8ddfb425aff57a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Created by: Michael Neumann <mneumann@ntecs.de>
# $FreeBSD$

PORTNAME=   hatari
PORTVERSION=    1.6.2
CATEGORIES= emulators
MASTER_SITES=   http://download.tuxfamily.org/hatari/%SUBDIR%/
MASTER_SITE_SUBDIR= ${PORTVERSION}

MAINTAINER= ports@FreeBSD.org
COMMENT=    Atari ST emulator

LICENSE=    GPLv2 # (or later)

BUILD_DEPENDS=  portaudio>=19:${PORTSDIR}/audio/portaudio2
LIB_DEPENDS=    png15:${PORTSDIR}/graphics/png
RUN_DEPENDS=    portaudio>=19:${PORTSDIR}/audio/portaudio2

OPTIONS_DEFINE= DOCS

USE_BZIP2=  yes
USE_GNOME=  pygtk2
USE_SDL=    sdl
USE_READLINE=   yes
USES=       cmake
CMAKE_ARGS= -DPORTAUDIO_INCLUDE_DIR:STRING="${PA2_INCLUDE_DIR}" \
        -DPORTAUDIO_LIBRARY:STRING="${PA2_LIBRARY}" \
        -DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \
        -DETCDIR:STRING="${PREFIX}/etc" \
        -DMANDIR:STRING="man/man1"
MAKE_JOBS_SAFE= yes

MANCOMPRESSED=  yes
MANLANG=    "" fr
MAN1=       ${PORTNAME}.1
MAN1_EN=    atari-hd-image.1 hatariui.1 hconsole.1 hmsa.1 zip2st.1

CFLAGS+=    -I${LOCALBASE}/include/portaudio2
PA2_INCLUDE_DIR=-I${LOCALBASE}/include/portaudio2
PA2_LIBRARY=    ${LOCALBASE}/lib/portaudio2/libportaudio.so

.include <bsd.port.options.mk>

post-patch:
.for file in doc/hatari.1 doc/fr/hatari.1 tools/hconsole/hconsole.1
    @${REINPLACE_CMD} -e \
        's|^/etc/hatari.cfg .*|${PREFIX}/etc/hatari.cfg| ; \
         s|/usr/share|${PREFIX}/share|' ${WRKSRC}/${file}
.endfor
    @${REINPLACE_CMD} -e '/doc/s|^add_|#add_|' \
        ${WRKSRC}/CMakeLists.txt
    @${REINPLACE_CMD} -e '/DESTINATION/s|/icons/.*)|/pixmaps)|' \
        ${WRKSRC}/python-ui/CMakeLists.txt

post-build:
    @cd ${WRKSRC}/doc && ${GZIP_CMD} -c ${PORTNAME}.1 > ${PORTNAME}.1.gz
    @cd ${WRKSRC}/doc/fr && ${GZIP_CMD} -c ${PORTNAME}.1 > ${PORTNAME}.1.gz

post-install:
    ${INSTALL_MAN} ${WRKSRC}/doc/${PORTNAME}.1.gz ${MANPREFIX}/man/man1
    @${MKDIR} ${MANPREFIX}/man/fr/man1
    ${INSTALL_MAN} ${WRKSRC}/doc/fr/${PORTNAME}.1.gz ${MANPREFIX}/man/fr/man1
.if ${PORT_OPTIONS:MDOCS}
    @${MKDIR} ${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/readme.txt ${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/doc/*.html ${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/doc/[a-z]*.txt ${DOCSDIR}
    @${MKDIR} ${DOCSDIR}/fr
    ${INSTALL_DATA} ${WRKSRC}/doc/fr/*.txt ${DOCSDIR}/fr
    @${MKDIR} ${DOCSDIR}/images
    ${INSTALL_DATA} ${WRKSRC}/doc/images/*.png ${DOCSDIR}/images
.endif

.include <bsd.port.mk>