New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev-perl/Sereal-{Encoder,Decoder}: Use miniz pkg-config file #25746
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Copyright 1999-2022 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
|
||
DIST_AUTHOR=YVES | ||
DIST_VERSION=4.023 | ||
inherit edo perl-module flag-o-matic | ||
|
||
DESCRIPTION="Fast, compact, powerful binary deserialization" | ||
SLOT="0" | ||
KEYWORDS="~amd64" | ||
IUSE="test" | ||
RESTRICT="!test? ( test )" | ||
|
||
RDEPEND=" | ||
virtual/perl-XSLoader | ||
app-arch/csnappy:= | ||
app-arch/zstd:= | ||
>=dev-libs/miniz-2.2.0-r1:= | ||
" | ||
DEPEND=" | ||
app-arch/csnappy:= | ||
app-arch/zstd:= | ||
>=dev-libs/miniz-2.2.0-r1:= | ||
" | ||
BDEPEND="${RDEPEND} | ||
>=virtual/perl-ExtUtils-MakeMaker-7.0 | ||
>=virtual/perl-ExtUtils-ParseXS-2.210.0 | ||
virtual/perl-File-Path | ||
test? ( | ||
virtual/perl-Data-Dumper | ||
virtual/perl-File-Spec | ||
virtual/perl-Scalar-List-Utils | ||
dev-perl/Test-Deep | ||
dev-perl/Test-Differences | ||
dev-perl/Test-LongString | ||
>=virtual/perl-Test-Simple-0.880.0 | ||
dev-perl/Test-Warn | ||
) | ||
" | ||
|
||
src_prepare() { | ||
local bundled_lib | ||
for bundled_lib in inc/Devel snappy miniz{.c,.h} zstd ; do | ||
edo rm -r ${bundled_lib} | ||
done | ||
|
||
sed -i -e "/miniz.*OBJ_EXT/d" inc/Sereal/BuildTools.pm || die | ||
|
||
perl-module_src_prepare | ||
} | ||
|
||
src_compile() { | ||
DIST_MAKE=( | ||
"INC=$($(tc-getPKG_CONFIG) --cflags miniz)" | ||
"OTHERLDFLAGS=$($(tc-getPKG_CONFIG) --libs miniz)" | ||
) | ||
|
||
perl-module_src_compile | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Copyright 1999-2022 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
|
||
DIST_AUTHOR=YVES | ||
DIST_VERSION=4.023 | ||
inherit edo perl-module flag-o-matic | ||
|
||
DESCRIPTION="Fast, compact, powerful binary serialization" | ||
SLOT="0" | ||
KEYWORDS="~amd64" | ||
|
||
# Note: bundled zstd fails compile | ||
RDEPEND=" | ||
virtual/perl-XSLoader | ||
app-arch/csnappy:= | ||
app-arch/zstd:= | ||
>=dev-libs/miniz-2.2.0-r1:= | ||
" | ||
DEPEND=" | ||
app-arch/csnappy:= | ||
app-arch/zstd:= | ||
>=dev-libs/miniz-2.2.0-r1:= | ||
" | ||
# Tester note: ideally you want dev-perl/Sereal-Decoder | ||
# as well, but we can't depend on it because it forms | ||
# a tight cycle if we do | ||
BDEPEND="${RDEPEND} | ||
>=virtual/perl-ExtUtils-MakeMaker-7.0.0 | ||
>=virtual/perl-ExtUtils-ParseXS-2.210.0 | ||
virtual/perl-File-Path | ||
test? ( | ||
virtual/perl-Data-Dumper | ||
virtual/perl-File-Spec | ||
virtual/perl-Scalar-List-Utils | ||
dev-perl/Test-Deep | ||
dev-perl/Test-Differences | ||
dev-perl/Test-LongString | ||
>=virtual/perl-Test-Simple-0.880.0 | ||
dev-perl/Test-Warn | ||
) | ||
" | ||
|
||
src_prepare() { | ||
local bundled_lib | ||
for bundled_lib in inc/Devel snappy miniz{.c,.h} zstd ; do | ||
edo rm -r ${bundled_lib} | ||
done | ||
|
||
sed -i -e "/miniz.*OBJ_EXT/d" inc/Sereal/BuildTools.pm || die | ||
|
||
perl-module_src_prepare | ||
} | ||
|
||
src_compile() { | ||
DIST_MAKE=( | ||
"INC=$($(tc-getPKG_CONFIG) --cflags miniz)" | ||
"OTHERLDFLAGS=$($(tc-getPKG_CONFIG) --libs miniz)" | ||
) | ||
|
||
perl-module_src_compile | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing toolchain-funcs inherit, bdepend for pkgconfig