NetBSD Problem Report #49032
From www@NetBSD.org Fri Jul 25 03:31:47 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 52838A7481
for <gnats-bugs@gnats.NetBSD.org>; Fri, 25 Jul 2014 03:31:47 +0000 (UTC)
Message-Id: <20140725033145.14A06A74B1@mollari.NetBSD.org>
Date: Fri, 25 Jul 2014 03:31:45 +0000 (UTC)
From: dhgutteridge@sympatico.ca
Reply-To: dhgutteridge@sympatico.ca
To: gnats-bugs@NetBSD.org
Subject: Package submission to add textproc/p5-Text-Hunspell to pkgsrc
X-Send-Pr-Version: www-1.0
>Number: 49032
>Category: pkg
>Synopsis: Package submission to add textproc/p5-Text-Hunspell to pkgsrc
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: pkg-manager
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Fri Jul 25 03:35:00 +0000 2014
>Closed-Date: Mon Dec 08 09:21:55 +0000 2014
>Last-Modified: Mon Dec 08 09:25:01 +0000 2014
>Originator: David H. Gutteridge
>Release: n/a
>Organization:
>Environment:
n/a
>Description:
I've been using the CPAN package Text::Hunspell to do morphological
analysis of texts, and thought I'd tidy up my work and send it in, in
case someone else will find this of use. (What does Hunspell offer
that other spellers don't? Well, for one thing, word stemming in
English, and for another, more sophisticated facilities in languages
with better support, e.g. in French it'll identify genders of words,
and whether they're singular or plural, etc.)
The only quirk to deal with in packaging this is that pkgsrc doesn't
install an un-versioned symlink for libhunspell (unlike most other
libraries), so the input to MakeMaker has to be adjusted accordingly.
Assuming the hunspell package omits that symlink by design, I'm using
the Perl interface to Pkgconfig to get a usable name to link against,
as that seemed like the safest means.
>How-To-Repeat:
(Look for this package and find it doesn't exist.)
>Fix:
DESCR:
This module provides a Perl interface to the OO Hunspell library.
# $NetBSD: Makefile Exp $
DISTNAME= Text-Hunspell-2.08
PKGNAME= p5-${DISTNAME}
CATEGORIES= textproc perl5
MASTER_SITES= ${MASTER_SITE_PERL_CPAN:=Text/}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://search.cpan.org/dist/Text-Hunspell
COMMENT= Perl module to interface with GNU Hunspell
LICENSE= ${PERL5_LICENSE}
USE_LANGUAGES= c c++
PERL5_PACKLIST= auto/Text/Hunspell/.packlist
BUILD_DEPENDS+= p5-ExtUtils-PkgConfig:../../devel/p5-ExtUtils-PkgConfig
.include "../../lang/perl5/module.mk"
.include "../../textproc/hunspell/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
distinfo:
$NetBSD$
SHA1 (Text-Hunspell-2.08.tar.gz) = b83220400d473e7c5fce77d07d1df2a6ddea03f0
RMD160 (Text-Hunspell-2.08.tar.gz) = 065b863d2d5ea4a3ad0167d60ce29c0b9de5b24c
Size (Text-Hunspell-2.08.tar.gz) = 23590 bytes
SHA1 (patch-Makefile.PL) = 9d91c4c9b86b08d7dddf7463a9805f6a58963ccc
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.
--- Makefile.PL.orig 2013-03-26 15:52:12.000000000 -0400
+++ Makefile.PL 2014-07-24 21:37:09.000000000 -0400
@@ -1,6 +1,6 @@
-use lib qw(inc);
-use Config;
-use Devel::CheckLib;
+#use lib qw(inc);
+#use Config;
+#use Devel::CheckLib;
#
# Try to warn the user if linking might fail.
@@ -8,44 +8,45 @@
#
# Probably too platform specific, but seemed an acceptable compromise.
#
-my $dlext = $Config{dlext} || 'so';
-my $candidate_lib;
-for (split " " => $Config{libpth}) {
- my $lib_path = "$_/libhunspell.$dlext";
- #warn "Checking $lib_path\n";
- if (-e $lib_path) {
- $candidate_lib++;
- warn "Found '$lib_path'. Good.\n";
- }
-}
-
-if (0 == $candidate_lib) {
- my $def_lib = "/usr/lib/libhunspell";
- my ($possible_candidate) = glob("$def_lib-*.so");
- $possible_candidate ||= "/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 => 'hunspell',
- header => 'hunspell/hunspell.h',
-);
+#my $dlext = $Config{dlext} || 'so';
+#my $candidate_lib;
+#for (split " " => $Config{libpth}) {
+# my $lib_path = "$_/libhunspell.$dlext";
+# #warn "Checking $lib_path\n";
+# if (-e $lib_path) {
+# $candidate_lib++;
+# warn "Found '$lib_path'. Good.\n";
+# }
+#}
+#
+#if (0 == $candidate_lib) {
+# my $def_lib = "/usr/lib/libhunspell";
+# my ($possible_candidate) = glob("$def_lib-*.so");
+# $possible_candidate ||= "/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 => 'hunspell',
+# header => 'hunspell/hunspell.h',
+#);
use ExtUtils::MakeMaker;
+use ExtUtils::PkgConfig;
my $CC = $ENV{"CXX"} || 'g++';
WriteMakefile(
NAME => 'Text::Hunspell',
VERSION_FROM => 'Hunspell.pm',
- LIBS => ['-lhunspell'],
+ LIBS => [ExtUtils::PkgConfig->libs_only_l('hunspell')],
CC => $CC,
LD => '$(CC)',
PREREQ_PM => {}, # e.g., Module::Name => 1.1
>Release-Note:
>Audit-Trail:
From: "David H. Gutteridge" <dhgutteridge@sympatico.ca>
To: gnats-bugs@NetBSD.org
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
From: "David H. Gutteridge" <dhgutteridge@sympatico.ca>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/49032: Package submission to add textproc/p5-Text-Hunspell to pkgsrc
Date: Sun, 7 Dec 2014 17:04:38 -0500
The third time's the charm... The upstream maintainer took my patch,
making this quite a simple package now. New version:
DESCR:
This module provides a Perl interface to the OO Hunspell library.
Makefile:
# $NetBSD: Makefile Exp $
DISTNAME= Text-Hunspell-2.09
PKGNAME= p5-${DISTNAME}
CATEGORIES= textproc perl5
MASTER_SITES= ${MASTER_SITE_PERL_CPAN:=Text/}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://search.cpan.org/dist/Text-Hunspell
COMMENT= Perl module to interface with GNU Hunspell
LICENSE= ${PERL5_LICENSE}
USE_LANGUAGES= c c++
PERL5_PACKLIST= auto/Text/Hunspell/.packlist
BUILD_DEPENDS+= p5-ExtUtils-PkgConfig:../../devel/p5-ExtUtils-PkgConfig
.include "../../lang/perl5/module.mk"
.include "../../textproc/hunspell/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
distinfo:
$NetBSD$
SHA1 (Text-Hunspell-2.09.tar.gz) = c49d6a06d36d5e205106b7a46afeb10fab241dea
RMD160 (Text-Hunspell-2.09.tar.gz) = 33c9cb93fe8161799bf86ad38ed1855a4ac88818
Size (Text-Hunspell-2.09.tar.gz) = 18784 bytes
Dave
State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Mon, 08 Dec 2014 09:21:55 +0000
State-Changed-Why:
Imported, thank you!
(I just added "-[0-9]*" to the DEPENDS line; pkgling correctly warned about that.)
From: "Thomas Klausner" <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/49032 CVS commit: pkgsrc/textproc/p5-Text-Hunspell
Date: Mon, 8 Dec 2014 09:21:04 +0000
Module Name: pkgsrc
Committed By: wiz
Date: Mon Dec 8 09:21:04 UTC 2014
Added Files:
pkgsrc/textproc/p5-Text-Hunspell: DESCR Makefile distinfo
Log Message:
Import p5-Text-Hunspell-2.09 as textproc/p5-Text-Hunspell.
This module provides a Perl interface to the OO Hunspell library.
Provided by David H. Gutteridge in PR 49032.
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/textproc/p5-Text-Hunspell/DESCR \
pkgsrc/textproc/p5-Text-Hunspell/Makefile \
pkgsrc/textproc/p5-Text-Hunspell/distinfo
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.