diff options
author | rillig <rillig@pkgsrc.org> | 2021-08-12 05:29:41 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2021-08-12 05:29:41 +0000 |
commit | 4434a1d41814317a7f7a31c8037e1b6a48b1931c (patch) | |
tree | e7e5fcf3c07f30f813752cb4871716f43154de92 /pkgtools/pkglint | |
parent | 87d2fb0dd90ebc752a97f6824df09f89ff515f12 (diff) | |
download | pkgsrc-4434a1d41814317a7f7a31c8037e1b6a48b1931c.tar.gz |
pkgtools/pkglint: update to 21.2.3
Changes since 21.2.2:
Temporarily disable the warning about Meson and gmake. It led to a
false positive in x11/libxkbcommon, where pkglint wrongly assumed that
the package would use gmake.
For packages using Meson, do not warn if an included package uses
CONFIGURE_ARGS.
Diffstat (limited to 'pkgtools/pkglint')
-rw-r--r-- | pkgtools/pkglint/Makefile | 5 | ||||
-rw-r--r-- | pkgtools/pkglint/files/package.go | 19 | ||||
-rw-r--r-- | pkgtools/pkglint/files/package_test.go | 35 |
3 files changed, 49 insertions, 10 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile index dee3a5cb40c..38277f360dc 100644 --- a/pkgtools/pkglint/Makefile +++ b/pkgtools/pkglint/Makefile @@ -1,7 +1,6 @@ -# $NetBSD: Makefile,v 1.693 2021/08/11 19:35:10 bsiegert Exp $ +# $NetBSD: Makefile,v 1.694 2021/08/12 05:29:41 rillig Exp $ -PKGNAME= pkglint-21.2.2 -PKGREVISION= 1 +PKGNAME= pkglint-21.2.3 CATEGORIES= pkgtools DISTNAME= tools MASTER_SITES= ${MASTER_SITE_GITHUB:=golang/} diff --git a/pkgtools/pkglint/files/package.go b/pkgtools/pkglint/files/package.go index d273ee7557f..db78ce44195 100644 --- a/pkgtools/pkglint/files/package.go +++ b/pkgtools/pkglint/files/package.go @@ -1194,7 +1194,7 @@ func (pkg *Package) checkMeson(mklines *MkLines) { func (pkg *Package) checkMesonGnuMake(mklines *MkLines) { gmake := mklines.Tools.ByName("gmake") - if gmake != nil && gmake.UsableAtRunTime() { + if G.Experimental && gmake != nil && gmake.UsableAtRunTime() { mkline := NewLineWhole(pkg.File(".")) mkline.Warnf("Meson packages usually don't need GNU make.") mkline.Explain( @@ -1204,12 +1204,19 @@ func (pkg *Package) checkMesonGnuMake(mklines *MkLines) { } func (pkg *Package) checkMesonConfigureArgs() { - if mkline := pkg.vars.FirstDefinition("CONFIGURE_ARGS"); mkline != nil { - mkline.Warnf("Meson packages usually don't need CONFIGURE_ARGS.") - mkline.Explain( - "After migrating a package from GNU make to Meson,", - "CONFIGURE_ARGS are typically not needed anymore.") + mkline := pkg.vars.FirstDefinition("CONFIGURE_ARGS") + if mkline == nil { + return } + + if pkg.Rel(mkline.Location.Filename).HasPrefixPath("..") { + return + } + + mkline.Warnf("Meson packages usually don't need CONFIGURE_ARGS.") + mkline.Explain( + "After migrating a package from GNU make to Meson,", + "CONFIGURE_ARGS are typically not needed anymore.") } func (pkg *Package) checkMesonPython(mklines *MkLines) { diff --git a/pkgtools/pkglint/files/package_test.go b/pkgtools/pkglint/files/package_test.go index 190d0074103..d7acf064cec 100644 --- a/pkgtools/pkglint/files/package_test.go +++ b/pkgtools/pkglint/files/package_test.go @@ -2619,6 +2619,14 @@ func (s *Suite) Test_Package_checkUseLanguagesCompilerMk__endian_mk(c *check.C) } func (s *Suite) Test_Package_checkMesonGnuMake(c *check.C) { + + // False positive in x11/libxkbcommon, 2021-08-12. + // + // It seems that the Tools registry is not initialized properly since + // x11/libxkbcommon does not mention gmake at all, and 'bmake show-all' + // also does not contain 'gmake'. + G.Experimental = true + t := s.Init(c) t.CreateFileLines("devel/meson/build.mk") @@ -2632,7 +2640,9 @@ func (s *Suite) Test_Package_checkMesonGnuMake(c *check.C) { G.Check(".") - // XXX: Giving the line number would be nice. + // XXX: Giving the line number where gmake is actually used by the + // package would be nice. Without that information, it is unclear why + // the package uses gmake at all. t.CheckOutputLines( "WARN: Meson packages usually don't need GNU make.") } @@ -2654,6 +2664,29 @@ func (s *Suite) Test_Package_checkMesonConfigureArgs(c *check.C) { "WARN: Makefile:20: Meson packages usually don't need CONFIGURE_ARGS.") } +func (s *Suite) Test_Package_checkMesonConfigureArgs__include(c *check.C) { + t := s.Init(c) + + t.CreateFileLines("devel/meson/build.mk") + t.CreateFileLines("devel/libcommon/use.mk", + MkCvsID, + "", + "CONFIGURE_ARGS+=\t--enable-feature") + t.SetUpPackage("category/package", + ".include \"../../devel/libcommon/use.mk\"", + ".include \"../../devel/meson/build.mk\"") + t.Chdir("category/package") + t.FinishSetUp() + + G.Check(".") + + // When checking the package x11/libxkbcommon, do not warn that + // converters/libiconv/builtin.mk defines CONFIGURE_ARGS, since that + // file may be used by other packages as well, or the relevant section + // may be guarded by '.if ${HAS_CONFIGURE}'. + t.CheckOutputEmpty() +} + func (s *Suite) Test_Package_checkMesonPython(c *check.C) { t := s.Init(c) |