diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2020-07-11 20:34:27 +0200 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2020-07-11 20:10:03 -0700 |
commit | 82667371131f2f1ba28c244b2a51391134f25669 (patch) | |
tree | 207e1967d3a8c17b5601bfd1a2afd50691f04685 /app-text | |
parent | dev-python/pyfakefs: s390 keyworded (bug #707066) (diff) | |
download | gentoo-82667371131f2f1ba28c244b2a51391134f25669.tar.gz gentoo-82667371131f2f1ba28c244b2a51391134f25669.tar.bz2 gentoo-82667371131f2f1ba28c244b2a51391134f25669.zip |
app-text/editorconfig-core-c: Switch to cmake.eclass, fix EAPI-7 port
- Properly disable static-libs
- Always depends on app-doc/doxygen for man pages
- Depends on dev-libs/libpcre2, not dev-libs/libpcre (see changelog)
Closes: https://bugs.gentoo.org/726702
Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'app-text')
-rw-r--r-- | app-text/editorconfig-core-c/editorconfig-core-c-0.12.3-r1.ebuild | 31 | ||||
-rw-r--r-- | app-text/editorconfig-core-c/files/editorconfig-core-c-0.12.3-no-static-libs.patch | 69 |
2 files changed, 100 insertions, 0 deletions
diff --git a/app-text/editorconfig-core-c/editorconfig-core-c-0.12.3-r1.ebuild b/app-text/editorconfig-core-c/editorconfig-core-c-0.12.3-r1.ebuild new file mode 100644 index 000000000000..828fb761bded --- /dev/null +++ b/app-text/editorconfig-core-c/editorconfig-core-c-0.12.3-r1.ebuild @@ -0,0 +1,31 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake + +DESCRIPTION="EditorConfig core library written in C" +HOMEPAGE="https://github.com/editorconfig/editorconfig-core-c/" +SRC_URI="https://github.com/editorconfig/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" +IUSE="cli doc" + +BDEPEND="app-doc/doxygen" +DEPEND="dev-libs/libpcre2:=" +RDEPEND="${DEPEND} + cli? ( !dev-python/editorconfig-core-py[cli] )" + +PATCHES=( "${FILESDIR}/${P}-no-static-libs.patch" ) + +src_install() { + use doc && local HTML_DOCS=( "${BUILD_DIR}"/doc/html/. ) + cmake_src_install + + if ! use cli; then + rm -r "${ED}/usr/bin" || die + fi +} diff --git a/app-text/editorconfig-core-c/files/editorconfig-core-c-0.12.3-no-static-libs.patch b/app-text/editorconfig-core-c/files/editorconfig-core-c-0.12.3-no-static-libs.patch new file mode 100644 index 000000000000..369b806467be --- /dev/null +++ b/app-text/editorconfig-core-c/files/editorconfig-core-c-0.12.3-no-static-libs.patch @@ -0,0 +1,69 @@ +From 4fa85f00f824b1dd5d1244c77667ea497d94f02b Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner <asturm@gentoo.org> +Date: Sat, 11 Jul 2020 21:11:58 +0200 +Subject: [PATCH] Do not build static lib if BUILD_STATICALLY_LINKED_EXE=OFF + +Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> +--- + src/lib/CMakeLists.txt | 36 +++++++++++++++++++++++------------- + 1 file changed, 23 insertions(+), 13 deletions(-) + +diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt +index 353ab1c..12db621 100644 +--- a/src/lib/CMakeLists.txt ++++ b/src/lib/CMakeLists.txt +@@ -44,16 +44,18 @@ if(WIN32) + endif() + target_link_libraries(editorconfig_shared ${PCRE2_LIBRARIES}) + +-add_library(editorconfig_static STATIC ${editorconfig_LIBSRCS}) +-set_target_properties(editorconfig_static PROPERTIES +- OUTPUT_NAME editorconfig_static +- VERSION ${PROJECT_VERSION}) ++if(BUILD_STATICALLY_LINKED_EXE) ++ add_library(editorconfig_static STATIC ${editorconfig_LIBSRCS}) ++ set_target_properties(editorconfig_static PROPERTIES ++ OUTPUT_NAME editorconfig_static ++ VERSION ${PROJECT_VERSION}) + +-# We need to link Shwapi since we use PathIsRelative +-if(WIN32) +- target_link_libraries(editorconfig_static Shlwapi) ++ # We need to link Shwapi since we use PathIsRelative ++ if(WIN32) ++ target_link_libraries(editorconfig_static Shlwapi) ++ endif() ++ target_link_libraries(editorconfig_static ${PCRE2_LIBRARIES}) + endif() +-target_link_libraries(editorconfig_static ${PCRE2_LIBRARIES}) + + # EditorConfig package name for find_package() and the CMake package registry. + # On UNIX the system registry is usually just "lib/cmake/<package>". +@@ -65,11 +67,19 @@ set(editorconfig_CONFIG_EXPORT_NAME "${config_package_name}Targets") + set(editorconfig_CONFIG_INSTALL_LIBDIR + "${CMAKE_INSTALL_LIBDIR}/cmake/${config_package_name}") + +-install(TARGETS editorconfig_shared editorconfig_static +- EXPORT ${editorconfig_CONFIG_EXPORT_NAME} +- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++if(BUILD_STATICALLY_LINKED_EXE) ++ install(TARGETS editorconfig_static ++ EXPORT ${editorconfig_CONFIG_EXPORT_NAME} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++else() ++ install(TARGETS editorconfig_shared ++ EXPORT ${editorconfig_CONFIG_EXPORT_NAME} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++endif() + + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/editorconfig.pc.in +-- +2.27.0 + |