Prune sysutils/rubygem-smart_proxy_salt
[dports.git] / astro / stellarium / Makefile
1 # Created by: Jean-Yves Lefort <jylefort@brutele.be>
2 # $FreeBSD$
3
4 PORTNAME=       stellarium
5 PORTVERSION=    0.13.1
6 CATEGORIES=     astro
7 MASTER_SITES=   SF/${PORTNAME}/Stellarium-sources/${PORTVERSION}
8 DISTFILES=      ${DISTNAME}${EXTRACT_SUFX}
9 EXTRACT_ONLY=   ${_DISTFILES:Nstars_*.cat}
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_QT5=        qmake_build buildtools_build linguisttools_build \
18                 core concurrent declarative
19 INSTALLS_ICONS= yes
20
21 PORTDOCS=       AUTHORS ChangeLog README
22
23 OPTIONS_DEFINE=         MORE_STARS TEXTURES MULTIMEDIA DOCS
24 OPTIONS_DEFAULT=        MULTIMEDIA
25 MORE_STARS_DESC=        Install extra star catalogs (1.0GB)
26 TEXTURES_DESC=          Install better quality textures
27 MULTIMEDIA_DESC=        Sound and video support
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_1.cat:stars4 stars_5_2v0_1.cat:stars5 \
36                 stars_6_2v0_1.cat:stars6 stars_7_2v0_1.cat:stars7 \
37                 stars_8_2v0_1.cat:stars8
38 PLIST_SUB+=     MORE_STARS=""
39 .else
40 PLIST_SUB+=     MORE_STARS="@comment "
41 .endif
42
43 .if ${PORT_OPTIONS:MTEXTURES}
44 MASTER_SITES+=  SF/${PORTNAME}/Extra-data-files/textures:gfx
45 DISTFILES+=     textures-1K.zip:gfx
46 .endif
47
48 .if ${PORT_OPTIONS:MMULTIMEDIA}
49 USE_QT5+=       multimedia
50 .else
51 CMAKE_ARGS+=    -DENABLE_SOUND:BOOL=OFF
52 .endif
53
54 post-patch:
55         @${REINPLACE_CMD} -e 's, -Wno-unused-result,,' ${WRKSRC}/CMakeLists.txt
56
57 post-install:
58 .if ${PORT_OPTIONS:MMORE_STARS}
59         ${INSTALL_DATA} ${DISTDIR}/stars_[45678]_[12]v0_1.cat \
60                 ${STAGEDIR}${DATADIR}/stars/default
61 .endif
62 .if ${PORT_OPTIONS:MTEXTURES}
63         (cd ${WRKDIR} && for f in *.png; do \
64                 new=`${STAT} -f '%z' $$f` ; \
65                 existing=`${STAT} -f '%z' \
66                         ${STAGEDIR}${DATADIR}/textures/$$f` ; \
67                 ${TEST} $$new -gt $$existing || continue ; \
68                 ${ECHO_CMD} "-- Replacing texture: $$f\
69                         (has larger file size: $$new vs. $$existing)" ; \
70                 ${INSTALL_DATA} $$f ${STAGEDIR}${DATADIR}/textures ; \
71         done)
72 .endif
73         @${MKDIR} ${STAGEDIR}${DOCSDIR}
74         ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
75
76 .include <bsd.port.mk>