Date: Monday, January 2, 2023 @ 07:43:04
Author: grawlinson
Revision: 1372865
archrelease: copy trunk to community-any
Added:
reuse/repos/community-any/PKGBUILD
(from rev 1372864, reuse/trunk/PKGBUILD)
reuse/repos/community-any/ftbfs-build.py.patch
(from rev 1372864, reuse/trunk/ftbfs-build.py.patch)
Deleted:
reuse/repos/community-any/PKGBUILD
----------------------+
PKGBUILD | 154 +++++++++++++++++++++++++++----------------------
ftbfs-build.py.patch | 116 ++++++++++++++++++++++++++++++++++++
2 files changed, 203 insertions(+), 67 deletions(-)
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2023-01-02 07:41:54 UTC (rev 1372864)
+++ PKGBUILD 2023-01-02 07:43:04 UTC (rev 1372865)
@@ -1,67 +0,0 @@
-# Maintainer: George Rawlinson <[email protected]>
-# Contributor: Max Mehl <aur at mehl dot mx>
-# SPDX-FileCopyrightText: 2019 Max Mehl
-# SPDX-License-Identifier: CC0-1.0
-
-pkgname=reuse
-_pkgname=reuse-tool
-pkgver=1.0.0
-pkgrel=2
-pkgdesc='Helper tool for providing and confirming copyright and licensing
information'
-arch=('any')
-url='https://github.com/fsfe/reuse-tool'
-license=('GPL3' 'Apache' 'custom:CC-BY-SA-4.0' 'custom:CC0-1.0')
-depends=(
- 'python'
- 'python-debian'
- 'python-requests'
- 'python-license-expression'
- 'python-boolean.py'
- 'python-jinja'
- 'python-binaryornot'
- 'python-setuptools'
-)
-makedepends=(
- 'git'
- 'python-setuptools-scm'
-)
-checkdepends=('python-pytest')
-optdepends=(
- 'git: git repository support'
- 'mercurial: mercurial repository support'
-)
-_commit='b0fd725328e42d98f6c8e60d2d3587dd728bbcc7'
-source=("$pkgname::git+$url#commit=$_commit")
-b2sums=('SKIP')
-
-pkgver() {
- cd "$pkgname"
-
- git describe --tags | sed 's/^v//'
-}
-
-build() {
- cd "$pkgname"
-
- python setup.py build
-}
-
-check() {
- cd "$pkgname"
-
- pytest
-}
-
-package() {
- cd "$pkgname"
-
- python setup.py install \
- --root="$pkgdir" \
- --optimize=1 \
- --skip-build
-
- # licenses
- install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSES/*
-
- sed -n '/## License/,$ p' README.md >
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-}
Copied: reuse/repos/community-any/PKGBUILD (from rev 1372864,
reuse/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2023-01-02 07:43:04 UTC (rev 1372865)
@@ -0,0 +1,87 @@
+# Maintainer: George Rawlinson <[email protected]>
+# Contributor: Max Mehl <aur at mehl dot mx>
+# SPDX-FileCopyrightText: 2019 Max Mehl
+# SPDX-License-Identifier: CC0-1.0
+
+pkgname=reuse
+pkgver=1.1.0
+pkgrel=1
+pkgdesc='Helper tool for providing and confirming copyright and licensing
information'
+arch=('any')
+url='https://reuse.software/'
+license=('GPL3' 'Apache' 'custom:CC0-1.0')
+depends=(
+ 'python'
+ 'python-debian'
+ 'python-license-expression'
+ 'python-boolean.py'
+ 'python-jinja'
+ 'python-binaryornot'
+ 'python-setuptools'
+)
+makedepends=(
+ 'git'
+ 'python-build'
+ 'python-installer'
+ 'python-wheel'
+ 'python-poetry-core'
+)
+checkdepends=('python-pytest')
+optdepends=(
+ 'git: git repository support'
+ 'mercurial: mercurial repository support'
+)
+_commit='1cd6ec56c825ba62e097a95b743edde76d4398ca'
+source=(
+ "$pkgname::git+https://github.com/fsfe/reuse-tool#commit=$_commit"
+ 'ftbfs-build.py.patch'
+)
+b2sums=('SKIP'
+
'52794da4f1c871591a0be306388aff4973ca0a90ad43162b8762c8c8c283122943ed8e383e1424307dff8e8112267f02ea6f5c66b28d45f6afb6ec583bd27a0d')
+
+pkgver() {
+ cd "$pkgname"
+
+ git describe --tags | sed 's/^v//'
+}
+
+build() {
+ cd "$pkgname"
+
+ # https://github.com/fsfe/reuse-tool/issues/640
+ # why does this look horrible?
+ # let me count the ways:
+
+ # 1. this creates the locale files, but not the rest of the actual package!
+ python -m build --wheel --no-isolation
+
+ # 2. this removes the problem
+ patch -p1 -i "$srcdir/ftbfs-build.py.patch"
+
+ # 3. this builds the rest of the actual package
+ python -m build --wheel --no-isolation
+}
+
+check() {
+ cd "$pkgname"
+
+ pytest -v
+}
+
+package() {
+ cd "$pkgname"
+
+ python -m installer --destdir="$pkgdir" dist/*.whl
+
+ # NFI what poetry is doing, it's installing stuff to the wrong directory
+ local site_packages=$(python -c "import site;
print(site.getsitepackages()[0])")
+ pushd "$pkgdir/$site_packages"
+ install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" AUTHORS.rst CHANGELOG.md
README.md
+ rm -rf AUTHORS.rst CHANGELOG.md README.md
+ popd
+
+ # licenses
+ install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSES/*
+
+ sed -n '/## License/,$ p' README.md >
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
Copied: reuse/repos/community-any/ftbfs-build.py.patch (from rev 1372864,
reuse/trunk/ftbfs-build.py.patch)
===================================================================
--- ftbfs-build.py.patch (rev 0)
+++ ftbfs-build.py.patch 2023-01-02 07:43:04 UTC (rev 1372865)
@@ -0,0 +1,116 @@
+--- a/build.py
++++ /dev/null
+@@ -1,103 +0,0 @@
+-#!/usr/bin/env python3
+-#
+-# SPDX-FileCopyrightText: 2017 Free Software Foundation Europe e.V.
<https://fsfe.org>
+-# SPDX-FileCopyrightText: 2022 Carmen Bianca Bakker <[email protected]>
+-#
+-# SPDX-License-Identifier: GPL-3.0-or-later
+-
+-"""Script called by poetry. The API used by poetry is unstable, but let's hope
+-this stays functional.
+-"""
+-
+-import glob
+-import os
+-import shutil
+-import subprocess
+-from pathlib import Path
+-from warnings import warn
+-
+-from setuptools import Distribution
+-from setuptools.command.build_py import build_py
+-
+-# pylint: disable=attribute-defined-outside-init
+-
+-
+-class Build(build_py):
+- """Redefined build."""
+-
+- def initialize_options(self):
+- super().initialize_options()
+- self.po_files = None
+- self.msgfmt = None
+- self.mo_outputs = []
+-
+- def finalize_options(self):
+- super().finalize_options()
+- self.po_files = glob.glob("po/*.po")
+- for msgfmt in ["msgfmt", "msgfmt.py", "msgfmt3.py"]:
+- self.msgfmt = shutil.which(msgfmt)
+- if self.msgfmt:
+- break
+-
+- def run(self):
+- super().run()
+- if self.msgfmt:
+- for po_file in self.po_files:
+- self.announce(f"compiling {po_file}")
+- lang_dir = str(
+- Path(self.build_lib)
+- / "reuse/locale"
+- / Path(po_file).stem
+- / "LC_MESSAGES"
+- )
+- destination = str(Path(lang_dir) / "reuse.mo")
+- compile_func = lambda msgfmt, in_file, out: subprocess.run(
+- [msgfmt, in_file, "-o", out],
+- check=True,
+- )
+-
+- self.mkpath(lang_dir)
+- self.make_file(
+- po_file,
+- destination,
+- compile_func,
+- (self.msgfmt, po_file, destination),
+- )
+- self.mo_outputs.append(destination)
+-
+- else:
+- warn("msgfmt is not installed. Translations will not be
included.")
+-
+- def get_outputs(self, include_bytecode=1):
+- return (
+- super().get_outputs(include_bytecode=include_bytecode)
+- + self.mo_outputs
+- )
+-
+-
+-def build():
+- """Main function that runs the compilation."""
+- distribution = Distribution(
+- {
+- "package_dir": {"": "src"},
+- }
+- )
+- cmd = Build(distribution)
+- cmd.inplace = 1
+- cmd.ensure_finalized()
+- cmd.run()
+-
+- # Copy into src/. This appears to be the thing that actually does all the
+- # heavy lifting. I'm not sure why I'm bothering with all the
+- # setuptools-specific logic above.
+- #
+- # In summary: Get .mo files from build directory and put them into
+- # src/reuse/locale/{lang}/LC_MESSAGES/reuse.mo.
+- for output in cmd.get_outputs():
+- relative = Path("src") / os.path.relpath(output, cmd.build_lib)
+- relative.parent.mkdir(parents=True, exist_ok=True)
+- shutil.copyfile(output, relative)
+-
+-
+-if __name__ == "__main__":
+- build()
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -68,7 +68,6 @@ reuse = 'reuse._main:main'
+
+ [tool.poetry.build]
+ generate-setup-file = false
+-script = "build.py"
+
+ [build-system]
+ requires = ["poetry-core>=1.1.0", "setuptools"]