Received: by mail.netbsd.org (Postfix, from userid 605) id A443784D79; Mon, 18 Nov 2019 07:50:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 2B30184D65 for ; Mon, 18 Nov 2019 07:50:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id RLdOomGpBsOH for ; Mon, 18 Nov 2019 07:50:51 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 6DB0784D38 for ; Mon, 18 Nov 2019 07:50:51 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 61B63FA97; Mon, 18 Nov 2019 07:50:51 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_157406345128410" MIME-Version: 1.0 Date: Mon, 18 Nov 2019 07:50:51 +0000 From: "Roland Illig" Subject: CVS commit: pkgsrc/pkgtools/url2pkg To: pkgsrc-changes@NetBSD.org Reply-To: rillig@netbsd.org X-Mailer: log_accum Message-Id: <20191118075051.61B63FA97@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_157406345128410 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: rillig Date: Mon Nov 18 07:50:51 UTC 2019 Modified Files: pkgsrc/pkgtools/url2pkg: Makefile pkgsrc/pkgtools/url2pkg/files: url2pkg.py url2pkg_test.py Log Message: pkgtools/url2pkg: update to 19.3.7 Changes since 19.3.6: Detect whether the package uses GNU Make, based on the top-level Makefile. To generate a diff of this commit: cvs rdiff -u -r1.109 -r1.110 pkgsrc/pkgtools/url2pkg/Makefile cvs rdiff -u -r1.26 -r1.27 pkgsrc/pkgtools/url2pkg/files/url2pkg.py cvs rdiff -u -r1.24 -r1.25 pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_157406345128410 Content-Disposition: inline Content-Length: 4199 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/pkgtools/url2pkg/Makefile diff -u pkgsrc/pkgtools/url2pkg/Makefile:1.109 pkgsrc/pkgtools/url2pkg/Makefile:1.110 --- pkgsrc/pkgtools/url2pkg/Makefile:1.109 Thu Nov 14 20:03:47 2019 +++ pkgsrc/pkgtools/url2pkg/Makefile Mon Nov 18 07:50:51 2019 @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.109 2019/11/14 20:03:47 rillig Exp $ +# $NetBSD: Makefile,v 1.110 2019/11/18 07:50:51 rillig Exp $ -PKGNAME= url2pkg-19.3.6 +PKGNAME= url2pkg-19.3.7 CATEGORIES= pkgtools MAINTAINER= rillig@NetBSD.org Index: pkgsrc/pkgtools/url2pkg/files/url2pkg.py diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.26 pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.27 --- pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.26 Thu Nov 14 20:03:47 2019 +++ pkgsrc/pkgtools/url2pkg/files/url2pkg.py Mon Nov 18 07:50:51 2019 @@ -1,5 +1,5 @@ #! @PYTHONBIN@ -# $NetBSD: url2pkg.py,v 1.26 2019/11/14 20:03:47 rillig Exp $ +# $NetBSD: url2pkg.py,v 1.27 2019/11/18 07:50:51 rillig Exp $ # Copyright (c) 2019 The NetBSD Foundation, Inc. # All rights reserved. @@ -47,7 +47,7 @@ import re import subprocess import sys from pathlib import Path -from typing import Any, Callable, Dict, List, NamedTuple, Optional, Tuple, Union +from typing import Any, Callable, Dict, List, NamedTuple, Optional, Set, Tuple, Union class Var(NamedTuple): @@ -603,6 +603,9 @@ class Adjuster: # All these files will be included at the bottom of the Makefile. includes: List[str] + # the tools for USE_TOOLS. Examples are sed, echo, printf, perl5. + tools: Set[str] + # a list of variable assignments that will make up the fourth # paragraph of the package Makefile, where the build configuration # takes place. @@ -642,6 +645,7 @@ class Adjuster: self.bl3_lines = [] self.includes = [] self.build_vars = [] + self.tools = set() self.extra_vars = [] self.todos = [] self.pkgname_prefix = '' @@ -817,6 +821,10 @@ class Adjuster: if self.wrksrc_isfile('CMakeLists.txt'): self.build_vars.append(Var('USE_CMAKE', '=', 'yes')) + def adjust_gnu_make(self): + if self.wrksrc_isfile('Makefile') and self.wrksrc_grep('Makefile', r'^(?:ifeq|ifdef)\b'): + self.tools.add('gmake') + def adjust_meson(self): if self.wrksrc_isfile('meson.build'): self.includes.append('../../devel/meson/build.mk') @@ -1042,7 +1050,10 @@ class Adjuster: depend_vars.extend(Var('TEST_DEPENDS', '+=', d) for d in self.test_depends) lines.add_vars(*depend_vars) - lines.add_vars(*self.build_vars) + build_vars = self.build_vars + if self.tools: + build_vars.append(Var('USE_TOOLS', '+=', ' '.join(sorted(self.tools)))) + lines.add_vars(*build_vars) lines.add_vars(*self.extra_vars) lines.add(*self.bl3_lines) @@ -1074,6 +1085,7 @@ class Adjuster: self.adjust_descr() self.adjust_configure() self.adjust_cmake() + self.adjust_gnu_make() self.adjust_meson() self.adjust_gconf2_schemas() self.adjust_libtool() Index: pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.24 pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.25 --- pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.24 Mon Oct 28 20:17:24 2019 +++ pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py Mon Nov 18 07:50:51 2019 @@ -1,4 +1,4 @@ -# $NetBSD: url2pkg_test.py,v 1.24 2019/10/28 20:17:24 rillig Exp $ +# $NetBSD: url2pkg_test.py,v 1.25 2019/11/18 07:50:51 rillig Exp $ import pytest from url2pkg import * @@ -889,6 +889,16 @@ def test_Adjuster_adjust_cmake(tmp_path: assert str_vars(adjuster.build_vars) == ['USE_CMAKE=yes'] +def test_Adjuster_adjust_gnu_make(tmp_path: Path): + adjuster = Adjuster(g, '', Lines()) + adjuster.abs_wrksrc = tmp_path + (tmp_path / 'Makefile').write_text('ifdef HAVE_STDIO_H') + + adjuster.adjust_gnu_make() + + assert adjuster.tools == {'gmake'} + + def test_Adjuster_adjust_configure__none(tmp_path: Path): adjuster = Adjuster(g, '', Lines()) adjuster.abs_wrksrc = tmp_path --_----------=_157406345128410--