summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmytro Meleshko2021-05-21 11:07:02 +0300
committerDmytro Meleshko2021-05-21 11:09:04 +0300
commit7d1c2ae522da2d7def17725586cd63870d2c1380 (patch)
tree3575d1dc8d4f4e0e98a5606d6ecf3dde1852c9d6
downloadaur-7d1c2ae522da2d7def17725586cd63870d2c1380.tar.gz
initial commit, v0.11.1
-rw-r--r--.SRCINFO23
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD50
-rw-r--r--mirage-python3.patch103
4 files changed, 181 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..0b6e9603347
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = mirage-python3
+ pkgdesc = A fast and simple GTK+ Image Viewer (Python3 port)
+ pkgver = 0.11.1
+ pkgrel = 1
+ url = https://gitlab.com/thomasross/mirage
+ arch = any
+ license = GPL3
+ depends = python
+ depends = gtk3
+ depends = python-gobject
+ depends = python-cairo
+ depends = libgexiv2
+ provides = mirage
+ conflicts = mirage
+ source = mirage-python3-0.11.1.tar.bz2::https://gitlab.com/thomasross/mirage/-/archive/0.11.1/mirage-0.11.1.tar.bz2
+ source = mirage-python3-0.11.1.debian.tar.xz::https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/mirage/0.11.1-1build2/mirage_0.11.1-1build2.debian.tar.xz
+ source = mirage-python3.patch
+ sha256sums = 2932f7e9e6a1da7785cae2664669eff6f12ca26163afb3d1a3c8e1cc3255e5ec
+ sha256sums = 48b5cf3ff7d50d602ea673a424ffd659ab8813ce7dd1837b574cf39eb732c50a
+ sha256sums = 3e569cfaf6d2061a3692e33a2c85693d531cdaf1abf74ca0ea0e94a4823178b9
+
+pkgname = mirage-python3
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..13a5079bd32
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+/src/
+/pkg/
+/mirage-python3-*.pkg.tar.*
+
+/mirage-python3-*.tar.*
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..4ff772736af
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+# Maintainer: Dmytro Meleshko <dmytro dot meleshko at gmail dot com>
+# NOTE: DON'T FORGET TO CHECK IF THE DEBIAN PACKAGE HAS BEEN UPDATED!!!
+_pkgname=mirage
+pkgname="${_pkgname}-python3"
+pkgver=0.11.1
+pkgrel=1
+_debian_pkgrel=1build2
+pkgdesc="A fast and simple GTK+ Image Viewer (Python3 port)"
+arch=('any')
+url="https://gitlab.com/thomasross/mirage"
+license=('GPL3')
+provides=("${_pkgname}")
+conflicts=("${_pkgname}")
+depends=('python' 'gtk3' 'python-gobject' 'python-cairo' 'libgexiv2')
+source=("${pkgname}-${pkgver}.tar.bz2::https://gitlab.com/thomasross/${_pkgname}/-/archive/${pkgver}/${_pkgname}-${pkgver}.tar.bz2"
+ "${pkgname}-${pkgver}.debian.tar.xz::https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/${_pkgname}/${pkgver}-${_debian_pkgrel}/${_pkgname}_${pkgver}-${_debian_pkgrel}.debian.tar.xz"
+ "${pkgname}.patch")
+sha256sums=('2932f7e9e6a1da7785cae2664669eff6f12ca26163afb3d1a3c8e1cc3255e5ec'
+ '48b5cf3ff7d50d602ea673a424ffd659ab8813ce7dd1837b574cf39eb732c50a'
+ '3e569cfaf6d2061a3692e33a2c85693d531cdaf1abf74ca0ea0e94a4823178b9')
+
+prepare() {
+ cd "${_pkgname}-${pkgver}"
+ patch --forward --strip=1 --input="${srcdir}/${pkgname}.patch"
+}
+
+build() {
+ cd "${_pkgname}-${pkgver}"
+
+ local po_file; for po_file in po/*.po; do
+ local po_file_lang="$(basename "$po_file" .po)"
+ if [[ "$po_file_lang" != "messages" ]]; then
+ local mo_file_dir="mo/${po_file_lang}"
+ mkdir -p "$mo_file_dir"
+ local mo_file="${mo_file_dir}/${_pkgname}.mo"
+ echo "generating ${mo_file}"
+ msgfmt "$po_file" -o "$mo_file"
+ fi
+ done
+
+ glib-compile-resources --sourcedir="resources" --target="io.thomasross.${_pkgname}.gresource" "resources/${_pkgname}.gresource.xml"
+
+ python setup.py build
+}
+
+package() {
+ cd "${_pkgname}-${pkgver}"
+ python setup.py install --root="$pkgdir" --optimize=1 --skip-build
+ install -TDm644 "${srcdir}/debian/${_pkgname}.1" "${pkgdir}/usr/share/man/man1"
+}
diff --git a/mirage-python3.patch b/mirage-python3.patch
new file mode 100644
index 00000000000..fdace9cda10
--- /dev/null
+++ b/mirage-python3.patch
@@ -0,0 +1,103 @@
+diff --unified --recursive --text mirage-0.11.1.orig/setup.py mirage-0.11.1/setup.py
+--- mirage-0.11.1.orig/setup.py 2020-06-07 05:01:58.000000000 +0300
++++ mirage-0.11.1/setup.py 2021-05-21 10:43:25.456902888 +0300
+@@ -1,71 +1,8 @@
+ #!/usr/bin/env python3
+
+-import os
+-import subprocess
+-
+ from distutils.core import setup, Extension
+
+
+-def removeall(path):
+- if not os.path.isdir(path):
+- return
+-
+- files = os.listdir(path)
+-
+- for x in files:
+- fullpath = os.path.join(path, x)
+- if os.path.isfile(fullpath):
+- f = os.remove
+- rmgeneric(fullpath, f)
+- elif os.path.isdir(fullpath):
+- removeall(fullpath)
+- f = os.rmdir
+- rmgeneric(fullpath, f)
+-
+-
+-def rmgeneric(path, __func__):
+- try:
+- __func__(path)
+- except OSError:
+- pass
+-
+-
+-# Create mo files:
+-if not os.path.exists("mo/"):
+- os.mkdir("mo/")
+-for lang in (
+- "it",
+- "de",
+- "pl",
+- "es",
+- "fr",
+- "ru",
+- "hu",
+- "cs",
+- "pt_BR",
+- "zh_CN",
+- "nl",
+- "uk",
+- "sv",
+-):
+- pofile = "po/" + lang + ".po"
+- mofile = "mo/" + lang + "/mirage.mo"
+- if not os.path.exists("mo/" + lang + "/"):
+- os.mkdir("mo/" + lang + "/")
+- print("generating", mofile)
+- os.system("msgfmt %s -o %s" % (pofile, mofile))
+-
+-
+-print("Generating gresources bundle")
+-subprocess.call(
+- [
+- "glib-compile-resources",
+- "--sourcedir=resources",
+- "--target=io.thomasross.mirage.gresource",
+- "resources/mirage.gresource.xml",
+- ]
+-)
+-
+ setup(
+ name="Mirage",
+ version="0.11.1",
+@@ -120,27 +57,3 @@
+ ("share/locale/sv/LC_MESSAGES", ["mo/sv/mirage.mo"]),
+ ],
+ )
+-
+-# Cleanup (remove /build, /mo, and *.pyc files:
+-print("Cleaning up...")
+-try:
+- removeall("build/")
+- os.rmdir("build/")
+-except:
+- pass
+-try:
+- removeall("mo/")
+- os.rmdir("mo/")
+-except:
+- pass
+-try:
+- os.remove("io.thomasross.mirage.gresource")
+-except:
+- pass
+-try:
+- for f in os.listdir("."):
+- if os.path.isfile(f):
+- if os.path.splitext(os.path.basename(f))[1] == ".pyc":
+- os.remove(f)
+-except:
+- pass