commit:     a251d356d0fe4598a39dfbe59387944d0c30cfdb
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  4 17:02:08 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Sep  4 17:04:58 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a251d356

sys-libs/llvm-libunwind: Bump to 3.9.0

Patch-by: Lei Zhang <zhanglei.april <AT> gmail.com>

 sys-libs/llvm-libunwind/Manifest                   |  1 +
 .../files/libunwind-3.9-cmake-static-lib.patch     | 43 +++++++++++++++++++++
 .../llvm-libunwind/llvm-libunwind-3.9.0.ebuild     | 44 ++++++++++++++++++++++
 3 files changed, 88 insertions(+)

diff --git a/sys-libs/llvm-libunwind/Manifest b/sys-libs/llvm-libunwind/Manifest
index 93c857f..40a45c1 100644
--- a/sys-libs/llvm-libunwind/Manifest
+++ b/sys-libs/llvm-libunwind/Manifest
@@ -1 +1,2 @@
 DIST libunwind-3.8.1.src.tar.xz 60596 SHA256 
21e58ce09a5982255ecf86b86359179ddb0be4f8f284a95be14201df90e48453 SHA512 
2a60d7c4b0aee6c58f50089ac9fa2b756ab1d74faaee32f7436ddace4510589c7ffdd20478919966ed2fa8a23ee1b5d1b26115dbd8ee2834b00b5bcd61d00b14
 WHIRLPOOL 
f2756de12d39de2df9bf06be3024327b3ca37f2537aae17efda6e94fb9807c31cab1a2eb070aca8e7e44467ab51c69fecbeef063e07472ec59657309a16bdd1c
+DIST libunwind-3.9.0.src.tar.xz 61764 SHA256 
66675ddec5ba0d36689757da6008cb2596ee1a9067f4f598d89ce5a3b43f4c2b SHA512 
dce384bea99ed61b363b847e20946fc9d70377389a227cc7054fbaa916e7cb5ba0b9d89f0df6ed33409dbf38beefd3654c18c1abcf0e50b5d0315ce0135a1d25
 WHIRLPOOL 
3fddaf6a06390143beee04d0e73ac0b66fb27c5497b80309ca314a52fd67d49ae3806b2b7588f07185c49339a75b7549bbf303f50224916f1ed65f6ad82415d0

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
new file mode 100644
index 00000000..82beb44
--- /dev/null
+++ b/sys-libs/llvm-libunwind/files/libunwind-3.9-cmake-static-lib.patch
@@ -0,0 +1,43 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 806b825..4b330f9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -104,6 +104,7 @@ option(LIBUNWIND_ENABLE_ASSERTIONS "Enable assertions 
independent of build mode.
+ option(LIBUNWIND_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
+ option(LIBUNWIND_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
+ option(LIBUNWIND_ENABLE_SHARED "Build libunwind as a shared library." ON)
++option(LIBUNWIND_ENABLE_STATIC "Build libunwind as a static library." OFF)
+ option(LIBUNWIND_ENABLE_CROSS_UNWINDING "Enable cross-platform unwinding 
support." OFF)
+ option(LIBUNWIND_ENABLE_ARM_WMMX "Enable unwinding support for ARM WMMX 
registers." OFF)
+ 
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index b7c2d63..7c453de 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -51,8 +51,10 @@ set(LIBUNWIND_SOURCES
+ 
+ if (LIBUNWIND_ENABLE_SHARED)
+   add_library(unwind SHARED ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
+-else()
+-  add_library(unwind STATIC ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
++endif()
++if (LIBUNWIND_ENABLE_STATIC)
++  add_library(unwind_static STATIC ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
++  set_target_properties(unwind_static PROPERTIES OUTPUT_NAME unwind)
+ endif ()
+ 
+ # Generate library list.
+@@ -109,7 +111,9 @@ set_property(SOURCE ${LIBUNWIND_CXX_SOURCES}
+ set_property(SOURCE ${LIBUNWIND_C_SOURCES}
+              APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_C_FLAGS} 
${LIBUNWIND_C_FLAGS}")
+ 
+-install(TARGETS unwind
+-        LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+-        ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
+-
++if (LIBUNWIND_ENABLE_SHARED)
++  install(TARGETS unwind LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX})
++endif ()
++if (LIBUNWIND_ENABLE_STATIC)
++  install(TARGETS unwind_static ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
++endif ()

diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-3.9.0.ebuild 
b/sys-libs/llvm-libunwind/llvm-libunwind-3.9.0.ebuild
new file mode 100644
index 00000000..ba30c80
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-3.9.0.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+CMAKE_MIN_VERSION=3.4.3
+inherit cmake-multilib
+
+MY_P="libunwind-${PV}"
+DESCRIPTION="C++ runtime stack unwinder from LLVM"
+HOMEPAGE="https://github.com/llvm-mirror/libunwind";
+SRC_URI="http://llvm.org/releases/${PV}/${MY_P}.src.tar.xz";
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug +static-libs"
+
+RDEPEND="!sys-libs/libunwind"
+# llvm-config and cmake files needed to get proper flags
+# (3.9.0 needed because cmake file install path changed)
+DEPEND=">=sys-devel/llvm-3.9.0"
+
+S="${WORKDIR}/${MY_P}.src"
+
+src_prepare() {
+       # add switch for static-libs; accepted upstream
+       eapply "${FILESDIR}/libunwind-3.9-cmake-static-lib.patch"
+       default
+}
+
+multilib_src_configure() {
+       local libdir=$(get_libdir)
+
+       local mycmakeargs=(
+               -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+               -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
+               -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
+       )
+
+       cmake-utils_src_configure
+}

Reply via email to