7 MASTER_SITES= SF/${PORTNAME}/Celestia-source/${PORTVERSION}
8 PKGNAMESUFFIX= -${CELESTIA_UI}
10 MAINTAINER= danfe@FreeBSD.org
11 COMMENT= Scriptable space flight simulator for X11
15 LIB_DEPENDS= libpng.so:graphics/png
17 USES= compiler:c++11-lang gettext gl gmake jpeg libtool lua:52 pkgconfig
20 EXTRA_PATCHES= ${FILESDIR}/celestia-1.6.1-lua-5.2.patch:-p1 \
21 ${FILESDIR}/celestia-lua-52-fix.patch:-p1 \
22 ${FILESDIR}/celestia-1.6.1-gcc47.patch:-p1 \
23 ${FILESDIR}/celestia-1.6.1-gcc48.patch:-p1
25 CXXFLAGS+= -fsigned-char # fix text rendering (see Gentoo bug 316573)
26 CPPFLAGS+= -I${LOCALBASE}/include
27 LDFLAGS+= -L${LOCALBASE}/lib -pthread
29 UI_LIST= glut gtk gnome
31 CONFLICTS= ${UI_LIST:S|${CELESTIA_UI}||:S|^|celestia-|:S|$|-[0-9]*|}
33 # Celestia provides different UI frontends; you should pick one that suits
34 # you best by setting CELESTIA_UI variable. Possible values are:
36 # glut Bare-boned minimal GLUT-based core with no toolbar or menu (this is
38 # gtk Full interface with minimal dependencies: adds menu, configuration
39 # dialog, some other utilities;
41 .if ${CELESTIA_UI} == "glut"
42 CONFIGURE_ARGS+= --with-glut
45 .elif ${CELESTIA_UI} == "gtk"
46 CONFIGURE_ARGS+= --with-gtk
49 PLIST_FILES= share/applications/celestia.desktop
51 IGNORE= requires one of the <${UI_LIST}> values for CELESTIA_UI
54 .if ${CELESTIA_UI} == "gtk"
56 LIB_DEPENDS+= libgtkglext-x11-1.0.so:x11-toolkits/gtkglext \
57 libtheora.so:multimedia/libtheora
59 PLIST_FILES+= share/celestia/celestia-logo.png share/celestia/celestiaui.xml
64 PORTDOCS= AUTHORS ChangeLog README
69 @${REINPLACE_CMD} -E '/fav(->|\.)fov/s|NULL|0.0|' \
70 ${WRKSRC}/src/celestia/celestiacore.cpp \
71 ${WRKSRC}/src/celestia/favorites.cpp
72 @${REINPLACE_CMD} -e '280s,NULL,false,' \
73 ${WRKSRC}/src/celengine/parseobject.cpp
74 # Fix Lua discovery pkg-config(1) calls
75 @${REINPLACE_CMD} -E 's|lua5\.?|lua-5.|' ${WRKSRC}/configure
76 # Remove controversial compiler options (respect our C[XX]FLAGS)
77 .for o in O2 ffast-math fexpensive-optimizations fomit-frame-pointer
78 @${REINPLACE_CMD} -e 's|-${o}||g' ${WRKSRC}/configure
80 # Allow add-ons to be placed inside user's home directory
81 @${REINPLACE_CMD} -e '/^#/!s|"extras"|& "~/.celestia"|' \
82 ${WRKSRC}/celestia.cfg
83 # Inhibit installation of copies of GPL (lots of them; use LICENSE framework
84 # instead) and remove bogus argument from mv(1)
85 @${REINPLACE_CMD} -e 's|COPYING||g ; s| -b|| ' ${WRKSRC}/Makefile.in
86 @${REINPLACE_CMD} -e 's|=.*COPYING_\*)|=| ; \
87 /KDE_DIST/s|COPYING_[^ ]* ||g' ${WRKSRC}/locale/Makefile.in
88 @${REINPLACE_CMD} -e 's|kde_libs_htmldir|kde_htmldir|' \
89 ${WRKSRC}/src/celestia/kde/doc/celestia/Makefile.in
92 # Technically, we should only install icon explicitly for GLUT UI, since
93 # correct icons are properly installed for other cases, but doing it here
94 # does not hurt and simplifies PLIST handling
95 ${INSTALL_DATA} ${WRKSRC}/src/celestia/gtk/data/celestia.png \
96 ${STAGEDIR}${PREFIX}/share/pixmaps
97 @${MKDIR} ${STAGEDIR}${DOCSDIR}
98 ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
100 .include <bsd.port.mk>