pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/49032: Package submission to add textproc/p5-Text-Hunspell to pkgsrc



The following reply was made to PR pkg/49032; it has been noted by GNATS.

From: "David H. Gutteridge" <dhgutteridge%sympatico.ca@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: pkg/49032: Package submission to add textproc/p5-Text-Hunspell to pkgsrc
Date: Thu, 16 Oct 2014 23:05:01 -0400

 Following up on this, I've answered one of my questions. The hunspell
 distribution expects pkgconfig will be used, in line with my patch to
 Makefile.PL. The original patch I was using could be improved a bit
 in terms of error handling, so I did so.
 
 This has been reported upstream as cpan.org bug #99548, as noted in
 the patch file.
 
 Revised files:
 
 distinfo:
 
 $NetBSD$
 
 SHA1 (Text-Hunspell-2.08.tar.gz) =3D =
 b83220400d473e7c5fce77d07d1df2a6ddea03f0
 RMD160 (Text-Hunspell-2.08.tar.gz) =3D =
 065b863d2d5ea4a3ad0167d60ce29c0b9de5b24c
 Size (Text-Hunspell-2.08.tar.gz) =3D 23590 bytes
 SHA1 (patch-Makefile.PL) =3D ca0a4537935b7d333d0be2099be20ee1bd4b4aa8
 
 patch-Makefile.PL:
 
 $NetBSD: patch-Makefile.PL Exp $
 
 The check to see if libhunspell is installed is redundant, since it's
 an explicit dependency that pkgsrc must provide. There's no unversioned
 libhunspell link installed by pkgsrc, so we must substitute a link with
 the major/minor suffix, which we find using ExtUtils::PkgConfig.
 
 This has been reported upstream as cpan.org bug #99548.
 
 --- Makefile.PL.orig	2013-03-26 15:52:12.000000000 -0400
 +++ Makefile.PL	2014-10-16 22:18:56.000000000 -0400
 @@ -1,6 +1,6 @@
 -use lib qw(inc);
 -use Config;
 -use Devel::CheckLib;
 +#use lib qw(inc);
 +#use Config;
 +#use Devel::CheckLib;
 =20
  #
  # Try to warn the user if linking might fail.
 @@ -8,53 +8,66 @@
  #
  # Probably too platform specific, but seemed an acceptable compromise.
  #
 -my $dlext =3D $Config{dlext} || 'so';
 -my $candidate_lib;
 -for (split " " =3D> $Config{libpth}) {
 -    my $lib_path =3D "$_/libhunspell.$dlext";
 -    #warn "Checking $lib_path\n";
 -    if (-e $lib_path) {
 -        $candidate_lib++;
 -        warn "Found '$lib_path'. Good.\n";
 -    }
 -}
 -
 -if (0 =3D=3D $candidate_lib) {
 -    my $def_lib =3D "/usr/lib/libhunspell";
 -    my ($possible_candidate) =3D glob("$def_lib-*.so");
 -    $possible_candidate ||=3D "/usr/lib/libhunspell-<ver>.so";
 -    warn =
 "---------------------------------------------------------------------\n";=
 
 -    warn "Your system doesn't appear to have a libhunspell.$dlext =
 link.\n";
 -    warn "Linking might fail. If it does, you might want to try =
 installing\n";
 -    warn "the libhunspell-dev package (or the equivalent on your OS) or =
 try:\n";
 -    warn "\n";
 -    warn "    $Config{lns} $possible_candidate $def_lib.so\n";
 -    warn =
 "---------------------------------------------------------------------\n";=
 
 -    warn "\n";
 -}
 -
 -check_lib_or_exit(
 -    lib =3D> 'hunspell',
 -    header =3D> 'hunspell/hunspell.h',
 -);
 +#my $dlext =3D $Config{dlext} || 'so';
 +#my $candidate_lib;
 +#for (split " " =3D> $Config{libpth}) {
 +#    my $lib_path =3D "$_/libhunspell.$dlext";
 +#    #warn "Checking $lib_path\n";
 +#    if (-e $lib_path) {
 +#        $candidate_lib++;
 +#        warn "Found '$lib_path'. Good.\n";
 +#    }
 +#}
 +#
 +#if (0 =3D=3D $candidate_lib) {
 +#    my $def_lib =3D "/usr/lib/libhunspell";
 +#    my ($possible_candidate) =3D glob("$def_lib-*.so");
 +#    $possible_candidate ||=3D "/usr/lib/libhunspell-<ver>.so";
 +#    warn =
 "---------------------------------------------------------------------\n";=
 
 +#    warn "Your system doesn't appear to have a libhunspell.$dlext =
 link.\n";
 +#    warn "Linking might fail. If it does, you might want to try =
 installing\n";
 +#    warn "the libhunspell-dev package (or the equivalent on your OS) =
 or try:\n";
 +#    warn "\n";
 +#    warn "    $Config{lns} $possible_candidate $def_lib.so\n";
 +#    warn =
 "---------------------------------------------------------------------\n";=
 
 +#    warn "\n";
 +#}
 +#
 +#check_lib_or_exit(
 +#    lib =3D> 'hunspell',
 +#    header =3D> 'hunspell/hunspell.h',
 +#);
 =20
  use ExtUtils::MakeMaker;
 +use ExtUtils::PkgConfig;
 =20
  my $CC =3D $ENV{"CXX"} || 'g++';
 =20
 -WriteMakefile(
 -    NAME          =3D> 'Text::Hunspell',
 -    VERSION_FROM  =3D> 'Hunspell.pm',
 -    LIBS          =3D> ['-lhunspell'],
 -    CC            =3D> $CC,
 -    LD            =3D> '$(CC)',
 -    PREREQ_PM     =3D> {}, # e.g., Module::Name =3D> 1.1
 -    XSOPT         =3D> '-C++',
 -    TYPEMAPS      =3D> ['perlobject.map', 'typemap'],
 -    META_MERGE    =3D> {
 -        resources =3D> {
 -            repository =3D> =
 'https://github.com/cosimo/perl5-text-hunspell',
 -        },
 -        keywords  =3D> [ qw(hunspell spelling spell-checker =
 text-processing) ],
 -    },
 -);
 +my $shlib_location =3D ExtUtils::PkgConfig->libs_only_l('hunspell');
 +my $header_location =3D ExtUtils::PkgConfig->cflags_only_I('hunspell');
 +
 +if ($shlib_location ne '' && $header_location ne '') {
 +	WriteMakefile(
 +		NAME          =3D> 'Text::Hunspell',
 +		VERSION_FROM  =3D> 'Hunspell.pm',
 +		LIBS          =3D> [$shlib_location],
 +		CC            =3D> $CC,
 +		LD            =3D> '$(CC)',
 +		PREREQ_PM     =3D> {}, # e.g., Module::Name =3D> 1.1
 +		XSOPT         =3D> '-C++',
 +		TYPEMAPS      =3D> ['perlobject.map', 'typemap'],
 +		META_MERGE    =3D> {
 +			resources =3D> {
 +				repository =3D> =
 'https://github.com/cosimo/perl5-text-hunspell',
 +			},
 +			keywords  =3D> [ qw(hunspell spelling =
 spell-checker text-processing) ],
 +		},
 +	);
 +}
 +else {
 +	# By default, ExtUtils::PkgConfig provides a verbose warning =
 about
 +	# being unable to locate the pkgconfig file and such. This adds =
 an
 +	# additional comment after that output.
 +	warn "You may need to install the libhunspell-dev package (or =
 the ";
 +	warn "equivalent on your OS).\n";
 +}
 
 Regards,
 
 Dave
 
 


Home | Main Index | Thread Index | Old Index