aboutsummaryrefslogtreecommitdiffstats
path: root/science/fasthenry/Makefile
blob: da9372c09977dd529d595e2dfe3469041884a72d (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
66
67
68
# New ports collection makefile for:    FastHenry
# Date created:     5 Jan 2006
# Whom:         Pedro Giffuni <giffunip@asme.org>
#
# $FreeBSD$
#

PORTNAME=   fasthenry
DISTVERSION=    3.0wr-011109
CATEGORIES= science cad
MASTER_SITES=   http://www.wrcad.com/ftp/pub/ LOCAL/bf

MAINTAINER= bf@FreeBSD.org
COMMENT=    A multipole-accelerated inductance analysis program

HAS_CONFIGURE=  yes
CONFIGURE_SCRIPT=   config
WRKSRC =    ${WRKDIR}/fasthenry-3.0wr

post-patch:
    @${REINPLACE_CMD} -Ee '/CFLAGS =/{s/=/+=/;s/-O[[:digit:]]*//;}' \
        ${WRKSRC}/src/fasthenry/Makefile.default \
        ${WRKSRC}/src/fasthenry/sparse/Makefile \
        ${WRKSRC}/src/zbuf/Makefile.default
#minimal changes to fix the clang build (there should be a more thorough
#clean-up, to correct types of functions, remove implicit declarations, fix
#formatting, add missing returns, etc.)
    @${REINPLACE_CMD} -e 's,return;,return 0;,' \
        ${WRKSRC}/src/fasthenry/barnoldi.c \
        ${WRKSRC}/src/fasthenry/contact.c \
        ${WRKSRC}/src/fasthenry/findpaths.c \
        ${WRKSRC}/src/fasthenry/fillM.c \
        ${WRKSRC}/src/fasthenry/hole.c \
        ${WRKSRC}/src/fasthenry/induct.c \
        ${WRKSRC}/src/fasthenry/joelself.c \
        ${WRKSRC}/src/fasthenry/mulSetup.c \
        ${WRKSRC}/src/fasthenry/read_tree.c
    @${REINPLACE_CMD} -Ee \
    '/^(AllocateBlockOfAllocationList|InitializeElementBlocks|RecordAllocation)/,/^\}/s/return;/return 0;/' \
        ${WRKSRC}/src/fasthenry/sparse/spAllocate.c
    @${REINPLACE_CMD} -Ee \
    '/^(EnlargeMatrix|ExpandTranslationArrays|spcLinkRows)/,/^\}/s/return;/return 0;/' \
        ${WRKSRC}/src/fasthenry/sparse/spBuild.c
    @${REINPLACE_CMD} -Ee \
    '/^(ComplexRowColElimination|CountMarkowitz|CreateInternalVectors|ExchangeColElements|ExchangeRowElements|ExchangeRowsAndCols|MarkowitzProducts|RealRowColElimination|UpdateMarkowitzNumbers|spcColExchange|spcRowExchange)/,/^\}/s/return;/return 0;/' \
        ${WRKSRC}/src/fasthenry/sparse/spFactor.c
    @${REINPLACE_CMD} -Ee 's,^mul(Up|Down),void &,' \
        ${WRKSRC}/src/fasthenry/mulDo.c
    @${REINPLACE_CMD} -e 's,^mulMatUp,void &,' \
        ${WRKSRC}/src/fasthenry/mulMats.c

do-install:
    @${INSTALL_PROGRAM} ${WRKSRC}/bin/fasthenry ${PREFIX}/bin/
    @${INSTALL_PROGRAM} ${WRKSRC}/bin/zbuf ${PREFIX}/bin
.if !defined(NOPORTDOCS)
    ${MKDIR} ${DOCSDIR}
    ${CAT} ${WRKSRC}/README ${WRKSRC}/README.mit > ${DOCSDIR}/readme
    ${CAT} ${WRKSRC}/doc/manual_*.ps > ${DOCSDIR}/manual.ps
    ${CAT} ${WRKSRC}/doc/nonuniform_manual_*.ps > ${DOCSDIR}/nonuniform_manual.ps
    ${INSTALL_DATA} ${WRKSRC}/doc/ms_thesis.ps ${DOCSDIR}
    ${GZIP_CMD} ${DOCSDIR}/*
.endif
.if !defined(NOPORTEXAMPLES)
    ${MKDIR} ${EXAMPLESDIR}
    ${INSTALL_DATA} ${WRKSRC}/examples/* ${EXAMPLESDIR}
.endif

.include <bsd.port.mk>