Tweak sysutils/ansible23 version 2.3.2.0
[dports.git] / lang / cling / Makefile
1 # Created by: Mahdi Mokhtari <mokhi64@gmail.com>
2 # $FreeBSD$
3
4 PORTNAME=               cling
5 PORTVERSION=            0.4
6 PORTREVISION?=          3
7 CATEGORIES=             lang devel
8 MASTER_SITES=           https://root.cern.ch/download/cling/
9 DISTNAME=               ${PORTNAME}_2016-12-29_sources
10
11 MAINTAINER=             mmokhi@FreeBSD.org
12 COMMENT=                Interactive C++ Interpreter Based on LLVM and Clang Libs
13
14 LICENSE=                LLVM NCSA
15 LICENSE_COMB=           multi
16 LICENSE_NAME_LLVM=      LLVM Release License
17 LICENSE_FILE_LLVM=      ${WRKSRC}/LICENSE.TXT
18 LICENSE_FILE_NCSA=      ${WRKSRC}/tools/cling/LICENSE.TXT
19 LICENSE_PERMS_LLVM=     dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
20
21 BROKEN_armv6=           fails to compile: AArch64TargetMachine.cpp: relocation truncated to fit: R_ARM_CALL against symbol '__aeabi_uldivmod'
22 BROKEN_armv7=           fails to compile: AArch64TargetMachine.cpp: relocation truncated to fit: R_ARM_CALL against symbol '__aeabi_uldivmod'
23
24 WRKSRC=         ${WRKDIR}/src
25
26 LLVM_RELEASE=   3.9.0
27 LLVM_SUFFIX=    39_cern-root
28 LLVM_PREFIX=    ${PREFIX}/llvm${LLVM_SUFFIX}
29
30 USES=           cmake:outsource compiler:c11 compiler:c++11-lib cpe \
31                 python:build shebangfix tar:bzip2
32 USE_LDCONFIG=   ${LLVM_PREFIX}/lib
33
34 SHEBANG_FILES=  tools/clang/tools/clang-format/clang-format-diff.py \
35                 tools/clang/tools/clang-format/git-clang-format \
36                 tools/clang/tools/scan-view/bin/scan-view
37
38 SUB_FILES=      llvm-wrapper.sh
39 SUB_LIST+=      LLVM_PREFIX="${LLVM_PREFIX}" LLVM_SUFFIX="${LLVM_SUFFIX}"
40 PLIST_SUB+=             LLVM_SUFFIX=${LLVM_SUFFIX} LLVM_RELEASE=${LLVM_RELEASE}
41
42 CMAKE_BUILD_TYPE=       Release
43 CMAKE_INSTALL_PREFIX=   ${LLVM_PREFIX}
44
45 CMAKE_ARGS+=    -DINSTALL_LAYOUT=FREEBSD \
46             --target ${PORTNAME}
47
48 CLING_FILES=    bin/cling \
49             lib/libcling.so \
50             lib/libclingInterpreter.a \
51             lib/libclingJupyter.so \
52             lib/libclingMetaProcessor.a \
53             lib/libclingUserInterface.a \
54             lib/libclingUtils.a \
55             include/cling/Interpreter/AutoloadCallback.h \
56             include/cling/Interpreter/CIFactory.h \
57             include/cling/Interpreter/CValuePrinter.h \
58             include/cling/Interpreter/ClangInternalState.h \
59             include/cling/Interpreter/ClingCodeCompleteConsumer.h \
60             include/cling/Interpreter/ClingOptions.h \
61             include/cling/Interpreter/CompilationOptions.h \
62             include/cling/Interpreter/DynamicExprInfo.h \
63             include/cling/Interpreter/DynamicLibraryManager.h \
64             include/cling/Interpreter/DynamicLookupLifetimeHandler.h \
65             include/cling/Interpreter/DynamicLookupRuntimeUniverse.h \
66             include/cling/Interpreter/Exception.h \
67             include/cling/Interpreter/Interpreter.h \
68             include/cling/Interpreter/InterpreterCallbacks.h \
69             include/cling/Interpreter/InvocationOptions.h \
70             include/cling/Interpreter/LookupHelper.h \
71             include/cling/Interpreter/RuntimePrintValue.h \
72             include/cling/Interpreter/RuntimeUniverse.h \
73             include/cling/Interpreter/Transaction.h \
74             include/cling/Interpreter/Value.h \
75             include/cling/MetaProcessor/MetaProcessor.h \
76             include/cling/UserInterface/UserInterface.h \
77             include/cling/UserInterface/textinput/Callbacks.h \
78             include/cling/UserInterface/textinput/Color.h \
79             include/cling/UserInterface/textinput/Display.h \
80             include/cling/UserInterface/textinput/Editor.h \
81             include/cling/UserInterface/textinput/History.h \
82             include/cling/UserInterface/textinput/InputData.h \
83             include/cling/UserInterface/textinput/KeyBinding.h \
84             include/cling/UserInterface/textinput/Range.h \
85             include/cling/UserInterface/textinput/Reader.h \
86             include/cling/UserInterface/textinput/SignalHandler.h \
87             include/cling/UserInterface/textinput/StreamReader.h \
88             include/cling/UserInterface/textinput/StreamReaderUnix.h \
89             include/cling/UserInterface/textinput/StreamReaderWin.h \
90             include/cling/UserInterface/textinput/TerminalConfigUnix.h \
91             include/cling/UserInterface/textinput/TerminalDisplay.h \
92             include/cling/UserInterface/textinput/TerminalDisplayUnix.h \
93             include/cling/UserInterface/textinput/TerminalDisplayWin.h \
94             include/cling/UserInterface/textinput/Text.h \
95             include/cling/UserInterface/textinput/TextInput.h \
96             include/cling/UserInterface/textinput/TextInputContext.h \
97             include/cling/Utils/AST.h \
98             include/cling/Utils/Output.h \
99             include/cling/Utils/ParserStateRAII.h \
100             include/cling/Utils/Paths.h \
101             include/cling/Utils/Platform.h \
102             include/cling/Utils/SourceNormalization.h \
103             include/cling/Utils/Validation.h
104 FIRST_FILE=     ${CLING_FILES:C/^/XXXX/1:MXXXX*:C/^XXXX//}
105
106 post-patch:
107         @${REINPLACE_CMD} -e 's|%%LLVM_PREFIX%%|${LLVM_PREFIX}|g' \
108             ${PATCH_WRKSRC}/tools/cling/tools/driver/cling.cpp
109         @${REINPLACE_CMD} -e 's|%%LLVM_PREFIX%%|${LLVM_PREFIX}|g' \
110             ${PATCH_WRKSRC}/tools/cling/lib/Interpreter/CIFactory.cpp
111
112 post-install:
113         ${RM} ${STAGEDIR}${LLVM_PREFIX}/man/man1/scan-build.1
114         ${RM} -rf ${STAGEDIR}${LLVM_PREFIX}/man
115         ${INSTALL_SCRIPT} ${WRKDIR}/llvm-wrapper.sh \
116             ${STAGEDIR}${PREFIX}/${FIRST_FILE}
117         ${MKDIR} ${STAGEDIR}${PREFIX}/include/${PORTNAME}/Interpreter
118         ${MKDIR} ${STAGEDIR}${PREFIX}/include/${PORTNAME}/MetaProcessor
119         ${MKDIR} ${STAGEDIR}${PREFIX}/include/${PORTNAME}/UserInterface/textinput
120         ${MKDIR} ${STAGEDIR}${PREFIX}/include/${PORTNAME}/Utils
121 .for file in ${CLING_FILES:C/^/XXXX/1:NXXXX*}
122         ${LN} -f ${STAGEDIR}${PREFIX}/${FIRST_FILE} ${STAGEDIR}${PREFIX}/${file}
123 .endfor
124
125 .include <bsd.port.mk>