summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-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 74c81e229de7..8b4631cfff04 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 063f272a8196..385b73fc5a3c 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 3a2aa8b3d9e3..c9b8688946d0 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 077ac39f7ffa..000000000000
--- 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:])