summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7eb545d1de4b8fd24d83ead46aef466aa8da3ad7 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>
# Based On: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=sdlmame-wout-toolkits
pkgver=0.218
pkgrel=1
pkgdesc="A port of the popular Multiple Arcade Machine Emulator using SDL with OpenGL support. Without Qt toolkit"
url='http://mamedev.org'
license=('custom:MAME License')
arch=('x86_64')
conflicts=('sdlmame'
           'sdlmamefamily-tools'
           'mame'
           )
depends=('sdl2_ttf'
         'lua'
         'flac'
         'portmidi'
         'portaudio'
         'libjpeg-turbo'
         'fontconfig'
         'sqlite'
         'libutf8proc'
         'pugixml'
         )
makedepends=('nasm'
             'mesa'
             'glu'
             'glm'
             'wget'
#              'asio'
             'python-sphinxcontrib-svg2pdfconverter'
             'rapidjson'
             )
source=("https://github.com/mamedev/mame/archive/mame${pkgver/./}.tar.gz"
        'mame.sh'
        'https://patch-diff.githubusercontent.com/raw/bkaradzic/GENie/pull/493.diff'
        'mame.desktop::https://git.archlinux.org/svntogit/community.git/plain/trunk/mame.desktop?h=packages/mame'
        'mame.svg::https://git.archlinux.org/svntogit/community.git/plain/trunk/mame.svg?h=packages/mame'
        )
sha256sums=('c855d2a53956d7ecc6b2d029747495278cd701dc785c50548f0f20ffa673b91f'
            '441ecf30fa03c13945947f56bb577b7e12c9a6cc287097fd969eb71be0f3ae85'
            'SKIP'
            '6beb883c8efed5b7466d43d0658b47c3e4a9928b5d0245ed56446b230e28306b'
            '17c442c933d764175e4ce1de50a80c0c2ddd5d733caf09c3cd5e6ba697ac43f4'
            )

install=sdlmame-wout-toolkits.install

prepare() {
  cd "mame-mame${pkgver/./}"

  patch -d 3rdparty/genie -p1 -i "${srcdir}/493.diff"
}

build() {
  cd "mame-mame${pkgver/./}"

  make PTR64=1 \
       SSE2=1 \
       OPTIMIZE=2 \
       NOWERROR=1 \
       ARCHOPTS=-flifetime-dse=1 \
       USE_QTDEBUG=0 \
       TOOLS=1 \
       TEST=0 \
       STRIP_SYMBOLS=1 \
       VERBOSE=1 \
       USE_SYSTEM_LIB_ASIO=0 \
       USE_SYSTEM_LIB_EXPAT=1 \
       USE_SYSTEM_LIB_ZLIB=1 \
       USE_SYSTEM_LIB_JPEG=1 \
       USE_SYSTEM_LIB_FLAC=1 \
       USE_SYSTEM_LIB_LUA=1 \
       USE_SYSTEM_LIB_SQLITE3=1 \
       USE_SYSTEM_LIB_PORTMIDI=1 \
       USE_SYSTEM_LIB_PORTAUDIO=1 \
       USE_SYSTEM_LIB_UTF8PROC=1 \
       USE_SYSTEM_LIB_GLM=1 \
       USE_SYSTEM_LIB_RAPIDJSON=1 \
       USE_SYSTEM_LIB_PUGIXML=1

}

package() {
  cd "mame-mame${pkgver/./}"

  # Install the sdlmame script
  install -Dm755 "${srcdir}/mame.sh" "${pkgdir}/usr/bin/mame"

  # Install the applications, and the UI font in /usr/share
  install -Dm755 mame64 "${pkgdir}/usr/lib/mame/mame"
  _apps=('castool'
         'chdman'
         'floptool'
         'imgtool'
         'jedutil'
         'ldresample'
         'ldverify'
         'nltool'
         'nlwav'
         'pngcmp'
         'regrep'
         'romcmp'
         'split'
         'src2html'
         'srcclean'
         'testkeys'
         'unidasm'
         )
  for i in "${_apps[@]}"; do
    install -Dm755 "${i}" "${pkgdir}/usr/lib/mame/${i}"
    ln -s "../lib/mame/${i}" "${pkgdir}/usr/bin/mame-${i}"
  done

  # Install the extra bits
  _extra=('artwork'
          'bgfx'
          'ctrlr'
          'hash'
          'hlsl'
          'keymaps'
          'language'
          'plugins'
          'roms'
          )
  for i in $(find ${_extra[@]} -type f); do install -Dm644 "${i}" "${pkgdir}/usr/lib/mame/${i}"; done
  (cd src/osd/modules/opengl/shader; for i in glsl*.*h; do install -Dm644 "${i}" "${pkgdir}/usr/lib/mame/shader/${i}"; done)
  install -Dm644 uismall.bdf "${pkgdir}/usr/lib/mame/fonts/uismall.bdf"

  # Install man
  (cd docs/man/; for i in $(find . -type f -name '*.1'); do install -Dm644 "${i}" "${pkgdir}/usr/share/man/man1/${i}"; done)
  (cd docs/man/; for i in $(find . -type f -name '*.6'); do install -Dm644 "${i}" "${pkgdir}/usr/share/man/man6/${i}"; done)

  # Include the license
  install -Dm644 docs/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

  # documentation
  (cd docs; make BUILDDIR="${pkgdir}/usr/share/doc/${pkgname}" html)
  for i in $(find "${pkgdir}/usr/share/doc/${pkgname}" -type f); do
    sed -e "s|${srcdir}||g" \
        -e "s|${pkgdir}||g" \
        -i "${i}"
  done

  # install desktop file and icon
  install -Dm644 "${srcdir}/mame.desktop" -t "${pkgdir}/usr/share/applications"
  install -Dm644 "${srcdir}/mame.svg" -t "${pkgdir}/usr/share/icons/hicolor/scalable/apps"

}