Tweak astro/xmoontool version 3.0.3_8
[dports.git] / astro / stellarium-qt4 / Makefile
1 # Created by: Jean-Yves Lefort <jylefort@brutele.be>
2 # $FreeBSD$
3
4 PORTNAME=       stellarium
5 PORTVERSION=    0.12.6
6 CATEGORIES=     astro
7 MASTER_SITES=   SF/${PORTNAME}/Stellarium-sources/${PORTVERSION}
8 PKGNAMESUFFIX=  -qt4
9 DISTFILES=      ${DISTNAME}${EXTRACT_SUFX}
10 EXTRACT_ONLY=   ${_DISTFILES:Nstars_*.cat}
11
12 MAINTAINER=     danfe@FreeBSD.org
13 COMMENT=        3D photo-realistic sky renderer (planetarium)
14
15 LICENSE=        GPLv2+
16
17 CONFLICTS_INSTALL=      ${PORTNAME}-0.13.*
18 PORTSCOUT=      limit:^0\.12\.                  # track only 0.12.x (legacy)
19
20 USES=           cmake gettext iconv
21 USE_QT4=        moc_build rcc_build uic_build qmake_build \
22                 corelib gui network opengl
23
24 PORTDOCS=       AUTHORS ChangeLog README
25
26 OPTIONS_DEFINE=         DOCS MORE_STARS MULTIMEDIA SCRIPTING TEXTURES
27 OPTIONS_DEFAULT=        MULTIMEDIA SCRIPTING TEXTURES
28 MORE_STARS_DESC=        Install extra star catalogs (1.0GB)
29 TEXTURES_DESC=          Install better quality textures
30 MULTIMEDIA_DESC=        Sound and video support (via Phonon)
31 SCRIPTING_DESC=         Scripting support
32
33 .include <bsd.port.options.mk>
34
35 .if ${PORT_OPTIONS:MMORE_STARS} || ${.TARGETS:Mmakesum}
36 .  for i in 4 5 6 7 8
37 MASTER_SITES+=  SF/${PORTNAME}/Extra-data-files/stars${i}:stars${i}
38 .  endfor
39 DISTFILES+=     stars_4_1v0_1.cat:stars4 stars_5_2v0_1.cat:stars5 \
40                 stars_6_2v0_1.cat:stars6 stars_7_2v0_1.cat:stars7 \
41                 stars_8_2v0_1.cat:stars8
42 PLIST_SUB+=     MORE_STARS=""
43 .else
44 PLIST_SUB+=     MORE_STARS="@comment "
45 .endif
46
47 .if ${PORT_OPTIONS:MTEXTURES} || ${.TARGETS:Mmakesum}
48 MASTER_SITES+=  SF/${PORTNAME}/Extra-data-files/textures:gfx
49 DISTFILES+=     textures-1K.zip:gfx
50 PLIST_SUB+=     TEXTURES=""
51 .else
52 PLIST_SUB+=     TEXTURES="@comment "
53 .endif
54
55 .if ${PORT_OPTIONS:MMULTIMEDIA}
56 USE_QT4+=       phonon
57 .else
58 CMAKE_ARGS+=    -DENABLE_SOUND:BOOL=OFF
59 .endif
60
61 .if ${PORT_OPTIONS:MSCRIPTING}
62 USE_QT4+=       script
63 PLIST_SUB+=     SCRIPTS=""
64 .else
65 CMAKE_ARGS+=    -DENABLE_SCRIPTING:BOOL=OFF
66 PLIST_SUB+=     SCRIPTS="@comment "
67 .endif
68
69 post-patch: .SILENT
70 # Avoid picking up the wrong `fixx11h.h' (`x11/kdelibs3' port installs one
71 # that does not handle FontChange)
72         ${GREP} -Rl --null fixx11h\\.h ${WRKSRC}/src ${WRKSRC}/plugins | \
73                 ${XARGS} -0 ${REINPLACE_CMD} -e 's/fixx11h\.h/fixx11qt4h.h/'
74         cd ${WRKSRC}/src/core/external && ${MV} fixx11h.h fixx11qt4h.h
75
76 post-install-MORE_STARS-on:
77         ${INSTALL_DATA} ${DISTDIR}/stars_[45678]_[12]v0_1.cat \
78                 ${STAGEDIR}${DATADIR}/stars/default
79
80 post-install-TEXTURES-on:
81         (cd ${WRKDIR} && for f in *.png; do \
82                 new=`${STAT} -f '%z' $$f` ; \
83                 existing=`${STAT} -qf '%z' \
84                         ${STAGEDIR}${DATADIR}/textures/$$f || \
85                         ${ECHO_CMD} 0` ; \
86                 ${TEST} $$new -gt $$existing || continue ; \
87                 ${ECHO_CMD} "-- Replacing texture: $$f\
88                         (has larger file size or missing)" ; \
89                 ${INSTALL_DATA} $$f ${STAGEDIR}${DATADIR}/textures ; \
90         done)
91         @${REINPLACE_CMD} -e '1410s|nomap|vesta|' \
92                 ${STAGEDIR}${DATADIR}/data/ssystem.ini
93
94 post-install-DOCS-on:
95         @${MKDIR} ${STAGEDIR}${DOCSDIR}
96         ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
97
98 .include <bsd.port.mk>