Skip to content
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
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions dev-libs/miniz/files/miniz-2.2.0-fixincdir.patch
@@ -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@
22 changes: 22 additions & 0 deletions dev-libs/miniz/files/miniz-2.2.0-fixpcpath.patch
@@ -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()

23 changes: 23 additions & 0 deletions dev-libs/miniz/miniz-2.2.0-r1.ebuild
@@ -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 )
61 changes: 61 additions & 0 deletions dev-perl/Sereal-Decoder/Sereal-Decoder-4.23.0-r1.ebuild
@@ -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
Copy link
Member

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


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
}
63 changes: 63 additions & 0 deletions dev-perl/Sereal-Encoder/Sereal-Encoder-4.23.0-r1.ebuild
@@ -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
}