summaryrefslogblamecommitdiff
path: root/astro/celestia/Makefile
blob: cef64d08ac6b8bfe7072d726b96f6bcdf678fe64 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                  
                                                       
 
                                             





                                                          
                   


                   
                           
                         
      



                                                     
                 





                                                                                                        

          

                                                                                                                 




                                                 
                                                                       
                                                   
                                                                       
                                                  
                                                                       







                                                                     
                                                                           




                                                      
                                                                       
                                                   
                                                                       
                                                                     
                                                                       
































                                                                             
                      
# New ports collection makefile for:	celestia
# Date created:				2002-05-17
# Whom:					trevor
#
# $FreeBSD$
#

PORTNAME=		celestia
PORTVERSION=		1.2.4
CATEGORIES=		astro
MASTER_SITES=		${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR=	celestia

MAINTAINER=	trevor@FreeBSD.org
COMMENT=	Scriptable space flight simulator for X

BUILD_DEPENDS=	bash:${PORTSDIR}/shells/bash2
LIB_DEPENDS=	jpeg.9:${PORTSDIR}/graphics/jpeg \
		png.5:${PORTSDIR}/graphics/png \
		gtkgl.5:${PORTSDIR}/x11-toolkits/gtkglarea

GNU_CONFIGURE=	yes
PLIST=		${WRKDIR}/pkg-plist
USE_REINPLACE=	yes
USE_GMAKE=	yes
USE_MESA=	yes
USE_X_PREFIX=	yes
.if !defined(WITHOUT_GNOME)
USE_GNOME=	gnomelibs
.endif

CONFIGURE_ARGS=	--prefix=${PREFIX} \
		--includedir="${LOCALBASE}/include" \
		--libdir="${LOCALBASE}/lib"
CONFIGURE_ENV=	\
	LDFLAGS="-L${X11BASE}/lib -L${LOCALBASE}/lib -lm ${PTHREAD_LIBS}" \
	CPPFLAGS="-I${X11BASE}/include -I${X11BASE}/include/GL -I${LOCALBASE}/include ${PTHREAD_CFLAGS}"

.if defined(WITHOUT_GNOME)
CONFIGURE_ARGS+=	--without-gtk
.endif

pre-patch:
	${REINPLACE_CMD} -e \
's:-O2::g; s:-Wall::g; s:-ffast-math::g; s:-fexpensive-optimizations::g; s:! /bin/sh:! ${LOCALBASE}/bin/bash:g' \
	${WRKSRC}/configure

pre-install:
	${ECHO_CMD} bin/celestia > ${PLIST}
	${FIND} ${WRKSRC}/data/ -name '*.???' | \
		${SED} -e "s:^${WRKSRC}/:share/celestia/:g" >> ${PLIST}
	${FIND} ${WRKSRC}/extras/ -name '*.ssc' | \
		${SED} -e "s:^${WRKSRC}/:share/celestia/:g" >> ${PLIST}
	${FIND} ${WRKSRC}/fonts/ -name '*.txf' | \
		${SED} -e "s:^${WRKSRC}/:share/celestia/:g" >> ${PLIST}
.for ii in celestia.cfg demo.cel guide.cel start.cel
	${ECHO_CMD} share/celestia/${ii} >> ${PLIST}
.endfor
.if !defined(NOPORTDOCS)
.for ii in AUTHORS COPYING ChangeLog INSTALL README TODO controls.txt
	${ECHO_CMD} share/doc/celestia/${ii} >> ${PLIST}
.endfor
	 ${FIND} ${WRKSRC}/manual/ -name '*.???*' | \
		${SED} -e "s:^${WRKSRC}/:share/doc/celestia/:g" >> ${PLIST}
.for ii in celestia/manual celestia
	${ECHO_CMD} @dirrm share/doc/${ii} >> ${PLIST}
.endfor
.endif
	${FIND} ${WRKSRC}/models/ -name '*.???' | \
		${SED} -e "s:^${WRKSRC}/:share/celestia/:g" >> ${PLIST}
	${FIND} ${WRKSRC}/shaders/ -name '*.vp' | \
		${SED} -e "s:^${WRKSRC}/:share/celestia/:g" >> ${PLIST}
	${FIND} ${WRKSRC}/textures/ -name '*.jpg' -o -name '*.png'| \
		${SED} -e "s:^${WRKSRC}/:share/celestia/:g" >> ${PLIST}
.for ii in /data /extras /textures/lores /textures/medres /textures /models \
	/shaders /fonts /
	${ECHO_CMD} @dirrm share/celestia${ii} >> ${PLIST}
.endfor

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/src/celestia/celestia ${PREFIX}/bin/
.for ii in /data /extras /textures/lores /textures/medres /models /shaders \
	/fonts
	${MKDIR} ${DATADIR}${ii}
.endfor
	${INSTALL_DATA} ${WRKSRC}/data/*.??? ${DATADIR}/data/
	${INSTALL_DATA} ${WRKSRC}/extras/*.ssc ${DATADIR}/extras/
	${INSTALL_DATA} ${WRKSRC}/fonts/*.txf ${DATADIR}/fonts/
.for ii in celestia.cfg demo.cel guide.cel start.cel
	${INSTALL_DATA} ${WRKSRC}/${ii} ${DATADIR}/
.endfor
.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}/manual
.for ii in AUTHORS COPYING ChangeLog INSTALL README TODO controls.txt
	${INSTALL_DATA} ${WRKSRC}/${ii} ${DOCSDIR}/
.endfor
	${INSTALL_DATA} ${WRKSRC}/manual/*.???* ${DOCSDIR}/manual/
.endif
	${INSTALL_DATA} ${WRKSRC}/models/*.??? ${DATADIR}/models/
	${INSTALL_DATA} ${WRKSRC}/shaders/*.vp ${DATADIR}/shaders/
	${INSTALL_DATA} ${WRKSRC}/textures/flare.jpg \
		${WRKSRC}/textures/logo.png ${DATADIR}/textures/
	${INSTALL_DATA} ${WRKSRC}/textures/lores/*.??? \
		${DATADIR}/textures/lores/
	${INSTALL_DATA} ${WRKSRC}/textures/medres/*.??? \
		${DATADIR}/textures/medres/

.include <bsd.port.mk>