llvm 3.5.2
[git/cygwin-packages/llvm3.5.git] / llvm.cygport
1 # IMPORTANT:
2 # This package MUST be rebuilt for each version of gcc, and the
3 # cygwin-clang.patch fixed accordingly.
4
5 inherit python python3
6
7 NAME="llvm"
8 VERSION=3.5.2
9 RELEASE=1
10 CATEGORY="Libs"
11 SUMMARY="LLVM bytecode interpreter and toolchain"
12 DESCRIPTION="The LLVM Core libraries provide a modern source- and target-
13 independent optimizer, along with code generation support for many popular CPUs
14 (as well as some less common ones!) These libraries are built around a well
15 specified code representation known as the LLVM intermediate representation."
16 HOMEPAGE="http://www.llvm.org/"
17 SRC_URI="http://www.llvm.org/releases/${VERSION}/llvm-${VERSION}.src.tar.xz"
18 SRC_URI+=" http://www.llvm.org/releases/${VERSION}/cfe-${VERSION}.src.tar.xz"
19 SRC_DIR="llvm-${VERSION}.src"
20 PATCH_URI="
21 3.4.2-llvm-config.patch
22 3.4.2-cygwin-implib.patch
23 3.5.1-cygwin-clang.patch
24 3.4.2-cygwin-ctypes.patch
25 "
26
27 PKG_NAMES="llvm llvm-doc libllvm3.5 libllvm-devel libllvm-devel-static"
28 PKG_NAMES+=" clang clang-analyzer libclang libclang-devel libclang-devel-static"
29 PKG_NAMES+=" python-clang python3-clang"
30 llvm_CATEGORY="Interpreters"
31 llvm_CONTENTS="--exclude=cygclang.dll --exclude=clang* --exclude=cygLLVM-*.dll
32 --exclude=llvm-config* --exclude=c-*.exe --exclude=scan-*
33 --exclude=html* --exclude=ps --exclude=ocamldoc*
34 usr/bin/ usr/share/doc/"
35 llvm_doc_CATEGORY="Doc"
36 llvm_doc_SUMMARY="LLVM documentation"
37 llvm_doc_CONTENTS="usr/share/doc/${PN}/html* usr/share/doc/${PN}/ps/"
38 libllvm3_5_SUMMARY="LLVM library (runtime)"
39 libllvm3_5_CONTENTS="usr/bin/cygLLVM-3.5.dll"
40 libllvm_devel_SUMMARY="LLVM library (development)"
41 libllvm_devel_CONTENTS="usr/bin/llvm-config* usr/include/llvm* usr/lib/libLLVM-*.dll.a usr/share/llvm/cmake/"
42 libllvm_devel_static_SUMMARY=${llvm_devel_SUMMARY}
43 libllvm_devel_static_REQUIRES="libllvm-devel"
44 libllvm_devel_static_CONTENTS="--exclude=*.dll.a usr/lib/libLLVM*"
45 ocaml_llvm_SUMMARY="LLVM library (OCaml bindings)"
46 ocaml_llvm_CONTENTS="${OCAML_LIBDIR#/} usr/share/doc/${PN}/ocamldoc*"
47 clang_CATEGORY="Devel"
48 clang_SUMMARY="C/C++/ObjC compiler frontend based on LLVM"
49 clang_DESCRIPTION="Clang is an LLVM native C/C++/ObjC compiler, which aims to
50 deliver amazingly fast compiles, extremely useful error and warning messages
51 and to provide a platform for building great source level tools. The Clang
52 Static Analyzer is a tool that automatically finds bugs in your code, and is a
53 great example of the sort of tool that can be built using the Clang frontend
54 as a library to parse C/C++ code."
55 clang_REQUIRES="gcc-core gcc-g++"
56 clang_CONTENTS="usr/bin/c-* usr/bin/clang*.exe usr/bin/clang++ usr/lib/clang/ usr/share/man/man1/clang*"
57 clang_analyzer_CATEGORY="Devel"
58 clang_analyzer_SUMMARY="C/C++/ObjC code analyzer"
59 clang_analyzer_DESCRIPTION=${clang_DESCRIPTION}
60 clang_analyzer_REQUIRES="clang"
61 clang_analyzer_CONTENTS="usr/bin/scan-* usr/libexec/clang-analyzer/ usr/share/man/man1/scan-build.*"
62 libclang_SUMMARY="C/C++/ObjC compiler library (runtime)"
63 libclang_DESCRIPTION=${clang_DESCRIPTION}
64 libclang_CONTENTS="usr/bin/cygclang.dll"
65 libclang_devel_SUMMARY="C/C++/ObjC compiler library (development)"
66 libclang_devel_DESCRIPTION=${clang_DESCRIPTION}
67 libclang_devel_REQUIRES="libllvm-devel"
68 libclang_devel_CONTENTS="usr/include/clang-c/ usr/lib/libclang.dll.a"
69 libclang_devel_static_SUMMARY=${libclang_devel_SUMMARY}
70 libclang_devel_static_REQUIRES="libclang-devel"
71 libclang_devel_static_CONTENTS="--exclude=*.dll.a usr/include/clang/ usr/lib/libclang*"
72 python_clang_SUMMARY="C/C++/ObjC compiler library (Python bindings)"
73 python_clang_DESCRIPTION=${clang_DESCRIPTION}
74 python_clang_REQUIRES="libclang" # loaded via ctypes
75 python_clang_CONTENTS="${PYTHON_SITELIB#/}/clang/"
76 python3_clang_SUMMARY="C/C++/ObjC compiler library (Py3K bindings)"
77 python3_clang_DESCRIPTION=${clang_DESCRIPTION}
78 python3_clang_REQUIRES="libclang" # loaded via ctypes
79 python3_clang_CONTENTS="${PYTHON3_SITELIB#/}/clang/"
80
81 CYGPORT_USE_UNSTABLE_API=1
82 src_unpack_hook() {
83 rm -fr tools/clang
84 mv ../cfe-${VERSION}.src tools/clang
85 }
86
87 src_compile() {
88 # leave optimization to build system, fails to dlopen with -O2
89 CFLAGS=${CFLAGS/-O[0-9]/}
90 CXXFLAGS=${CXXFLAGS/-O[0-9]/}
91
92 local gccdir=/usr/lib/gcc/${ARCH}-pc-cygwin/$(${CC} -dumpversion)
93
94 cd ${B}
95 cygconf --disable-assertions --enable-optimized --enable-debug-runtime \
96 --enable-debug-symbols --enable-targets=x86,cpp \
97 --enable-libffi --enable-shared --disable-embed-stdcxx \
98 --disable-polly --disable-libcpp --enable-bindings=none \
99 --with-gcc-toolchain=/usr \
100 --with-clang-resource-dir=../lib/clang/${ARCH}-pc-cygwin/${VERSION} \
101 --with-c-include-dirs=${gccdir}/include:/usr/include:/usr/include/w32api
102
103 cygmake REQUIRES_RTTI=1
104 }
105
106 src_install() {
107 cd ${B}
108 cyginstall PROJ_docsdir=/usr/share/doc/llvm \
109 PROJ_headers=${D}/usr/lib/clang/${ARCH}-pc-cygwin/${VERSION}/include
110
111 case ${VERSION} in
112 *.*.*) rm -f ${D}/usr/bin/cygLLVM-${VERSION}.dll
113 dosym libLLVM-${VERSION%.*}.dll.a /usr/lib/libLLVM-${VERSION}.dll.a
114 esac
115
116 dodir /usr/libexec/clang-analyzer
117 for a in scan-build scan-view
118 do
119 cp -r ${S}/tools/clang/tools/$a ${D}/usr/libexec/clang-analyzer/
120 dosym /usr/libexec/clang-analyzer/$a/$a /usr/bin/$a
121 done
122 doman ${S}/tools/clang/tools/scan-build/scan-build.1
123 rm -f ${D}/usr/libexec/clang-analyzer/scan-build/*.1
124 python_optimize /usr/libexec/clang-analyzer
125
126 dodir /usr/libexec/clang-analyzer/scan-build/bin
127 dosym /usr/bin/clang.exe /usr/libexec/clang-analyzer/scan-build/bin/clang
128
129 pythoninto clang
130 dopython ${S}/tools/clang/bindings/python/clang/*.py
131 python_optimize
132
133 python3into clang
134 dopython3 ${S}/tools/clang/bindings/python/clang/*.py
135 2to3-${PYTHON3_VERSION} -n -w ${D}${PYTHON3_SITELIB}/clang/*.py
136 python3_optimize
137 }
This page took 0.039526 seconds and 5 git commands to generate.