pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/url2pkg/files



Module Name:    pkgsrc
Committed By:   rillig
Date:           Wed Jan 17 17:18:15 UTC 2024

Modified Files:
        pkgsrc/pkgtools/url2pkg/files: Build.pm url2pkg.py url2pkg_test.py
        pkgsrc/pkgtools/url2pkg/files/python: url2pkg.py

Log Message:
url2pkg: use TOOL_DEPENDS for Perl and Python modules

Suggested by gdt@.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 pkgsrc/pkgtools/url2pkg/files/Build.pm
cvs rdiff -u -r1.51 -r1.52 pkgsrc/pkgtools/url2pkg/files/url2pkg.py
cvs rdiff -u -r1.47 -r1.48 pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py
cvs rdiff -u -r1.2 -r1.3 pkgsrc/pkgtools/url2pkg/files/python/url2pkg.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/files/Build.pm
diff -u pkgsrc/pkgtools/url2pkg/files/Build.pm:1.4 pkgsrc/pkgtools/url2pkg/files/Build.pm:1.5
--- pkgsrc/pkgtools/url2pkg/files/Build.pm:1.4  Sun Oct 27 19:19:55 2019
+++ pkgsrc/pkgtools/url2pkg/files/Build.pm      Wed Jan 17 17:18:14 2024
@@ -76,8 +76,8 @@ sub new(%) {
 sub create_build_script($) {
        my ($self) = @_;
 
-       $self->url2pkg_write_dependencies("BUILD_DEPENDS", "configure_requires");
-       $self->url2pkg_write_dependencies("BUILD_DEPENDS", "build_requires");
+       $self->url2pkg_write_dependencies("TOOL_DEPENDS", "configure_requires");
+       $self->url2pkg_write_dependencies("TOOL_DEPENDS", "build_requires");
        $self->url2pkg_write_dependencies("DEPENDS", "requires");
        $self->url2pkg_write_dependencies("TEST_DEPENDS", "test_requires");
        $self->url2pkg_write_dependencies("#RECOMMENDS", "recommends");

Index: pkgsrc/pkgtools/url2pkg/files/url2pkg.py
diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.51 pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.52
--- pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.51       Mon Oct 30 07:12:49 2023
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg.py    Wed Jan 17 17:18:14 2024
@@ -1,5 +1,5 @@
 #! @PYTHONBIN@
-# $NetBSD: url2pkg.py,v 1.51 2023/10/30 07:12:49 wiz Exp $
+# $NetBSD: url2pkg.py,v 1.52 2024/01/17 17:18:14 rillig Exp $
 
 # Copyright (c) 2019 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -683,6 +683,7 @@ class Adjuster:
     # "package>=version:../../category/package".
     depends: List[str]
     build_depends: List[str]
+    tool_depends: List[str]
     test_depends: List[str]
 
     # .include, interleaved with BUILDLINK3_API_DEPENDS.
@@ -731,6 +732,7 @@ class Adjuster:
         self.categories = []
         self.depends = []
         self.build_depends = []
+        self.tool_depends = []
         self.test_depends = []
         self.bl3_lines = []
         self.includes = []
@@ -783,6 +785,8 @@ class Adjuster:
             self.depends.append(value)
         elif kind == 'BUILD_DEPENDS':
             self.build_depends.append(value)
+        elif kind == 'TOOL_DEPENDS':
+            self.tool_depends.append(value)
         elif kind == 'TEST_DEPENDS':
             self.test_depends.append(value)
         else:
@@ -1199,6 +1203,8 @@ class Adjuster:
         depend_vars.extend(
             Var('BUILD_DEPENDS', '+=', d) for d in self.build_depends)
         depend_vars.extend(
+            Var('TOOL_DEPENDS', '+=', d) for d in self.tool_depends)
+        depend_vars.extend(
             Var('DEPENDS', '+=', d) for d in self.depends)
         depend_vars.extend(
             Var('TEST_DEPENDS', '+=', d) for d in self.test_depends)

Index: pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py
diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.47 pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.48
--- pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.47  Mon Oct 30 07:12:49 2023
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py       Wed Jan 17 17:18:14 2024
@@ -1,4 +1,4 @@
-# $NetBSD: url2pkg_test.py,v 1.47 2023/10/30 07:12:49 wiz Exp $
+# $NetBSD: url2pkg_test.py,v 1.48 2024/01/17 17:18:14 rillig Exp $
 
 # URLs for manual testing:
 #
@@ -772,8 +772,10 @@ def test_Adjuster_read_dependencies():
     child_process_output = [
         'DEPENDS\tpackage>=112.0:../../pkgtools/pkglint',
         'DEPENDS\tpackage>=120.0:../../pkgtools/x11-links',
-        'BUILD_DEPENDS\turl2pkg>=1.0',
-        'BUILD_DEPENDS\tdoes-not-exist>=1.0',
+        'BUILD_DEPENDS\turl2pkg>=1.0b',
+        'BUILD_DEPENDS\tdoes-not-exist-build>=1.0',
+        'TOOL_DEPENDS\turl2pkg>=1.0t',
+        'TOOL_DEPENDS\tdoes-not-exist-tool>=1.0',
         'TEST_DEPENDS\tpkglint',
         'A line that is not a dependency at all',
         '',
@@ -797,13 +799,19 @@ def test_Adjuster_read_dependencies():
         ".include \"../../pkgtools/x11-links/buildlink3.mk\"",
     ]
     assert adjuster.build_depends == [
-        'url2pkg>=1.0:../../pkgtools/url2pkg',
-        '# TODO: does-not-exist>=1.0',
+        'url2pkg>=1.0b:../../pkgtools/url2pkg',
+        '# TODO: does-not-exist-build>=1.0',
+    ]
+    assert adjuster.tool_depends == [
+        'url2pkg>=1.0t:../../pkgtools/url2pkg',
+        '# TODO: does-not-exist-tool>=1.0',
     ]
     assert adjuster.test_depends == ['pkglint>=0:../../pkgtools/pkglint']
     assert detab(adjuster.generate_lines()) == [
-        'BUILD_DEPENDS+= url2pkg>=1.0:../../pkgtools/url2pkg',
-        'BUILD_DEPENDS+= # TODO: does-not-exist>=1.0',
+        'BUILD_DEPENDS+= url2pkg>=1.0b:../../pkgtools/url2pkg',
+        'BUILD_DEPENDS+= # TODO: does-not-exist-build>=1.0',
+        'TOOL_DEPENDS+=  url2pkg>=1.0t:../../pkgtools/url2pkg',
+        'TOOL_DEPENDS+=  # TODO: does-not-exist-tool>=1.0',
         'DEPENDS+=       package>=112.0:../../pkgtools/pkglint',
         'TEST_DEPENDS+=  pkglint>=0:../../pkgtools/pkglint',
         '',
@@ -890,6 +898,7 @@ def test_Adjuster_generate_adjusted_Make
     # some dependencies whose directory is explicitly given
     adjuster.depends.append('depends>=11.0:../../devel/depends')
     adjuster.build_depends.append('build-depends>=12.0:../../devel/build-depends')
+    adjuster.tool_depends.append('tool-depends>=12.5:../../devel/tool-depends')
     adjuster.test_depends.append('test-depends>=13.0:../../devel/test-depends')
 
     lines = adjuster.generate_lines()
@@ -897,10 +906,10 @@ def test_Adjuster_generate_adjusted_Make
     assert detab(lines) == [
         mkcvsid,
         '',
-        '# TODO: dependency TOOL_DEPENDS # TODO: tool-depends>=6.0',
-        '',
         'BUILD_DEPENDS+= # TODO: build-depends>=7.0',
         'BUILD_DEPENDS+= build-depends>=12.0:../../devel/build-depends',
+        'TOOL_DEPENDS+=  # TODO: tool-depends>=6.0',
+        'TOOL_DEPENDS+=  tool-depends>=12.5:../../devel/tool-depends',
         'DEPENDS+=       # TODO: depends>=5.0',
         'DEPENDS+=       depends>=11.0:../../devel/depends',
         'TEST_DEPENDS+=  # TODO: test-depends>=8.0',

Index: pkgsrc/pkgtools/url2pkg/files/python/url2pkg.py
diff -u pkgsrc/pkgtools/url2pkg/files/python/url2pkg.py:1.2 pkgsrc/pkgtools/url2pkg/files/python/url2pkg.py:1.3
--- pkgsrc/pkgtools/url2pkg/files/python/url2pkg.py:1.2 Thu Aug 25 19:56:07 2022
+++ pkgsrc/pkgtools/url2pkg/files/python/url2pkg.py     Wed Jan 17 17:18:14 2024
@@ -1,4 +1,4 @@
-# $NetBSD: url2pkg.py,v 1.2 2022/08/25 19:56:07 rillig Exp $
+# $NetBSD: url2pkg.py,v 1.3 2024/01/17 17:18:14 rillig Exp $
 #
 # Forwards the module metadata from distutils and setuptools to url2pkg.
 
@@ -29,8 +29,8 @@ def setup(**kwargs):
     print_depends('DEPENDS', kwargs.get('requires', []))  # only for distutils.core
     print_depends('DEPENDS', kwargs.get('install_requires', []))
     print_depends('TEST_DEPENDS', kwargs.get('tests_require', []))
-    print_depends('BUILD_DEPENDS', kwargs.get('extras_require', {}).get('dev', []))
-    print_depends('BUILD_DEPENDS', kwargs.get('setup_requires', []))
+    print_depends('TOOL_DEPENDS', kwargs.get('extras_require', {}).get('dev', []))
+    print_depends('TOOL_DEPENDS', kwargs.get('setup_requires', []))
     print_var('COMMENT', kwargs.get('description', '').rstrip('.'))
     print_var('HOMEPAGE', kwargs.get('url', ''))
     print_license(kwargs.get('license', ''))



Home | Main Index | Thread Index | Old Index