Matoking / protontricks

A wrapper that does winetricks things for Proton enabled games, requires Winetricks.
GNU General Public License v3.0
1.64k stars 36 forks source link

pŕotontricks 1.10.2 fail to build in Slackware #211

Closed adcdam closed 11 months ago

adcdam commented 1 year ago

until version 1.9.1 i was using this patch to be able to build protontricks:

Since version 1.4.1 upstream has used setuptools-scm to determine the
current version number. Unfortunately the package in question does not
support GitHub release archives, using GitHub VCS snapshots would require
retrieving and updating commit hashes corresponding to release tags, and
PyPI tarballs do not contain tests. setuptools_scm_git_archive does not
help because it requires extra files to be included in the repository,
which upstream has not done.

Seeing as we already know the version number, bypass setuptools_scm
altogether and create the version file ourselves. For obvious reasons the
latter has to be done in ebuilds themselves.

--- a/setup.py
+++ b/setup.py
@@ -16,9 +16,6 @@

 setup(
     name="protontricks",
-    use_scm_version={
-        "write_to": "src/protontricks/_version.py"
-    },
     description=DESCRIPTION,
     long_description=LONG_DESCRIPTION,
     author=AUTHOR,

but now setup.py seems different

when i build protontricks version 1.10.2 i get this

/usr/lib64/python3.9/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
  warnings.warn(msg, warning_class)
Traceback (most recent call last):
  File "/tmp/SBo/protontricks-1.10.2/setup.py", line 4, in <module>
    setup(
  File "/usr/lib64/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib64/python3.9/site-packages/setuptools/_distutils/core.py", line 147, in setup
    _setup_distribution = dist = klass(attrs)
  File "/usr/lib64/python3.9/site-packages/setuptools/dist.py", line 476, in __init__
    _Distribution.__init__(
  File "/usr/lib64/python3.9/site-packages/setuptools/_distutils/dist.py", line 280, in __init__
    self.finalize_options()
  File "/usr/lib64/python3.9/site-packages/setuptools/dist.py", line 900, in finalize_options
    ep(self)
  File "/usr/lib64/python3.9/site-packages/setuptools_scm/integration.py", line 104, in infer_version
    _assign_version(dist, config)
  File "/usr/lib64/python3.9/site-packages/setuptools_scm/integration.py", line 51, in _assign_version
    _version_missing(config)
  File "/usr/lib64/python3.9/site-packages/setuptools_scm/__init__.py", line 106, in _version_missing
    raise LookupError(
LookupError: setuptools-scm was unable to detect version for /tmp/SBo/protontricks-1.10.2.

Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj

can you suply a patch to be able to build protontricks?

Matoking commented 1 year ago

The PyPI sdist contain the test files now, so that should be a viable option now if that was the blocking issue for using the upstream sources as-is.

If that doesn't work, the setuptools_scm configuration parameter was moved to pyproject.toml some time ago. Removing these lines from the file could do the trick:

--- a/pyproject.toml
+++ b/pyproject.toml
@@ -5,6 +5,3 @@ requires = [
     "setuptools-scm"
 ]
 build-backend = "setuptools.build_meta"
-
-[tool.setuptools_scm]
-write_to = "src/protontricks/_version.py"

I haven't tested it, however.

Matoking commented 11 months ago

Closing due to inactivity.