aboutsummaryrefslogtreecommitdiffstats
path: root/biology/canu/Makefile
blob: 8d0fcc801b7b4f9b00d0ddae9dc928910a25802b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# $FreeBSD$

PORTNAME=   canu
DISTVERSIONPREFIX=  v
DISTVERSION=    1.6
CATEGORIES= biology java perl5

MAINTAINER= jwb@FreeBSD.org
COMMENT=    Single molecule sequence assembler

LICENSE=    GPLv2
LICENSE_FILE=   ${WRKSRC}/README.license.GPL

LIB_DEPENDS+=   libboost_regex.so:devel/boost-libs
RUN_DEPENDS+=   gnuplot:math/gnuplot

USES=       compiler:openmp gmake perl5
USE_JAVA=   yes
JAVA_RUN=   yes
JAVA_VERSION=   1.8+

USE_GITHUB= yes
GH_ACCOUNT= marbl

BUILD_WRKSRC=   ${WRKSRC}/src

# Makefile compiles directly into ${DESTDIR}${PREFIX}
MAKE_ENV+=  DESTDIR=${BUILD_WRKSRC}

post-patch:
    ${REINPLACE_CMD} \
        -e 's|-O4||g' \
        -e 's|-funroll-loops||g' \
        -e 's|-fexpensive-optimizations||g' \
        -e 's|amd64|${ARCH}|g' \
        ${BUILD_WRKSRC}/Makefile
    ${REINPLACE_CMD} -e 's|\\$$bin/mhap-|${JAVAJARDIR}/mhap-|g' \
        ${BUILD_WRKSRC}/pipelines/canu/OverlapMhap.pm
    ${REINPLACE_CMD} -e 's|RealBin/lib|RealBin/../${SITE_PERL_REL}/canu|g' \
        ${BUILD_WRKSRC}/pipelines/canu.pl

# Reorganize according to filesystem hierarchy standard
post-build:
    @${MKDIR} ${BUILD_WRKSRC}${PREFIX}/FreeBSD-${ARCH}/${SITE_PERL_REL}
    @${MV} ${BUILD_WRKSRC}${PREFIX}/FreeBSD-${ARCH}/bin/lib/canu \
        ${BUILD_WRKSRC}${PREFIX}/FreeBSD-${ARCH}/${SITE_PERL_REL}
    @${RMDIR} ${BUILD_WRKSRC}${PREFIX}/FreeBSD-${ARCH}/bin/lib
    @${MV} ${BUILD_WRKSRC}${PREFIX}/FreeBSD-${ARCH}/bin/*.a \
        ${BUILD_WRKSRC}${PREFIX}/FreeBSD-${ARCH}/lib
    @${MKDIR} ${BUILD_WRKSRC}${PREFIX}/FreeBSD-${ARCH}/${JAVAJARDIR:S,^${PREFIX}/,,}
    @${MV} ${BUILD_WRKSRC}${PREFIX}/FreeBSD-${ARCH}/bin/*.jar \
        ${BUILD_WRKSRC}${PREFIX}/FreeBSD-${ARCH}/${JAVAJARDIR:S,^${PREFIX}/,,}
    @${RM} ${BUILD_WRKSRC}${PREFIX}/FreeBSD-${ARCH}/bin/canu.defaults

do-install:
    cd ${BUILD_WRKSRC}${PREFIX}/FreeBSD-${ARCH} && ${COPYTREE_BIN} bin \
        ${STAGEDIR}${PREFIX}
    # STRIP_CMD fails without this on 11.1 under poudriere
    @${CHMOD} u+w ${STAGEDIR}${PREFIX}/bin/*
    ${STRIP_CMD} \
        `file ${STAGEDIR}${PREFIX}/bin/* | ${GREP} ELF | cut -d : -f 1`
    cd ${BUILD_WRKSRC}${PREFIX}/FreeBSD-${ARCH} && ${COPYTREE_SHARE} "lib share" \
        ${STAGEDIR}${PREFIX}

.include <bsd.port.mk>