nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 brotli,
4 buildPerlPackage,
5 fetchurl,
6 perlPackages,
7 pkg-config,
8}:
9
10buildPerlPackage {
11 pname = "IO-Compress-Brotli";
12 version = "0.019";
13
14 src = fetchurl {
15 url = "mirror://cpan/authors/id/T/TI/TIMLEGGE/IO-Compress-Brotli-0.019.tar.gz";
16 hash = "sha256-N/QN187kSs6iby92Onc+YdTsIjMF3e7KRhJEPL8oj78=";
17 };
18
19 patches = [
20 # Use system brotli in Makefile.PL
21 ./use-system-brotli.patch
22 ];
23
24 postPatch = ''
25 substituteInPlace Makefile.PL \
26 --replace-fail "@LIBS@" "-L${lib.getLib brotli}/lib -lbrotlienc -lbrotlidec -lbrotlicommon"
27 '';
28
29 nativeBuildInputs = [ pkg-config ];
30
31 buildInputs = [
32 brotli
33 perlPackages.FileSlurper
34 ];
35
36 propagatedBuildInputs = with perlPackages; [
37 FileSlurper
38 GetoptLong
39 ];
40
41 env.NIX_CFLAGS_COMPILE = "-I${lib.getDev brotli}/include";
42
43 meta = {
44 description = "Write Brotli buffers/streams";
45 homepage = "https://github.com/timlegge/perl-IO-Compress-Brotli";
46 changelog = "https://github.com/timlegge/perl-IO-Compress-Brotli/blob/main/Changes";
47 license = with lib.licenses; [
48 artistic1
49 gpl1Plus
50 ];
51 maintainers = [ lib.maintainers.anthonyroussel ];
52 };
53}