summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b49d95bbe6039aef81e230b4048bd44eb0498d00 (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: username227 <gfrank227 [at] gmail [dot] com> 
_pkgname=torzu
pkgname=torzu
pkgver=2024.08.10
_pkgver=2024-08-10
pkgrel=1
pkgdesc="Torzu is a fork of yuzu, the world's most popular, open-source, Nintendo Switch emulator. It is written in C++ with portability in mind."
arch=(x86_64)
url=https://notabug.org/litucks/torzu
license=(GPL-3.0-or-later)
provides=('torzu')
depends=('alsa-lib' 'brotli' 'catch2' 'enet' 'llvm-libs' 'freetype2' 'gcc-libs' 'glibc' 'glu' 'hicolor-icon-theme' 'gamemode' 'libass' 'libpulse' 'libtool' 'libvdpau' 'lz4' 'qt5-base' 'qt5-multimedia' 'qt5-webengine' 'sdl2' 'zlib')
makedepends=('curl' 'autoconf' 'cmake' 'gcc13' 'git' 'glslang' 'alsa-lib' 'glu' 'hidapi' 'libpulse' 'systemd-libs' 'xcb-util-wm' 'xcb-util-image' 'xcb-util-keysyms' 'xcb-util-renderutil' 'libxcb' 'libxext' 'libxkbcommon-x11' 'nasm' 'qt5-base' 'qt5-webengine' 'qt5-multimedia' 'mbedtls2' 'fmt' 'nlohmann-json' 'zstd' 'openssl' 'libunistring' 'aom' 'automake' 'base-devel' 'libass' 'freetype2' 'haskell-gnutls' 'lame' 'sdl2' 'libva' 'libvorbis' 'libxcb' 'meson' 'ninja' 'pkgconf' 'texinfo' 'wget' 'vasm' 'x264' 'x265' 'numactl' 'libvpx' 'libfdk-aac' 'libopusenc' 'ffmpeg' 'svt-av1' 'dav1d' 'boost' 'clang' 'vulkan-headers' 'ffmpeg4.4' 'zip' 'unzip' 'tar' 'boost-libs' 'spirv-headers')
conflicts=('torzu-git')
options=(!debug lto strip)
source=(
  git+https://notabug.org/litucks/torzu#tag=$_pkgver
  git+https://github.com/lsalzman/enet.git
  cubeb::git+http://github.com/mozilla/cubeb.git
  git+https://github.com/libusb/libusb.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/bylaws/libadrenotools.git
  git+https://github.com/lat9nq/tzdb_to_nx.git
  git+https://github.com/brofield/simpleini.git
  git+https://github.com/merryhime/oaknut.git
  git+https://github.com/KhronosGroup/SPIRV-Headers.git
  git+https://github.com/KhronosGroup/SPIRV-Tools.git
  git+https://github.com/fmtlib/fmt.git
  git+https://github.com/KhronosGroup/Vulkan-Utility-Libraries.git
  git+https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
  git+https://github.com/KhronosGroup/Vulkan-Headers.git
  # Submodule Submodules
  git+https://github.com/eggert/tz.git #submodule_of_tzdb_to_nx
  git+https://github.com/bylaws/liblinkernsbypass.git #submodule_of_libadrenogtools
  git+https://github.com/google/googletest.git #submodule_of_cubeb
  git+https://github.com/arsenm/sanitizers-cmake.git #submodule_of_cubeb
  )
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')

prepare() {
  cd "$srcdir/$_pkgname"
  git submodule update --init --recursive --depth 1
  for submodule in {enet,cubeb,libusb,xbyak,opus,SDL,cpp-httplib,ffmpeg,vcpkg,libadrenotools,tzdb_to_nx,simpleini,oaknut,SPIRV-Headers,SPIRV-Tools,fmt,Vulkan-Utility-Libraries,VulkanMemoryAllocator,Vulkan-Headers};
  do
    git config --file=.gitmodules submodule.$submodule.url "${srcdir}"/$submodule
  done
  git -c protocol.file.allow=always submodule update --init

  pushd externals/cubeb
  for submodule in {sanitiers-cmake,googletest};
  do
  git config --file=.gitmodules submodule.$submodule.url "${srcdir}"/$submodule
  done
  git -c protocol.file.allow=always submodule update --init
  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
}

build() {
  cd "$srcdir/torzu"
   # Fix to help cmake find libusb
  CXXFLAGS+=" -I/usr/include/libusb-1.0"
  
  cmake -B build -G Ninja \
    -DTORZU_USE_BUNDLED_VCPKG=ON \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_CXX_FLAGS="-march=x86-64-v2" \
    -DCMAKE_CXX_COMPILER=/usr/bin/g++-13 \
    -DCMAKE_C_COMPILER=/usr/bin/gcc-13 \
    -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
    -DENABLE_QT_TRANSLATION=OFF \
    -DUSE_DISCORD_PRESENCE=ON \
    -DYUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS=OFF \
    -DTORZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \
    -DTORZU_USE_BUNDLED_FFMPEG=ON \
    -DTORZU_ENABLE_LTO=ON \
    -DTORZU_CRASH_DUMPS=OFF \
    -DCMAKE_INSTALL_PREFIX="/usr" \
    -DTORZU_ROOM=OFF \
    -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
    -DFFmpeg_COMPONENTS="swscale;avutil;avfilter;avcodec" \
    -DFFmpeg_PREFIX=$srcdir/externals/ffmpeg/ffmpeg \
    -GNinja \
    -Wno-dev
  ninja -C build
} 

package() {
  DESTDIR="$pkgdir/" ninja -C $srcdir/torzu/build install

}