commit:     c83deef5496190a13784839a9b48e20a77458346
Author:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 11 20:02:45 2019 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Mon Mar 11 20:40:12 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c83deef5

dev-libs/yajl: fix pkg-config file install

Fixes: https://bugs.gentoo.org/677870
Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

 dev-libs/yajl/files/yajl-2.1.0-pkg-config.patch | 50 +++++++++++++++++++++++++
 dev-libs/yajl/yajl-2.1.0-r2.ebuild              | 38 +++++++++++++++++++
 2 files changed, 88 insertions(+)

diff --git a/dev-libs/yajl/files/yajl-2.1.0-pkg-config.patch 
b/dev-libs/yajl/files/yajl-2.1.0-pkg-config.patch
new file mode 100644
index 00000000000..fc31ef0cf5d
--- /dev/null
+++ b/dev-libs/yajl/files/yajl-2.1.0-pkg-config.patch
@@ -0,0 +1,50 @@
+From 63703fd039fce33ac36e94b9ace4b7c12ef042b9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgo...@gentoo.org>
+Date: Sun, 24 Feb 2019 10:49:44 +0100
+Subject: [PATCH] cmake: Fix installing pkg-config file into libdir
+
+Fix the CMake rules to install pkg-config file into lib/pkgconfig
+rather than share/pkgconfig.  The former location is correct
+for ABI-dependent files such as libraries, while the latter should be
+used only for ABI-agnostic resources (data files, executables).
+
+This fixes using yajl on multilib systems where 32-bit and 64-bit
+versions of the library are installed separately.  This requires two
+separate pkg-config files to be installed along with the libraries
+into appropriate libdirs.  When the file was installed into /usr/share,
+only one variant was permitted and effectively using the other multilib
+variant was broken, breaking other packages.
+
+Original bug report: https://bugs.gentoo.org/677870
+---
+ src/CMakeLists.txt | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 99cf9e9..81369e4 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -30,7 +30,7 @@ ADD_DEFINITIONS(-DYAJL_BUILD)
+ # set up some paths
+ SET (libDir ${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/lib)
+ SET (incDir ${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/include/yajl)
+-SET (shareDir 
${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/share/pkgconfig)
++SET (pcDir ${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/lib/pkgconfig)
+ 
+ # set the output path for libraries
+ SET(LIBRARY_OUTPUT_PATH ${libDir})
+@@ -61,7 +61,7 @@ FILE(MAKE_DIRECTORY ${incDir})
+ # generate build-time source
+ SET(dollar $)
+ CONFIGURE_FILE(api/yajl_version.h.cmake ${incDir}/yajl_version.h)
+-CONFIGURE_FILE(yajl.pc.cmake ${shareDir}/yajl.pc)
++CONFIGURE_FILE(yajl.pc.cmake ${pcDir}/yajl.pc)
+ 
+ # copy public headers to output directory
+ FOREACH (header ${PUB_HDRS})
+@@ -84,4 +84,4 @@ INSTALL(TARGETS yajl
+ INSTALL(TARGETS yajl_s ARCHIVE DESTINATION lib${LIB_SUFFIX})
+ INSTALL(FILES ${PUB_HDRS} DESTINATION include/yajl)
+ INSTALL(FILES ${incDir}/yajl_version.h DESTINATION include/yajl)
+-INSTALL(FILES ${shareDir}/yajl.pc DESTINATION share/pkgconfig)
++INSTALL(FILES ${pcDir}/yajl.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig)

diff --git a/dev-libs/yajl/yajl-2.1.0-r2.ebuild 
b/dev-libs/yajl/yajl-2.1.0-r2.ebuild
new file mode 100644
index 00000000000..9abc15c922f
--- /dev/null
+++ b/dev-libs/yajl/yajl-2.1.0-r2.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-multilib vcs-snapshot
+
+DESCRIPTION="Small event-driven (SAX-style) JSON parser"
+HOMEPAGE="https://lloyd.github.com/yajl/";
+SRC_URI="https://github.com/lloyd/yajl/tarball/${PV} -> ${P}.tar.gz"
+
+LICENSE="ISC"
+SLOT="0/2"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 
~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos 
~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="static-libs"
+
+PATCHES=( "${FILESDIR}"/${P}-uclibc.patch "${FILESDIR}"/${P}-pkg-config.patch )
+
+src_prepare() {
+       cmake-utils_src_prepare
+
+       multilib_copy_sources
+}
+
+src_test() {
+       run_test() {
+               cd "${BUILD_DIR}"/test/parsing
+               ./run_tests.sh ./yajl_test || die
+       }
+       multilib_parallel_foreach_abi run_test
+}
+
+src_install() {
+       cmake-multilib_src_install
+
+       use static-libs || \
+               find "${D}" -name libyajl_s.a -delete
+}

Reply via email to