diff a/picodrive/PKGBUILD b/picodrive/PKGBUILD --- a/picodrive/PKGBUILD 1969-12-31 17:00:00.000000000 -0700 +++ b/picodrive/PKGBUILD 1969-12-31 17:00:00.000000000 -0700 @@ -0,0 +1,52 @@ +# Maintainer: Noa Body + +pkgname=picodrive +pkgver=1.99.r127.g54f74b81 +pkgrel=1 +pkgdesc='Yet another Megadrive / Genesis / Sega CD / Mega CD / 32X / SMS emulator.' +arch=(x86_64) +url=http://notaz.gp2x.de +license=(GPL2) +depends=(alsa-lib hicolor-icon-theme libglvnd libpng sdl) +makedepends=(gendesk glu freeglut ffmpeg libepoxy mesa openal zlib) +source=("$pkgname"::git+https://github.com/irixxxx/"$pkgname".git + "$pkgname".patch) +provides=("$pkgname") +replaces=("$pkgname") +sha256sums=('SKIP' + '8c93fd9661d501b10e82f79bfda193d03ad68672329638b0741613be07687784') + +pkgver() { + cd "$pkgname" + git describe --long --abbrev=7 --tags | sed 's/^v//;s/_/./;s/\([^-]*-g\)/r\1/;s/-/./g' +} + +prepare() { + gendesk -f -n --name='Picodrive' --comment='A megadrive/genesis emulator' --custom='Keywords=game;console;' --exec="$pkgname" --icon="$pkgname" --terminal=false --categories='GNOME;GTK;Game' --startupnotify=false --pkgname="$pkgname" + git -C "$pkgname" submodule update --init --recursive + git -C "$pkgname" submodule update --checkout -f + patch -Np1 -i "$pkgname".patch + test -f "$pkgname.svg" || inkscape "$pkgname"/platform/opendingux/data/megadrive.png --export-plain-svg --export-filename="$pkgname".svg + cd "$pkgname" + perl -pi -e 's|(GL)ES(/gl\.h)|\1\2|gi' platform/libpicofe/gl{,_platform}.c + perl -pi -e 's|(LDFLAGS \+=) (-lEGL -lGLES)v1_CM|\1 -lGL \2v2|gi' Makefile + ./configure --with-sdl-gles=no + make clean +} + +build() { + cd "$pkgname" + make -j$(nproc) +} + +package() { + install -dm 755 "$pkgdir"/usr/{bin,share/{"$pkgname"/skin,applications,icons/hicolor/scalable/apps}} + install -m 755 "$pkgname"/PicoDrive "$pkgdir"/usr/share/"$pkgname"/picodrive + install -m 644 "$pkgname".desktop "$pkgdir"/usr/share/applications/ + install -m 644 "$pkgname"/platform/game_def.cfg "$pkgdir"/usr/share/"$pkgname"/ + install -m 644 "$pkgname"/pico/carthw.cfg "$pkgdir"/usr/share/"$pkgname"/ + install -m 644 "$pkgname"/platform/pandora/skin/* "$pkgdir"/usr/share/"$pkgname"/skin/ + mogrify "$pkgdir"/usr/share/"$pkgname"/skin/*.png + install -m 644 "$pkgname".svg "$pkgdir"/usr/share/icons/hicolor/scalable/apps/ + ln -rsf "$pkgdir"/usr/share/"$pkgname/$pkgname" "$pkgdir"/usr/bin/ +} diff a/picodrive/picodrive.patch b/picodrive/picodrive.patch index e69de29..feb733a 100644 --- a/picodrive/picodrive.patch 1969-12-31 17:00:00.000000000 -0700 +++ b/picodrive/picodrive.patch 1969-12-31 17:00:00.000000000 -0700 @@ -0,0 +1,38 @@ +diff a/picodrive/platform/libpicofe/in_sdl.c b/picodrive/platform/libpicofe/in_sdl.c +--- a/picodrive/platform/libpicofe/in_sdl.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/picodrive/platform/libpicofe/in_sdl.c 1969-12-31 17:00:00.000000000 -0700 +@@ -324,6 +324,34 @@ + } + break; + ++ case SDL_JOYHATMOTION: ++ if (event->jhat.which != state->joy_id) ++ return -2; ++ if (event->jhat.value == SDL_HAT_CENTERED) { ++ kc = state->axis_keydown[event->jhat.hat]; ++ state->axis_keydown[event->jhat.hat] = 0; ++ ret = 1; ++ } ++ else if (event->jhat.value & SDL_HAT_UP || event->jhat.value & SDL_HAT_LEFT) { ++ kc = state->axis_keydown[event->jhat.hat]; ++ if (kc) ++ update_keystate(state->keystate, kc, 0); ++ kc = (event->jhat.value & SDL_HAT_UP) ? SDLK_UP : SDLK_LEFT; ++ state->axis_keydown[event->jhat.hat] = kc; ++ down = 1; ++ ret = 1; ++ } ++ else if (event->jhat.value & SDL_HAT_DOWN || event->jhat.value & SDL_HAT_RIGHT) { ++ kc = state->axis_keydown[event->jhat.hat]; ++ if (kc) ++ update_keystate(state->keystate, kc, 0); ++ kc = (event->jhat.value & SDL_HAT_DOWN) ? SDLK_DOWN : SDLK_RIGHT; ++ state->axis_keydown[event->jhat.hat] = kc; ++ down = 1; ++ ret = 1; ++ } ++ break; ++ + case SDL_JOYBUTTONDOWN: + case SDL_JOYBUTTONUP: + if (event->jbutton.which != state->joy_id)