pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/url2pkg



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.

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@localhost

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



Home | Main Index | Thread Index | Old Index