Update astro/stellarium to version 0.12.4
[dports.git] / astro / stellarium / Makefile
1 # Created by: Jean-Yves Lefort <jylefort@brutele.be>
2 # $FreeBSD: astro/stellarium/Makefile 334279 2013-11-19 01:49:40Z danfe $
3
4 PORTNAME=       stellarium
5 PORTVERSION=    0.12.4
6 CATEGORIES=     astro
7 MASTER_SITES=   SF/${PORTNAME}/Stellarium-sources/${PORTVERSION}
8 DISTFILES=      ${DISTNAME}${EXTRACT_SUFX}
9 EXTRACT_ONLY:=  ${DISTFILES}
10
11 MAINTAINER=     danfe@FreeBSD.org
12 COMMENT=        3D photo-realistic sky renderer (planetarium)
13
14 LICENSE=        GPLv2
15
16 USES=           cmake gettext iconv
17 USE_GL=         glu
18 USE_QT4=        moc_build rcc_build uic_build qmake_build \
19                 corelib gui network opengl script
20 INSTALLS_ICONS= yes
21
22 PORTDOCS=       AUTHORS ChangeLog README
23
24 OPTIONS_DEFINE=         MORE_STARS MULTIMEDIA DOCS
25 OPTIONS_DEFAULT=        MULTIMEDIA
26 MORE_STARS_DESC=        Install extra star catalogs (1.2GB)
27 MULTIMEDIA_DESC=        Sound and video support (via Phonon)
28
29 .include <bsd.port.options.mk>
30
31 .if ${PORT_OPTIONS:MMORE_STARS}
32 .  for i in 4 5 6 7 8
33 MASTER_SITES+=  SF/${PORTNAME}/Extra-data-files/stars${i}:stars${i}
34 .  endfor
35 DISTFILES+=     stars_4_1v0_0.cat:stars4 stars_5_2v0_0.cat:stars5 \
36                 stars_6_2v0_0.cat:stars6 stars_7_2v0_0.cat:stars7 \
37                 stars_8_2v0_0.cat:stars8
38 PLIST_SUB+=     MORE_STARS=""
39 .else
40 PLIST_SUB+=     MORE_STARS="@comment "
41 .endif
42
43 .if ${PORT_OPTIONS:MMULTIMEDIA}
44 USE_QT4+=       phonon
45 .else
46 CMAKE_ARGS+=    -DENABLE_SOUND:BOOL=OFF
47 .endif
48
49 post-patch: .SILENT
50         ${REINPLACE_CMD} -e '/QTTEST/d' ${WRKSRC}/CMakeLists.txt
51 # Avoid picking up the wrong `fixx11h.h' (`x11/kdelibs3' port installs one
52 # that does not handle FontChange)
53         ${GREP} -Rl --null fixx11h\\.h ${WRKSRC}/src ${WRKSRC}/plugins | \
54                 ${XARGS} -0 ${REINPLACE_CMD} -e 's/fixx11h\.h/fixx11qt4h.h/'
55         cd ${WRKSRC}/src/core/external && ${MV} fixx11h.h fixx11qt4h.h
56
57 post-install:
58 .if ${PORT_OPTIONS:MMORE_STARS}
59         ${INSTALL_DATA} ${DISTDIR}/stars_[45678]_[12]v0_0.cat \
60                 ${STAGEDIR}${DATADIR}/stars/default
61 .endif
62         @${MKDIR} ${STAGEDIR}${DOCSDIR}
63         ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
64
65 .include <bsd.port.mk>