summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTorge Matthies2019-10-13 17:25:59 +0200
committerTorge Matthies2019-10-13 17:25:59 +0200
commit5e682b5c59631e42ed350072cb7090d4ee8294de (patch)
tree992b405a71707fceae559c7ddcfc0a7b12639cde
parent3f798d08c30e336de88b29935cbe7371a9421713 (diff)
downloadaur-5e682b5c59631e42ed350072cb7090d4ee8294de.tar.gz
Version 0.2-1
-rw-r--r--.SRCINFO12
-rw-r--r--PKGBUILD22
-rw-r--r--osu-file-extensions-handler.desktop2
-rwxr-xr-xosu-wine.py43
4 files changed, 21 insertions, 58 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 74c81e229de..8b4631cfff0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,18 +1,16 @@
pkgbase = osu-handler
pkgdesc = Provides a handler for osu! file formats
- pkgver = 0.1
+ pkgver = 0.2
pkgrel = 1
install = osu-handler.install
arch = any
- license = AGPL3
+ license = GPL3
depends = osu-mime
depends = desktop-file-utils
- depends = python
- depends = libnotify
- source = osu-wine.py
+ source = git+https://github.com/openglfreak/osu-handler-wine.git
source = osu-file-extensions-handler.desktop
- sha256sums = a2b57b360c508dc195bd8b1fd95c69b8f007ec3a22eda894d8ac234356ff8d44
- sha256sums = b629d7f99652bb96bc8f381dde7e455ba66fc1b69b472ee7762b7f5a1f641dc8
+ sha256sums = SKIP
+ sha256sums = 43f9ce9166b90f1aa47a48f0eab26131274cfaf17dcfe5964ebdb757632c95fb
pkgname = osu-handler
diff --git a/PKGBUILD b/PKGBUILD
index 063f272a819..385b73fc5a3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,20 +2,28 @@
pkgname=osu-handler
pkgdesc='Provides a handler for osu! file formats'
-pkgver=0.1
+pkgver=0.2
pkgrel=1
arch=(any)
-license=(AGPL3)
-depends=(osu-mime desktop-file-utils python libnotify)
+license=(GPL3)
+depends=(osu-mime desktop-file-utils)
install='osu-handler.install'
-source=(osu-wine.py
+source=(git+https://github.com/openglfreak/osu-handler-wine.git
osu-file-extensions-handler.desktop)
-sha256sums=('a2b57b360c508dc195bd8b1fd95c69b8f007ec3a22eda894d8ac234356ff8d44'
- 'b629d7f99652bb96bc8f381dde7e455ba66fc1b69b472ee7762b7f5a1f641dc8')
+sha256sums=('SKIP'
+ '43f9ce9166b90f1aa47a48f0eab26131274cfaf17dcfe5964ebdb757632c95fb')
+
+build() {
+ cd "$srcdir"
+
+ arch-meson osu-handler-wine build -D b_ndebug=true
+
+ ninja -C build
+}
package() {
cd "$pkgdir"
- install -D -m755 "$srcdir/osu-wine.py" 'usr/lib/osu-mime/osu-wine'
+ install -D -m755 "$srcdir/build/osu-handler-wine" 'usr/lib/osu-handler/osu-handler-wine'
install -D -m644 "$srcdir/osu-file-extensions-handler.desktop" 'usr/share/applications/osu-file-extensions-handler.desktop'
}
diff --git a/osu-file-extensions-handler.desktop b/osu-file-extensions-handler.desktop
index 3a2aa8b3d9e..c9b8688946d 100644
--- a/osu-file-extensions-handler.desktop
+++ b/osu-file-extensions-handler.desktop
@@ -2,7 +2,7 @@
Type=Application
Name=osu!
MimeType=application/x-osu-skin;application/x-osu-replay;application/x-osu-archive;
-Exec=/usr/lib/osu-mime/osu-wine start /ProgIDOpen osu! %f
+Exec=/usr/lib/osu-handler/osu-handler-wine start /ProgIDOpen osu! %f
NoDisplay=true
StartupNotify=true
Icon=osu!
diff --git a/osu-wine.py b/osu-wine.py
deleted file mode 100755
index 077ac39f7ff..00000000000
--- a/osu-wine.py
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/python3
-import sys
-import os
-
-def prog_paths():
- with os.scandir('/proc') as sd:
- for entry in sd:
- if entry.name.isdecimal() and entry.is_dir(follow_symlinks=False):
- yield entry
-
-def main(args):
- uid = os.getuid()
-
- for dirent in prog_paths():
- try:
- if dirent.stat().st_uid != uid:
- continue
-
- with open(dirent.path + '/comm', 'rb') as file:
- if file.read() != b'osu!.exe\n':
- continue
-
- exe_path = os.readlink(dirent.path + '/exe')
- if not exe_path.endswith('/wine-preloader'):
- continue
- wine_path = exe_path[:-len('-preloader')]
-
- with open(dirent.path + '/environ', 'rb') as file:
- environ = file.read()
- environ = environ.split(b'\0')
- environ = environ[:-1]
- environ = dict(x.split(b'=', maxsplit=1) for x in environ)
-
- del environ[b'WINELOADERNOEXEC']
- os.execve(wine_path, [wine_path] + args, environ)
- except OSError:
- pass
-
- os.execl('/usr/bin/notify-send', 'notify-send', '-i', 'osu!', '-a', 'osu!',
- 'No running osu! instance found')
-
-if __name__ == '__main__':
- main(sys.argv[1:])