summaryrefslogtreecommitdiff
path: root/libre/mcomix/PKGBUILD
blob: 1729fe341fae3f3e0acd78b71801a12868ccbd24 (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
# Maintainer (Arch): schuay <jakob.gruber@gmail.com>
# Contributor (Arch): Ray Powell <ray_al@xphoniexx.net>
# Maintainer (Hyperbola): André Silva <emulatorman@hyperbola.info>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname=mcomix
pkgver=1.3.0.dev0
pkgrel=2
pkgrel+=.parabola1
pkgdesc="A user-friendly, customizable image viewer specifically designed to handle comic books"
pkgdesc+=", without nonfree libunrar support"
arch=('any')
url="https://github.com/multiSnow/mcomix3"
license=('GPL')
depends=('gtk3' 'python-cairo' 'python-gobject' 'python-pillow')
makedepends=('git')
optdepends=('mupdf-tools: for pdf comics'
            'p7zip: for 7zip compressed comics')
conflicts=('mcomix-libre')
replaces=('mcomix-libre')
_commit=2f82616f34154624c78fb6eca3bc0cc5cdef0cf3  # gtk3
source=("git+https://github.com/multiSnow/mcomix3.git#commit=$_commit"
        'libre.patch')
sha256sums=('SKIP'
            '24f8302cc6d7b969c44883bb361137f59d13b21c959ed9c88918bc370c70351a')

prepare() {
  cd mcomix3
  # Remove nonfree unRAR support
  rm -v mcomix/mcomix/archive/rar{,_external}.py
  rm -v mime/icons/*/application-x-cbr.png
  patch -Np1 -i ${srcdir}/libre.patch
}

package() {
  cd mcomix3

  python installer.py --srcdir=mcomix --target="${pkgdir}"/usr/share

  install -dm755 "$pkgdir"/usr/bin
  ln -s /usr/share/mcomix/mcomixstarter.py "$pkgdir"/usr/bin/mcomix
  ln -s /usr/share/mcomix/comicthumb.py "$pkgdir"/usr/bin/comicthumb

  install -Dm644 mime/mcomix.desktop "$pkgdir"/usr/share/applications/mcomix.desktop
  install -Dm644 mime/mcomix.appdata.xml "$pkgdir"/usr/share/metainfo/mcomix.appdata.xml
  install -Dm644 mime/mcomix.xml "$pkgdir"/usr/share/mime/packages/mcomix.xml
  install -Dm644 mime/comicthumb.thumbnailer "$pkgdir"/usr/share/thumbnailers/comicthumb.thumbnailer

  for size in 16x16 22x22 24x24 32x32 48x48
  do
    install -dm755 "$pkgdir"/usr/share/icons/hicolor/$size/apps/
    install -Dm644 mcomix/mcomix/images/$size/mcomix.png "$pkgdir"/usr/share/icons/hicolor/$size/apps/mcomix.png
    install -Dm644 mime/icons/$size/application-x-cb7.png "$pkgdir"/usr/share/icons/hicolor/$size/mimetypes/application-x-cb7.png
    install -Dm644 mime/icons/$size/application-x-cbt.png "$pkgdir"/usr/share/icons/hicolor/$size/mimetypes/application-x-cbt.png
    install -Dm644 mime/icons/$size/application-x-cbz.png "$pkgdir"/usr/share/icons/hicolor/$size/mimetypes/application-x-cbz.png
  done

  install -Dm644 man/mcomix.1 "$pkgdir"/usr/share/man/man1/mcomix.1
  install -Dm644 man/comicthumb.1 "$pkgdir"/usr/share/man/man1/comicthumb.1
}