dev-libs/miniz: pkg-config tweaks

Install the pkg-config file in into the correct (architecture specific)
directory, and also correct the include directory so that it behaves the
same as the CMake config file.

Closes: https://bugs.gentoo.org/849578
Signed-off-by: Matthew Smith <matthew@gentoo.org>
This commit is contained in:
Matthew Smith
2022-06-04 09:43:32 +01:00
parent 1e09ad93d8
commit e4c20836da
3 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
From 37ea28133d9abea3926248c9517676be9b558ca7 Mon Sep 17 00:00:00 2001
From: Matthew Smith <matthew@gentoo.org>
Date: Sat, 4 Jun 2022 09:31:06 +0100
Subject: [PATCH 2/2] build: Set pkgconfig includedir to miniz directory
Allows users to include <miniz.h> instead of <miniz/miniz.h> which
seems to be the intended behaviour.
--- a/miniz.pc.in
+++ b/miniz.pc.in
@@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/miniz
Name: @PROJECT_NAME@
Description: @PROJECT_DESCRIPTION@

View File

@@ -0,0 +1,22 @@
From 9cd715b3b1f5accc2e7cd0b167808c1a47a08938 Mon Sep 17 00:00:00 2001
From: Matthew Smith <matthew@gentoo.org>
Date: Sat, 4 Jun 2022 09:22:37 +0100
Subject: [PATCH 1/2] build: Install .pc file in correct directory
/usr/share/pkgconfig should be used for architecture independent
libraries (e.g. data or scripts), while an architecture dependent
directory like /usr/lib64/pkgconfig should be used for native
binaries.
Co-authored-by: Sam James <sam@gentoo.org>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -173,7 +173,7 @@ if(NOT BUILD_HEADER_ONLY)
if(INSTALL_PROJECT)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/miniz.pc
- DESTINATION ${CMAKE_INSTALL_DATADIR}/pkgconfig)
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
endif()

View File

@@ -0,0 +1,23 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake
DESCRIPTION="A lossless, high performance data compression library"
HOMEPAGE="https://github.com/richgel999/miniz"
SRC_URI="https://github.com/richgel999/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0/${PV}"
KEYWORDS="~amd64 ~x86"
PATCHES=(
# https://bugs.gentoo.org/849578
# https://github.com/richgel999/miniz/pull/239
"${FILESDIR}"/${PN}-2.2.0-fixpcpath.patch
"${FILESDIR}"/${PN}-2.2.0-fixincdir.patch
)
DOCS=( ChangeLog.md readme.md )