summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 18f90600588a16c8de2c308af321745ee6ce72e5 (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
# Maintainer: Matti Niemenmaa <matti.niemenmaa+aur ät iki dȯt fi>

pkgname=game_music_emu-kode54-git
pkgver=r193.be0a069
pkgrel=1
pkgdesc="Multi-purpose console music emulator and player library (a.k.a. libgme) (kode54's fork)"
arch=(i686 x86_64)
url='https://gitlab.kode54.net/kode54/Game_Music_Emu'
license=('LGPL2.1')
depends=('gcc-libs' 'glibc')
makedepends=('git' 'qt5-base')
conflicts=('libgme')
provides=('libgme')
source=("${pkgname}::git+https://bitbucket.org/losnoco/game_music_emu.git"
        'File_Extractor::git+https://bitbucket.org/losnoco/file_extractor.git')
sha256sums=('SKIP' 'SKIP')

pkgver() {
   cd "$srcdir/$pkgname"
   printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
   cd "$srcdir/$pkgname"/prj/Game_Music_Emu

   # Call it libgme instead of libGame_Music_Emu.
   sed -i '/^TARGET /s/Game_Music_Emu/gme/' Game_Music_Emu.pro

   # gme/gme.txt identifies this as "0.6.0 Pre-release", generate
   # libgme.so.0.6.0 instead of libgme.so.1.0.0. Especially since libgme.so.0
   # is needed for compatibility with gstreamer0.10-bad-plugins.
   echo 'VERSION=0.6.0' >> Game_Music_Emu.pro

   # The header is already in INCLUDEPATH but the code needs adding to SOURCES.
   echo 'SOURCES += ../../../File_Extractor/fex/Data_Reader.cpp' >> Game_Music_Emu.pro

   # Don't request a static lib, it prevents a dynamic one from being built.
   sed -i '/^CONFIG /s/staticlib //' Game_Music_Emu.pro

   # Install the header file too.
   cat >> Game_Music_Emu.pro <<EOF
headers.path = /usr/include/gme
headers.files += ../../gme/gme.h
INSTALLS += headers
QMAKE_LFLAGS += -Wl,--allow-multiple-definition
EOF
}

build() {
   cd "$srcdir/$pkgname"/prj/Game_Music_Emu
   qmake Game_Music_Emu.pro
   make
}

package() {
   cd "$srcdir/$pkgname"/prj/Game_Music_Emu
   make INSTALL_ROOT="$pkgdir" install
}