# $NetBSD$

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

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

## Requires 64-bit long
#NOT_FOR_ARCHS=	i386

DISTNAME=	blasr_libcpp-${PORTVERSION}
CATEGORIES=	biology
# FreeBSD MASTER_SITE_SUBDIR: 
MASTER_SITES=	http://acadix.biz/Ports/distfiles/ \
		http://personalpages.tds.net/~jwbacon/Ports/distfiles/
EXTRACT_SUFX=	.tar.xz

MAINTAINER=	jwbacon@tds.net

COMMENT=	Library for analyzing PacBio sequences
# Double-check this
LICENSE=	modified-bsd

# Pessimistic assumption.  Test and change if possible.
# MAKE_JOBS_SAFE=	no

USE_LANGUAGES=	c c++
USE_TOOLS+=	gmake

# Broken: hdf5-c++>=1.8:../../devel/hdf5-c++
# hdf5>=1.8:../../jb-wip/hdf5

DEPENDS+=		bash:../../shells/bash

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

SUBST_CLASSES+=		pbbam
SUBST_STAGE.pbbam=	post-configure
SUBST_FILES.pbbam=	${WRKSRC}/libconfig.h
SUBST_SED.pbbam=	-e 's|define|undef|'

SUBST_CLASSES+=gcc44
SUBST_STAGE.gcc44=	post-patch
SUBST_FILES.gcc44=	${WRKSRC}/*/*
SUBST_SED.gcc44=	-e 's|c++11|c++0x|g' \

# OS X Lion
SUBST_CLASSES+=		headers
SUBST_STAGE.headers=	post-patch
SUBST_FILES.headers=	hdf/*.hpp pbdata/saf/*.hpp
SUBST_SED.headers=	-e 's|\<cstdint\>|\<stdint.h\>|g' \
			-e 's|\<cinttypes\>|\<inttypes.h\>|g'
SUBST_STAGES+=		uintmax
SUBST_STAGE.uintmax=	post-patch
SUBST_FILES.uintmax=	alignment/suffixarray/SuffixArray.hpp
SUBST_SED.uintmax=	-e 's|UINT_MAX|INT_MAX|g'

CXXFLAGS+=	-I${LOCALBASE}/include
MAKE_FILE=	makefile

PORTNAME=	blasr_libcpp
PORTVERSION=	2015.08.17

# You may need this, especially if using do-install.
# Note: Depends on PLIST.
#AUTO_MKDIRS=	yes

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

do-install:
	${MKDIR} ${DESTDIR}${PREFIX}/include ${DESTDIR}${PREFIX}/lib
	cd ${WRKSRC} && for fn in `find . -name '*.h' -o -name '*.hpp'`; do \
		dir=`dirname $$fn | cut -d / -f 2-`; \
		${MKDIR} ${DESTDIR}${PREFIX}/include/${PORTNAME}/$$dir; \
		${INSTALL_DATA} $$fn ${DESTDIR}${PREFIX}/include/${PORTNAME}/$$dir; \
	done
	for fn in `find ${WRKSRC} -name '*.a'`; do \
		${INSTALL_DATA} $$fn ${DESTDIR}${PREFIX}/lib; \
	done

.include "../../lang/python/application.mk"
.include "../../jb-wip/hdf5-c++/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
