void-packages/srcpkgs/perl-IO-Compress-Brotli/patches/no-bundled-brotli.patch

51 lines
1.2 KiB
Diff

--- IO-Compress-Brotli-0.004001/Makefile.PL.orig 2022-08-02 09:39:14.249801914 +0200
+++ IO-Compress-Brotli-0.004001/Makefile.PL 2022-08-02 09:39:03.236639950 +0200
@@ -1,5 +1,23 @@
use 5.014000;
use ExtUtils::MakeMaker;
+use ExtUtils::PkgConfig;
+
+my @requirements = qw(libbrotlidec libbrotlienc);
+my $libs = '';
+my $inc = '';
+
+my %pkgcfg;
+foreach my $req (@requirements) {
+ eval{
+ %pkgcfg = ExtUtils::PkgConfig->find($req);
+ };
+ if ($@) {
+ die "Could not determine location of library $req.";
+ }
+ $libs .= $pkgcfg{libs}.' ';
+ $inc .= $pkgcfg{cflags}.' ';
+}
+
WriteMakefile(
NAME => 'IO::Compress::Brotli',
@@ -16,20 +34,12 @@ WriteMakefile(
'Time::HiRes' => '0',
},
BUILD_REQUIRES => {},
- INC => '-Ibrotli/c/include',
- MYEXTLIB => 'brotli/libbrotli$(LIB_EXT)',
- clean => { FILES => 'brotli/libbrotli$(LIB_EXT)' },
META_ADD => {
dynamic_config => 0,
resources => {
repository => 'https://git.ieval.ro/?p=io-compress-brotli.git',
},
- }
+ },
+ LIBS => $libs,
+ INC => $inc,
);
-
-sub MY::postamble {
-'
-$(MYEXTLIB): brotli/Makefile
- cd brotli && CFLAGS=-fPIC `which gmake || echo $(MAKE)` lib
-'
-}