summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 819efb05c781589593537c5c2089e67d81a952b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Maintainer: Cebtenzzre <cebtenzzre (at) gmail (dot) com>
_pkgname=dupeguru
pkgname="${_pkgname}-git"
pkgver=4.3.1.r40.g9ad84ade
pkgrel=1
pkgdesc='Find duplicate files on your system'
arch=('x86_64')
url='https://dupeguru.voltaicideas.net/'
license=('GPL3')
depends=('python' 'python-mutagen' 'python-polib' 'python-pyqt5' 'python-semantic-version'
         'python-send2trash' 'python-xxhash')
makedepends=('git' 'python-distro' 'python-sphinx')
checkdepends=('flake8' 'python-pytest' 'python-tox')
source=('git+https://github.com/arsenetar/dupeguru.git')
sha256sums=('SKIP')
provides=('dupeguru')
conflicts=('dupeguru' 'dupeguru-se' 'dupeguru-pe' 'dupeguru-me')

pkgver() {
  cd "$_pkgname"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "$_pkgname"

  # Ignore formatting-related test failures
  sed -i '/black --check/d' tox.ini

  # Update sphinx requirement
  sed -i 's/^\(sphinx>=5\.3\.0,<\)7\.0\.0$/\18.0.0/' requirements.txt

  # Fix tox python versions
  sed -i 's/^envlist = py36,py37,py38,py39,py310$/envlist = py37,py38,py39,py310,py311/' tox.ini
}

build() {
  cd "$_pkgname"
  python -m venv env --system-site-packages
  source env/bin/activate
  python -m pip install --no-index --find-links=deps -r requirements.txt
  python build.py --clean
}

check() {
  cd "$_pkgname"
  tox
}

package() {
  cd "$_pkgname"
  python package.py --arch-pkg
  cd "build/${_pkgname}-arch"

  mkdir -p "${pkgdir}/usr/share"/{'applications',"${_pkgname}"}
  mkdir -p "${pkgdir}/usr/lib/${_pkgname}"

  cp -a -- * "${pkgdir}/usr/lib/${_pkgname}/"

  mv "${pkgdir}/usr/lib/${_pkgname}/${_pkgname}.desktop" "${pkgdir}/usr/share/applications"
  mv "${pkgdir}/usr/lib/${_pkgname}"/*.png "${pkgdir}/usr/share/${_pkgname}"

  chmod a+x "${pkgdir}/usr/lib/${_pkgname}/run.py"

  mkdir -p "${pkgdir}/usr/bin"
  ln -s ../lib/${_pkgname}/run.py "${pkgdir}/usr/bin/${_pkgname}"
}