push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
diff --git a/alienfile b/alienfile
index 18d6b42..5ccf296 100644
--- a/alienfile
+++ b/alienfile
@@ -11,12 +11,6 @@ plugin 'PkgConfig' => 'libffi';
share {
- plugin 'Download::GitHub' => (
- github_user => 'libffi',
- github_repo => 'libffi',
- asset => 1,
- );
-
plugin 'Build::Autoconf' => ();
my $configure = '--disable-shared --enable-static --disable-builddir';
diff --git a/t/00_diag.t b/t/00_diag.t
index 51dd784..2bc314c 100644
--- a/t/00_diag.t
+++ b/t/00_diag.t
@@ -13,7 +13,6 @@ $modules{$_} = $_ for qw(
Alien::Base
Alien::Build
Alien::Build::MM
- Alien::Build::Plugin::Download::GitHub
Alien::Build::Plugin::Probe::Vcpkg
Capture::Tiny
ExtUtils::MakeMaker

View File

@@ -0,0 +1,25 @@
diff --git a/lib/Archive/Libarchive/Lib.pm b/lib/Archive/Libarchive/Lib.pm
index 3fcbcf4..214df7a 100644
--- a/lib/Archive/Libarchive/Lib.pm
+++ b/lib/Archive/Libarchive/Lib.pm
@@ -3,7 +3,7 @@ package Archive::Libarchive::Lib;
use strict;
use warnings;
use 5.020;
-use FFI::CheckLib 0.30 qw( find_lib_or_die );
+use FFI::CheckLib qw( find_lib_or_die );
use Encode qw( decode );
use experimental qw( signatures );
index 3fcbcf4..718caed 100644
--- a/lib/Archive/Libarchive/Lib.pm
+++ b/lib/Archive/Libarchive/Lib.pm
@@ -23,7 +23,7 @@ L<Archive::Libarchive>.
sub lib
{
- $ENV{ARCHIVE_LIBARCHIVE_LIB_DLL} // find_lib_or_die( lib => 'archive', symbol => ['archive_read_free','archive_write_free','archive_free'], alien => ['Alien::Libarchive3'] );
+ $ENV{ARCHIVE_LIBARCHIVE_LIB_DLL} // find_lib_or_die( lib => 'archive', symbol => ['archive_read_free','archive_write_free','archive_free'], libpath => '@@libarchive@@' );
}
sub ffi

View File

@@ -0,0 +1,63 @@
{
BioPerl,
IOString,
buildPerlModule,
fetchFromGitHub,
fetchurl,
kent,
lib,
libmysqlclient,
libpng,
openssl,
}:
buildPerlModule rec {
pname = "Bio-BigFile";
version = "1.07";
src = fetchurl {
url = "mirror://cpan/authors/id/L/LD/LDS/Bio-BigFile-${version}.tar.gz";
sha256 = "277b66ce8acbdd52399e2c5a0cf4e3bd5c74c12b94877cd383d0c4c97740d16d";
};
# Only kent 335 works with Bio-BigFile, see
# - official documentation: https://www.ensembl.org/info/docs/tools/vep/script/vep_download.html#bigfile
# - one of the developer's answer: https://github.com/Ensembl/ensembl-vep/issues/1412
# BioBigfile needs the environment variable KENT_SRC to find kent
KENT_SRC = kent.overrideAttrs (old: rec {
pname = "kent";
version = "335";
src = fetchFromGitHub {
owner = "ucscGenomeBrowser";
repo = "kent";
rev = "v${version}_base";
sha256 = "1455dwzpaq4hyhcqj3fpwgq5a39kp46qarfbr6ms6l2lz583r083";
};
patches = [
# Fix for linking error with zlib. Adding zlib as a dependency is not enough
./kent-utils.patch
# Vendoring upstream patch (not merged in uscsGenomeBrowser/kent)
./kent-316e4fd40f53c96850128fd65097a42623d1e736.patch
];
});
buildInputs = [
BioPerl
IOString
libpng
libmysqlclient
openssl
];
# Ensure compatibility with GCC-11 (compilation fails if -Wno-format-security)
hardeningDisable = [ "format" ];
meta = with lib; {
homepage = "https://metacpan.org/dist/Bio-BigFile";
description = "Manipulate Jim Kent's BigWig and BigBed index files for genomic features";
license = licenses.artistic2;
maintainers = with maintainers; [ apraga ];
};
}

View File

@@ -0,0 +1,25 @@
From 316e4fd40f53c96850128fd65097a42623d1e736 Mon Sep 17 00:00:00 2001
From: Marcel Bargull <marcel.bargull@udo.edu>
Date: Sat, 27 Mar 2021 16:23:34 +0100
Subject: [PATCH] Fix linking Clang 11 compiled objects
With Clang 11 htmlRecover from lib/htmshell.h is picked up as a
definition, not just declaration of the jmp_buf. As such both
lib/htmshell.c and hg/lib/cart.c export two symbols with the same name.
---
src/inc/htmshell.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/inc/htmshell.h b/src/inc/htmshell.h
index 9d85f45b936..dd586db761c 100644
--- a/src/inc/htmshell.h
+++ b/src/inc/htmshell.h
@@ -160,7 +160,7 @@ void htmlBadVar(char *varName);
void htmlImage(char *fileName, int width, int height);
/* Display centered image file. */
-jmp_buf htmlRecover; /* Error recovery jump. Exposed for cart's use. */
+extern jmp_buf htmlRecover; /* Error recovery jump. Exposed for cart's use. */
void htmlVaWarn(char *format, va_list args);
/* Write an error message. (Generally you just call warn() or errAbort().

View File

@@ -0,0 +1,27 @@
--- ./src/utils/bigWigCat/makefile 2023-03-27 14:03:01.585896516 +0000
+++ ./src/utils/bigWigCat/makefile 2023-03-27 14:03:27.716180479 +0000
@@ -1,3 +1,4 @@
kentSrc = ../..
A = bigWigCat
include $(kentSrc)/inc/userApp.mk
+L += -lz
--- ./src/utils/pslLiftSubrangeBlat/makefile 1970-01-01 00:00:01.000000000 +0000
+++ ./src/utils/pslLiftSubrangeBlat/makefile 2023-03-27 14:36:59.044600213 +0000
@@ -3,7 +3,7 @@
preMyLibs += ../../lib/$(MACHTYPE)/jkhgap.a
include $(kentSrc)/inc/userApp.mk
HG_INC += -I../../hg/inc
-L += $(MYSQLLIBS) -lm
+L += $(MYSQLLIBS) -lm -lz
test::
cd tests && ${MAKE} test
--- ./src/utils/bigWigCorrelate/makefile 2023-03-27 14:36:23.117545553 +0000
+++ ./src/utils/bigWigCorrelate/makefile 2023-03-27 14:36:33.854328176 +0000
@@ -1,3 +1,4 @@
kentSrc = ../..
A = bigWigCorrelate
include $(kentSrc)/inc/userApp.mk
+L += -lz

View File

@@ -0,0 +1,57 @@
{
lib,
buildPerlPackage,
fetchFromGitHub,
}:
buildPerlPackage rec {
pname = "BioExtAlign";
version = "1.5.1";
outputs = [ "out" ];
src = fetchFromGitHub {
owner = "bioperl";
repo = "bioperl-ext";
rev = "bioperl-ext-release-${lib.replaceStrings [ "." ] [ "-" ] version}";
sha256 = "sha256-+0tZ6q3PFem8DWa2vq+njOLmjDvMB0JhD0FGk00lVMA=";
};
patches = [
# Starting for Perl 5.6, implicit function declaration are treated as errors
# There may be an error but ensembl-vep (the main package for this dependency)
# runs
./no-implicit-function.patch
# Tests need other parts of BioExt, disabling them
./disable-other-tests.patch
./fprintf.patch
];
# Do not install other Bio-ext packages
preConfigure = ''
cd Bio/Ext/Align
'';
# Disable tests as it requires Bio::Tools::Align which is in a different directory
buildPhase = ''
make
'';
checkPhase = ''
runHook preCheck
make test
runHook postCheck
'';
meta = {
homepage = "https://github.com/bioperl/bioperl-ext";
description = "Write Perl Subroutines in Other Programming Languages";
longDescription = ''
Part of BioPerl Extensions (BioPerl-Ext) distribution, a collection of Bioperl C-compiled extensions.
'';
license = with lib.licenses; [ artistic1 ];
maintainers = with lib.maintainers; [ apraga ];
};
}

View File

@@ -0,0 +1,84 @@
diff --git a/Bio/Ext/Align/test.pl b/Bio/Ext/Align/test.pl
index 72411f3..1deb77b 100755
--- a/Bio/Ext/Align/test.pl
+++ b/Bio/Ext/Align/test.pl
@@ -8,13 +8,10 @@ my $DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
BEGIN {
eval { require Test; };
use Test;
- plan tests => 9;
+ plan tests => 4;
}
use Bio::Ext::Align;
-use Bio::Tools::dpAlign;
-use Bio::Seq;
-use Bio::AlignIO;
$loaded = 1;
ok(1); # modules loaded
@@ -34,64 +31,3 @@ $alb = &Bio::Ext::Align::Align_Sequences_ProteinSmithWaterman($seq1,$seq2,
$seq2->seq,15,50,STDERR) if $DEBUG;
-warn( "Testing Local Alignment case...\n") if $DEBUg;
-
-$alnout = new Bio::AlignIO(-format => 'pfam', -fh => \*STDERR);
-$aln = &Bio::Ext::Align::Align_DNA_Sequences("AATGCCATTGACGG",
- "CAGCCTCGCTTAG",3,-1,3,1,
- Bio::Tools::dpAlign::DPALIGN_LOCAL_MILLER_MYERS);
-
-$out = Bio::SimpleAlign->new();
-
-$out->add_seq(Bio::LocatableSeq->new(-seq => $aln->aln1,
- -start => $aln->start1,
- -end => $aln->end1,
- -id => "one"));
-
-$out->add_seq(Bio::LocatableSeq->new(-seq => $aln->aln2,
- -start => $aln->start2,
- -end => $aln->end2,
- -id => "two"));
-$alnout->write_aln($out) if $DEBUG;
-
-$aln = &Bio::Ext::Align::Align_Protein_Sequences("WLGQRNLVSSTGGNLLNVWLKDW","WMGNRNVVNLLNVWFRDW",0,
- Bio::Tools::dpAlign::DPALIGN_LOCAL_MILLER_MYERS);
-$out = Bio::SimpleAlign->new();
-ok($aln);
-
-$out->add_seq(Bio::LocatableSeq->new(-seq => $aln->aln1,
- -start => $aln->start1,
- -end => $aln->end1,
- -id => "one"));
-
-$out->add_seq(Bio::LocatableSeq->new(-seq => $aln->aln2,
- -start => $aln->start2,
- -end => $aln->end2,
- -id => "two"));
-$alnout->write_aln($out) if $DEBUG;
-ok(1);
-
-warn( "Testing Global Alignment case...\n") if $DEBUG;
-
-$factory = new Bio::Tools::dpAlign('-alg' => Bio::Tools::dpAlign::DPALIGN_GLOBAL_MILLER_MYERS);
-$s1 = new Bio::Seq(-id => "one", -seq => "AATGCCATTGACGG", -alphabet => 'dna');
-$s2 = new Bio::Seq(-id => "two", -seq => "CAGCCTCGCTTAG", -alphabet => 'dna');
-$aln = $factory->pairwise_alignment($s1, $s2);
-$alnout->write_aln($aln) if $DEBUG;
-$factory->align_and_show($s1, $s2) if $DEBUG;
-
-ok(1);
-
-$s1 = new Bio::Seq(-id => "one", -seq => "WLGQRNLVSSTGGNLLNVWLKDW",
- -alphabet => 'protein');
-$s2 = new Bio::Seq(-id => "two", -seq => "WMGNRNVVNLLNVWFRDW",
- -alphabet => 'protein');
-$aln = $factory->pairwise_alignment($s1, $s2);
-$alnout->write_aln($aln) if $DEBUG;
-$factory->align_and_show($s1, $s2) if $DEBUG;
-ok(1);
-
-$prof = $factory->sequence_profile($s1);
-warn( "Optimal Alignment Score = %d\n", $factory->pairwise_alignment_score($prof, $s2)) if $DEBUG;
-
-ok($factory->pairwise_alignment_score($prof,$s2),77);

View File

@@ -0,0 +1,13 @@
diff --git a/libs/dpalign.c b/libs/dpalign.c
index 0e07b67..0eab932 100644
--- a/Bio/Ext/Align/libs/dpalign.c
+++ b/Bio/Ext/Align/libs/dpalign.c
@@ -40,7 +40,7 @@ int blosum62[24][24] = {
void
dpAlign_fatal(char * s)
{
- fprintf(stderr, s);
+ fputs(s, stderr);
exit(-1);
}

View File

@@ -0,0 +1,13 @@
diff --git a/Bio/Ext/Align/Makefile.PL b/Bio/Ext/Align/Makefile.PL
index cc6c343..ea5cffa 100755
--- a/Bio/Ext/Align/Makefile.PL
+++ b/Bio/Ext/Align/Makefile.PL
@@ -5,7 +5,7 @@ WriteMakefile(
'NAME' => 'Bio::Ext::Align',
'VERSION' => '1.5.1',
'LIBS' => ['-lm'], # e.g., '-lm'
- 'DEFINE' => '-DPOSIX -DNOERROR', # e.g., '-DHAVE_SOMETHING'
+ 'DEFINE' => '-DPOSIX -DNOERROR -Wno-implicit-function-declaration', # e.g., '-DHAVE_SOMETHING'
'INC' => '-I./libs', # e.g., '-I/usr/include/other'
'MYEXTLIB' => 'libs/libsw$(LIB_EXT)',
'clean' => { 'FILES' => 'libs/*.o libs/*.a' }

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
Replaces the legacy DES crypt hash used in tests with a stronger
bcrypt function, as crypt() in pkgs.perl no longer supports DES
# htpasswd -nbB mufasa "Circle of Life"
diff --git a/t/lib/TestApp/htpasswd b/t/lib/TestApp/htpasswd
index 6cec784..91e5375 100644
--- a/t/lib/TestApp/htpasswd
+++ b/t/lib/TestApp/htpasswd
@@ -1 +1 @@
-mufasa:Y7hn4ncIVPOuI
+mufasa:$2y$05$.KPC4Gja9L5AxJATDQBzs.lCHkm49l/9dcoyPcJg0JhyIvsD6Gqza

View File

@@ -0,0 +1,11 @@
diff --git a/lib/CatalystX/Script/Server/Starman.pm b/lib/CatalystX/Script/Server/Starman.pm
index 670bd74..7b3bd2e 100644
--- a/lib/CatalystX/Script/Server/Starman.pm
+++ b/lib/CatalystX/Script/Server/Starman.pm
@@ -9,5 +9,5 @@ our $VERSION = '0.02';
extends 'Catalyst::Script::Server';
-has '+fork' => ( default => 1, init_arg => undef );
+has '+fork' => ( default => 1 );

View File

@@ -0,0 +1,47 @@
From 5592bfb58eb8d1c8a644e67c9bba795d1384a995 Mon Sep 17 00:00:00 2001
From: Marc Lehmann <schmorp@schmorp.de>
Date: Sat, 6 Sep 2025 11:31:36 +0200
Subject: [PATCH 1/2] fix json_atof_scan1 overflows
with fuzzed overlong numbers. CVE-2025-40928
Really the comparisons were wrong.
---
XS.xs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/XS.xs b/XS.xs
index 9b1ce2b..94ab0d6 100755
--- a/XS.xs
+++ b/XS.xs
@@ -710,16 +710,16 @@ json_atof_scan1 (const char *s, NV *accum, int *expo, int postdp, int maxdepth)
/* if we recurse too deep, skip all remaining digits */
/* to avoid a stack overflow attack */
if (UNLIKELY(--maxdepth <= 0))
- while (((U8)*s - '0') < 10)
+ while ((U8)(*s - '0') < 10)
++s;
for (;;)
{
- U8 dig = (U8)*s - '0';
+ U8 dig = (U8)(*s - '0');
if (UNLIKELY(dig >= 10))
{
- if (dig == (U8)((U8)'.' - (U8)'0'))
+ if (dig == (U8)('.' - '0'))
{
++s;
json_atof_scan1 (s, accum, expo, 1, maxdepth);
@@ -739,7 +739,7 @@ json_atof_scan1 (const char *s, NV *accum, int *expo, int postdp, int maxdepth)
else if (*s == '+')
++s;
- while ((dig = (U8)*s - '0') < 10)
+ while ((dig = (U8)(*s - '0')) < 10)
exp2 = exp2 * 10 + *s++ - '0';
*expo += neg ? -exp2 : exp2;
--
2.50.1

View File

@@ -0,0 +1,24 @@
From 51fda02d223f516c4948606c050bfc732b95f481 Mon Sep 17 00:00:00 2001
From: Brian Fraser <brian.fraser@booking.com>
Date: Thu, 24 Sep 2020 15:00:20 +0200
Subject: [PATCH] _des.h: expose perl_des_expand_key() and perl_des_crypt() to
prevent implicit delaration errors/warnings
---
_des.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/_des.h b/_des.h
index ec56b27..b636cda 100644
--- a/_des.h
+++ b/_des.h
@@ -4,4 +4,6 @@ typedef unsigned long des_ks[32];
void _des_crypt( des_cblock in, des_cblock out, des_ks key, int encrypt );
void _des_expand_key( des_user_key userKey, des_ks key );
+void perl_des_expand_key(des_user_key userKey, des_ks ks);
+void perl_des_crypt( des_cblock input, des_cblock output, des_ks ks, int encrypt );
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,11 @@
--- a/Makefile.PL 2016-04-21 15:44:34.000000000 +0200
+++ b/Makefile.PL 2017-10-31 11:04:28.389959946 +0100
@@ -129,7 +129,7 @@
# a system sqlite is also sophisticated enough to have a patching system
# that can change the if ( 0 ) to if ( 1 )
my ($sqlite_local, $sqlite_base, $sqlite_lib, $sqlite_inc);
-if ( 0 ) {
+if ( 1 ) {
require File::Spec;
if ( $sqlite_base = (grep(/SQLITE_LOCATION=.*/, @ARGV))[0] ) {
$sqlite_base =~ /=(.*)/;

View File

@@ -0,0 +1,26 @@
https://github.com/gfx/p5-Data-Clone/pull/3
From 43102a83d15aedc61e5904eb5a6dab33c3c02b40 Mon Sep 17 00:00:00 2001
From: Yves Orton <demerphq@gmail.com>
Date: Thu, 9 Feb 2023 16:24:45 +0100
Subject: [PATCH] t/07_stack.t - isn't is deprecated, use isnt instead
As of 5.37.8 use of apostrophe for a package separator is deprecated,
and in 5.40 it will be removed entirely. Switch to isnt() instead
of isn't().
---
t/07_stack.t | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/07_stack.t b/t/07_stack.t
index 165e6a5..a750366 100644
--- a/t/07_stack.t
+++ b/t/07_stack.t
@@ -17,6 +17,6 @@ use Data::Clone;
my $before = bless [], Bar::;
my $after = clone($before);
-isn't $after, $before, 'stack reallocation during callback';
+isnt $after, $before, 'stack reallocation during callback';
done_testing;

View File

@@ -0,0 +1,214 @@
Eliminate use of state/node files in temp directory, which are a security concern due to insecure writing of State/Node files in a temporary directory, with predictable filenames, with a possible symlink attack.
Fixes CVE-2013-4184
https://github.com/bleargh45/Data-UUID/pull/40 by Graham TerMarsch @bleargh45
diff --git a/Makefile.PL b/Makefile.PL
index 4ca26af..fb1a0f0 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -89,30 +89,14 @@ WriteMakefile(
CONFIGURE => sub {
my %opt;
- GetOptions(\%opt, 's|state-storage-directory:s', 'd|default-umask:s',
- 'help|?', 'man') or pod2usage(2);
+ GetOptions(\%opt, 'help|?', 'man') or pod2usage(2);
pod2usage(1) if $opt{help};
pod2usage(-verbose => 2) if $opt{man};
print "Configured options (run perl Makefile.PL --help for how to change this):\n";
- my $d = File::Spec->tmpdir;
- $d = $opt{s} || $d;
- print "\tUUID state storage: $d\n";
- $d =~ s/\\/\\\\/g if $^O eq 'MSWin32';
-
- my $m = '0007';
- unless ($^O eq 'MSWin32') {
- $m = $opt{d} || $m;
- print "\tdefault umask: $m\n";
- }
-
- chmod(0666, sprintf("%s/%s", $d, ".UUID_NODEID"));
- chmod(0666, sprintf("%s/%s", $d, ".UUID_STATE"));
return {
- DEFINE => '-D_STDIR=' . shell_quote(c_quote($d))
- . ' -D' . shell_quote("__$Config{osname}__")
- . ' -D_DEFAULT_UMASK=' . shell_quote($m)
+ DEFINE => ' -D' . shell_quote("__$Config{osname}__")
};
}
);
@@ -127,11 +111,9 @@ Makefile.PL - configure Makefile for Data::UUID
perl Makefile.PL [options] [EU::MM options]
-perl Makefile.PL -s=/var/local/lib/data-uuid -d=0007
+perl Makefile.PL
Options:
- --state-storage-directory directory for storing library state information
- --default-umask umask for files in the state storage directory
--help brief help message
--man full documentation
@@ -141,18 +123,6 @@ Options can be abbreviated, see L<Getopt::Long/"Case and abbreviations">.
=over
-=item --state-storage-directory
-
-Optional. Takes a string that is interpreted as directory for storing library
-state information. Default is c:/tmp/ on Windows if it already exists, or the
-operating system's temporary directory (see tmpdir in L<File::Spec/"METHODS">),
-or /var/tmp as fallback.
-
-=item --default-umask
-
-Optional. Takes a string that is interpreted as umask for the files in the state
-storage directory. Default is 0007. This is ignored on Windows.
-
=item --help
Print a brief help message and exits.
@@ -165,10 +135,7 @@ Prints the manual page and exits.
=head1 DESCRIPTION
-B<Makefile.PL> writes the Makefile for the Data::UUID library. It is configured
-with the options L</"--state-storage-directory"> and L</"--default-umask">.
-Unless given, default values are used. In any case the values are printed for
-confirmation.
+B<Makefile.PL> writes the Makefile for the Data::UUID library.
Additionally, the usual EU::MM options are processed, see
L<ExtUtils::MakeMaker/"Using Attributes and Parameters">.
diff --git a/README b/README
index 8aaa1c2..34d53a5 100644
--- a/README
+++ b/README
@@ -23,15 +23,6 @@ To install this module type the following:
make test
make install
-NOTE: This module is designed to save its state information in a permanent
-storage location. The installation script (i.e. Makefile.PL) prompts for
-a directory name to use as a storage location for state file and defaults
-this directory to "/var/tmp" if no directory name is provided.
-The installation script will not accept names of directories that do not
-exist, however, it will take the locations, which the installing user
-has no write permissions to. In this case, the state information will not be
-saved, which will maximize the chances of generating duplicate UUIDs.
-
COPYRIGHT AND LICENCE
Copyright (C) 2001, Alexander Golomshtok
diff --git a/UUID.h b/UUID.h
index dc5ea28..11d6e13 100644
--- a/UUID.h
+++ b/UUID.h
@@ -44,23 +44,6 @@
#include <process.h>
#endif
-#if !defined _STDIR
-# define _STDIR "/var/tmp"
-#endif
-#if !defined _DEFAULT_UMASK
-# define _DEFAULT_UMASK 0007
-#endif
-
-#define UUID_STATE ".UUID_STATE"
-#define UUID_NODEID ".UUID_NODEID"
-#if defined __mingw32__ || (defined _WIN32 && !defined(__cygwin__)) || defined _MSC_VER
-#define UUID_STATE_NV_STORE _STDIR"\\"UUID_STATE
-#define UUID_NODEID_NV_STORE _STDIR"\\"UUID_NODEID
-#else
-#define UUID_STATE_NV_STORE _STDIR"/"UUID_STATE
-#define UUID_NODEID_NV_STORE _STDIR"/"UUID_NODEID
-#endif
-
#define UUIDS_PER_TICK 1024
#ifdef _MSC_VER
#define I64(C) C##i64
@@ -134,7 +117,6 @@ typedef struct _uuid_state_t {
typedef struct _uuid_context_t {
uuid_state_t state;
uuid_node_t nodeid;
- perl_uuid_time_t next_save;
} uuid_context_t;
static void format_uuid_v1(
diff --git a/UUID.xs b/UUID.xs
index c3496a8..8191727 100644
--- a/UUID.xs
+++ b/UUID.xs
@@ -356,29 +356,11 @@ PREINIT:
UV one = 1;
CODE:
RETVAL = (uuid_context_t *)PerlMemShared_malloc(sizeof(uuid_context_t));
- if ((fd = fopen(UUID_STATE_NV_STORE, "rb"))) {
- fread(&(RETVAL->state), sizeof(uuid_state_t), 1, fd);
- fclose(fd);
- get_current_time(&timestamp);
- RETVAL->next_save = timestamp;
- }
- if ((fd = fopen(UUID_NODEID_NV_STORE, "rb"))) {
- pid_t *hate = (pid_t *) &(RETVAL->nodeid);
- fread(&(RETVAL->nodeid), sizeof(uuid_node_t), 1, fd );
- fclose(fd);
-
- *hate += getpid();
- } else {
+
get_random_info(seed);
seed[0] |= 0x80;
memcpy(&(RETVAL->nodeid), seed, sizeof(uuid_node_t));
- mask = umask(_DEFAULT_UMASK);
- if ((fd = fopen(UUID_NODEID_NV_STORE, "wb"))) {
- fwrite(&(RETVAL->nodeid), sizeof(uuid_node_t), 1, fd);
- fclose(fd);
- };
- umask(mask);
- }
+
errno = 0;
#if DU_THREADSAFE
MUTEX_LOCK(&instances_mutex);
@@ -415,17 +397,6 @@ PPCODE:
self->state.node = self->nodeid;
self->state.ts = timestamp;
self->state.cs = clockseq;
- if (timestamp > self->next_save ) {
- mask = umask(_DEFAULT_UMASK);
- if((fd = fopen(UUID_STATE_NV_STORE, "wb"))) {
- LOCK(fd);
- fwrite(&(self->state), sizeof(uuid_state_t), 1, fd);
- UNLOCK(fd);
- fclose(fd);
- }
- umask(mask);
- self->next_save = timestamp + (10 * 10 * 1000 * 1000);
- }
ST(0) = make_ret(uuid, ix);
XSRETURN(1);
@@ -585,14 +556,6 @@ CODE:
MUTEX_UNLOCK(&instances_mutex);
if (count == 0) {
#endif
- mask = umask(_DEFAULT_UMASK);
- if ((fd = fopen(UUID_STATE_NV_STORE, "wb"))) {
- LOCK(fd);
- fwrite(&(self->state), sizeof(uuid_state_t), 1, fd);
- UNLOCK(fd);
- fclose(fd);
- };
- umask(mask);
PerlMemShared_free(self);
#if DU_THREADSAFE
}

View File

@@ -0,0 +1,11 @@
--- Device-OUI-1.04/lib/Device/OUI.pm.orig 2009-03-07 02:23:17.000000000 +0000
+++ Device-OUI-1.04/lib/Device/OUI.pm 2016-08-09 08:19:00.642799675 +0100
@@ -54,7 +54,7 @@
for my $x ( keys %hash ) {
if ( not defined $hash{ $x } ) { $hash{ $x } = '' }
}
- return $handle->{ $oui } = join( "\0", %hash );
+ return $handle->{ $oui } = join( "\0", map {$_,$hash{$_}} sort keys %hash );
} elsif ( my $x = $handle->{ $oui } ) {
return { split( "\0", $x ) };
}

View File

@@ -0,0 +1,20 @@
smartmatch deprecated in perl-5.37.10
Patch by @pghmcfc from
https://github.com/dex4er/perl-Exception-Base/issues/5#issuecomment-1637075218
diff --git a/t/tlib/Exception/BaseTest.pm b/t/tlib/Exception/BaseTest.pm
index d590d12..e531ed7 100644
--- a/t/tlib/Exception/BaseTest.pm
+++ b/t/tlib/Exception/BaseTest.pm
@@ -569,8 +569,9 @@ sub test_overload {
$self->assert_matches(qr/String at /, $obj);
# smart matching for Perl 5.10
- if ($] >= 5.010) {
+ # Deprecation warning added in 5.37.10
+ if ($] >= 5.010 && $] < 5.037010) {
no if $] >= 5.018, warnings => 'experimental::smartmatch';
eval q{
$self->assert_num_equals(1, 'String' ~~ $obj);

View File

@@ -0,0 +1,31 @@
https://rt.cpan.org/Public/Bug/Display.html?id=132995
From 94b5fc74c3d7ed835e83bac40632962af32f5b30 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
Date: Mon, 13 Jul 2020 22:08:45 +0100
Subject: [PATCH] Fix indirect method call in ExtUtils::Constant test
It puts both "use $];" and "bootstrap $package \$VERSION;" in the
generated test module, which is going to break if we ever remove
`indirect` from the current feature bundle.
Fix by making the method call direct instead.
---
t/Constant.t | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/Constant.t b/t/Constant.t
index d6b45668da..526a32c779 100644
--- a/t/Constant.t
+++ b/t/Constant.t
@@ -435,7 +435,7 @@ EOT
print FH ");\n";
# Print the AUTOLOAD subroutine ExtUtils::Constant generated for us
print FH autoload ($package, $]);
- print FH "bootstrap $package \$VERSION;\n1;\n__END__\n";
+ print FH "$package->bootstrap(\$VERSION);\n1;\n__END__\n";
close FH or die "close $pm: $!\n";
################ test.pl
--
2.26.2

View File

@@ -0,0 +1,25 @@
From ca70a73bb147549e62e74751d924b1dbb59d1707 Mon Sep 17 00:00:00 2001
From: Stig Palmquist <stig@stig.io>
Date: Thu, 5 Jun 2025 03:45:50 +0200
Subject: [PATCH] Fix CVE-2011-10007
---
lib/File/Find/Rule.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/File/Find/Rule.pm b/lib/File/Find/Rule.pm
index feccc76..d4dc475 100644
--- a/lib/File/Find/Rule.pm
+++ b/lib/File/Find/Rule.pm
@@ -420,7 +420,7 @@ sub grep {
$self->exec( sub {
local *FILE;
- open FILE, $_ or return;
+ open FILE, '<', $_ or return;
local ($_, $.);
while (<FILE>) {
for my $p (@pattern) {
--
2.49.0

View File

@@ -0,0 +1,12 @@
diff -Naur Google-ProtocolBuffers-0.08-orig/lib/Google/ProtocolBuffers/Compiler.pm Google-ProtocolBuffers-0.08/lib/Google/ProtocolBuffers/Compiler.pm
--- Google-ProtocolBuffers-0.08-orig/lib/Google/ProtocolBuffers/Compiler.pm 2008-10-23 13:46:01.000000000 -0400
+++ Google-ProtocolBuffers-0.08/lib/Google/ProtocolBuffers/Compiler.pm 2013-01-16 13:52:09.855063997 -0500
@@ -16,7 +16,7 @@
my $grammar = <<'END_OF_GRAMMAR';
-proto : <skip: qr! (?: //.*\n | \s+ )* !x>
+proto : <skip: qr! (?: //.*?\n | \s+ | /\*.*?\*/\s* )* !xs>
## list of top level declarations.
## Skip empty declarations and ";".
(message | extend | enum | import | package | option | service | syntax | ";")(s) /\Z/

View File

@@ -0,0 +1,86 @@
diff -ur a/gdk.typemap b/gdk.typemap
--- a/gdk.typemap 2017-05-21 15:02:54.000000000 -0400
+++ b/gdk.typemap 2023-11-03 13:17:43.717890172 -0400
@@ -23,6 +23,7 @@
TYPEMAP
# can be either a pointer or an integer, this handles both cases
+uintptr_t T_UV
GdkNativeWindow T_UV
# GdkBitmap doesn't get its own type id, but needs to be treated separately.
diff -ur a/xs/GdkDnd.xs b/xs/GdkDnd.xs
--- a/xs/GdkDnd.xs 2017-05-21 15:02:54.000000000 -0400
+++ b/xs/GdkDnd.xs 2023-11-03 13:23:22.478329089 -0400
@@ -142,12 +142,12 @@
void
gdk_drag_get_protocol_for_display (class, display, xid)
GdkDisplay *display
- guint32 xid
+ uintptr_t xid
PREINIT:
GdkDragProtocol protocol;
- guint32 ret;
+ uintptr_t ret;
PPCODE:
- ret = gdk_drag_get_protocol_for_display (display, xid, &protocol);
+ ret = (uintptr_t)gdk_drag_get_protocol_for_display (display, INT2PTR(GdkNativeWindow, xid), &protocol);
XPUSHs (sv_2mortal (newSVuv (ret)));
XPUSHs (sv_2mortal (ret
? newSVGdkDragProtocol (protocol)
@@ -184,12 +184,12 @@
=cut
void
gdk_drag_get_protocol (class, xid)
- guint32 xid
+ uintptr_t xid
PREINIT:
GdkDragProtocol protocol;
- guint32 ret;
+ uintptr_t ret;
PPCODE:
- ret = gdk_drag_get_protocol (xid, &protocol);
+ ret = (uintptr_t)gdk_drag_get_protocol (INT2PTR(GdkNativeWindow, xid), &protocol);
XPUSHs (sv_2mortal (newSVuv (ret)));
XPUSHs (sv_2mortal (newSVGdkDragProtocol (protocol)));
diff -ur a/xs/GdkSelection.xs b/xs/GdkSelection.xs
--- a/xs/GdkSelection.xs 2017-05-21 15:02:54.000000000 -0400
+++ b/xs/GdkSelection.xs 2023-11-03 13:26:58.976888906 -0400
@@ -147,7 +147,7 @@
## void gdk_selection_send_notify (guint32 requestor, GdkAtom selection, GdkAtom target, GdkAtom property, guint32 time_)
void
gdk_selection_send_notify (class, requestor, selection, target, property, time_)
- guint32 requestor
+ GdkNativeWindow requestor
GdkAtom selection
GdkAtom target
GdkAtom property
@@ -161,7 +161,7 @@
void
gdk_selection_send_notify_for_display (class, display, requestor, selection, target, property, time_)
GdkDisplay *display
- guint32 requestor
+ GdkNativeWindow requestor
GdkAtom selection
GdkAtom target
GdkAtom property
diff -ur a/xs/GtkWindow.xs b/xs/GtkWindow.xs
--- a/xs/GtkWindow.xs 2017-05-21 15:02:54.000000000 -0400
+++ b/xs/GtkWindow.xs 2023-11-03 13:32:53.673168678 -0400
@@ -581,13 +581,13 @@
void
gtk_window_remove_embedded_xid (window, xid)
GtkWindow * window
- guint xid
+ GdkNativeWindow xid
## void gtk_window_add_embedded_xid (GtkWindow *window, guint xid)
void
gtk_window_add_embedded_xid (window, xid)
GtkWindow * window
- guint xid
+ GdkNativeWindow xid
##void gtk_window_reshow_with_initial_size (GtkWindow *window)
void

View File

@@ -0,0 +1,28 @@
commit ce474dbca0c95c06a85a3a329fcdbcc97b8ad317
Author: Stig Palmquist <git@stig.io>
Date: 2023-11-21 13:27:46 +0100
Fix t/shell.t compat with Getopt-Long-Descriptive 0.106
diff --git a/t/command/shell.t b/t/command/shell.t
index ebd67d8..a09afd2 100644
--- a/t/command/shell.t
+++ b/t/command/shell.t
@@ -28,7 +28,7 @@ run_ok( $app, [ '--no-help' ], "Don't help me" );
cmp_ok($return, '==', 1, 'Exit status is correct');
like($stderr, qr/^$/s, 'no stderr');
like($stdout, qr{usage: hailo}, 'Got usage header');
- like($stdout, qr{progress\s+Display progress}, 'Got --progress');
+ like($stdout, qr{progress\s*(?:\(or -p\))?\s+Display progress}, 'Got --progress');
like($stdout, qr{files are assumed to be UTF-8 encoded}, 'Got UTF-8 note');
unlike($stdout, qr{examples:}, "no examples on normal output");
}
@@ -75,7 +75,7 @@ run_ok( $app, [ '--no-help' ], "Don't help me" );
like($stderr, qr/^$/s, 'no stderr');
like($stdout, qr/Unknown option: blah-blah-blah/, 'Unknown option');
like($stdout, qr{usage: hailo}, 'Got usage header');
- like($stdout, qr{progress\s+Display progress}, 'Got --progress');
+ like($stdout, qr{progress\s*(?:\(or -p\))?\s+Display progress}, 'Got --progress');
like($stdout, qr{files are assumed to be UTF-8 encoded}, 'Got UTF-8 note');
unlike($stdout, qr{examples:}, "no examples on error");

View File

@@ -0,0 +1,65 @@
{
buildPerlPackage,
exiftool,
fetchurl,
gitUpdater,
lib,
shortenPerlShebang,
stdenv,
testers,
}:
buildPerlPackage rec {
pname = "Image-ExifTool";
version = "13.25";
src = fetchurl {
url = "https://exiftool.org/Image-ExifTool-${version}.tar.gz";
hash = "sha256-HNVVFEhGooKYeDvr86tFIjUnPHg1hBCBPj1Ok8ZTsfo=";
};
nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang;
postPatch = ''
patchShebangs exiftool
'';
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
shortenPerlShebang $out/bin/exiftool
'';
passthru = {
tests.version = testers.testVersion {
inherit version;
command = "${lib.getExe exiftool} -ver";
package = exiftool;
};
updateScript = gitUpdater { url = "https://github.com/exiftool/exiftool.git"; };
};
meta = {
description = "Tool to read, write and edit EXIF meta information";
longDescription = ''
ExifTool is a platform-independent Perl library plus a command-line
application for reading, writing and editing meta information in a wide
variety of files. ExifTool supports many different metadata formats
including EXIF, GPS, IPTC, XMP, JFIF, GeoTIFF, ICC Profile, Photoshop
IRB, FlashPix, AFCP and ID3, as well as the maker notes of many digital
cameras by Canon, Casio, DJI, FLIR, FujiFilm, GE, GoPro, HP,
JVC/Victor, Kodak, Leaf, Minolta/Konica-Minolta, Motorola, Nikon,
Nintendo, Olympus/Epson, Panasonic/Leica, Pentax/Asahi, Phase One,
Reconyx, Ricoh, Samsung, Sanyo, Sigma/Foveon and Sony.
'';
homepage = "https://exiftool.org/";
changelog = "https://exiftool.org/history.html";
license = with lib.licenses; [
gpl1Plus # or
artistic2
];
maintainers = with lib.maintainers; [
kiloreux
anthonyroussel
];
mainProgram = "exiftool";
};
}

View File

@@ -0,0 +1,31 @@
--- a/XS.xs 2025-09-06 08:34:51.376455632 -0300
+++ b/XS.xs 2025-09-06 08:35:30.725873619 -0300
@@ -253,16 +253,16 @@
// if we recurse too deep, skip all remaining digits
// to avoid a stack overflow attack
if (expect_false (--maxdepth <= 0))
- while (((U8)*s - '0') < 10)
+ while ((U8)(*s - '0') < 10)
++s;
for (;;)
{
- U8 dig = (U8)*s - '0';
+ U8 dig = *s - '0';
if (expect_false (dig >= 10))
{
- if (dig == (U8)((U8)'.' - (U8)'0'))
+ if (dig == (U8)('.' - '0'))
{
++s;
json_atof_scan1 (s, accum, expo, 1, maxdepth);
@@ -282,7 +282,7 @@
else if (*s == '+')
++s;
- while ((dig = (U8)*s - '0') < 10)
+ while ((dig = (U8)(*s - '0')) < 10)
exp2 = exp2 * 10 + *s++ - '0';
*expo += neg ? -exp2 : exp2;

View File

@@ -0,0 +1,31 @@
{
fetchFromGitHub,
buildPerlPackage,
lib,
}:
buildPerlPackage {
pname = "MNI-Perllib";
version = "2012-04-13";
src = fetchFromGitHub {
owner = "BIC-MNI";
repo = "mni-perllib";
rev = "b908472b4390180ea5d19a121ac5edad6ed88d83";
sha256 = "0vk99pwgbard62k63386r7dpnm3h435jdqywr4xqfq7p04dz6kyb";
};
patches = [ ./no-stdin.patch ];
doCheck = false; # TODO: almost all tests fail ... is this a real problem?
meta = {
description = "MNI MINC perllib (not used much anymore)";
homepage = "https://github.com/BIC-MNI/mni-perllib";
license = with lib.licenses; [
artistic1
gpl1Plus
];
maintainers = with lib.maintainers; [ bcdarwin ];
};
}

View File

@@ -0,0 +1,13 @@
diff --git a/Makefile.PL b/Makefile.PL
index 9f2039a..12d699c 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -213,7 +213,7 @@ TEXT
} # &MY::postamble
-query_subs;
+#query_subs;
my $f;
WriteMakefile

View File

@@ -0,0 +1,27 @@
{
lib,
fetchurl,
openldap,
buildPerlPackage,
}:
buildPerlPackage rec {
pname = "Mozilla-Ldap";
version = "1.5.3";
USE_OPENLDAP = 1;
LDAPSDKDIR = openldap.dev;
LDAPSDKLIBDIR = "${openldap.out}/lib";
src = fetchurl {
url = "https://ftp.mozilla.org/pub/directory/perldap/releases/${version}/src/perl-mozldap-${version}.tar.gz";
sha256 = "0s0albdw0zvg3w37s7is7gddr4mqwicjxxsy400n1p96l7ipnw4x";
};
meta = {
description = "Mozilla's ldap client library";
homepage = "https://metacpan.org/release/perldap";
license = with lib.licenses; [
mpl20
lgpl21Plus
gpl2Plus
];
};
}

View File

@@ -0,0 +1,20 @@
{
buildPerlModule,
remctl,
TestPod,
}:
buildPerlModule {
pname = "NetRemctl";
inherit (remctl) meta src version;
postPatch = ''
cp -R tests/tap/perl/Test perl/t/lib
cd perl
'';
buildInputs = [ remctl ];
checkInputs = [ TestPod ];
}

View File

@@ -0,0 +1,22 @@
diff '--color=auto' -ur Paranoid-2.10/lib/Paranoid.pm Paranoid-2.10-patched/lib/Paranoid.pm
--- Paranoid-2.10/lib/Paranoid.pm 2022-03-08 10:01:04.000000000 +0100
+++ Paranoid-2.10-patched/lib/Paranoid.pm 2023-10-20 16:57:54.025754755 +0200
@@ -47,7 +47,7 @@
%EXPORT_TAGS = ( all => [@EXPORT_OK], );
use constant PTRUE_ZERO => '0 but true';
-use constant DEFAULT_PATH => '/bin:/sbin:/usr/bin:/usr/sbin';
+use constant DEFAULT_PATH => '__BLESSED_PATH__';
#####################################################################
#
diff '--color=auto' -ur Paranoid-2.10/t/01_init_core.t Paranoid-2.10-patched/t/01_init_core.t
--- Paranoid-2.10/t/01_init_core.t 2022-01-24 10:30:20.000000000 +0100
+++ Paranoid-2.10-patched/t/01_init_core.t 2023-10-20 16:58:16.856288407 +0200
@@ -35,5 +35,4 @@
ok( psecureEnv('/bin:/sbin'), 'psecureEnv 1' );
is( $ENV{PATH}, '/bin:/sbin', 'Validated PATH' );
ok( psecureEnv(), 'psecureEnv 2' );
-is( $ENV{PATH}, '/bin:/sbin:/usr/bin:/usr/sbin', 'Validated PATH' );
-
+is( $ENV{PATH}, '__BLESSED_PATH__', 'Validated PATH' );

View File

@@ -0,0 +1,78 @@
{
lib,
fetchFromGitHub,
buildPerlPackage,
shortenPerlShebang,
DBDmysql,
DBI,
IOSocketSSL,
TermReadKey,
go,
buildGoModule,
git,
}:
let
version = "3.7.0";
src = fetchFromGitHub {
owner = "percona";
repo = "percona-toolkit";
rev = "v${version}";
sha256 = "sha256-fJGeL9XZHTFmpns5CE7It35HRnF3JiC6muOpOS1zboI=";
# needed for build script
leaveDotGit = true;
};
goDeps =
(buildGoModule {
pname = "Percona-Toolkit go-bindings";
inherit src version;
vendorHash = "sha256-HAaoVYK6av085zSG0ZRpbmUgEA2UEt7CGWF/834e+z4=";
}).goModules;
in
buildPerlPackage {
pname = "Percona-Toolkit";
inherit src version;
outputs = [ "out" ];
nativeBuildInputs = [
git
shortenPerlShebang
];
buildInputs = [
DBDmysql
go
DBI
IOSocketSSL
TermReadKey
];
postPatch = ''
cp -r --reflink=auto ${goDeps} vendor
chmod -R u+rw vendor
substituteInPlace src/go/Makefile \
--replace-fail "go get ./..." "echo 'Skipping go get due to offline build'"
'';
preBuild = ''
export HOME=$TMPDIR
'';
postInstall = ''
shortenPerlShebang $(grep -l "/bin/env perl" $out/bin/*)
'';
meta = {
description = "Collection of advanced command-line tools to perform a variety of MySQL and system tasks";
homepage = "https://www.percona.com/software/database-tools/percona-toolkit";
changelog = "https://docs.percona.com/percona-toolkit/release_notes.html";
license = with lib.licenses; [ gpl2Only ];
maintainers = with lib.maintainers; [ izorkin ];
};
}

View File

@@ -0,0 +1,12 @@
Replaces the legacy DES crypt hash used in tests with a stronger
bcrypt function, as crypt() in pkgs.perl no longer supports DES
# htpasswd -nbB admin s3cr3t
diff --git a/t/Plack-Middleware/htpasswd b/t/Plack-Middleware/htpasswd
index b597da8..f80461d 100644
--- a/t/Plack-Middleware/htpasswd
+++ b/t/Plack-Middleware/htpasswd
@@ -1,1 +1,1 @@
-admin:6iSeSVcVHgNQw
+admin:$2y$05$qO4lTUQMcE5mU6KI0t7j9uCjcTkpf6sAp0cv6oZiemD0MI8keeKPa

View File

@@ -0,0 +1,128 @@
{
stdenv,
lib,
fetchurl,
docbook_xsl,
docbook_xsl_ns,
gettext,
libxslt,
glibcLocales,
docbook_xml_dtd_45,
docbook_sgml_dtd_41,
opensp,
bash,
fetchpatch,
perl,
buildPerlPackage,
ModuleBuild,
TextWrapI18N,
LocaleGettext,
SGMLSpm,
UnicodeLineBreak,
PodParser,
YAMLTiny,
SyntaxKeywordTry,
writeShellScriptBin,
}:
buildPerlPackage rec {
pname = "po4a";
version = "0.73";
src = fetchurl {
url = "https://github.com/mquinson/po4a/releases/download/v${version}/po4a-${version}.tar.gz";
hash = "sha256-bxj4LYyyo3c5QTfqOWzD6BldbNbkVP4CGKoPDjYDjqA=";
};
strictDeps = true;
nativeBuildInputs =
# the tests for the tex-format use kpsewhich -- texlive's file finding utility.
# We don't want to depend on texlive here, so we replace it with a minimal
# shellscript that suffices for the tests in t/fmt/tex/, i.e. it looks up
# article.cls to an existing file, but doesn't find article-wrong.cls.
let
kpsewhich-stub = writeShellScriptBin "kpsewhich" ''[[ $1 = "article.cls" ]] && echo /dev/null'';
in
[
gettext
libxslt
docbook_xsl
docbook_xsl_ns
ModuleBuild
docbook_xml_dtd_45
docbook_sgml_dtd_41
opensp
kpsewhich-stub
glibcLocales
];
patches = [
# Needs a patch for 5.40 until the next release
(fetchpatch {
url = "https://github.com/mquinson/po4a/commit/28fe52651eb8096d97d6bd3a97b3168522ba5306.patch";
hash = "sha256-QUXxkSzcnwRvU+2y2KoBXmtfE8qTZ2BV0StkJHqZehQ=";
})
(fetchpatch {
name = "gettext-0.25.patch";
url = "https://github.com/mquinson/po4a/commit/7d88a5e59606a9a29ffe73325fff4a5ddb865d5c.patch";
hash = "sha256-5x+EX++v7DxOHOZgRM2tv5eNN1Gy28f+qaqH27emZhk=";
})
];
# TODO: TermReadKey was temporarily removed from propagatedBuildInputs to unfreeze the build
propagatedBuildInputs =
lib.optionals (!stdenv.hostPlatform.isMusl) [
TextWrapI18N
]
++ [
LocaleGettext
SGMLSpm
UnicodeLineBreak
PodParser
YAMLTiny
SyntaxKeywordTry
];
buildInputs = [ bash ];
LC_ALL = "en_US.UTF-8";
SGML_CATALOG_FILES = "${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml";
preConfigure = ''
touch Makefile.PL
export PERL_MB_OPT="--install_base=$out --prefix=$out"
'';
buildPhase = ''
perl Build.PL --install_base=$out --install_path="lib=$out/${perl.libPrefix}"
./Build build
'';
# Disabling tests on musl
# Void linux package have investigated the failure and tracked it down to differences in gettext behavior. They decided to disable tests.
# https://github.com/void-linux/void-packages/pull/34029#issuecomment-973267880
# Alpine packagers have not worried about running the tests until now:
# https://git.alpinelinux.org/aports/tree/main/po4a/APKBUILD#n11
#
# Disabling tests on Darwin until https://github.com/NixOS/nixpkgs/issues/236560 is resolved.
doCheck = (!stdenv.hostPlatform.isMusl) && (!stdenv.hostPlatform.isDarwin);
checkPhase = ''
export SGML_CATALOG_FILES=${docbook_sgml_dtd_41}/sgml/dtd/docbook-4.1/docbook.cat
./Build test
'';
installPhase = ''
./Build install
for f in $out/bin/*; do
substituteInPlace $f --replace "#! /usr/bin/env perl" "#!${perl}/bin/perl"
substituteInPlace $f --replace "exec perl" "exec ${perl}/bin/perl"
done
'';
meta = {
description = "Tools for helping translation of documentation";
homepage = "https://po4a.org";
license = with lib.licenses; [ gpl2Plus ];
};
}

View File

@@ -0,0 +1,18 @@
diff --git a/Socket6.xs b/Socket6.xs
index 05c791c..058e9d9 100644
--- a/Socket6.xs
+++ b/Socket6.xs
@@ -105,10 +105,6 @@ const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
#define HAVE_INET_PTON 1
#endif
-#ifndef HAVE_PL_SV_UNDEF
-#define PL_sv_undef sv_undef
-#endif
-
static int
not_here(char *s)
{
--
2.16.3

View File

@@ -0,0 +1,11 @@
--- a/Build.PL
+++ b/Build.PL
@@ -88,7 +88,7 @@ if ( $^O =~ /mswin32/i ) {
}
}
else {
- if ( $Config{archname} =~ /^x86_64|^ppc64|^s390x|^aarch64|^riscv64/ ) {
+ if ( 0 ) {
$libdir =~ s/\bbin\b/lib64/;
if ( !-d $libdir ) {
my $test = $libdir;

View File

@@ -0,0 +1,60 @@
{
lib,
buildPerlPackage,
fetchFromGitHub,
GD,
IPCShareLite,
JSON,
LWP,
mapnik,
boost,
nix-update-script,
pkg-config,
}:
buildPerlPackage rec {
pname = "Tirex";
version = "0.8.0";
src = fetchFromGitHub {
owner = "openstreetmap";
repo = "tirex";
tag = "v${version}";
hash = "sha256-tFDyN3slj9ipa9JPB6f+mnzMIW926vOge4ZSbmxjtiE=";
};
patches = [
# Support Mapnik >= v4.0.0 (no more mapnik-config)
./use-pkg-config.patch
];
nativeBuildInputs = [
pkg-config
];
buildInputs = [
GD
IPCShareLite
JSON
LWP
mapnik
boost
]
++ mapnik.buildInputs;
installPhase = ''
install -m 755 -d $out/usr/libexec
make install DESTDIR=$out INSTALLOPTS=""
mv $out/$out/lib $out/$out/share $out
rmdir $out/$out $out/nix/store $out/nix
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Tools for running a map tile server";
homepage = "https://wiki.openstreetmap.org/wiki/Tirex";
maintainers = with lib.maintainers; [ jglukasik ];
license = with lib.licenses; [ gpl2Only ];
};
}

View File

@@ -0,0 +1,13 @@
--- a/backend-mapnik/Makefile
+++ b/backend-mapnik/Makefile
@@ -1,8 +1,7 @@
INSTALLOPTS=-g root -o root
-CFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-CXXFLAGS = `mapnik-config --cflags` $(CFLAGS)
+CXXFLAGS += `pkg-config --cflags libmapnik` -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
CXXFLAGS += -Wall -Wextra -pedantic -Wredundant-decls -Wdisabled-optimization -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo -Wold-style-cast
-LDFLAGS= `mapnik-config --libs --ldflags --dep-libs` -lboost_filesystem
+LDFLAGS += `pkg-config --libs libmapnik` -lboost_filesystem
backend-mapnik: renderd.o metatilehandler.o networklistener.o networkmessage.o networkrequest.o networkresponse.o debuggable.o requesthandler.o
$(CXX) -o $@ $^ $(LDFLAGS)

View File

@@ -0,0 +1,45 @@
{
stdenv,
lib,
fetchFromGitHub,
buildPerlPackage,
shortenPerlShebang,
LWP,
LWPProtocolHttps,
DataDump,
JSON,
gitUpdater,
}:
buildPerlPackage rec {
pname = "WWW-YoutubeViewer";
version = "3.11.2";
src = fetchFromGitHub {
owner = "trizen";
repo = "youtube-viewer";
rev = version;
sha256 = "9Z4fv2B0AnwtYsp7h9phnRMmHtBOMObIJvK8DmKQRxs=";
};
nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang;
propagatedBuildInputs = [
LWP
LWPProtocolHttps
DataDump
JSON
];
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
shortenPerlShebang $out/bin/youtube-viewer
'';
passthru.updateScript = gitUpdater { };
meta = with lib; {
description = "Lightweight application for searching and streaming videos from YouTube";
homepage = "https://github.com/trizen/youtube-viewer";
license = with licenses; [ artistic2 ];
maintainers = with maintainers; [ woffs ];
mainProgram = "youtube-viewer";
};
}

View File

@@ -0,0 +1,242 @@
From bee8338fd1cbd7aad4bf60c2965833343b6ead6f Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Tue, 21 May 2024 15:17:30 +0200
Subject: [PATCH 1/3] Fix test suite with libxml2 2.13.0
---
t/02parse.t | 7 ++++++-
t/08findnodes.t | 8 +++++++-
t/19die_on_invalid_utf8_rt_58848.t | 2 +-
t/25relaxng.t | 4 ++--
t/26schema.t | 4 ++--
t/60error_prev_chain.t | 8 ++++----
6 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/t/02parse.t b/t/02parse.t
index b111507b..40aa5f13 100644
--- a/t/02parse.t
+++ b/t/02parse.t
@@ -884,7 +884,12 @@ EOXML
eval {
$doc2 = $parser->parse_string( $xmldoc );
};
- isnt($@, '', "error parsing $xmldoc");
+ # https://gitlab.gnome.org/GNOME/libxml2/-/commit/b717abdd
+ if (XML::LibXML::LIBXML_RUNTIME_VERSION() < 21300) {
+ isnt($@, '', "error parsing $xmldoc");
+ } else {
+ is( $doc2->documentElement()->firstChild()->nodeName(), "foo" );
+ }
$parser->validation(1);
diff --git a/t/08findnodes.t b/t/08findnodes.t
index 016c85a1..e9417bc5 100644
--- a/t/08findnodes.t
+++ b/t/08findnodes.t
@@ -123,7 +123,13 @@ my $docstring = q{
my @ns = $root->findnodes('namespace::*');
# TEST
-is(scalar(@ns), 2, ' TODO : Add test name' );
+# https://gitlab.gnome.org/GNOME/libxml2/-/commit/aca16fb3
+# fixed xmlCopyNamespace with XML namespace.
+if (XML::LibXML::LIBXML_RUNTIME_VERSION() < 21300) {
+ is(scalar(@ns), 2, ' TODO : Add test name' );
+} else {
+ is(scalar(@ns), 3, ' TODO : Add test name' );
+}
# bad xpaths
# TEST:$badxpath=4;
diff --git a/t/19die_on_invalid_utf8_rt_58848.t b/t/19die_on_invalid_utf8_rt_58848.t
index aa8ad105..4160cb27 100644
--- a/t/19die_on_invalid_utf8_rt_58848.t
+++ b/t/19die_on_invalid_utf8_rt_58848.t
@@ -16,7 +16,7 @@ use XML::LibXML;
my $err = $@;
# TEST
- like ("$err", qr{parser error : Input is not proper UTF-8},
+ like ("$err", qr{not proper UTF-8|Invalid bytes in character encoding},
'Parser error.',
);
}
diff --git a/t/25relaxng.t b/t/25relaxng.t
index 93e61883..71383b2a 100644
--- a/t/25relaxng.t
+++ b/t/25relaxng.t
@@ -132,7 +132,7 @@ print "# 6 check that no_network => 1 works\n";
{
my $rng = eval { XML::LibXML::RelaxNG->new( location => $netfile, no_network => 1 ) };
# TEST
- like( $@, qr{I/O error : Attempt to load network entity}, 'RNG from file location with external import and no_network => 1 throws an exception.' );
+ like( $@, qr{Attempt to load network entity}, 'RNG from file location with external import and no_network => 1 throws an exception.' );
# TEST
ok( !defined $rng, 'RNG from file location with external import and no_network => 1 is not loaded.' );
}
@@ -152,7 +152,7 @@ print "# 6 check that no_network => 1 works\n";
</grammar>
EOF
# TEST
- like( $@, qr{I/O error : Attempt to load network entity}, 'RNG from buffer with external import and no_network => 1 throws an exception.' );
+ like( $@, qr{Attempt to load network entity}, 'RNG from buffer with external import and no_network => 1 throws an exception.' );
# TEST
ok( !defined $rng, 'RNG from buffer with external import and no_network => 1 is not loaded.' );
}
diff --git a/t/26schema.t b/t/26schema.t
index 17f641e4..c404cedd 100644
--- a/t/26schema.t
+++ b/t/26schema.t
@@ -117,7 +117,7 @@ EOF
{
my $schema = eval { XML::LibXML::Schema->new( location => $netfile, no_network => 1 ) };
# TEST
- like( $@, qr{I/O error : Attempt to load network entity}, 'Schema from file location with external import and no_network => 1 throws an exception.' );
+ like( $@, qr{Attempt to load network entity}, 'Schema from file location with external import and no_network => 1 throws an exception.' );
# TEST
ok( !defined $schema, 'Schema from file location with external import and no_network => 1 is not loaded.' );
}
@@ -129,7 +129,7 @@ EOF
</xsd:schema>
EOF
# TEST
- like( $@, qr{I/O error : Attempt to load network entity}, 'Schema from buffer with external import and no_network => 1 throws an exception.' );
+ like( $@, qr{Attempt to load network entity}, 'Schema from buffer with external import and no_network => 1 throws an exception.' );
# TEST
ok( !defined $schema, 'Schema from buffer with external import and no_network => 1 is not loaded.' );
}
diff --git a/t/60error_prev_chain.t b/t/60error_prev_chain.t
index e48215c4..55ac0b2e 100644
--- a/t/60error_prev_chain.t
+++ b/t/60error_prev_chain.t
@@ -16,13 +16,11 @@ use XML::LibXML;
{
my $parser = XML::LibXML->new();
- $parser->validation(0);
- $parser->load_ext_dtd(0);
eval
{
local $^W = 0;
- $parser->parse_file('example/JBR-ALLENtrees.htm');
+ $parser->parse_string('<doc>&ldquo;&nbsp;&rdquo;</doc>');
};
my $err = $@;
@@ -31,7 +29,7 @@ use XML::LibXML;
if( $err && !ref($err) ) {
plan skip_all => 'The local libxml library does not support errors as objects to $@';
}
- plan tests => 1;
+ plan tests => 2;
while (defined($err) && $count < 200)
{
@@ -44,6 +42,8 @@ use XML::LibXML;
# TEST
ok ((!$err), "Reached the end of the chain.");
+ # TEST
+ is ($count, 3, "Correct number of errors reported")
}
=head1 COPYRIGHT & LICENSE
From c9f9c2fe51173b0a00969f01b577399f1098aa47 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Thu, 13 Feb 2025 19:50:35 +0100
Subject: [PATCH 2/3] Fix test suite with libxml2 2.14.0
---
t/16docnodes.t | 7 ++++++-
t/49_load_html.t | 8 +++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/t/16docnodes.t b/t/16docnodes.t
index db7bc1fc..0b0ae005 100644
--- a/t/16docnodes.t
+++ b/t/16docnodes.t
@@ -60,7 +60,12 @@ for my $time (0 .. 2) {
$doc->setDocumentElement($node);
# TEST
- is( $node->serialize(), '<test contents="&#xE4;"/>', 'Node serialise works.' );
+ # libxml2 2.14 avoids unnecessary escaping of attribute values.
+ if (XML::LibXML::LIBXML_VERSION() >= 21400) {
+ is( $node->serialize(), "<test contents=\"\xE4\"/>", 'Node serialise works.' );
+ } else {
+ is( $node->serialize(), '<test contents="&#xE4;"/>', 'Node serialise works.' );
+ }
$doc->setEncoding('utf-8');
# Second output
diff --git a/t/49_load_html.t b/t/49_load_html.t
index 70d26607..3861edf8 100644
--- a/t/49_load_html.t
+++ b/t/49_load_html.t
@@ -52,7 +52,13 @@ use XML::LibXML;
</div>
EOS
- {
+ SKIP: {
+ # libxml2 2.14 tokenizes HTML according to HTML5 where
+ # this isn't an error, see "13.2.5.73 Named character
+ # reference state".
+ skip("libxml2 version >= 21400", 1)
+ if XML::LibXML::LIBXML_VERSION >= 21400;
+
my $buf = '';
open my $fh, '>', \$buf;
# redirect STDERR there
From ecbebc2f33fecb66b3d5487c6e48bea353e374f9 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Fri, 16 May 2025 19:11:12 +0200
Subject: [PATCH 3/3] Remove tests that disable line numbers
Line numbers are always enabled since libxml2 2.15.0.
---
t/02parse.t | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/t/02parse.t b/t/02parse.t
index 40aa5f13..17419f8f 100644
--- a/t/02parse.t
+++ b/t/02parse.t
@@ -14,7 +14,7 @@ use locale;
POSIX::setlocale(LC_ALL, "C");
-use Test::More tests => 533;
+use Test::More tests => 531;
use IO::File;
use XML::LibXML::Common qw(:libxml);
@@ -25,7 +25,7 @@ use constant XML_DECL => "<?xml version=\"1.0\"?>\n";
use Errno qw(ENOENT);
-# TEST*533
+# TEST*531
##
# test values
@@ -773,15 +773,6 @@ EOXML
my $newkid = $root->appendChild( $doc->createElement( "bar" ) );
is( $newkid->line_number(), 0, "line number is 0");
-
- $parser->line_numbers(0);
- eval { $doc = $parser->parse_string( $goodxml ); };
-
- $root = $doc->documentElement();
- is( $root->line_number(), 0, "line number is 0");
-
- @kids = $root->childNodes();
- is( $kids[1]->line_number(), 0, "line number is 0");
}
SKIP: {

View File

@@ -0,0 +1,30 @@
diff --git a/inc/My/Builder/Unix.pm b/inc/My/Builder/Unix.pm
index 15291d5..5c5ab24 100644
--- a/inc/My/Builder/Unix.pm
+++ b/inc/My/Builder/Unix.pm
@@ -48,7 +48,7 @@ sub get_additional_libs {
sub can_build_binaries_from_sources {
my $self = shift;
- return 1; # yes we can
+ return 0; # no we can't
}
sub build_binaries {
diff --git a/t/004_get_header_version.t b/t/004_get_header_version.t
index d4146ff..27f53ea 100644
--- a/t/004_get_header_version.t
+++ b/t/004_get_header_version.t
@@ -1,8 +1,11 @@
# t/004_config.t
-use Test::More tests => 1;
+use Test::More;
use Alien::SDL;
+Test::More::plan( skip_all => 'NixOS doesn\'t have SDL headers in this location' );
+
+
like( Alien::SDL->get_header_version('SDL_version.h'), qr/([0-9]+\.)*[0-9]+/, "Testing SDL_version.h" );
#like( Alien::SDL->get_header_version('SDL_net.h'), qr/([0-9]+\.)*[0-9]+/, "Testing SDL_net.h" );
#like( Alien::SDL->get_header_version('SDL_image.h'), qr/([0-9]+\.)*[0-9]+/, "Testing SDL_image.h" );

View File

@@ -0,0 +1,34 @@
From a46f0e41056b48a56c572fe8884d4b5104a8343e Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Sun, 29 Jun 2014 21:51:15 +0300
Subject: [PATCH] multi_linestring2perl: only extend the array if needed
When the size is 0, we end up extending the stack with
a negative value. As of Perl 5.19.4, more precisely
http://perl5.git.perl.org/perl.git/commit/fc16c3924bd6aa054f21ad5445fecf9b7f39dc36
this ends up allocating memory for 4G-1 elements.
See Dave Mitchell's comments on perl5-porters:
Message-ID: <20140522115758.GX15438@iabyn.com>
http://marc.info/?l=perl5-porters&m=140075990913228&w=2
---
src/mline2av.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/mline2av.h b/src/mline2av.h
index e4b3fc2..d7bacee 100644
--- a/src/mline2av.h
+++ b/src/mline2av.h
@@ -9,7 +9,8 @@ multi_linestring2perl(pTHX_ const multi_linestring& mls)
{
AV* av = newAV();
const unsigned int size = mls.size();
- av_extend(av, size-1);
+ if (size > 0)
+ av_extend(av, size-1);
for (int i = 0; i < size; i++) {
AV* lineav = newAV();
--
2.0.0

View File

@@ -0,0 +1,37 @@
Send an ETag header, and honour the If-None-Match request header
diff -ru -x '*~' Catalyst-Plugin-Static-Simple-0.30-orig/lib/Catalyst/Plugin/Static/Simple.pm Catalyst-Plugin-Static-Simple-0.30/lib/Catalyst/Plugin/Static/Simple.pm
--- Catalyst-Plugin-Static-Simple-0.30-orig/lib/Catalyst/Plugin/Static/Simple.pm 2012-05-04 18:49:30.000000000 +0200
+++ Catalyst-Plugin-Static-Simple-0.30/lib/Catalyst/Plugin/Static/Simple.pm 2013-02-25 22:57:18.667150181 +0100
@@ -187,16 +187,27 @@
my $type = $c->_ext_to_type( $full_path );
my $stat = stat $full_path;
- $c->res->headers->content_type( $type );
- $c->res->headers->content_length( $stat->size );
- $c->res->headers->last_modified( $stat->mtime );
# Tell Firefox & friends its OK to cache, even over SSL:
- $c->res->headers->header('Cache-control' => 'public');
+ #$c->res->headers->header('Cache-control' => 'public');
+
+ $c->res->headers->last_modified( $stat->mtime );
# Optionally, set a fixed expiry time:
if ($config->{expires}) {
$c->res->headers->expires(time() + $config->{expires});
}
+ if ($config->{send_etag}) {
+ my $etag = '"' . $stat->mtime . '-' . $stat->ino . '-'. $stat->size . '"';
+ $c->res->headers->header('ETag' => $etag);
+ if (($c->req->header('If-None-Match') // "") eq $etag) {
+ $c->res->status(304);
+ return 1;
+ }
+ }
+
+ $c->res->headers->content_type( $type );
+ $c->res->headers->content_length( $stat->size );
+
my $fh = IO::File->new( $full_path, 'r' );
if ( defined $fh ) {
binmode $fh;

View File

@@ -0,0 +1,30 @@
diff --git a/t/13-keygen.t b/t/13-keygen.t
index f430ffb..2050624 100644
--- a/t/13-keygen.t
+++ b/t/13-keygen.t
@@ -1,5 +1,5 @@
use strict;
-use Test::More tests => 29;
+use Test::More tests => 25;
use Crypt::OpenPGP;
use Crypt::OpenPGP::Message;
@@ -26,9 +26,6 @@ for my $type ( qw( RSA DSA ) ) {
isa_ok $pub->key, 'Crypt::OpenPGP::Certificate';
isa_ok $sec->key, 'Crypt::OpenPGP::Certificate';
- is $pub->key->key_id, $sec->key->key_id,
- 'public key_id matches secret key_id';
-
is $pub->primary_uid, $id, 'primary_uid matches';
is $pub->key->key->size, $bits, 'keysize (in bits) matches for pubkey';
@@ -47,8 +44,6 @@ for my $type ( qw( RSA DSA ) ) {
isa_ok $pieces[1], 'Crypt::OpenPGP::UserID';
isa_ok $pieces[2], 'Crypt::OpenPGP::Signature';
- is $pieces[0]->key_id, $sec->key->key_id,
- 'serialized public key_id matches secret key_id';
}
{

View File

@@ -0,0 +1,13 @@
diff --git a/lib/Encode/IMAPUTF7.pm b/lib/Encode/IMAPUTF7.pm
index 07835b9..411c57f 100644
--- a/lib/Encode/IMAPUTF7.pm
+++ b/lib/Encode/IMAPUTF7.pm
@@ -9,6 +9,8 @@ __PACKAGE__->Define('IMAP-UTF-7', 'imap-utf-7');
our $VERSION = '1.05';
use MIME::Base64;
use Encode;
+use Exporter 'import';
+our @EXPORT_OK = qw(encode decode);
#
# Algorithms taken from Unicode::String by Gisle Aas

View File

@@ -0,0 +1,18 @@
#! /bin/sh
source lib-cache.sh;
print_reqs() {
module_name="$1";
./requirements.sh "$1"| while read; do
if let "$(./source-download-link.sh "${REPLY}" | wc -c)" && [ perl != "$REPLY" ]; then
echo "$REPLY";
fi;
done;
}
module_name="$1";
module_basename="${module_name//::/-}";
cached_output print_reqs "$module_basename" "$module_name" "pure.deps";

View File

@@ -0,0 +1,21 @@
#! /bin/sh
source lib-cache.sh;
print_requirements () {
module_name="$1";
./requirements.sh "$module_name" | while read; do
echo "$REPLY";
print_reqs_cache "$REPLY";
done | sort | uniq
};
print_reqs_cache () {
module_name="$1";
module_basename="${module_name//::/-}";
cached_output print_requirements "$module_basename" "$module_name" "full.deps";
};
print_reqs_cache "$@";

View File

@@ -0,0 +1,19 @@
#! /bin/sh
source lib-cache.sh
get_file() {
url="$1";
if [ -n "$url" ]; then
curl "$1";
else
echo -n;
fi;
}
url="$1";
name="$2";
name=${name:-$(basename "$url")}
cached_output get_file "${name%%.*}" "$url" "${name#*.}"

View File

@@ -0,0 +1,18 @@
# First argument: command to run
# Second argument: cache name
# Third argument: argument to command
# Fourth argument: cache type
cached_output () {
cmd="$1";
basename="$2";
arg="$3";
ext="$4";
if ! [ -e "cache-${ext//./-}/${basename}.${ext}" ]; then
mkdir -p "cache-${ext//./-}";
$cmd $arg > "cache-${ext//./-}/${basename}.${ext}";
fi;
cat "cache-${ext//./-}/${basename}.${ext}";
}

View File

@@ -0,0 +1,5 @@
#! /bin/sh
rm -rf test;
mkdir test;
for i in *.sh; do ln -s ../$i test; done;

View File

@@ -0,0 +1,17 @@
#! /bin/sh
source lib-cache.sh;
module_name="$1";
module_basename="${1//::/-}";
print_requirements () {
module_name="$1";
./retrieve-meta-yaml.sh "$module_name" |
sed -re '1,/^requires:/d; /^[a-z]/,$d; s@^\s*@@; s@:\s.*@@';
./retrieve-meta-yaml.sh "$module_name" |
sed -re '1,/^build_requires:/d; /^[a-z]/,$d; s@^\s*@@; s@:\s.*@@';
};
cached_output print_requirements "$module_basename" "$module_name" "direct.deps";

View File

@@ -0,0 +1,14 @@
#! /bin/sh
module_basename="$1";
file_name="$2";
version_regexp="${module_basename}(-[0-9.a-z]+){0,1}";
author_regexp="[A-Z0-9]+";
./retrieve-modulepage.sh "$module_basename" |
egrep "[<]a href=\"[a-z0-9/]*/(${author_regexp}/){0,1}${version_regexp}/${file_name}" |
sed -re "s@.*href=\"@@; s@\".*@@" |
sed -re 's@^/@http://search.cpan.org/@';
echo "$link_line";

View File

@@ -0,0 +1,16 @@
#! /bin/sh
source lib-cache.sh;
print_meta_yaml () {
module_name="$1";
module_basename="${module_name//::/-}";
./grab-url.sh "$(./retrieve-file-link.sh "$module_basename" "META.yml")" \
"${module_basename}.meta.yml";
};
module_name="$1";
module_basename="${module_name//::/-}";
cached_output print_meta_yaml "$module_basename" "$module_name" meta.yaml;

View File

@@ -0,0 +1,5 @@
#! /bin/sh
module_basename="$1";
./grab-url.sh "http://search.cpan.org/dist/$module_basename/" "$module_basename".html;

View File

@@ -0,0 +1,17 @@
#! /bin/sh
source lib-cache.sh;
module_name="$1";
module_basename="${module_name//::/-}";
write_link() {
module_basename="$1";
./retrieve-modulepage.sh "$module_basename" |
grep -A 2 "This Release" |
grep href |
sed -re 's/.*href="//; s/".*//; s@^/@http://search.cpan.org/@';
}
cached_output write_link "$module_basename" "$module_basename" src.link;

View File

@@ -0,0 +1,10 @@
/path/to/write-nix-expression.sh Group::Module::Submodule
It will output Nix assignment formatted for placing into
all-packages.nix amongst all the perl packages, like perlAlgorithmDiff.
Actually it will grab distribution unit Group-Module-Submodule via
search.cpan.org, and make some effort to write correct dependencies.
If among requirements there are some that have empty META.yml, or if
any of requirements acannot be installed by just getting distribution
unit whose name can be guessed by replacing :: with -, manual editing
will be needed.

View File

@@ -0,0 +1,34 @@
#! /bin/sh
cd $(dirname $0);
source lib-cache.sh;
print_expression () {
module_name="$1";
module_basename="${module_name//::/-}";
module_compressedname="perl${module_name//::/}";
sourcelink="$(./source-download-link.sh "${module_name}")";
version_name="${sourcelink%.tar.*}";
version_name="${version_name##*/}";
dependencies="$(./filtered-requirements.sh "$module_name" | sed -e 's/^/perl/; s/:://g' | xargs)";
source_hash=$(nix-prefetch-url "$sourcelink" 2>/dev/null);
cat <<EOF
${module_compressedname} = import ../development/perl-modules/generic perl {
name = "${version_name}";
src = fetchurl {
url = ${sourcelink};
sha256 = "$source_hash";
};
propagatedBuildInputs = [${dependencies}];
};
EOF
};
module_name="$1";
module_basename="${module_name//::/-}";
cached_output print_expression "$module_basename" "$module_name" "nix";

View File

@@ -0,0 +1,44 @@
PERL5LIB="$PERL5LIB${PERL5LIB:+:}$out/lib/perl5/site_perl"
perlFlags=
for i in $(IFS=:; echo $PERL5LIB); do
perlFlags="$perlFlags -I$i"
done
oldPreConfigure="$preConfigure"
preConfigure() {
eval "$oldPreConfigure"
find . | while read fn; do
if test -f "$fn"; then
first=$(dd if="$fn" count=2 bs=1 2> /dev/null)
if test "$first" = "#!"; then
echo "patching $fn..."
sed -i "$fn" -e "s|^#\!\(.*\bperl\b.*\)$|#\!\1$perlFlags|"
fi
fi
done
local flagsArray=()
concatTo flagsArray makeMakerFlags
# Perl expect these to be exported
export CPPRUN="$CC -E"
export FULL_AR=$AR
# Requires to be $CC since it tries adding "-Wl"
export LD=$CC
perl Makefile.PL AR="$AR" FULL_AR="$AR" CC="$CC" LD="$CC" CPPRUN="$CPPRUN" \
PREFIX=$out INSTALLDIRS=site "${flagsArray[@]}" \
PERL=$(type -P perl) FULLPERL=\"$fullperl/bin/perl\"
}
if test -n "$perlPreHook"; then
eval "$perlPreHook"
fi
genericBuild
if test -n "$perlPostHook"; then
eval "$perlPostHook"
fi

View File

@@ -0,0 +1,85 @@
{
lib,
stdenv,
perl,
toPerlModule,
}:
{
buildInputs ? [ ],
nativeBuildInputs ? [ ],
outputs ? [
"out"
"devdoc"
],
src ? null,
# enabling or disabling does nothing for perl packages so set it explicitly
# to false to not change hashes when enableParallelBuildingByDefault is enabled
enableParallelBuilding ? false,
doCheck ? true,
checkTarget ? "test",
# Prevent CPAN downloads.
PERL_AUTOINSTALL ? "--skipdeps",
# From http://wiki.cpantesters.org/wiki/CPANAuthorNotes: "allows
# authors to skip certain tests (or include certain tests) when
# the results are not being monitored by a human being."
AUTOMATED_TESTING ? true,
# current directory (".") is removed from @INC in Perl 5.26 but many old libs rely on it
# https://metacpan.org/pod/release/XSAWYERX/perl-5.26.0/pod/perldelta.pod#Removal-of-the-current-directory-%28%22.%22%29-from-@INC
PERL_USE_UNSAFE_INC ? "1",
env ? { },
postPatch ? "patchShebangs .",
...
}@attrs:
lib.throwIf (attrs ? name)
"buildPerlPackage: `name` (\"${attrs.name}\") is deprecated, use `pname` and `version` instead"
(
let
defaultMeta = {
homepage = "https://metacpan.org/dist/${attrs.pname}";
inherit (perl.meta) platforms;
};
package = stdenv.mkDerivation (
attrs
// {
name = "perl${perl.version}-${attrs.pname}-${attrs.version}";
builder = ./builder.sh;
buildInputs = buildInputs ++ [ perl ];
nativeBuildInputs =
nativeBuildInputs
++ (if !(stdenv.buildPlatform.canExecute stdenv.hostPlatform) then [ perl.mini ] else [ perl ]);
inherit
outputs
src
doCheck
checkTarget
enableParallelBuilding
postPatch
;
env = {
inherit PERL_AUTOINSTALL AUTOMATED_TESTING PERL_USE_UNSAFE_INC;
fullperl = perl.__spliced.buildHost or perl;
}
// env;
meta = defaultMeta // (attrs.meta or { });
}
);
in
toPerlModule package
)

View File

@@ -0,0 +1,14 @@
diff --git a/lib/LWP/Protocol/https.pm b/lib/LWP/Protocol/https.pm
index 645e828..7098f64 100644
--- a/lib/LWP/Protocol/https.pm
+++ b/lib/LWP/Protocol/https.pm
@@ -29,6 +29,9 @@ sub _extra_sock_opts
}
}
if ($ssl_opts{SSL_verify_mode}) {
+ if ($ENV{NIX_SSL_CERT_FILE}) {
+ $ssl_opts{SSL_ca_file} //= $ENV{NIX_SSL_CERT_FILE};
+ }
unless (exists $ssl_opts{SSL_ca_file} || exists $ssl_opts{SSL_ca_path}) {
if ($Net::HTTPS::SSL_SOCKET_CLASS eq 'IO::Socket::SSL'
&& defined &IO::Socket::SSL::default_ca

View File

@@ -0,0 +1,48 @@
{
buildPerlPackage,
lib,
fetchurl,
DBDmysql,
}:
buildPerlPackage {
pname = "maatkit";
version = "7540";
src = fetchurl {
url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/maatkit/maatkit-7540.tar.gz";
sha256 = "1a7rxrddkrsfxb2wj01ha91ld0vapfkqcy8j9p08l76zz2l8p2v1";
};
outputs = [ "out" ];
buildInputs = [ DBDmysql ];
preConfigure = ''
find . | while read fn; do
if test -f "$fn"; then
first=$(dd if="$fn" count=2 bs=1 2> /dev/null)
if test "$first" = "#!"; then
sed < "$fn" > "$fn".tmp \
-e "s|^#\!\(.*[/\ ]perl.*\)$|#\!$perl/bin/perl $perlFlags|"
if test -x "$fn"; then chmod +x "$fn".tmp; fi
mv "$fn".tmp "$fn"
fi
fi
done
'';
meta = with lib; {
description = "Database toolkit";
longDescription = ''
You can use Maatkit to prove replication is working correctly, fix
corrupted data, automate repetitive tasks, speed up your servers, and
much more.
In addition to MySQL, there is support for PostgreSQL, Memcached, and a
growing variety of other databases and technologies.
'';
license = licenses.gpl2Plus;
homepage = "https://code.google.com/archive/p/maatkit/";
};
}

View File

@@ -0,0 +1,27 @@
diff -ru Module-Pluggable-4.8/lib/Module/Pluggable/Object.pm Module-Pluggable-4.8-new/lib/Module/Pluggable/Object.pm
--- Module-Pluggable-4.8/lib/Module/Pluggable/Object.pm 2013-05-28 01:30:06.000000000 +0200
+++ Module-Pluggable-4.8-new/lib/Module/Pluggable/Object.pm 2013-06-02 23:24:52.704125205 +0200
@@ -180,12 +180,13 @@
my $sp = catdir($dir, (split /::/, $searchpath));
# if it doesn't exist or it's not a dir then skip it
- next unless ( -e $sp && -d _ ); # Use the cached stat the second time
+ next unless ( -d $sp );
my @files = $self->find_files($sp);
# foreach one we've found
foreach my $file (@files) {
+
# untaint the file; accept .pm only
next unless ($file) = ($file =~ /(.*$file_regex)$/);
# parse the file to get the name
@@ -314,7 +315,7 @@
(my $path = $File::Find::name) =~ s#^\\./##;
push @files, $path;
}
- }, $search_path );
+ }, "$search_path/." );
}
#chdir $cwd;
return @files;

View File

@@ -0,0 +1,65 @@
From http://daveviner.blogspot.com/2009/12/amazon-mechanical-turk-perl-library.html
http://www.vinertech.com/patches/net-amazon-mechanicalturk.patch
diff -rubB Net-Amazon-MechanicalTurk-1.01/lib/Net/Amazon/MechanicalTurk/ModuleUtil.pm Net-Amazon-MechanicalTurk-1.01/lib/Net/Amazon/MechanicalTurk/ModuleUtil.pm
--- Net-Amazon-MechanicalTurk-1.01/lib/Net/Amazon/MechanicalTurk/ModuleUtil.pm 2007-08-13 11:38:53.000000000 -0700
+++ Net-Amazon-MechanicalTurk-1.01/lib/Net/Amazon/MechanicalTurk/ModuleUtil.pm 2009-12-13 16:37:49.000000000 -0800
@@ -29,17 +29,21 @@
}
sub packageExists {
- my ($class, $package) = @_;
+ my ($class, $package, $moduleFile) = @_;
+
+ if (defined($moduleFile) && exists($INC{$moduleFile})) {
+ return 1;
+ }
# Symbol table black magic
no strict 'refs';
- return defined %{*{"${package}::"}};
+ return scalar(keys(%{*{"${package}::"}}));
}
sub require {
my ($class, $module) = @_;
- if (!$class->packageExists($module)) {
my $moduleFile = $module . ".pm";
$moduleFile =~ s/::/\//g;
+ if (!$class->packageExists($module, $moduleFile)) {
require $moduleFile;
}
}
diff -rubB Net-Amazon-MechanicalTurk-1.01/t/73-datagenerator-dbi.t Net-Amazon-MechanicalTurk-1.01/t/73-datagenerator-dbi.t
--- Net-Amazon-MechanicalTurk-1.01/t/73-datagenerator-dbi.t 2007-08-13 11:38:56.000000000 -0700
+++ Net-Amazon-MechanicalTurk-1.01/t/73-datagenerator-dbi.t 2009-12-13 16:55:30.000000000 -0800
@@ -8,10 +8,10 @@
eval {
require DBI;
- require DBD::SQLite2;
+ require DBD::SQLite;
};
if ($@) {
- plan skip_all => "SQLite2 not installed.";
+ plan skip_all => "SQLite not installed.";
}
else {
plan tests => 2;
@@ -21,7 +21,7 @@
#-----------------------
my $dbfile = "t/data/test.db";
unlink($dbfile) if (-f $dbfile);
-my $dbh = DBI->connect("dbi:SQLite2:dbname=${dbfile}","","", {
+my $dbh = DBI->connect("dbi:SQLite:dbname=${dbfile}","","", {
RaiseError => 1,
AutoCommit => 1
});
@@ -42,7 +42,7 @@
foreach my $id (1..30) {
$sth->execute($id, rand(), scalar localtime());
}
-
+$sth->finish();
# Actual test
#----------------------

View File

@@ -0,0 +1,913 @@
From https://github.com/openbsd/ports/blob/master/net/p5-Net-SNMP/patches/patch-lib_Net_SNMP_Security_USM_pm
Tests for the additional algorithms have also been added.
diff --git a/MANIFEST b/MANIFEST
index 3430564..d3dd7f0 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -40,3 +40,7 @@ t/usm-sha1-3des.t
t/usm-sha1-aes.t
t/usm-sha1-cfb192aes.t
t/usm-sha1-des.t
+t/usm-sha224-aes.t
+t/usm-sha256-aes.t
+t/usm-sha384-aes.t
+t/usm-sha512-aes.t
diff --git a/lib/Net/SNMP/Security/USM.pm b/lib/Net/SNMP/Security/USM.pm
index a76ef56..0bcd52c 100644
--- a/lib/Net/SNMP/Security/USM.pm
+++ b/lib/Net/SNMP/Security/USM.pm
@@ -26,8 +26,9 @@ use Net::SNMP::Message qw(
use Crypt::DES();
use Digest::MD5();
use Digest::SHA();
-use Digest::HMAC_MD5();
-use Digest::HMAC_SHA1();
+
+use Digest::SHA qw( hmac_sha1 hmac_sha224 hmac_sha256 hmac_sha384 hmac_sha512 );
+use Digest::HMAC_MD5 qw ( hmac_md5 );
## Version of the Net::SNMP::Security::USM module
@@ -41,7 +42,9 @@ our @EXPORT_OK;
our %EXPORT_TAGS = (
authprotos => [
- qw( AUTH_PROTOCOL_NONE AUTH_PROTOCOL_HMACMD5 AUTH_PROTOCOL_HMACSHA )
+ qw( AUTH_PROTOCOL_NONE AUTH_PROTOCOL_HMACMD5 AUTH_PROTOCOL_HMACSHA
+ AUTH_PROTOCOL_HMACSHA224 AUTH_PROTOCOL_HMACSHA256
+ AUTH_PROTOCOL_HMACSHA384 AUTH_PROTOCOL_HMACSHA512 )
],
levels => [
qw( SECURITY_LEVEL_NOAUTHNOPRIV SECURITY_LEVEL_AUTHNOPRIV
@@ -64,9 +67,13 @@ $EXPORT_TAGS{ALL} = [ @EXPORT_OK ];
## RCC 3414 - Authentication protocols
-sub AUTH_PROTOCOL_NONE { '1.3.6.1.6.3.10.1.1.1' } # usmNoAuthProtocol
-sub AUTH_PROTOCOL_HMACMD5 { '1.3.6.1.6.3.10.1.1.2' } # usmHMACMD5AuthProtocol
-sub AUTH_PROTOCOL_HMACSHA { '1.3.6.1.6.3.10.1.1.3' } # usmHMACSHAAuthProtocol
+sub AUTH_PROTOCOL_NONE { '1.3.6.1.6.3.10.1.1.1' } # usmNoAuthProtocol
+sub AUTH_PROTOCOL_HMACMD5 { '1.3.6.1.6.3.10.1.1.2' } # usmHMACMD5AuthProtocol
+sub AUTH_PROTOCOL_HMACSHA { '1.3.6.1.6.3.10.1.1.3' } # usmHMACSHAAuthProtocol
+sub AUTH_PROTOCOL_HMACSHA224 { '1.3.6.1.6.3.10.1.1.4' } # usmHMAC128SHA224AuthProtocol
+sub AUTH_PROTOCOL_HMACSHA256 { '1.3.6.1.6.3.10.1.1.5' } # usmHMAC192SHA256AuthProtocol
+sub AUTH_PROTOCOL_HMACSHA384 { '1.3.6.1.6.3.10.1.1.6' } # usmHMAC256SHA384AuthProtocol
+sub AUTH_PROTOCOL_HMACSHA512 { '1.3.6.1.6.3.10.1.1.7' } # usmHMAC384SHA512AuthProtocol
## RFC 3414 - Privacy protocols
@@ -125,6 +132,7 @@ sub new
'_time_epoc' => time(), # snmpEngineBoots epoc
'_user_name' => q{}, # securityName
'_auth_data' => undef, # Authentication data
+ '_auth_maclen' => undef, # MAC length
'_auth_key' => undef, # authKey
'_auth_password' => undef, # Authentication password
'_auth_protocol' => AUTH_PROTOCOL_HMACMD5, # authProtocol
@@ -281,10 +289,10 @@ sub generate_request_msg
if ($pdu->security_level() > SECURITY_LEVEL_NOAUTHNOPRIV) {
# Save the location to fill in msgAuthenticationParameters later
- $auth_location = $msg->length() + 12 + length $pdu_buffer;
+ $auth_location = $msg->length() + $this->{_auth_maclen} + length $pdu_buffer;
# Set the msgAuthenticationParameters to all zeros
- $auth_params = pack 'x12';
+ $auth_params = pack "x$this->{_auth_maclen}";
}
if (!defined $msg->prepare(OCTET_STRING, $auth_params)) {
@@ -419,12 +427,12 @@ sub process_incoming_msg
# to compute the HMAC properly.
if (my $len = length $auth_params) {
- if ($len != 12) {
+ if ($len != $this->{_auth_maclen}) {
return $this->_error(
'The msgAuthenticationParameters length of %d is invalid', $len
);
}
- substr ${$msg->reference}, ($msg->index() - 12), 12, pack 'x12';
+ substr ${$msg->reference}, ($msg->index() - $this->{_auth_maclen}), $this->{_auth_maclen}, pack "x$this->{_auth_maclen}";
}
# msgPrivacyParameters::=OCTET STRING
@@ -748,6 +756,18 @@ sub _auth_password
quotemeta AUTH_PROTOCOL_HMACMD5, AUTH_PROTOCOL_HMACMD5,
'(?:hmac-)?sha(?:-?1|-96)?', AUTH_PROTOCOL_HMACSHA,
quotemeta AUTH_PROTOCOL_HMACSHA, AUTH_PROTOCOL_HMACSHA,
+ '(?:hmac-)?sha(?:-?224)', AUTH_PROTOCOL_HMACSHA224,
+ 'usmHMAC128SHA224AuthProtocol', AUTH_PROTOCOL_HMACSHA224,
+ quotemeta AUTH_PROTOCOL_HMACSHA224,AUTH_PROTOCOL_HMACSHA224,
+ '(?:hmac-)?sha(?:-?256)', AUTH_PROTOCOL_HMACSHA256,
+ 'usmHMAC192SHA256AuthProtocol', AUTH_PROTOCOL_HMACSHA256,
+ quotemeta AUTH_PROTOCOL_HMACSHA256,AUTH_PROTOCOL_HMACSHA256,
+ '(?:hmac-)?sha(?:-?384)', AUTH_PROTOCOL_HMACSHA384,
+ 'usmHMAC256SHA384AuthProtocol', AUTH_PROTOCOL_HMACSHA384,
+ quotemeta AUTH_PROTOCOL_HMACSHA384,AUTH_PROTOCOL_HMACSHA384,
+ '(?:hmac-)?sha(?:-?512)', AUTH_PROTOCOL_HMACSHA512,
+ 'usmHMAC384SHA512AuthProtocol', AUTH_PROTOCOL_HMACSHA512,
+ quotemeta AUTH_PROTOCOL_HMACSHA512,AUTH_PROTOCOL_HMACSHA512,
};
sub _auth_protocol
@@ -1100,7 +1120,7 @@ sub _authenticate_outgoing_msg
}
# Set the msgAuthenticationParameters
- substr ${$msg->reference}, -$auth_location, 12, $this->_auth_hmac($msg);
+ substr ${$msg->reference}, -$auth_location, $this->{_auth_maclen}, $this->_auth_hmac($msg);
return TRUE;
}
@@ -1126,7 +1146,7 @@ sub _auth_hmac
return q{} if (!defined($this->{_auth_data}) || !defined $msg);
return substr
- $this->{_auth_data}->reset()->add(${$msg->reference()})->digest(), 0, 12;
+ $this->{_auth_data}(${$msg->reference()}, $this->{_auth_key}), 0, $this->{_auth_maclen};
}
sub _auth_data_init
@@ -1141,16 +1161,35 @@ sub _auth_data_init
if ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACMD5) {
- $this->{_auth_data} =
- Digest::HMAC_MD5->new($this->{_auth_key});
+ $this->{_auth_data} = \&hmac_md5;
+ $this->{_auth_maclen} = 12;
} elsif ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACSHA) {
- $this->{_auth_data} =
- Digest::HMAC_SHA1->new($this->{_auth_key});
+ $this->{_auth_data} = \&hmac_sha1;
+ $this->{_auth_maclen} = 12;
+
+ } elsif ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACSHA224) {
+
+ $this->{_auth_data} = \&hmac_sha224;
+ $this->{_auth_maclen} = 16;
+
+ } elsif ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACSHA256) {
+
+ $this->{_auth_data} = \&hmac_sha256;
+ $this->{_auth_maclen} = 24;
+
+ } elsif ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACSHA384) {
+
+ $this->{_auth_data} = \&hmac_sha384;
+ $this->{_auth_maclen} = 32;
+
+ } elsif ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACSHA512) {
+
+ $this->{_auth_data} = \&hmac_sha512;
+ $this->{_auth_maclen} = 48;
} else {
-
return $this->_error(
'The authProtocol "%s" is unknown', $this->{_auth_protocol}
);
@@ -1628,6 +1667,10 @@ sub _auth_key_validate
{
AUTH_PROTOCOL_HMACMD5, [ 16, 'HMAC-MD5' ],
AUTH_PROTOCOL_HMACSHA, [ 20, 'HMAC-SHA1' ],
+ AUTH_PROTOCOL_HMACSHA224, [ 28, 'HMAC-SHA224' ],
+ AUTH_PROTOCOL_HMACSHA256, [ 32, 'HMAC-SHA256' ],
+ AUTH_PROTOCOL_HMACSHA384, [ 48, 'HMAC-SHA384' ],
+ AUTH_PROTOCOL_HMACSHA512, [ 64, 'HMAC-SHA512' ],
};
if (!exists $key_len->{$this->{_auth_protocol}}) {
@@ -1783,8 +1826,12 @@ sub _password_localize
my $digests =
{
- AUTH_PROTOCOL_HMACMD5, 'Digest::MD5',
- AUTH_PROTOCOL_HMACSHA, 'Digest::SHA',
+ AUTH_PROTOCOL_HMACMD5, ['Digest::MD5', ],
+ AUTH_PROTOCOL_HMACSHA, ['Digest::SHA', 1],
+ AUTH_PROTOCOL_HMACSHA224, ['Digest::SHA', 224],
+ AUTH_PROTOCOL_HMACSHA256, ['Digest::SHA', 256],
+ AUTH_PROTOCOL_HMACSHA384, ['Digest::SHA', 384],
+ AUTH_PROTOCOL_HMACSHA512, ['Digest::SHA', 512],
};
if (!exists $digests->{$this->{_auth_protocol}}) {
@@ -1793,7 +1840,12 @@ sub _password_localize
);
}
- my $digest = $digests->{$this->{_auth_protocol}}->new;
+ my $digest;
+ if (!defined($digests->{$this->{_auth_protocol}}[1])) {
+ $digest = $digests->{$this->{_auth_protocol}}[0]->new;
+ } else {
+ $digest = $digests->{$this->{_auth_protocol}}[0]->new($digests->{$this->{_auth_protocol}}[1]);
+ }
# Create the initial digest using the password
diff --git a/t/usm-sha224-aes.t b/t/usm-sha224-aes.t
new file mode 100644
index 0000000..e7d118e
--- /dev/null
+++ b/t/usm-sha224-aes.t
@@ -0,0 +1,169 @@
+# -*- mode: perl -*-
+# ============================================================================
+
+# Test of the SNMPv3 User-based Security Model.
+
+# Copyright (c) 2001-2009 David M. Town <dtown@cpan.org>.
+# Copyright (c) 2024 Michal Josef Špaček <skim@cpan.org>.
+# All rights reserved.
+
+# This program is free software; you may redistribute it and/or modify it
+# under the same terms as the Perl 5 programming language system itself.
+
+# ============================================================================
+
+use strict;
+use Test;
+
+BEGIN
+{
+ $| = 1;
+ $^W = 1;
+ plan tests => 7
+}
+
+use Net::SNMP::Message qw(SEQUENCE OCTET_STRING FALSE);
+
+#
+# Load the Net::SNMP::Security::USM module
+#
+
+eval 'use Net::SNMP::Security::USM; use Crypt::Rijndael;';
+
+my $skip = ($@ =~ /locate (:?\S+\.pm)/) ? $@ : FALSE;
+
+#
+# 1. Create the Net::SNMP::Security::USM object
+#
+
+my ($u, $e);
+
+eval
+{
+ ($u, $e) = Net::SNMP::Security::USM->new(
+ -username => 'dtown',
+ -authpassword => 'maplesyrup',
+ -authprotocol => 'sha224',
+ -privpassword => 'maplesyrup',
+ -privprotocol => 'aes',
+ );
+
+ # "Perform" discovery...
+ $u->_engine_id_discovery(pack 'x11H2', '02');
+
+ # ...and synchronization
+ $u->_synchronize(10, time);
+};
+
+skip(
+ $skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Security::USM object'
+);
+
+#
+# 2. Check the localized authKey
+#
+
+eval
+{
+ $e = unpack 'H*', $u->auth_key();
+};
+
+skip(
+ $skip,
+ ($@ || $e),
+ '0bd8827c6e29f8065e08e09237f177e410f69b90e1782be682075674',
+ 'Invalid authKey calculated'
+);
+
+#
+# 3. Check the localized privKey
+#
+
+eval
+{
+ $e = unpack 'H*', $u->priv_key();
+};
+
+skip(
+ $skip,
+ ($@ || $e),
+ '0bd8827c6e29f8065e08e09237f177e4',
+ 'Invalid privKey calculated'
+);
+
+#
+# 4. Create and initialize a Message
+#
+
+my $m;
+
+eval
+{
+ ($m, $e) = Net::SNMP::Message->new();
+ $m->prepare(SEQUENCE, pack('H*', 'deadbeef') x 8);
+ $e = $m->error();
+};
+
+skip($skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Message object');
+
+#
+# 5. Calculate the HMAC
+#
+
+my $h;
+
+eval
+{
+ $h = unpack 'H*', $u->_auth_hmac($m);
+};
+
+skip($skip, $@, q{}, 'Calculate the HMAC failed');
+
+#
+# 6. Encrypt/descrypt the Message
+#
+
+my $henc;
+
+eval
+{
+ my $engine_boots = 0;
+ my $engine_time = 1710186219;
+ my $salt;
+ my $len = $m->length();
+ my $buff = $m->clear();
+ $u->{_engine_boots} = $engine_boots;
+ $u->{_engine_time} = $engine_time;
+ my $encrypted = $u->_encrypt_data($m, $salt, $buff);
+ $henc = unpack 'H*', $encrypted;
+ $m->append($encrypted);
+ substr $salt, 0, 0, pack 'NN', $engine_boots, $engine_time;
+ $u->_decrypt_data($m, $salt, $m->process(OCTET_STRING));
+ $e = $u->error();
+ # Remove padding if necessary
+ if ($len -= $m->length()) {
+ substr ${$m->reference()}, $len, -$len, q{};
+ }
+};
+
+skip(
+ $skip,
+ ($@ || $e || $henc),
+ '042228c5467793ab001f4be546de4b990f90998b09d43f2baaffb52a5d36457cef3b5ab7',
+ 'Privacy failed',
+);
+
+#
+# 7. Check the HMAC
+#
+
+my $h2;
+
+eval
+{
+ $h2 = unpack 'H*', $u->_auth_hmac($m);
+};
+
+skip($skip, ($@ || $h2), $h, 'Authentication failed');
+
+# ============================================================================
diff --git a/t/usm-sha256-aes.t b/t/usm-sha256-aes.t
new file mode 100644
index 0000000..4521187
--- /dev/null
+++ b/t/usm-sha256-aes.t
@@ -0,0 +1,169 @@
+# -*- mode: perl -*-
+# ============================================================================
+
+# Test of the SNMPv3 User-based Security Model.
+
+# Copyright (c) 2001-2009 David M. Town <dtown@cpan.org>.
+# Copyright (c) 2024 Michal Josef Špaček <skim@cpan.org>.
+# All rights reserved.
+
+# This program is free software; you may redistribute it and/or modify it
+# under the same terms as the Perl 5 programming language system itself.
+
+# ============================================================================
+
+use strict;
+use Test;
+
+BEGIN
+{
+ $| = 1;
+ $^W = 1;
+ plan tests => 7
+}
+
+use Net::SNMP::Message qw(SEQUENCE OCTET_STRING FALSE);
+
+#
+# Load the Net::SNMP::Security::USM module
+#
+
+eval 'use Net::SNMP::Security::USM; use Crypt::Rijndael;';
+
+my $skip = ($@ =~ /locate (:?\S+\.pm)/) ? $@ : FALSE;
+
+#
+# 1. Create the Net::SNMP::Security::USM object
+#
+
+my ($u, $e);
+
+eval
+{
+ ($u, $e) = Net::SNMP::Security::USM->new(
+ -username => 'dtown',
+ -authpassword => 'maplesyrup',
+ -authprotocol => 'sha256',
+ -privpassword => 'maplesyrup',
+ -privprotocol => 'aes',
+ );
+
+ # "Perform" discovery...
+ $u->_engine_id_discovery(pack 'x11H2', '02');
+
+ # ...and synchronization
+ $u->_synchronize(10, time);
+};
+
+skip(
+ $skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Security::USM object'
+);
+
+#
+# 2. Check the localized authKey
+#
+
+eval
+{
+ $e = unpack 'H*', $u->auth_key();
+};
+
+skip(
+ $skip,
+ ($@ || $e),
+ '8982e0e549e866db361a6b625d84cccc11162d453ee8ce3a6445c2d6776f0f8b',
+ 'Invalid authKey calculated'
+);
+
+#
+# 3. Check the localized privKey
+#
+
+eval
+{
+ $e = unpack 'H*', $u->priv_key();
+};
+
+skip(
+ $skip,
+ ($@ || $e),
+ '8982e0e549e866db361a6b625d84cccc',
+ 'Invalid privKey calculated'
+);
+
+#
+# 4. Create and initialize a Message
+#
+
+my $m;
+
+eval
+{
+ ($m, $e) = Net::SNMP::Message->new();
+ $m->prepare(SEQUENCE, pack('H*', 'deadbeef') x 8);
+ $e = $m->error();
+};
+
+skip($skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Message object');
+
+#
+# 5. Calculate the HMAC
+#
+
+my $h;
+
+eval
+{
+ $h = unpack 'H*', $u->_auth_hmac($m);
+};
+
+skip($skip, $@, q{}, 'Calculate the HMAC failed');
+
+#
+# 6. Encrypt/descrypt the Message
+#
+
+my $henc;
+
+eval
+{
+ my $engine_boots = 0;
+ my $engine_time = 1710186219;
+ my $salt;
+ my $len = $m->length();
+ my $buff = $m->clear();
+ $u->{_engine_boots} = $engine_boots;
+ $u->{_engine_time} = $engine_time;
+ my $encrypted = $u->_encrypt_data($m, $salt, $buff);
+ $henc = unpack 'H*', $encrypted;
+ $m->append($encrypted);
+ substr $salt, 0, 0, pack 'NN', $engine_boots, $engine_time;
+ $u->_decrypt_data($m, $salt, $m->process(OCTET_STRING));
+ $e = $u->error();
+ # Remove padding if necessary
+ if ($len -= $m->length()) {
+ substr ${$m->reference()}, $len, -$len, q{};
+ }
+};
+
+skip(
+ $skip,
+ ($@ || $e || $henc),
+ '0422863d06faf464369a298b66062e54374ba3b4a0f862162d25ba72130038f8befc9e21',
+ 'Privacy failed',
+);
+
+#
+# 7. Check the HMAC
+#
+
+my $h2;
+
+eval
+{
+ $h2 = unpack 'H*', $u->_auth_hmac($m);
+};
+
+skip($skip, ($@ || $h2), $h, 'Authentication failed');
+
+# ============================================================================
diff --git a/t/usm-sha384-aes.t b/t/usm-sha384-aes.t
new file mode 100644
index 0000000..e88ca4a
--- /dev/null
+++ b/t/usm-sha384-aes.t
@@ -0,0 +1,169 @@
+# -*- mode: perl -*-
+# ============================================================================
+
+# Test of the SNMPv3 User-based Security Model.
+
+# Copyright (c) 2001-2009 David M. Town <dtown@cpan.org>.
+# Copyright (c) 2024 Michal Josef Špaček <skim@cpan.org>.
+# All rights reserved.
+
+# This program is free software; you may redistribute it and/or modify it
+# under the same terms as the Perl 5 programming language system itself.
+
+# ============================================================================
+
+use strict;
+use Test;
+
+BEGIN
+{
+ $| = 1;
+ $^W = 1;
+ plan tests => 7
+}
+
+use Net::SNMP::Message qw(SEQUENCE OCTET_STRING FALSE);
+
+#
+# Load the Net::SNMP::Security::USM module
+#
+
+eval 'use Net::SNMP::Security::USM; use Crypt::Rijndael;';
+
+my $skip = ($@ =~ /locate (:?\S+\.pm)/) ? $@ : FALSE;
+
+#
+# 1. Create the Net::SNMP::Security::USM object
+#
+
+my ($u, $e);
+
+eval
+{
+ ($u, $e) = Net::SNMP::Security::USM->new(
+ -username => 'dtown',
+ -authpassword => 'maplesyrup',
+ -authprotocol => 'sha384',
+ -privpassword => 'maplesyrup',
+ -privprotocol => 'aes',
+ );
+
+ # "Perform" discovery...
+ $u->_engine_id_discovery(pack 'x11H2', '02');
+
+ # ...and synchronization
+ $u->_synchronize(10, time);
+};
+
+skip(
+ $skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Security::USM object'
+);
+
+#
+# 2. Check the localized authKey
+#
+
+eval
+{
+ $e = unpack 'H*', $u->auth_key();
+};
+
+skip(
+ $skip,
+ ($@ || $e),
+ '3b298f16164a11184279d5432bf169e2d2a48307de02b3d3f7e2b4f36eb6f0455a53689a3937eea07319a633d2ccba78',
+ 'Invalid authKey calculated'
+);
+
+#
+# 3. Check the localized privKey
+#
+
+eval
+{
+ $e = unpack 'H*', $u->priv_key();
+};
+
+skip(
+ $skip,
+ ($@ || $e),
+ '3b298f16164a11184279d5432bf169e2',
+ 'Invalid privKey calculated'
+);
+
+#
+# 4. Create and initialize a Message
+#
+
+my $m;
+
+eval
+{
+ ($m, $e) = Net::SNMP::Message->new();
+ $m->prepare(SEQUENCE, pack('H*', 'deadbeef') x 8);
+ $e = $m->error();
+};
+
+skip($skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Message object');
+
+#
+# 5. Calculate the HMAC
+#
+
+my $h;
+
+eval
+{
+ $h = unpack 'H*', $u->_auth_hmac($m);
+};
+
+skip($skip, $@, q{}, 'Calculate the HMAC failed');
+
+#
+# 6. Encrypt/descrypt the Message
+#
+
+my $henc;
+
+eval
+{
+ my $engine_boots = 0;
+ my $engine_time = 1710186219;
+ my $salt;
+ my $len = $m->length();
+ my $buff = $m->clear();
+ $u->{_engine_boots} = $engine_boots;
+ $u->{_engine_time} = $engine_time;
+ my $encrypted = $u->_encrypt_data($m, $salt, $buff);
+ $henc = unpack 'H*', $encrypted;
+ $m->append($encrypted);
+ substr $salt, 0, 0, pack 'NN', $engine_boots, $engine_time;
+ $u->_decrypt_data($m, $salt, $m->process(OCTET_STRING));
+ $e = $u->error();
+ # Remove padding if necessary
+ if ($len -= $m->length()) {
+ substr ${$m->reference()}, $len, -$len, q{};
+ }
+};
+
+skip(
+ $skip,
+ ($@ || $e || $henc),
+ '0422850967bbff81be49aefadf9b6ee3eedb9093609fcfc813a21bdf09b469965923bfc0',
+ 'Privacy failed',
+);
+
+#
+# 7. Check the HMAC
+#
+
+my $h2;
+
+eval
+{
+ $h2 = unpack 'H*', $u->_auth_hmac($m);
+};
+
+skip($skip, ($@ || $h2), $h, 'Authentication failed');
+
+# ============================================================================
diff --git a/t/usm-sha512-aes.t b/t/usm-sha512-aes.t
new file mode 100644
index 0000000..c5eadf3
--- /dev/null
+++ b/t/usm-sha512-aes.t
@@ -0,0 +1,169 @@
+# -*- mode: perl -*-
+# ============================================================================
+
+# Test of the SNMPv3 User-based Security Model.
+
+# Copyright (c) 2001-2009 David M. Town <dtown@cpan.org>.
+# Copyright (c) 2024 Michal Josef Špaček <skim@cpan.org>.
+# All rights reserved.
+
+# This program is free software; you may redistribute it and/or modify it
+# under the same terms as the Perl 5 programming language system itself.
+
+# ============================================================================
+
+use strict;
+use Test;
+
+BEGIN
+{
+ $| = 1;
+ $^W = 1;
+ plan tests => 7
+}
+
+use Net::SNMP::Message qw(SEQUENCE OCTET_STRING FALSE);
+
+#
+# Load the Net::SNMP::Security::USM module
+#
+
+eval 'use Net::SNMP::Security::USM; use Crypt::Rijndael;';
+
+my $skip = ($@ =~ /locate (:?\S+\.pm)/) ? $@ : FALSE;
+
+#
+# 1. Create the Net::SNMP::Security::USM object
+#
+
+my ($u, $e);
+
+eval
+{
+ ($u, $e) = Net::SNMP::Security::USM->new(
+ -username => 'dtown',
+ -authpassword => 'maplesyrup',
+ -authprotocol => 'sha512',
+ -privpassword => 'maplesyrup',
+ -privprotocol => 'aes',
+ );
+
+ # "Perform" discovery...
+ $u->_engine_id_discovery(pack 'x11H2', '02');
+
+ # ...and synchronization
+ $u->_synchronize(10, time);
+};
+
+skip(
+ $skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Security::USM object'
+);
+
+#
+# 2. Check the localized authKey
+#
+
+eval
+{
+ $e = unpack 'H*', $u->auth_key();
+};
+
+skip(
+ $skip,
+ ($@ || $e),
+ '22a5a36cedfcc085807a128d7bc6c2382167ad6c0dbc5fdff856740f3d84c099ad1ea87a8db096714d9788bd544047c9021e4229ce27e4c0a69250adfcffbb0b',
+ 'Invalid authKey calculated'
+);
+
+#
+# 3. Check the localized privKey
+#
+
+eval
+{
+ $e = unpack 'H*', $u->priv_key();
+};
+
+skip(
+ $skip,
+ ($@ || $e),
+ '22a5a36cedfcc085807a128d7bc6c238',
+ 'Invalid privKey calculated'
+);
+
+#
+# 4. Create and initialize a Message
+#
+
+my $m;
+
+eval
+{
+ ($m, $e) = Net::SNMP::Message->new();
+ $m->prepare(SEQUENCE, pack('H*', 'deadbeef') x 8);
+ $e = $m->error();
+};
+
+skip($skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Message object');
+
+#
+# 5. Calculate the HMAC
+#
+
+my $h;
+
+eval
+{
+ $h = unpack 'H*', $u->_auth_hmac($m);
+};
+
+skip($skip, $@, q{}, 'Calculate the HMAC failed');
+
+#
+# 6. Encrypt/descrypt the Message
+#
+
+my $henc;
+
+eval
+{
+ my $engine_boots = 0;
+ my $engine_time = 1710186219;
+ my $salt;
+ my $len = $m->length();
+ my $buff = $m->clear();
+ $u->{_engine_boots} = $engine_boots;
+ $u->{_engine_time} = $engine_time;
+ my $encrypted = $u->_encrypt_data($m, $salt, $buff);
+ $henc = unpack 'H*', $encrypted;
+ $m->append($encrypted);
+ substr $salt, 0, 0, pack 'NN', $engine_boots, $engine_time;
+ $u->_decrypt_data($m, $salt, $m->process(OCTET_STRING));
+ $e = $u->error();
+ # Remove padding if necessary
+ if ($len -= $m->length()) {
+ substr ${$m->reference()}, $len, -$len, q{};
+ }
+};
+
+skip(
+ $skip,
+ ($@ || $e || $henc),
+ '0422bae4cdb263a0936b189051e9b1759183b16d07c9a7d8bf633d6dd2e817a2ac2fe742',
+ 'Privacy failed',
+);
+
+#
+# 7. Check the HMAC
+#
+
+my $h2;
+
+eval
+{
+ $h2 = unpack 'H*', $u->_auth_hmac($m);
+};
+
+skip($skip, ($@ || $h2), $h, 'Authentication failed');
+
+# ============================================================================

View File

@@ -0,0 +1,5 @@
GLUT=20801
VERSION=3.0 Mesa 10.2.6
VENDOR=Intel Open Source Technology Center
RENDERER=Mesa DRI Intel(R) Ivybridge Mobile
EXTENSIONS=GL_ARB_multisample GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_copy_texture GL_EXT_polygon_offset GL_EXT_subtexture GL_EXT_texture_object GL_EXT_vertex_array GL_EXT_compiled_vertex_array GL_EXT_texture GL_EXT_texture3D GL_IBM_rasterpos_clip GL_ARB_point_parameters GL_EXT_draw_range_elements GL_EXT_packed_pixels GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_separate_specular_color GL_EXT_texture_edge_clamp GL_SGIS_generate_mipmap GL_SGIS_texture_border_clamp GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_ARB_framebuffer_sRGB GL_ARB_multitexture GL_EXT_framebuffer_sRGB GL_IBM_multimode_draw_arrays GL_IBM_texture_mirrored_repeat GL_3DFX_texture_compression_FXT1 GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_transpose_matrix GL_EXT_blend_func_separate GL_EXT_fog_coord GL_EXT_multi_draw_arrays GL_EXT_secondary_color GL_EXT_texture_env_add GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod_bias GL_INGR_blend_func_separate GL_NV_blend_square GL_NV_light_max_exponent GL_NV_texgen_reflection GL_NV_texture_env_combine4 GL_S3_s3tc GL_SUN_multi_draw_arrays GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_EXT_framebuffer_object GL_EXT_texture_compression_s3tc GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_MESA_window_pos GL_NV_packed_depth_stencil GL_NV_texture_rectangle GL_ARB_depth_texture GL_ARB_occlusion_query GL_ARB_shadow GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat GL_ARB_window_pos GL_ATI_envmap_bumpmap GL_EXT_stencil_two_side GL_EXT_texture_cube_map GL_NV_depth_clamp GL_APPLE_packed_pixels GL_APPLE_vertex_array_object GL_ARB_draw_buffers GL_ARB_fragment_program GL_ARB_fragment_shader GL_ARB_shader_objects GL_ARB_vertex_program GL_ARB_vertex_shader GL_ATI_draw_buffers GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_MESA_pack_invert GL_NV_primitive_restart GL_ARB_depth_clamp GL_ARB_fragment_program_shadow GL_ARB_half_float_pixel GL_ARB_occlusion_query2 GL_ARB_point_sprite GL_ARB_shading_language_100 GL_ARB_sync GL_ARB_texture_non_power_of_two GL_ARB_vertex_buffer_object GL_ATI_blend_equation_separate GL_EXT_blend_equation_separate GL_OES_read_format GL_ARB_color_buffer_float GL_ARB_pixel_buffer_object GL_ARB_texture_compression_rgtc GL_ARB_texture_float GL_ARB_texture_rectangle GL_EXT_packed_float GL_EXT_pixel_buffer_object GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc GL_EXT_texture_rectangle GL_EXT_texture_sRGB GL_EXT_texture_shared_exponent GL_ARB_framebuffer_object GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_packed_depth_stencil GL_APPLE_object_purgeable GL_ARB_vertex_array_object GL_ATI_separate_stencil GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_gpu_program_parameters GL_EXT_texture_array GL_EXT_texture_integer GL_EXT_texture_sRGB_decode GL_EXT_timer_query GL_OES_EGL_image GL_AMD_performance_monitor GL_ARB_copy_buffer GL_ARB_depth_buffer_float GL_ARB_draw_instanced GL_ARB_half_float_vertex GL_ARB_instanced_arrays GL_ARB_map_buffer_range GL_ARB_texture_rg GL_ARB_texture_swizzle GL_ARB_vertex_array_bgra GL_EXT_texture_swizzle GL_EXT_vertex_array_bgra GL_NV_conditional_render GL_AMD_conservative_depth GL_AMD_draw_buffers_blend GL_AMD_seamless_cubemap_per_texture GL_ARB_ES2_compatibility GL_ARB_blend_func_extended GL_ARB_debug_output GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_explicit_attrib_location GL_ARB_fragment_coord_conventions GL_ARB_provoking_vertex GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_shader_texture_lod GL_ARB_texture_cube_map_array GL_ARB_texture_gather GL_ARB_texture_multisample GL_ARB_texture_query_lod GL_ARB_texture_rgb10_a2ui GL_ARB_uniform_buffer_object GL_ARB_vertex_type_2_10_10_10_rev GL_EXT_provoking_vertex GL_EXT_texture_snorm GL_MESA_texture_signed_rgba GL_ARB_get_program_binary GL_ARB_robustness GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_ARB_conservative_depth GL_ARB_internalformat_query GL_ARB_map_buffer_alignment GL_ARB_shader_atomic_counters GL_ARB_shading_language_420pack GL_ARB_shading_language_packing GL_ARB_texture_storage GL_ARB_transform_feedback_instanced GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_transform_feedback GL_AMD_shader_trinary_minmax GL_ARB_ES3_compatibility GL_ARB_clear_buffer_object GL_ARB_invalidate_subdata GL_ARB_texture_query_levels GL_ARB_texture_storage_multisample GL_ARB_texture_view GL_ARB_vertex_attrib_binding GL_KHR_debug GL_ARB_buffer_storage GL_ARB_multi_bind GL_ARB_texture_mirror_clamp_to_edge GL_ARB_vertex_type_10f_11f_11f_rev GL_EXT_shader_integer_mix GL_INTEL_performance_query

View File

@@ -0,0 +1,57 @@
diff --git a/Makefile.PL b/Makefile.PL
index 55c485c..8501c02 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -124,14 +124,7 @@ if ($^O eq 'MSWin32' || $IS_W32API)
# Look for available libs
our @libdirs = qw
{
- -L/usr/lib
- -L/usr/lib/i386-linux-gnu
- -L/usr/X11R6/lib
- -L/opt/X11/lib
- -L/usr/local/lib
- -L/usr/openwin/lib
- -L/opt/csw/lib
- -L/usr/local/freeglut/lib
+ @@libpaths@@
};
our @check_libs = qw
@@ -764,7 +759,6 @@ sub get_extensions
my $exc_file = 'gl_exclude.h';
unlink($exc_file) if (-e $exc_file);
my $glv_file = 'utils/glversion.txt';
- unlink($glv_file) if (-e $glv_file);
# Only run the rest if GLUT is installed
print "Testing GLUT version\n" if ($verbose);
@@ -817,7 +811,7 @@ sub get_extensions
$make_ver = ";make -f Makefile " . (length($lib) ? "GLUT_LIB=$lib " : "") . (length($def) ? "GLUT_DEF=$def " : "");
print "glversion: '$make_ver'\n" if $verbose>1;
}
- my $exec = 'cd utils'."$make_ver clean".$make_ver;
+ my $exec = 'cd utils'.$make_ver;
print "glversion: $exec\n" if ($verbose);
my $stat = `$exec`;
print "\n$stat\n\n" if ($verbose);
diff --git a/utils/Makefile b/utils/Makefile
index 910dcaf..1b1ac57 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -21,14 +21,13 @@ EXTRALIBS=-lGLU -lXi -lXmu -lXext -lX11 -lm
all: glversion.txt
glversion.txt: glversion
- ./glversion > glversion.txt
+ echo "skipping build of glversion.txt"
glversion: glversion.o
${LINK} glversion.o ${LDFLAGS} ${EXTRALIBS} -o glversion
chmod u+x glversion
clean:
- rm -f glversion.txt
rm -f glversion
rm -f glversion.o

View File

@@ -0,0 +1,16 @@
diff --git a/t/core_surface.t b/t/core_surface.t
index 897536b6..03efa859 100644
--- a/t/core_surface.t
+++ b/t/core_surface.t
@@ -51,7 +51,10 @@ is( $image->h, 32, 'image has height' );
my $pixel_format = $image->format;
isa_ok( $pixel_format, 'SDL::PixelFormat' );
-is( $pixel_format->BitsPerPixel, 8, ' BitsPerPixel' );
+# the bitmap has a bitdepth of 4
+# SDL_classic could not allocate less than full bytes per pixel
+# sdl12-compat returns the actual bit depth of the image here
+is( $pixel_format->BitsPerPixel, 4, ' BitsPerPixel' );
is( $pixel_format->BytesPerPixel, 1, ' BytesPerPixel' );
is( $pixel_format->Rloss, 8, ' Rloss' );
is( $pixel_format->Gloss, 8, ' Gloss' );

View File

@@ -0,0 +1,64 @@
From d734d03862d7dcc776bd2fa3ba662cdd5879b32e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Wed, 12 Jul 2023 17:55:27 +0200
Subject: [PATCH] Adapt to perl 5.37.1
Perl 5.37.1 removed a deprecated sv_nv() macro and SDL fails to build
with Perl 5.38.0:
lib/SDLx/Controller/Interface.xs:60:26: error: implicit declaration of function 'sv_nv'
60 | out->dv_x = sv_nv(temp);
| ^~~~~
Users are advised to use SvNVx() macro instead. SvNVx() seems to have been
available all the time (it predates a commit from 1993-10-07).
This patch does that.
https://github.com/PerlGameDev/SDL/issues/303
---
src/SDLx/Controller/Interface.xs | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/SDLx/Controller/Interface.xs b/src/SDLx/Controller/Interface.xs
index 3dc202b7..d326c885 100644
--- a/src/SDLx/Controller/Interface.xs
+++ b/src/SDLx/Controller/Interface.xs
@@ -57,15 +57,15 @@ void evaluate(SDLx_Interface *obj, SDLx_Derivative *out, SDLx_State *initial, fl
SV *temp;
temp = av_pop(accel);
- out->dv_x = sv_nv(temp);
+ out->dv_x = SvNVx(temp);
SvREFCNT_dec(temp);
temp = av_pop(accel);
- out->dv_y = sv_nv(temp);
+ out->dv_y = SvNVx(temp);
SvREFCNT_dec(temp);
temp = av_pop(accel);
- out->dang_v = sv_nv(temp);
+ out->dang_v = SvNVx(temp);
SvREFCNT_dec(temp);
SvREFCNT_dec((SV *)accel);
@@ -90,15 +90,15 @@ void evaluate_dt(SDLx_Interface *obj, SDLx_Derivative *out, SDLx_State *initial,
SV *temp;
temp = av_pop(accel);
- out->dv_x = sv_nv(temp);
+ out->dv_x = SvNVx(temp);
SvREFCNT_dec(temp);
temp = av_pop(accel);
- out->dv_y = sv_nv(temp);
+ out->dv_y = SvNVx(temp);
SvREFCNT_dec(temp);
temp = av_pop(accel);
- out->dang_v = sv_nv(temp);
+ out->dang_v = SvNVx(temp);
SvREFCNT_dec(temp);
SvREFCNT_dec((SV *)accel);

View File

@@ -0,0 +1,81 @@
{
lib,
stdenv,
file,
fetchFromGitLab,
buildPerlPackage,
ArchiveZip,
ArchiveCpio,
SubOverride,
shortenPerlShebang,
gitUpdater,
}:
buildPerlPackage rec {
pname = "strip-nondeterminism";
version = "1.14.1";
outputs = [
"out"
"dev"
]; # no "devdoc"
src = fetchFromGitLab {
owner = "reproducible-builds";
repo = "strip-nondeterminism";
domain = "salsa.debian.org";
rev = version;
sha256 = "C/812td9BX1YRqFpD9QYgBfzE+biZeAKgxoNcxpb6UU=";
};
strictDeps = true;
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ shortenPerlShebang ];
buildInputs = [
ArchiveZip
ArchiveCpio
SubOverride
];
postPatch = ''
substituteInPlace lib/File/StripNondeterminism.pm \
--replace "exec('file'" "exec('${lib.getExe file}'"
'';
postBuild = ''
patchShebangs ./bin
'';
postInstall = ''
# we dont need the debhelper script
rm $out/bin/dh_strip_nondeterminism
rm $out/share/man/man1/dh_strip_nondeterminism.1
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
shortenPerlShebang $out/bin/strip-nondeterminism
'';
installCheckPhase = ''
runHook preInstallCheck
($out/bin/strip-nondeterminism --help 2>&1 | grep -q "verbose") || (echo "'$out/bin/strip-nondeterminism --help' failed" && exit 1)
runHook postInstallCheck
'';
# running shortenPerlShebang in postBuild results in non-functioning binary 'exec format error'
doCheck = !stdenv.hostPlatform.isDarwin;
doInstallCheck = true;
passthru = {
updateScript = gitUpdater { };
};
meta = with lib; {
description = "Perl module for stripping bits of non-deterministic information";
mainProgram = "strip-nondeterminism";
homepage = "https://reproducible-builds.org/";
license = licenses.gpl3Only;
maintainers = with maintainers; [
pSub
artturin
];
};
}

View File

@@ -0,0 +1,11 @@
--- a/JPEG/jpeg/configure 2013-11-15 18:50:03.000000000 -0500
+++ b/JPEG/jpeg/configure 2023-09-05 23:36:12.675151164 -0400
@@ -623,7 +623,7 @@
cat > conftest.$ac_ext <<EOF
#line 625 "configure"
#include "confdefs.h"
-main(){return(0);}
+int main(){return(0);}
EOF
if { (eval echo configure:629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes

View File

@@ -0,0 +1,10 @@
--- XML-Grove-0.46alpha/t/grove.t 2008-07-22 14:47:27.000000000 +0200
+++ XML-Grove-0.46alpha/t/grove.t 2008-07-22 14:46:42.000000000 +0200
@@ -13,6 +13,7 @@ use XML::Parser::PerlSAX;
use XML::Grove::Builder;
use XML::Grove::AsString;
use XML::Grove::AsCanonXML;
+use utf8;
$loaded = 1;
print "ok 1\n";

View File

@@ -0,0 +1,45 @@
From e996904128653c67b04ddbdb1e10cef158098957 Mon Sep 17 00:00:00 2001
From: Samuel Dionne-Riel <samuel@dionne-riel.com>
Date: Fri, 6 Dec 2019 23:00:51 -0500
Subject: [PATCH] [HACK]: Assumes Expat paths are good.
The `check_lib` check fails with the cross-compilation build platform's
Perl, since apparently `mktemp` is missing...
Even then, side-stepping the issue, it seems it is not actually enough
to work, as the compilation fails.
---
Makefile.PL | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/Makefile.PL b/Makefile.PL
index 505d1df..fc38b76 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -29,12 +29,17 @@ foreach (@ARGV) {
@ARGV = @replacement_args;
unless (
- check_lib( # fill in what you prompted the user for here
- lib => [qw(expat)],
- header => ['expat.h'],
- incpath => $expat_incpath,
- ( $expat_libpath ? ( libpath => $expat_libpath ) : () ),
- )
+ #check_lib( # fill in what you prompted the user for here
+ # lib => [qw(expat)],
+ # header => ['expat.h'],
+ # incpath => $expat_incpath,
+ # ( $expat_libpath ? ( libpath => $expat_libpath ) : () ),
+ #)
+ # The check_lib implementation fails horribly with cross-compilation.
+ # We are giving known good paths to expat.
+ # And in all cases, the previous behaviour of not actually failing
+ # seemed to work just fine :/.
+ false
) {
warn <<'Expat_Not_Installed;';
--
2.23.0