# $NetBSD$

###########################################################
#               Generated by fbsd2pkg                     #
###########################################################

###########################################################
# Unconverted and partially converted FreeBSD port syntax:

DISTNAME=	blasr-${PORTVERSION}
CATEGORIES=	biology
MASTER_SITES=	http://acadix.biz/Ports/distfiles/
EXTRACT_SUFX=	.tar.xz

MAINTAINER=	bacon4000@gmail.com

COMMENT=	PacBio(R) long read aligner
# Double-check this
LICENSE=	modified-bsd

# Just assuming C and C++: Adjust this!
USE_LANGUAGES=	c c++
USE_TOOLS+=	gmake

SUBST_CLASSES+=		bash
SUBST_STAGE.bash=	post-patch
SUBST_FILES.bash=	${WRKSRC}/makefile
SUBST_SED.bash=		-e 's|/bin/bash|${PREFIX}/bin/bash|g'
SUBST_SED.bash+=	-e 's|-ldl||g'

SUBST_CLASSES+=		libs
SUBST_STAGE.libs=	post-configure
SUBST_FILES.libs=	${WRKSRC}/defines.mk
SUBST_SED.libs=		-e 's|-ldl||g'
SUBST_SED.libs+=	-e 's|-static||g'

CXXFLAGS+=	-I${PREFIX}/include/blasr_libcpp \
		-I${PREFIX}/include/blasr_libcpp/hdf \
		-I${PREFIX}/include/blasr_libcpp/pbdata \
		-I${PREFIX}/include/blasr_libcpp/alignment \
		-I${PREFIX}/include
MAKE_FILE=	makefile

PORTVERSION=	2015.08.17

AUTO_MKDIRS=	yes

do-configure:
	cd ${WRKSRC} && ./configure.py --no-pbbam \
		NOPBBAM=1 HDF5_INCLUDE=${PREFIX}/include \
		HDF5_LIB=${PREFIX}/lib

do-install:
	${INSTALL_PROGRAM} \
		${WRKSRC}/blasr \
		${WRKSRC}/utils/loadPulses \
		${WRKSRC}/utils/pls2fasta \
		${WRKSRC}/utils/samFilter \
		${WRKSRC}/utils/samtoh5 \
		${WRKSRC}/utils/samtom4 \
		${WRKSRC}/utils/sawriter \
		${WRKSRC}/utils/sdpMatcher \
		${WRKSRC}/utils/toAfg \
		${DESTDIR}${PREFIX}/bin

.include "../../devel/boost-libs/buildlink3.mk"
.include "../../devel/hdf5-c++/buildlink3.mk"
.include "../../wip/blasr_libcpp/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
