# Created by: Sébastien Santoro <dereckson@gmail.com>
# $FreeBSD: tags/RELEASE_10_1_0/astro/astrometry/Makefile 367888 2014-09-10 20:50:31Z gerald $

PORTNAME=	astrometry
PORTVERSION=	0.46
PORTREVISION=	1
CATEGORIES=	astro
MASTER_SITES=	http://www.astrometry.net/downloads/
DISTNAME=	${PORTNAME}.net-${PORTVERSION}

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Describes an astronomical image

BUILD_DEPENDS=	${PYTHON_SITELIBDIR}/numpy:${PORTSDIR}/math/py-numpy
LIB_DEPENDS=	libcairo.so:${PORTSDIR}/graphics/cairo \
		libcfitsio.so:${PORTSDIR}/astro/cfitsio \
		libjpeg.so:${PORTSDIR}/graphics/jpeg \
		libpng15.so:${PORTSDIR}/graphics/png \
		libnetpbm.so:${PORTSDIR}/graphics/netpbm
RUN_DEPENDS:=	${BUILD_DEPENDS}

USES=		gmake pkgconfig tar:bzip2
USE_PYTHON=	yes
ALL_TARGET=	all extra
MAKE_ENV=	INSTALL_DIR=${STAGEDIR}${PREFIX}/${PORTNAME}
MAKE_JOBS_UNSAFE=	yes
SUB_FILES=	pkg-message

post-patch:
	@${REINPLACE_CMD} -E 's,python (setup|-c),${PYTHON_CMD} \1,' \
		${WRKSRC}/blind/Makefile ${WRKSRC}/libkd/Makefile \
		${WRKSRC}/sdss/Makefile ${WRKSRC}/util/Makefile
# Outwit detection logic that thinks Clang does not support -shared argument
	@${REINPLACE_CMD} -e '/CCTEST/s,\\|warning:,,' \
		${WRKSRC}/util/makefile.common

.include <bsd.port.mk>
