summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c8e65c96b1ba51b6c3204b6274d77017cb4027a3 (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
59
60
61
# Note that the upstream source is unmaintained as of 2022, see:
# https://github.com/kode54/Game_Music_Emu/issues/22#issuecomment-1005423330
#
# libgme-git (or, when released, libgme >= 0.7.0) should be used instead.

pkgname=game_music_emu-kode54-git
pkgver=r192.fd803c8
pkgrel=1
pkgdesc="Multi-purpose console music emulator and player library (a.k.a. libgme) (kode54's fork)"
arch=(i686 x86_64)
url='https://bitbucket.org/losnoco/game_music_emu'
license=('LGPL2.1')
depends=('gcc-libs' 'glibc')
makedepends=('git' 'qt5-base')
conflicts=(libgme game_music_emu game_music_emu-kode54)
provides=(libgme game_music_emu game_music_emu-kode54)
source=("${pkgname}::git+https://github.com/kode54/Game_Music_Emu.git"
        'File_Extractor::git+https://github.com/kode54/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
}