AUR (en) - evdevremapkeys-git
I'm not maintaining the package anymore but feel free to adopt!
→ Here is a PKGBUILD that fixes the build() issue, the license issue, the missing dependencies issue and also installs the example files and readme files to a documentation directory.
→ Here is a diff to your current PKGBUILD:
--- PKGBUILD.org 2022-10-28 15:13:47.749900254 +0200
+++ PKGBUILD 2022-10-28 15:39:35.909851827 +0200
@@ -8,4 +8,5 @@
license=('MIT')
-depends=()
-makedepends=('git' 'python' 'python-virtualenv' 'patchelf')
+depends=('python-pyudev' 'python-yaml' 'python-evdev' 'python-pyxdg')
+makedepends=('git' 'python' 'patchelf' 'python-build' 'python-installer' 'python-wheel')
+# 'python-virtualenv' # Needed if ./build-binary.sh is used
provides=("${pkgname%-git}")
@@ -23,3 +24,7 @@
cd "$srcdir/${pkgname%-git}"
- ./build-binary.sh
+ python -m build --wheel --no-isolation
+
+ #python setup.py build # Alternative
+
+ # ./build-binary.sh # Broken, see https://aur.archlinux.org/packages/evdevremapkeys-git#comment-865027
}
@@ -27,3 +32,14 @@
package() {
- install -D -m 755 "$srcdir/${pkgname%-git}/dist/evdevremapkeys" "$pkgdir/usr/bin/evdevremapkeys"
+ cd "$srcdir/${pkgname%-git}"
+ python -m installer --destdir="$pkgdir" --compile-bytecode=1 dist/*.whl
+
+ #python setup.py install --root="$pkgdir" --optimize=1 # Alternative
+
+ # install -D -m 755 "$srcdir/${pkgname%-git}/dist/evdevremapkeys" "$pkgdir/usr/bin/evdevremapkeys" # Belongs to broken installation method, see https://aur.archlinux.org/packages/evdevremapkeys-git#comment-865027
+
+ install -v -m755 -d "${pkgdir}/usr/share/doc/${pkgname%-git}"
+ for _docfile in examples/* README.md RUNNING.md; do
+ install -v -m644 -D "${_docfile}" "${pkgdir}/usr/share/doc/${pkgname%-git}/${_docfile}"
+ done
+ install -v -m644 -D 'LICENSE' "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.MIT.txt"
}
Thanks for maintaining!
Missing dependencies: python-pyudev, python-yaml, python-evdev, python-pyxdg.
Thanks for maintaining!
You also need to provide a custom license into /usr/share/licenses/${pkgname}/, since MIT is not a common license for Arch Linux.
Thanks for maintaining!
I get similar build error as @Ashark.
When building, I get an error:
<details> <summary>Spoiler</summary>
54 INFO: Caching module graph hooks...
57 INFO: Analyzing base_library.zip ...
Traceback (most recent call last):
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/bin/pyinstaller", line 8, in <module>
sys.exit(run())
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/PyInstaller/__main__.py", line 114, in run
run_build(pyi_config, spec_file, **vars(args))
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/PyInstaller/__main__.py", line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/PyInstaller/building/build_main.py", line 725, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/PyInstaller/building/build_main.py", line 672, in build
exec(code, spec_namespace)
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/evdevremapkeys.spec", line 6, in <module>
a = Analysis(['evdevremapkeys/evdevremapkeys.py'],
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/PyInstaller/building/build_main.py", line 242, in __init__
self.__postinit__()
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/PyInstaller/building/datastruct.py", line 160, in __postinit__
self.assemble()
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/PyInstaller/building/build_main.py", line 341, in assemble
self.graph = initialize_modgraph(
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/PyInstaller/depend/analysis.py", line 799, in initialize_modgraph
graph = PyiModuleGraph(
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/PyInstaller/depend/analysis.py", line 120, in __init__
self._analyze_base_modules()
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/PyInstaller/depend/analysis.py", line 288, in _analyze_base_modules
self._base_modules = [mod
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/PyInstaller/depend/analysis.py", line 290, in <listcomp>
for mod in self.import_hook(req)]
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/PyInstaller/lib/modulegraph/modulegraph.py", line 1496, in import_hook
target_package, target_module_partname = self._find_head_package(
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/PyInstaller/lib/modulegraph/modulegraph.py", line 1681, in _find_head_package
raise ImportError("No module named " + target_package_name)
ImportError: No module named _bootlocale
Traceback (most recent call last):
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/bin/staticx", line 8, in <module>
sys.exit(main())
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/staticx/__main__.py", line 49, in main
generate(args.prog, args.output,
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/staticx/api.py", line 320, in generate
gen.generate(output=output)
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/staticx/api.py", line 115, in generate
self._get_bootloader()
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/staticx/api.py", line 85, in _get_bootloader
prog_mach = get_machine(self.orig_prog)
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/staticx/elf.py", line 332, in get_machine
with open_elf(path) as elf:
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/staticx/elf.py", line 326, in open_elf
return ELFFileX.open(path, mode)
File "/home/andrew/.cache/yay/evdevremapkeys-git/src/evdevremapkeys/venv/lib/python3.10/site-packages/staticx/elf.py", line 271, in open
return cls(open(path, mode), path=path)
FileNotFoundError: [Errno 2] No such file or directory: './dist/evdevremapkeys'
</details>
Build fails due to missing python-hatchling. Please add it to makedepends. Thanks!