Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/llvm-libunwind/, sys-libs/llvm-libunwind/files/
Date: Sun, 04 Sep 2016 17:05:04
Message-Id: 1473008698.a251d356d0fe4598a39dfbe59387944d0c30cfdb.mgorny@gentoo
1 commit: a251d356d0fe4598a39dfbe59387944d0c30cfdb
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 4 17:02:08 2016 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 4 17:04:58 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a251d356
7
8 sys-libs/llvm-libunwind: Bump to 3.9.0
9
10 Patch-by: Lei Zhang <zhanglei.april <AT> gmail.com>
11
12 sys-libs/llvm-libunwind/Manifest | 1 +
13 .../files/libunwind-3.9-cmake-static-lib.patch | 43 +++++++++++++++++++++
14 .../llvm-libunwind/llvm-libunwind-3.9.0.ebuild | 44 ++++++++++++++++++++++
15 3 files changed, 88 insertions(+)
16
17 diff --git a/sys-libs/llvm-libunwind/Manifest b/sys-libs/llvm-libunwind/Manifest
18 index 93c857f..40a45c1 100644
19 --- a/sys-libs/llvm-libunwind/Manifest
20 +++ b/sys-libs/llvm-libunwind/Manifest
21 @@ -1 +1,2 @@
22 DIST libunwind-3.8.1.src.tar.xz 60596 SHA256 21e58ce09a5982255ecf86b86359179ddb0be4f8f284a95be14201df90e48453 SHA512 2a60d7c4b0aee6c58f50089ac9fa2b756ab1d74faaee32f7436ddace4510589c7ffdd20478919966ed2fa8a23ee1b5d1b26115dbd8ee2834b00b5bcd61d00b14 WHIRLPOOL f2756de12d39de2df9bf06be3024327b3ca37f2537aae17efda6e94fb9807c31cab1a2eb070aca8e7e44467ab51c69fecbeef063e07472ec59657309a16bdd1c
23 +DIST libunwind-3.9.0.src.tar.xz 61764 SHA256 66675ddec5ba0d36689757da6008cb2596ee1a9067f4f598d89ce5a3b43f4c2b SHA512 dce384bea99ed61b363b847e20946fc9d70377389a227cc7054fbaa916e7cb5ba0b9d89f0df6ed33409dbf38beefd3654c18c1abcf0e50b5d0315ce0135a1d25 WHIRLPOOL 3fddaf6a06390143beee04d0e73ac0b66fb27c5497b80309ca314a52fd67d49ae3806b2b7588f07185c49339a75b7549bbf303f50224916f1ed65f6ad82415d0
24
25 diff --git a/sys-libs/llvm-libunwind/files/libunwind-3.9-cmake-static-lib.patch b/sys-libs/llvm-libunwind/files/libunwind-3.9-cmake-static-lib.patch
26 new file mode 100644
27 index 00000000..82beb44
28 --- /dev/null
29 +++ b/sys-libs/llvm-libunwind/files/libunwind-3.9-cmake-static-lib.patch
30 @@ -0,0 +1,43 @@
31 +diff --git a/CMakeLists.txt b/CMakeLists.txt
32 +index 806b825..4b330f9 100644
33 +--- a/CMakeLists.txt
34 ++++ b/CMakeLists.txt
35 +@@ -104,6 +104,7 @@ option(LIBUNWIND_ENABLE_ASSERTIONS "Enable assertions independent of build mode.
36 + option(LIBUNWIND_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
37 + option(LIBUNWIND_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
38 + option(LIBUNWIND_ENABLE_SHARED "Build libunwind as a shared library." ON)
39 ++option(LIBUNWIND_ENABLE_STATIC "Build libunwind as a static library." OFF)
40 + option(LIBUNWIND_ENABLE_CROSS_UNWINDING "Enable cross-platform unwinding support." OFF)
41 + option(LIBUNWIND_ENABLE_ARM_WMMX "Enable unwinding support for ARM WMMX registers." OFF)
42 +
43 +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
44 +index b7c2d63..7c453de 100644
45 +--- a/src/CMakeLists.txt
46 ++++ b/src/CMakeLists.txt
47 +@@ -51,8 +51,10 @@ set(LIBUNWIND_SOURCES
48 +
49 + if (LIBUNWIND_ENABLE_SHARED)
50 + add_library(unwind SHARED ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
51 +-else()
52 +- add_library(unwind STATIC ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
53 ++endif()
54 ++if (LIBUNWIND_ENABLE_STATIC)
55 ++ add_library(unwind_static STATIC ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
56 ++ set_target_properties(unwind_static PROPERTIES OUTPUT_NAME unwind)
57 + endif ()
58 +
59 + # Generate library list.
60 +@@ -109,7 +111,9 @@ set_property(SOURCE ${LIBUNWIND_CXX_SOURCES}
61 + set_property(SOURCE ${LIBUNWIND_C_SOURCES}
62 + APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_C_FLAGS} ${LIBUNWIND_C_FLAGS}")
63 +
64 +-install(TARGETS unwind
65 +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
66 +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
67 +-
68 ++if (LIBUNWIND_ENABLE_SHARED)
69 ++ install(TARGETS unwind LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX})
70 ++endif ()
71 ++if (LIBUNWIND_ENABLE_STATIC)
72 ++ install(TARGETS unwind_static ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
73 ++endif ()
74
75 diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-3.9.0.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-3.9.0.ebuild
76 new file mode 100644
77 index 00000000..ba30c80
78 --- /dev/null
79 +++ b/sys-libs/llvm-libunwind/llvm-libunwind-3.9.0.ebuild
80 @@ -0,0 +1,44 @@
81 +# Copyright 1999-2016 Gentoo Foundation
82 +# Distributed under the terms of the GNU General Public License v2
83 +# $Id$
84 +
85 +EAPI=6
86 +
87 +: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
88 +CMAKE_MIN_VERSION=3.4.3
89 +inherit cmake-multilib
90 +
91 +MY_P="libunwind-${PV}"
92 +DESCRIPTION="C++ runtime stack unwinder from LLVM"
93 +HOMEPAGE="https://github.com/llvm-mirror/libunwind"
94 +SRC_URI="http://llvm.org/releases/${PV}/${MY_P}.src.tar.xz"
95 +
96 +LICENSE="|| ( UoI-NCSA MIT )"
97 +SLOT="0"
98 +KEYWORDS="~amd64 ~x86"
99 +IUSE="debug +static-libs"
100 +
101 +RDEPEND="!sys-libs/libunwind"
102 +# llvm-config and cmake files needed to get proper flags
103 +# (3.9.0 needed because cmake file install path changed)
104 +DEPEND=">=sys-devel/llvm-3.9.0"
105 +
106 +S="${WORKDIR}/${MY_P}.src"
107 +
108 +src_prepare() {
109 + # add switch for static-libs; accepted upstream
110 + eapply "${FILESDIR}/libunwind-3.9-cmake-static-lib.patch"
111 + default
112 +}
113 +
114 +multilib_src_configure() {
115 + local libdir=$(get_libdir)
116 +
117 + local mycmakeargs=(
118 + -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
119 + -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
120 + -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
121 + )
122 +
123 + cmake-utils_src_configure
124 +}