summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0d3922b2358a34c936ab7a42586c76edc9c5ec90 (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
# Maintainer: heavysink <winstonwu91@gmail.com>

pkgname=townsemu-git
pkgver=3141.b6cbfbb
pkgrel=1
pkgdesc="An emulator of legendary Fujitsu FM TOWNS computer"
arch=('i686' 'x86_64')
url="https://github.com/captainys/TOWNSEMU"
license=('GPL')
depends=('alsa-lib' 'glu' 'llvm-libs')
makedepends=('git' 'cmake' 'clang')
provides=('townsemu')
conflicts=('townsemu')
source=("git+https://github.com/captainys/TOWNSEMU")
md5sums=('SKIP')

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

prepare() {
  cd TOWNSEMU
  mkdir -p build
  mkdir -p build_gui
  cd gui/src
  git clone https://github.com/captainys/public.git
  cd ..
  cd ..
  sed -i '1i #include <cstdio>' src/cmdutil/wav2snd.cpp
  sed -i '1i #include <cstdlib>' src/cmdutil/wav2snd.cpp
  sed -i '1i #include <cstdint>' src/ym2612/ym2612.h 
  sed -i '1i #include <cstdint>' src/externals/d77/d77.cpp 
  sed -i '1i #include <cstdint>' src/osdependent/filesys/filesys.h
  sed -i '1i #include <cstdint>' src/device/device.h
  sed -i '1i #include <cstdint>' src/rf5c68/rf5c68.h
  sed -i '1i #include <cstdio>' gui/src/public/src/yssimplesound/sample_fssimplewindow/main.cpp
  sed -i '1i #include <cstdlib>' gui/src/public/src/yssimplesound/sample_fssimplewindow/main.cpp
  sed -i '1i #include <cstdio>' gui/src/public/src/yssimplesound/sample/main.cpp
  sed -i '1i #include <cstdlib>' gui/src/public/src/yssimplesound/sample/main.cpp
}

build() {
  export CC=/usr/bin/clang
  export CXX=/usr/bin/clang++

  cd TOWNSEMU/build
  cmake ../src -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
  make
  cd ../build_gui
  cmake ../gui/src -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
  cmake --build main_gui
}

package() {
  cd TOWNSEMU/build

  install -m 755 -d "${pkgdir}/usr/bin"
  install -m 755 ./main_cui/Tsugaru_CUI ${pkgdir}/usr/bin/Tsugaru_CUI

  cd ../../TOWNSEMU/build_gui
  install -m 755 ./main_gui/Tsugaru_GUI ${pkgdir}/usr/bin/Tsugaru_GUI
}