Skip to content

Commit ffad8d3

Browse files
committed
Sync Compress-Raw-Zlib with CPAN 2.202
From ChangeLog: 2.202 27 June 2022 * Z_NULL should be 'UV' rather than 'PV' pmqs/Compress-Raw-Zlib#17 Sun Jun 26 22:02:04 2022 +0100 de28f0335d3d605d696b19d43fc48de42272455c 2.201 25 June 2022 * 2.021 Sat Jun 25 08:42:46 2022 +0100 85416cab509c18c5fa3f923de7b45b6c7c0f7a6f * 2.201 Sat Jun 25 08:39:26 2022 +0100 b3d63862b2ff4ac9d28e23be500c0d32ad69dd11 * More zlib-ng updates Thu Jun 23 22:42:13 2022 +0100 313f626425181702b5fc80af2b6ea7eed41d5a9d * Fix test count regression in t/07bufsize.t (#16) Wed Jun 22 09:45:11 2022 +0100 98dc5b4a2b30c26752b6f686462b06b8db72a5e4 2.200 21 June 2022 * Added zlib-ng support pmqs/Compress-Raw-Zlib#9 * Only set Z_SOLO when building zlib sources * pmqs/Compress-Raw-Zlib#12 Tue Jun 7 10:13:00 2022 +0100 c44e0b732e214b7f77d42a3af6ae64ef944cee90 2.105 14 April 2022 * Add Compress::Raw::Zlib::VERSION to output Sat May 14 15:16:57 2022 +0100 3e22c93169a67986017f64d9a2e5085c417d8624 * Dump version info when running test harness Sat May 14 15:10:17 2022 +0100 ca9f33ba0323d0abc91a83800636f180b2b44162 * Fix use of ZLIB_INCLUDE/LIB Sat May 14 09:01:38 2022 +0100 8a7d4a97d7441b61a8a888342766419044fa5a33 * More fixes for BUILD_ZLIB off Sat May 14 08:54:04 2022 +0100 2d9650094dab90858ef58bfbda62f3bc60e159e4 * Add BUILD_ZLIB to the matrix Sat May 14 08:31:54 2022 +0100 b61b92fc9d06bf04f1adec337357ffbd39535901 * Merge branch 'master' of * https://github.com/pmqs/Compress-Raw-Zlib Sat May 14 08:27:14 2022 +0100 3ac7d0d3d45ae263402fab1ebb3835e2ae16c5a6 * Fix for BUILD_ZLIB disabled Sat May 14 08:25:34 2022 +0100 b0f04e37fb58a34ef01767ad16a8f63ca868eec6 * Add BUILD_ZLIB to the matrix Sat May 14 08:22:56 2022 +0100 aa8f5ff981c7305c995d4e2f798ae0d7d45866a5 2.104 13 April 2022 * Merge pull request #11 from monkburger/symbol_fix_2 Fri May 13 07:17:19 2022 +0100 64aea2d3f78946d7df4096eadfa0d7267f4439a5 * perl_crz -> Perl_crz Tue May 3 18:19:24 2022 +0000 20502e6c2eba8ddcad80b20574e840457c0cb369 * This is a slightly different way to fix * pmqs/Compress-Raw-Zlib#8 Tue May 3 18:06:48 2022 +0000 d9cd27fb212da7455b6ba44729ca11bb441f3950 * add tests for crc32/adler32_combine Mon May 2 16:18:13 2022 +0100 dcfe9ef439790f1a4fae81cf3eac38cfeb848294
1 parent 587a88e commit ffad8d3

File tree

12 files changed

+469
-236
lines changed

12 files changed

+469
-236
lines changed

Porting/Maintainers.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ package Maintainers;
216216
},
217217

218218
'Compress::Raw::Zlib' => {
219-
'DISTRIBUTION' => 'PMQS/Compress-Raw-Zlib-2.105.tar.gz',
219+
'DISTRIBUTION' => 'PMQS/Compress-Raw-Zlib-2.202.tar.gz',
220220
'FILES' => q[cpan/Compress-Raw-Zlib],
221221
'EXCLUDED' => [
222222
qr{^examples/},

cpan/Compress-Raw-Zlib/Makefile.PL

+62-27
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use Config;
1212
my $ZLIB_LIB ;
1313
my $ZLIB_INCLUDE ;
1414
my $BUILD_ZLIB = 0 ;
15+
my $USE_ZLIB_NG = 0;
1516
my $OLD_ZLIB = '' ;
1617
my $WALL = '' ;
1718
my $GZIP_OS_CODE = -1 ;
@@ -74,6 +75,8 @@ UpDowngrade(getPerlFiles('MANIFEST'))
7475
my $OPT_Z_PREFIX = '-DZ_PREFIX' ;
7576
my $OPT_ZLIB_INCLUDE = "-I$ZLIB_INCLUDE";
7677
my $OPT_ZLIB_LIB = "-L$ZLIB_LIB" ;
78+
my $OPT_SOLO = '-DZ_SOLO';
79+
my $OPT_USE_ZLIB_NG = "";
7780

7881
if (! $BUILD_ZLIB)
7982
{
@@ -85,13 +88,21 @@ if (! $BUILD_ZLIB)
8588

8689
$OPT_ZLIB_LIB = ''
8790
if $ZLIB_LIB eq './zlib-src' ;
91+
92+
$OPT_SOLO = '';
93+
}
94+
95+
if ( $USE_ZLIB_NG)
96+
{
97+
$OPT_USE_ZLIB_NG = '-DUSE_ZLIB_NG';
98+
$ZLIB_LIBRARY_NAME = $^O eq 'MSWin32' ? 'zlib-ng' : 'z-ng' ;
8899
}
89100

90101
WriteMakefile(
91102
NAME => 'Compress::Raw::Zlib',
92103
VERSION_FROM => 'lib/Compress/Raw/Zlib.pm',
93104
INC => $OPT_ZLIB_INCLUDE ,
94-
DEFINE => "-DNO_VIZ -DZ_SOLO $OLD_ZLIB $WALL $OPT_Z_PREFIX -DGZIP_OS_CODE=$GZIP_OS_CODE $USE_PPPORT_H -DPerl_crz_BUILD_ZLIB=$BUILD_ZLIB" ,
105+
DEFINE => "-DNO_VIZ $OPT_SOLO $OLD_ZLIB $WALL $OPT_Z_PREFIX $OPT_USE_ZLIB_NG -DGZIP_OS_CODE=$GZIP_OS_CODE $USE_PPPORT_H -DPerl_crz_BUILD_ZLIB=$BUILD_ZLIB" ,
95106
XS => { 'Zlib.xs' => 'Zlib.c'},
96107
'depend' => { 'Makefile' => 'config.in' },
97108
'clean' => { FILES => '*.c constants.h constants.xs' },
@@ -177,7 +188,6 @@ my @names = qw(
177188
Z_NEED_DICT
178189
Z_NO_COMPRESSION
179190
Z_NO_FLUSH
180-
Z_NULL
181191
Z_OK
182192
Z_PARTIAL_FLUSH
183193
Z_RLE
@@ -187,8 +197,13 @@ my @names = qw(
187197
Z_UNKNOWN
188198
Z_VERSION_ERROR
189199
200+
ZLIBNG_VERNUM
201+
ZLIBNG_VER_MAJOR
202+
ZLIBNG_VER_MINOR
203+
ZLIBNG_VER_REVISION
204+
ZLIBNG_VER_STATUS
205+
ZLIBNG_VER_MODIFIED
190206
);
191-
#ZLIB_VERNUM
192207

193208
my %verSpecificNames = (
194209
Z_TREES => '1240',
@@ -226,6 +241,9 @@ if (eval {require ExtUtils::Constant; 1}) {
226241
}
227242
keys %verSpecificNames ;
228243

244+
push @names, { name => 'Z_NULL', type => 'UV' };
245+
push @names, { name => 'ZLIBNG_VERSION', type => 'PV' };
246+
229247
ExtUtils::Constant::WriteConstants(
230248
NAME => 'Zlib',
231249
NAMES => \@names,
@@ -244,12 +262,24 @@ else {
244262
}
245263
}
246264

265+
sub getBoolean
266+
{
267+
my $name = shift ;
268+
my $info = shift;
269+
270+
my $x = defined $ENV{$name}
271+
? $ENV{$name}
272+
: $info->{$name} ;
273+
274+
return ($x =~ /^yes|on|true|1$/i) ? 1 : 0;
275+
}
276+
247277
sub ParseCONFIG
248278
{
249279
my ($k, $v) ;
250280
my @badkey = () ;
251281
my %Info = () ;
252-
my @Options = qw( INCLUDE LIB BUILD_ZLIB OLD_ZLIB GZIP_OS_CODE ) ;
282+
my @Options = qw( INCLUDE LIB BUILD_ZLIB OLD_ZLIB GZIP_OS_CODE USE_ZLIB_NG) ;
253283
my %ValidOption = map {$_, 1} @Options ;
254284
my %Parsed = %ValidOption ;
255285
my $CONFIG = 'config.in' ;
@@ -285,44 +315,48 @@ sub ParseCONFIG
285315
$ZLIB_INCLUDE = defined $ENV{'ZLIB_INCLUDE'}
286316
? $ENV{'ZLIB_INCLUDE'}
287317
: $Info{'INCLUDE'} ;
318+
288319
$ZLIB_LIB = defined $ENV{'ZLIB_LIB'}
289320
?$ENV{'ZLIB_LIB'}
290321
: $Info{'LIB'} ;
291322

323+
$USE_ZLIB_NG = getBoolean('USE_ZLIB_NG', \%Info);
324+
292325
if ($^O eq 'VMS') {
293326
$ZLIB_INCLUDE = VMS::Filespec::vmspath($ZLIB_INCLUDE);
294327
$ZLIB_LIB = VMS::Filespec::vmspath($ZLIB_LIB);
295328
}
296329

297-
my $y = defined $ENV{'OLD_ZLIB'}
298-
? $ENV{'OLD_ZLIB'}
299-
: $Info{'OLD_ZLIB'} ;
300-
$OLD_ZLIB = '-DOLD_ZLIB' if $y and $y =~ /^yes|on|true|1$/i;
301-
302-
my $x = defined $ENV{'BUILD_ZLIB'}
303-
? $ENV{'BUILD_ZLIB'}
304-
: $Info{'BUILD_ZLIB'} ;
305-
306-
if ($x and $x =~ /^yes|on|true|1$/i ) {
330+
$OLD_ZLIB = '-DOLD_ZLIB'
331+
if getBoolean('OLD_ZLIB', \%Info);
307332

308-
$BUILD_ZLIB = 1 ;
333+
$BUILD_ZLIB = getBoolean('BUILD_ZLIB', \%Info);
309334

310-
# ZLIB_LIB & ZLIB_INCLUDE must point to the same place when
311-
# BUILD_ZLIB is specified.
312-
die "INCLUDE & LIB must be the same when BUILD_ZLIB is True\n"
313-
if $ZLIB_LIB ne $ZLIB_INCLUDE ;
335+
if ($BUILD_ZLIB ) {
314336

315-
# Check the zlib source directory exists
316-
die "LIB/INCLUDE directory '$ZLIB_LIB' does not exits\n"
317-
unless -d $ZLIB_LIB ;
337+
# ZLIB_LIB & ZLIB_INCLUDE must point to the same place when
338+
# BUILD_ZLIB is specified.
339+
die "INCLUDE & LIB must be the same when BUILD_ZLIB is True\n"
340+
if $ZLIB_LIB ne $ZLIB_INCLUDE ;
318341

319-
# check for a well known file
320-
die "LIB/INCLUDE directory, '$ZLIB_LIB', doesn't seem to have the zlib source files\n"
321-
unless -e catfile($ZLIB_LIB, 'zlib.h') ;
342+
# Check the zlib source directory exists
343+
die "LIB/INCLUDE directory '$ZLIB_LIB' does not exits\n"
344+
unless -d $ZLIB_LIB ;
322345

346+
# check for a well known file
347+
if ($USE_ZLIB_NG)
348+
{
349+
die "LIB/INCLUDE directory, '$ZLIB_LIB', doesn't seem to have the zlib-ng source files\n"
350+
unless -e catfile($ZLIB_LIB, 'zlib-ng.h') ;
351+
}
352+
else
353+
{
354+
die "LIB/INCLUDE directory, '$ZLIB_LIB', doesn't seem to have the zlib source files\n"
355+
unless -e catfile($ZLIB_LIB, 'zlib.h') ;
356+
}
323357

324-
# write the Makefile
325-
print "Building Zlib enabled\n" ;
358+
# write the Makefile
359+
print "Building Zlib enabled\n" ;
326360
}
327361

328362
$GZIP_OS_CODE = defined $ENV{'GZIP_OS_CODE'}
@@ -348,6 +382,7 @@ sub ParseCONFIG
348382
GZIP_OS_CODE [$GZIP_OS_CODE]
349383
OLD_ZLIB [$OLD_ZLIB]
350384
BUILD_ZLIB [$BUILD_ZLIB]
385+
USE_ZLIB_NG [$USE_ZLIB_NG]
351386
352387
EOM
353388

0 commit comments

Comments
 (0)