# $NetBSD$
#
###########################################################
#               Generated by fbsd2pkg                     #
###########################################################
# Do not upgrade to 2.2.1 until crash bugs are worked out

DISTNAME=	cufflinks-${PORTVERSION}
CATEGORIES=	biology
MASTER_SITES=	http://cole-trapnell-lab.github.io/cufflinks/assets/downloads/

MAINTAINER=	dsiercks@uwm.edu
HOMEPAGE=	http://port.home.page/
COMMENT=	Transcript assembly, differential expression and regulation for RNA-Seq
# LICENSE=	

USE_LANGUAGES=	c c++
GNU_CONFIGURE=	yes
REPLACE_PYTHON=	src/cuffmerge

# FIXME: boost problem with long double and hackaround: https://svn.boost.org/trac/boost/query?status=!closed&page=3&order=summary&row=description: #9331
# Just using double instead for now
SUBST_CLASSES+=		boost
SUBST_STAGE.boost=	post-patch
SUBST_SED.boost+=	-e 's|shared_ptr|boost::shared_ptr|g'
SUBST_SED.boost+=	-e 's|boost::shared_ptr.hpp|shared_ptr.hpp|g'
SUBST_SED.boost+=	-e 's|boost::boost::|boost::|g'
SUBST_SED.boost+=	-e 's|^mutex|boost::mutex|g'
SUBST_SED.boost+=	-e 's|logl|log|g'
SUBST_SED.boost+=	-e 's|long double|double|g'
SUBST_SED.boost+=	-e 's|Lf|lf|g'
SUBST_SED.boost+=	-e 's|Lg|lg|g'
SUBST_MESSAGE.boost=	"Substituting for boost"
SUBST_FILES.boost+=	${WRKSRC}/src/abundances.cpp
SUBST_FILES.boost+=	${WRKSRC}/src/abundances.h
SUBST_FILES.boost+=	${WRKSRC}/src/assemble.h
SUBST_FILES.boost+=	${WRKSRC}/src/biascorrection.cpp
SUBST_FILES.boost+=	${WRKSRC}/src/biascorrection.h
SUBST_FILES.boost+=	${WRKSRC}/src/bundles.cpp
SUBST_FILES.boost+=	${WRKSRC}/src/bundles.cpp.orig
SUBST_FILES.boost+=	${WRKSRC}/src/bundles.h
SUBST_FILES.boost+=	${WRKSRC}/src/clustering.cpp
SUBST_FILES.boost+=	${WRKSRC}/src/common.h
SUBST_FILES.boost+=	${WRKSRC}/src/compress_gtf.cpp
SUBST_FILES.boost+=	${WRKSRC}/src/cuffdiff.cpp
SUBST_FILES.boost+=	${WRKSRC}/src/cufflinks.cpp
SUBST_FILES.boost+=	${WRKSRC}/src/differential.cpp
SUBST_FILES.boost+=	${WRKSRC}/src/differential.h
SUBST_FILES.boost+=	${WRKSRC}/src/filters.cpp
SUBST_FILES.boost+=	${WRKSRC}/src/filters.h
SUBST_FILES.boost+=	${WRKSRC}/src/gtf_to_sam.cpp
SUBST_FILES.boost+=	${WRKSRC}/src/hits.h
SUBST_FILES.boost+=	${WRKSRC}/src/replicates.cpp
SUBST_FILES.boost+=	${WRKSRC}/src/replicates.h
SUBST_FILES.boost+=	${WRKSRC}/src/scaffolds.cpp
SUBST_FILES.boost+=	${WRKSRC}/src/scaffolds.h

SUBST_CLASSES+=		boolint
SUBST_STAGE.boolint=	post-patch
SUBST_FILES.boolint=	${WRKSRC}/src/rounding.h
SUBST_SED.boolint+=	-e 's|int& is_up|bool\& is_up|g'

# CONFIGURE_ARGS are not linker flags.  Run configure --help to see
# proper usage of --with-bam
CONFIGURE_ARGS+=--with-bam=${PREFIX}/samtools0119 --with-boost
# CONFIGURE_ARGS+=--with-bam="-L${PREFIX}/lib ${LINKER_RPATH_FLAG}${PREFIX}/lib"
CFLAGS+=	-I${LOCALBASE}/include/eigen3
LDFLAGS+=	-lboost_system -lboost_iostreams -lboost_thread

PORTVERSION=	2.1.1

.include "../../lang/python/application.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../math/eigen3/buildlink3.mk"
.include "../../devel/boost-libs/buildlink3.mk"
.include "../../devel/boost-headers/buildlink3.mk"
.include "../../devel/boost-jam/buildlink3.mk"
.include "../../wip/samtools0119/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
