From e65221f043fa0582fa1835b4ae580e030bb09b8d Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Mon, 24 Feb 2020 09:52:31 +0100 Subject: dev-libs/libgit2: Fix pkg-config install path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: https://bugs.gentoo.org/710572 Signed-off-by: Michał Górny --- .../libgit2/files/libgit2-0.99.0-pkg-config.patch | 81 ++++++++++++++++++++++ dev-libs/libgit2/libgit2-0.99.0-r1.ebuild | 76 ++++++++++++++++++++ dev-libs/libgit2/libgit2-0.99.0.ebuild | 72 ------------------- 3 files changed, 157 insertions(+), 72 deletions(-) create mode 100644 dev-libs/libgit2/files/libgit2-0.99.0-pkg-config.patch create mode 100644 dev-libs/libgit2/libgit2-0.99.0-r1.ebuild delete mode 100644 dev-libs/libgit2/libgit2-0.99.0.ebuild diff --git a/dev-libs/libgit2/files/libgit2-0.99.0-pkg-config.patch b/dev-libs/libgit2/files/libgit2-0.99.0-pkg-config.patch new file mode 100644 index 000000000000..4a60037c612a --- /dev/null +++ b/dev-libs/libgit2/files/libgit2-0.99.0-pkg-config.patch @@ -0,0 +1,81 @@ +From fbda0575b133a57d8f5d264742098994c7624c99 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tomasz=20K=C5=82oczko?= +Date: Wed, 19 Feb 2020 12:54:19 +0000 +Subject: [PATCH] Fix #5410: fix installing libgit2.pc in wrong location + +Remove using custom PKG_BUILD_PREFIu, PKG_BUILD_LIBDIR and +PKG_BUILD_INCLUDEDIR variables. +Use cmake CMAKE_INSTALL_PREFIX, LIB_INSTALL_DIR, INCLUDE_INSTALL_DIR instead. +This patch fixes install libgit2.pc file in correct location and simpifies +cmake module. +--- + cmake/Modules/PkgBuildConfig.cmake | 39 +++--------------------------- + 1 file changed, 4 insertions(+), 35 deletions(-) + +diff --git a/cmake/Modules/PkgBuildConfig.cmake b/cmake/Modules/PkgBuildConfig.cmake +index 1c0079eb0..e4c574431 100644 +--- a/cmake/Modules/PkgBuildConfig.cmake ++++ b/cmake/Modules/PkgBuildConfig.cmake +@@ -1,10 +1,5 @@ + # pkg-config file generation + # +-# Uses the following globals: +-# - PKG_BUILD_PREFIX: the build location (aka prefix). Defaults to CMAKE_INSTALL_PREFIX +-# - PKG_BUILD_LIBDIR: the libdir location. Defaults to ${prefix}/lib. +-# - PKG_BUILD_INCLUDEDIR: the includedir location. Defaults to ${prefix}/include. +-# + + function(pkg_build_config) + set(options) +@@ -29,37 +24,11 @@ function(pkg_build_config) + message(FATAL_ERROR "Missing VERSION argument") + endif() + +- if (DEFINED PKG_BUILD_PREFIX) +- set(PKGCONFIG_PREFIX "${PKG_BUILD_PREFIX}") +- else() +- set(PKGCONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}") +- endif() +- +- if(DEFINED PKG_BUILD_LIBDIR) +- if (IS_ABSOLUTE ${PKG_BUILD_LIBDIR}) +- set(PKGCONFIG_LIBDIR ${PKG_BUILD_LIBDIR}) +- else() +- set(PKGCONFIG_LIBDIR "\${prefix}/${PKG_BUILD_LIBDIR}") +- endif() +- else() +- set(PKGCONFIG_LIBDIR "\${prefix}/lib") +- endif() +- +- if(DEFINED PKG_BUILD_INCLUDEDIR) +- if (IS_ABSOLUTE ${PKG_BUILD_INCLUDEDIR}) +- set(PKGCONFIG_INCLUDEDIR ${PKG_BUILD_INCLUDEDIR}) +- else() +- set(PKGCONFIG_INCLUDEDIR "\${prefix}/${PKG_BUILD_INCLUDEDIR}") +- endif() +- else() +- set(PKGCONFIG_INCLUDEDIR "\${prefix}/include") +- endif() +- + # Write .pc "header" + file(WRITE "${PKGCONFIG_FILE}" +- "prefix=\"${PKGCONFIG_PREFIX}\"\n" +- "libdir=\"${PKGCONFIG_LIBDIR}\"\n" +- "includedir=\"${PKGCONFIG_INCLUDEDIR}\"\n" ++ "prefix=\"${CMAKE_INSTALL_PREFIX}\"\n" ++ "libdir=\"${LIB_INSTALL_DIR}\"\n" ++ "includedir=\"${INCLUDE_INSTALL_DIR}\"\n" + "\n" + "Name: ${PKGCONFIG_NAME}\n" + "Description: ${PKGCONFIG_DESCRIPTION}\n" +@@ -105,6 +74,6 @@ function(pkg_build_config) + + # Install .pc file + install(FILES "${PKGCONFIG_FILE}" +- DESTINATION "${PKGCONFIG_PREFIX}/${PKGCONFIG_LIBDIR}/pkgconfig" ++ DESTINATION "${LIB_INSTALL_DIR}/pkgconfig" + ) + endfunction() +-- +2.25.1 + diff --git a/dev-libs/libgit2/libgit2-0.99.0-r1.ebuild b/dev-libs/libgit2/libgit2-0.99.0-r1.ebuild new file mode 100644 index 000000000000..8d7000bba6c4 --- /dev/null +++ b/dev-libs/libgit2/libgit2-0.99.0-r1.ebuild @@ -0,0 +1,76 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{6,7} ) +inherit cmake python-any-r1 + +DESCRIPTION="A linkable library for Git" +HOMEPAGE="https://libgit2.org" +SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" +S=${WORKDIR}/${P/_/-} + +LICENSE="GPL-2-with-linking-exception" +SLOT="0/0.99" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~ppc-macos" +IUSE="examples gssapi libressl +ssh test +threads trace" +RESTRICT="!test? ( test )" + +RDEPEND=" + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + sys-libs/zlib + net-libs/http-parser:= + gssapi? ( virtual/krb5 ) + ssh? ( net-libs/libssh2 ) +" +DEPEND="${RDEPEND} + ${PYTHON_DEPS} + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${P}-pkg-config.patch +) + +src_prepare() { + cmake_src_prepare + # relying on forked http-parser to support some obscure URI form + sed -i -e '/empty_port/s:test:_&:' tests/network/urlparse.c || die +} + +src_configure() { + local mycmakeargs=( + -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)" + -DBUILD_CLAR=$(usex test) + -DENABLE_TRACE=$(usex trace) + -DUSE_GSSAPI=$(usex gssapi) + -DUSE_SSH=$(usex ssh) + -DTHREADSAFE=$(usex threads) + -DUSE_HTTP_PARSER=system + ) + cmake_src_configure +} + +src_test() { + if [[ ${EUID} -eq 0 ]] ; then + # repo::iterator::fs_preserves_error fails if run as root + # since root can still access dirs with 0000 perms + ewarn "Skipping tests: non-root privileges are required for all tests to pass" + else + local TEST_VERBOSE=1 + cmake_src_test -R offline + fi +} + +src_install() { + cmake_src_install + dodoc docs/*.{md,txt} + + if use examples ; then + find examples -name '.gitignore' -delete || die + dodoc -r examples + docompress -x /usr/share/doc/${PF}/examples + fi +} diff --git a/dev-libs/libgit2/libgit2-0.99.0.ebuild b/dev-libs/libgit2/libgit2-0.99.0.ebuild deleted file mode 100644 index 3abe4784a16c..000000000000 --- a/dev-libs/libgit2/libgit2-0.99.0.ebuild +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{6,7} ) -inherit cmake python-any-r1 - -DESCRIPTION="A linkable library for Git" -HOMEPAGE="https://libgit2.org" -SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" -S=${WORKDIR}/${P/_/-} - -LICENSE="GPL-2-with-linking-exception" -SLOT="0/0.99" -KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~ppc-macos" -IUSE="examples gssapi libressl +ssh test +threads trace" -RESTRICT="!test? ( test )" - -RDEPEND=" - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl:0= ) - sys-libs/zlib - net-libs/http-parser:= - gssapi? ( virtual/krb5 ) - ssh? ( net-libs/libssh2 ) -" -DEPEND="${RDEPEND} - ${PYTHON_DEPS} - virtual/pkgconfig -" - -src_prepare() { - cmake_src_prepare - # relying on forked http-parser to support some obscure URI form - sed -i -e '/empty_port/s:test:_&:' tests/network/urlparse.c || die -} - -src_configure() { - local mycmakeargs=( - -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)" - -DBUILD_CLAR=$(usex test) - -DENABLE_TRACE=$(usex trace) - -DUSE_GSSAPI=$(usex gssapi) - -DUSE_SSH=$(usex ssh) - -DTHREADSAFE=$(usex threads) - -DUSE_HTTP_PARSER=system - ) - cmake_src_configure -} - -src_test() { - if [[ ${EUID} -eq 0 ]] ; then - # repo::iterator::fs_preserves_error fails if run as root - # since root can still access dirs with 0000 perms - ewarn "Skipping tests: non-root privileges are required for all tests to pass" - else - local TEST_VERBOSE=1 - cmake_src_test -R offline - fi -} - -src_install() { - cmake_src_install - dodoc docs/*.{md,txt} - - if use examples ; then - find examples -name '.gitignore' -delete || die - dodoc -r examples - docompress -x /usr/share/doc/${PF}/examples - fi -} -- cgit v1.2.3-65-gdbad