summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ff1f9e62ad50c6ab0486eb457b29338003dc84f5 (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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# Maintainer: Fijxu <fijxu [at] nadeko [dot] net> 
# Maintainer: HurricanePootis <hurricanepootis@protonmail.com>

_pkgname=suyu
_branch=dev
pkgname=suyu-dev-qt6-git
pkgver=r27354.b911ac8516
pkgrel=1
pkgdesc="suyu is the afterlife the world's most popular, open-source, Nintendo Switch emulator (dev branch with QT6)"
arch=(x86_64)
url=https://git.suyu.dev/suyu/suyu
license=(GPL-3.0-or-later)
provides=('suyu')
conflicts=(suyu-dev-git suyu-git)
provides=(suyu-dev-git suyu-git)
install=$pkgname.install
depends=(
  brotli
  enet
  llvm-libs
  gcc-libs
  glibc
  hicolor-icon-theme
  libavcodec.so
  libavutil.so
  libboost_context.so
  libcrypto.so
  libfmt.so
  libopus.so
  libspeexdsp.so
  libssl.so
  libusb-1.0.so
  libva.so
  libzstd.so
  lz4
  qt6-base
  qt6-multimedia
  qt6-webengine
  sdl2
  zlib
)
makedepends=(
  boost
  clang
  cmake
  ffmpeg
  git
  glslang
  llvm
  ninja
  nlohmann-json
  qt6-tools
  shaderc
  spirv-headers
  vulkan-utility-libraries
  catch2
  rapidjson
  mbedtls
)
options=(!debug lto)
source=(
  git+https://git.suyu.dev/suyu/suyu.git#branch=${_branch}
  git+https://github.com/lsalzman/enet.git
  git+https://github.com/mozilla/cubeb.git
  git+https://git.suyu.dev/suyu/dynarmic.git
  git+https://github.com/libusb/libusb.git
  git+https://git.suyu.dev/suyu/discord-rpc.git
  git+https://github.com/KhronosGroup/Vulkan-Headers.git
  git+https://git.suyu.dev/suyu/sirit.git
  git+https://git.suyu.dev/suyu/mbedtls.git
  git+https://github.com/herumi/xbyak.git
  git+https://github.com/xiph/opus.git
  git+https://github.com/libsdl-org/SDL.git
  git+https://github.com/yhirose/cpp-httplib.git
  ffmpeg::git+https://github.com/FFmpeg/FFmpeg.git
  git+https://github.com/microsoft/vcpkg.git
  git+https://github.com/arun11299/cpp-jwt.git
  git+https://github.com/bylaws/libadrenotools.git
  git+https://github.com/lat9nq/tzdb_to_nx.git
  git+https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
  git+https://git.suyu.dev/suyu/breakpad.git
  git+https://github.com/brofield/simpleini.git
  git+https://github.com/merryhime/oaknut.git
  git+https://github.com/KhronosGroup/Vulkan-Utility-Libraries.git
  # Submodule Submodules
  git+https://github.com/arsenm/sanitizers-cmake.git
  git+https://github.com/zyantific/zycore-c.git
  git+https://github.com/bylaws/liblinkernsbypass.git
  git+https://github.com/KhronosGroup/SPIRV-Headers.git
  git+https://github.com/eggert/tz.git
)
b2sums=('SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP'
        'SKIP')

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

prepare() {
  cd "$srcdir/$_pkgname"
  for submodule in {enet,cubeb,dynarmic,libusb,discord-rpc,Vulkan-Headers,sirit,mbedtls,xbyak,opus,SDL,cpp-httplib,ffmpeg,vcpkg,cpp-jwt,libadrenotools,tzdb_to_nx,VulkanMemoryAllocator,breakpad,simpleini,oaknut,Vulkan-Utility-Libraries};
  do
    git config --file=.gitmodules submodule.$submodule.url "${srcdir}"/$submodule
  done
  git -c protocol.file.allow=always submodule update --init

  pushd externals/cubeb
  git config submodule.cmake/sanitizers-cmake.url "${srcdir}"/sanitizers-cmake
  git -c protocol.file.allow=always submodule update
  popd

  pushd externals/dynarmic/externals/zydis
  git config submodule.dependencies/zycore.url "${srcdir}"/zycore
  git -c protocol.file.allow=always submodule update
  popd

  pushd externals/libadrenotools
  git config submodule.lib/linkersbypass.url "${srcdir}"/linkernsbypass
  git -c protocol.file.allow=always submodule update
  popd

  pushd externals/nx_tzdb/tzdb_to_nx
  git config submodule.externals/tz/tz.url "${srcdir}"/tz
  git -c protocol.file.allow=always submodule update
  popd

  pushd externals/sirit
  git config submodule.externals/SPIRV-Headers.url "${srcdir}"/SPIRV-Headers
  git -c protocol.file.allow=always submodule update
  popd
}

build() {
  if [[ $CXXFLAGS == *"-flto"* ]]; then
    flags+=("-DSUYU_ENABLE_LTO=ON")
  fi
  export CXXFLAGS+=' -Wno-switch'
  cmake -S suyu -B build -G Ninja \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_REPOSITORY=suyu-emu/suyu \
    -DBUILD_TAG=${_branch}-${pkgver} \
    -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF \
    -DENABLE_QT6=ON \
    -DENABLE_QT_TRANSLATION=ON \
    -DENABLE_SDL2=ON \
    -DENABLE_WEB_SERVICE=ON \
    -DSIRIT_USE_SYSTEM_SPIRV_HEADERS=ON \
    -DTITLE_BAR_FORMAT_IDLE="suyu | ${_branch}-${pkgver} {}" \
    -DTITLE_BAR_FORMAT_RUNNING="suyu | ${_branch}-${pkgver} | {}" \
    -DUSE_DISCORD_PRESENCE=ON \
    -DSUYU_CHECK_SUBMODULES=ON \
    -DSUYU_DOWNLOAD_TIME_ZONE_DATA=ON \
    -DSUYU_USE_BUNDLED_FFMPEG=OFF \
    -DSUYU_USE_BUNDLED_QT=OFF \
    -DSUYU_USE_BUNDLED_SDL2=OFF \
    -DSUYU_USE_EXTERNAL_VULKAN_HEADERS=OFF \
    -DSUYU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES=OFF \
    -DSUYU_USE_EXTERNAL_SDL2=OFF \
    -DSUYU_USE_FASTER_LD=OFF \
    -DSUYU_USE_PRECOMPILED_HEADERS=OFF \
    -DSUYU_USE_QT_MULTIMEDIA=ON \
    -DSUYU_USE_QT_WEB_ENGINE=ON \
    -DSUYU_TESTS=OFF \
    "${flags[@]}" \
    -Wno-dev
  cmake --build build
}

package() {
  DESTDIR="${pkgdir}" cmake --install build
  install -Dm644 ${_pkgname}/dist/72-suyu-input.rules -t "${pkgdir}"/usr/lib/udev/rules.d/
}

# vim: ts=2 sw=2 et