From d49b06066fbca3115a30dce5536f175064b7c6a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= Date: Thu, 17 Jun 2021 11:29:45 +0200 Subject: [PATCH] New package: perl-GnuPG-Interface-1.02 --- .../patches/0001-disables-version-check.patch | 90 +++++++++++++++++++ .../0002-Hardcode-path-to-usr-bin-gpg.patch | 38 ++++++++ srcpkgs/perl-GnuPG-Interface/template | 15 ++++ 3 files changed, 143 insertions(+) create mode 100644 srcpkgs/perl-GnuPG-Interface/patches/0001-disables-version-check.patch create mode 100644 srcpkgs/perl-GnuPG-Interface/patches/0002-Hardcode-path-to-usr-bin-gpg.patch create mode 100644 srcpkgs/perl-GnuPG-Interface/template diff --git a/srcpkgs/perl-GnuPG-Interface/patches/0001-disables-version-check.patch b/srcpkgs/perl-GnuPG-Interface/patches/0001-disables-version-check.patch new file mode 100644 index 00000000000..2807cf114e6 --- /dev/null +++ b/srcpkgs/perl-GnuPG-Interface/patches/0001-disables-version-check.patch @@ -0,0 +1,90 @@ +From fe898b9211fd0a6d273c438c21755e39b9b221b3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= + +Date: Wed, 15 Jun 2022 13:05:40 +0200 +Subject: [PATCH 1/2] disables version check + +Void ships GnuPG in a new enough version anyway, so this check is not +necessary. The reason to disable the check is that it's broken rn: + +``` +error determining fileno for STDIN: Illegal seek at (eval 270) line 55. +Use of uninitialized value $line in pattern match (m//) at /usr/share/perl5/vendor_perl/GnuPG/Interface.pm line 827. +Use of uninitialized value $a in split at /usr/share/perl5/vendor_perl/GnuPG/Interface.pm line 841. +Use of uninitialized value $a in split at /usr/share/perl5/vendor_perl/GnuPG/Interface.pm line 841. +GnuPG Version 1.4 or 2.2+ required at (eval 270) line 55. +``` +--- + lib/GnuPG/Interface.pm | 18 ++---------------- + t/version_updates.t | 30 ------------------------------ + 2 files changed, 2 insertions(+), 46 deletions(-) + delete mode 100644 t/version_updates.t + +diff --git a/lib/GnuPG/Interface.pm b/lib/GnuPG/Interface.pm +index 905ae30..7fd2321 100644 +--- a/lib/GnuPG/Interface.pm ++++ b/lib/GnuPG/Interface.pm +@@ -818,22 +818,8 @@ sub search_keys( $% ) { + } + + sub _version { +- my ( $self ) = @_; +- +- my $out = IO::Handle->new; +- my $handles = GnuPG::Handles->new( stdout => $out ); +- my $pid = $self->wrap_call( commands => [ '--no-options', '--version' ], handles => $handles ); +- my $line = $out->getline; +- $line =~ /(\d+\.\d+\.\d+)/; +- +- my $version = $1; +- unless ($self->cmp_version($version, '2.2') >= 0 or +- ($self->cmp_version($version, '1.4') >= 0 and $self->cmp_version($version, '1.5') < 0 )) { +- croak "GnuPG Version 1.4 or 2.2+ required"; +- } +- waitpid $pid, 0; +- +- return $version; ++ # version detection is broken, hardcoding that we're on 2.2+ ++ return '2.3.7'; + } + + sub cmp_version($$) { +diff --git a/t/version_updates.t b/t/version_updates.t +deleted file mode 100644 +index 758ee7b..0000000 +--- a/t/version_updates.t ++++ /dev/null +@@ -1,30 +0,0 @@ +-#!/usr/bin/perl -w +- +-use strict; +- +-use lib './t'; +-use MyTest; +-use MyTestSpecific; +- +-TEST +-{ +- my $gpg = GnuPG::Interface->new(call => './test/fake-gpg-v1'); +- return ($gpg->version() eq '1.4.23'); +-}; +- +- +-TEST +-{ +- my $gpg = GnuPG::Interface->new(call => './test/fake-gpg-v2'); +- return ($gpg->version() eq '2.2.12'); +-}; +- +-TEST +-{ +- my $gpg = GnuPG::Interface->new(call => './test/fake-gpg-v1'); +- my $v1 = $gpg->version(); +- $gpg->call('./test/fake-gpg-v2'); +- my $v2 = $gpg->version(); +- +- return ($v1 eq '1.4.23' && $v2 eq '2.2.12'); +-} +-- +2.36.1 + diff --git a/srcpkgs/perl-GnuPG-Interface/patches/0002-Hardcode-path-to-usr-bin-gpg.patch b/srcpkgs/perl-GnuPG-Interface/patches/0002-Hardcode-path-to-usr-bin-gpg.patch new file mode 100644 index 00000000000..6052103f546 --- /dev/null +++ b/srcpkgs/perl-GnuPG-Interface/patches/0002-Hardcode-path-to-usr-bin-gpg.patch @@ -0,0 +1,38 @@ +From 4185798921211925d38e9ea2cd0f28f3eb32ddca Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= + +Date: Wed, 15 Jun 2022 13:10:01 +0200 +Subject: [PATCH 2/2] Hardcode path to /usr/bin/gpg + +--- + lib/GnuPG/Interface.pm | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/lib/GnuPG/Interface.pm b/lib/GnuPG/Interface.pm +index 7fd2321..ed2f49e 100644 +--- a/lib/GnuPG/Interface.pm ++++ b/lib/GnuPG/Interface.pm +@@ -76,7 +76,7 @@ sub gnupg_call { shift->call(@_); } + + sub BUILD { + my ( $self, $args ) = @_; +- $self->hash_init( call => 'gpg', %$args ); ++ $self->hash_init( call => '/usr/bin/gpg', %$args ); + } + + struct( +@@ -1183,9 +1183,8 @@ keys to list in a key-listing. + + =item call + +-This defines the call made to invoke GnuPG. Defaults to 'gpg'; this +-should be changed if 'gpg' is not in your path, or there is a different +-name for the binary on your system. ++This defines the call made to invoke GnuPG. Defaults to '/usr/bin/gpg'; this ++should be changed if there is a different name for the binary on your system. + + =item passphrase + +-- +2.36.1 + diff --git a/srcpkgs/perl-GnuPG-Interface/template b/srcpkgs/perl-GnuPG-Interface/template new file mode 100644 index 00000000000..20756374d95 --- /dev/null +++ b/srcpkgs/perl-GnuPG-Interface/template @@ -0,0 +1,15 @@ +# Template file for 'perl-GnuPG-Interface' +pkgname=perl-GnuPG-Interface +version=1.02 +revision=1 +wrksrc="${pkgname/perl-/}-$version" +build_style=perl-module +hostmakedepends="perl which gnupg" +makedepends="${hostmakedepends} perl-Moo perl-MooX-HandlesVia perl-MooX-late" +depends="${makedepends}" +short_desc="Perl interface GnuPG" +maintainer="Jan Christian Grünhage " +license="Artistic-1.0-Perl, GPL-1.0-or-later" +homepage="https://metacpan.org/release/GnuPG-Interface" +distfiles="${CPAN_SITE}/GnuPG/${pkgname/perl-/}-${version}.tar.gz" +checksum=c27a48c3d48e1a9205e362eeea66d46b032bd84637991fdf0b13828bcafdd3e6