summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8bbb5524f93f40533c3e24923ebd5e012e43d2d6 (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
# Maintainer: David Runge <dave@sleepmap.de>

pkgname=supercollider-git
_name="supercollider"
pkgver=3.10.0.r218.g794a842c86
pkgrel=1
pkgdesc="Environment and programming language for real time audio synthesis and algorithmic composition"
arch=('i686' 'x86_64' 'armv6h' 'armv7h')
url="https://supercollider.github.io/"
license=('GPL3')
depends=('boost-libs' 'desktop-file-utils' 'fftw' 'jack' 'qt5-svg'
'qt5-webengine' 'qt5-websockets' 'yaml-cpp')
makedepends=('boost' 'cmake' 'emacs' 'git' 'qt5-tools')
checkdepends=('xorg-server-xvfb')
optdepends=('emacs: emacs interface'
            'gedit: gedit interface'
            'sc3-plugins: additional extension plugins for scsynth')
conflicts=('supercollider')
provides=('supercollider')
source=("git+https://github.com/${_name}/${_name}.git#branch=develop"
        "use-system-boost.patch"
        "git+https://github.com/timblechmann/nova-simd.git"
        "git+https://github.com/timblechmann/nova-tt.git"
        "git+https://github.com/${_name}/hidapi.git"
        "git+https://github.com/${_name}/portaudio.git"
        "git+https://github.com/${_name}/yaml-cpp.git")
sha512sums=('SKIP'
            '0126a81b410c40bcbfaaaf07ecc8ce292b8eaf5d814eb5ad7c36c76e24b1a39d7b5bd607833b6082f92dd5a9aded7d8360b86a77021ead4a1860f548607e80bf'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP')

pkgver() {
  cd "${_name}"
  git describe --long --tags | sed 's/Version-//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${_name}"
  git submodule init
  git config submodule.external_libraries/nova-simd.url "${srcdir}/nova-simd"
  git config submodule.external_libraries/nova-tt.url "${srcdir}/nova-tt"
  git config submodule.external_libraries/hidapi.url "${srcdir}/hidapi"
  git config submodule.external_libraries/portaudio_sc_org.url "${srcdir}/portaudio"
  git config submodule.external_libraries/portaudio_sc_org.branch "${_name}"
  git config submodule.external_libraries/yaml-cpp.url "${srcdir}/yaml-cpp"
  git submodule update
  # make sure system boost is used:
  # https://github.com/supercollider/supercollider/issues/4096
  patch -Np1 -i ../use-system-boost.patch
  mkdir -p build
}

build() {
  cd "${_name}/build"
  _carch=$(uname -m)
  echo "$_carch architecture detected."
  case "$_carch" in
    "armv6l")
      export CC="gcc"
      export CXX="g++"
      cmake -DCMAKE_INSTALL_PREFIX=/usr \
            -DCMAKE_BUILD_TYPE=Release \
            -DLIBSCSYNTH=ON \
            -DFORTIFY=ON \
            -DSC_VIM=OFF \
            -DSYSTEM_BOOST=ON \
            -DSYSTEM_YAMLCPP=ON \
            -DSSE=OFF \
            -DSSE2=OFF \
            -DSUPERNOVA=OFF \
            -DNATIVE=OFF \
            -DSC_QT=OFF \
            -DSC_ED=OFF \
            -DSC_IDE=OFF \
            -DCMAKE_C_FLAGS='-march=armv6 -mfpu=vfp -mfloat-abi=hard' \
            -DCMAKE_CXX_FLAGS='-march=armv6 -mfpu=vfp -mfloat-abi=hard' \
             ..
    ;;
    "armv7l")
      export CC="gcc"
      export CXX="g++"
      cmake -DCMAKE_INSTALL_PREFIX=/usr \
            -DCMAKE_BUILD_TYPE=Release \
            -DLIBSCSYNTH=ON \
            -DFORTIFY=ON \
            -DSC_VIM=OFF \
            -DSYSTEM_BOOST=ON \
            -DSYSTEM_YAMLCPP=ON \
            -DSSE=OFF \
            -DSSE2=OFF \
            -DSUPERNOVA=OFF \
            -DNATIVE=OFF \
            -DSC_QT=OFF \
            -DSC_ED=OFF \
            -DSC_IDE=OFF \
            -DCMAKE_C_FLAGS='-march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon' \
            -DCMAKE_CXX_FLAGS='-march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon' \
            ..
    ;;
    *)
    cmake -DCMAKE_INSTALL_PREFIX=/usr \
          -DCMAKE_BUILD_TYPE=Release \
          -DLIBSCSYNTH=ON \
          -DFORTIFY=ON \
          -DSC_VIM=OFF \
          -DSYSTEM_BOOST=ON \
          -DSYSTEM_YAMLCPP=ON \
          ..
    ;;
  esac
  make VERBOSE=1
}

check() {
  cd "${_name}/build"
  xvfb-run make test ARGS="-V" || warning "Known failing tests: https://github.com/supercollider/supercollider/issues/3555"
}


package() {
  cd "${_name}/build"
  make DESTDIR="${pkgdir}/" install
  install -t "${pkgdir}/usr/share/doc/${pkgname}/" \
    -vDm 644 ../{AUTHORS,{CHANGELOG,README,README_LINUX}.md}
}