lfp


Logs | Files | README | LICENSE | GitLab


1
commit 674077467d1f51ac9b17a24b84d9a3038b3240d5
2
Author: wallentx <[email protected]>
3
Date:   Tue Oct 31 16:35:42 2023 -0500
4
5
    Remove usage of distutils, fix install from AUR
6
---
7
 Makefile                   |  5 ++---
8
 PKGBUILD                   |  5 ++---
9
 lfpreviewer/pyproject.toml |  3 +++
10
 lfpreviewer/setup.py       | 12 ++++++------
11
 4 files changed, 13 insertions(+), 12 deletions(-)
12
13
diff --git a/Makefile b/Makefile
14
index ac1b8bb..8e0253e 100644
15
--- a/Makefile
16
+++ b/Makefile
17
@@ -35,12 +35,11 @@ all: info
18
 
19
 lfpreviewer:
20
 	@echo -e "\n\e[1;33m[+]\e[0m Installing ${PREVIEWER}...\n"
21
-	@rm -rf ${PREVIEWER}/build ${PREVIEWER}/${PREVIEWER}.egg-info ${PREVIEWER}/dist
22
 	@${QUERY} ${PKGS} || ${INSTALL} ${PKGS}
23
 	@python3 -m pip install --upgrade pip
24
 	@python3 -m pip install --upgrade setuptools
25
-	@cd ${PREVIEWER} && python3 ./setup.py install && cd .. || true
26
-	@which lfpreviewer >/dev/null 2>&1 || echo -e "\n\e[1;31m[-]\e[0m Please ensure you have sufficient premission to install ${PREVIEWER}."
27
+	@cd ${PREVIEWER} && pip install . && cd .. || true
28
+	@which lfpreviewer >/dev/null 2>&1 || echo -e "\n\e[1;31m[-]\e[0m Please ensure you have sufficient permission to install ${PREVIEWER}."
29
 
30
 lfp:
31
 	@echo -e "\n\e[1;33m[+]\e[0m Installing ${PKG}...\n"
32
diff --git a/PKGBUILD b/PKGBUILD
33
index 3dba7a3..aa55b6b 100644
34
--- a/PKGBUILD
35
+++ b/PKGBUILD
36
@@ -8,7 +8,7 @@ license=('MIT')
37
 arch=('x86_64')
38
 install="lfp.install"
39
 url="https://gitlab.com/a4to/lfp"
40
-depends=(lf zsh ffmpeg graphicsmagick openslide ghostscript bat fzf dunst dialog xsel lolcat python3 python-docopt python-pillow python-attrs libxres python-setuptools)
41
+depends=(lf zsh ffmpeg graphicsmagick openslide ghostscript bat fzf dunst dialog xsel lolcat python3)
42
 conflicts=(lfp-git)
43
 optdepends=(
44
   'nodejs: to make use of lfps built in node actions manager'
45
@@ -32,8 +32,7 @@ package() {
46
   cd "$srcdir/${pkgname}-${pkgver}-${pkgrel}-${arch}/lfpreviewer" ||
47
   cd "$srcdir/${pkgname}/lfpreviewer"
48
 
49
-  pip3 install --user --upgrade --force-reinstall --no-deps setuptools wheel
50
-  python3 ./setup.py install --root="$pkgdir" --prefix=/usr --optimize=1
51
+  pip install . --root="$pkgdir" --prefix=/usr --no-deps
52
 
53
   cd "$srcdir/${pkgname}-${pkgver}-${pkgrel}-${arch}" >/dev/null 2>&1 ||
54
   cd "$srcdir/${pkgname}"
55
diff --git a/lfpreviewer/pyproject.toml b/lfpreviewer/pyproject.toml
56
new file mode 100644
57
index 0000000..9787c3b
58
--- /dev/null
59
+++ b/lfpreviewer/pyproject.toml
60
@@ -0,0 +1,3 @@
61
+[build-system]
62
+requires = ["setuptools", "wheel"]
63
+build-backend = "setuptools.build_meta"
64
diff --git a/lfpreviewer/setup.py b/lfpreviewer/setup.py
65
index 6608b67..3413522 100644
66
--- a/lfpreviewer/setup.py
67
+++ b/lfpreviewer/setup.py
68
@@ -1,9 +1,9 @@
69
 #!/usr/bin/env python3
70
 
71
-import lfpreviewer
72
-import distutils.core, setuptools, glob
73
+import setuptools
74
+import glob
75
 
76
-distutils.core.setup(
77
+setuptools.setup(
78
     name='lfpreviewer',
79
     version='0.1.0',
80
     description='Previewer for lfp',
81
@@ -14,10 +14,10 @@ distutils.core.setup(
82
     package_data={ '': ['*.sh'] },
83
     packages=setuptools.find_packages(),
84
     entry_points={ 'console_scripts': [
85
-        'lfpreviewer=lfpreviewer.__main__:main' ]
86
-    },
87
+        'lfpreviewer=lfpreviewer.__main__:main'
88
+    ]},
89
     ext_modules=[
90
-        distutils.core.Extension( "lfpreviewer.X", glob.glob("lfpreviewer/X/*.c"),
91
+        setuptools.Extension("lfpreviewer.X", glob.glob("lfpreviewer/X/*.c"),
92
         libraries=["X11", "Xext", "XRes"], include_dirs=["lfpreviewer/X"]),
93
     ],
94
     classifiers=[