summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ae8e5d3a9502b60cd9e0fd4b80d9e0758414be84 (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
# Maintainer: username227 <gfrank227 [at] gmail [dot] com> 
_pkgname=torzu
_branch=main
pkgname=torzu-git
pkgver=r27242.fd908334a
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' 'fmt' 'catch2' 'enet' 'llvm-libs' 'freetype2' 'gcc-libs' 'glibc' 'glu' 'hicolor-icon-theme' 'gamemode' 'libass' 'libpulse' 'libtool' 'libvdpau' 'lz4' 'sdl2' 'zlib')
makedepends=('sdl2' 'curl' 'autoconf' 'cmake' 'gcc' '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-tools' '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')
conflicts=('torzu')
options=(!debug lto strip)
source=(
  git+https://notabug.org/litucks/torzu
  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-Tools.git
  git+https://github.com/KhronosGroup/SPIRV-Headers.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
  git+https://github.com/arun11299/cpp-jwt.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')
pkgver() {
    cd "$srcdir/$_pkgname"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "$_pkgname"
  for _submodule in enet cubeb libusb xbyak opus SDL cpp-httplib tzdb_to_nx libadrenotools simpleini cpp-jwt oaknut fmt;
  do
    git config submodule.$_submodule.url ../$_submodule
  done
  git config submodule.externals/SDL.url ../SDL
  git config submodule.externals/VulkanMemoryAllocator.url ../VulkanMemoryAllocator
  git config submodule.externals/SPIRV-Headers.url ../SPIRV-Headers
  git config submodule.externals/SPIRV-Tools.url ../SPIRV-Tools
  git config submodule.externals/Vulkan-Utility-Libraries.url ../Vulkan-Utility-Libraries
  git config submodule.externals/Vulkan-Headers.url ../Vulkan-Headers
  git -c protocol.file.allow=always submodule update
  
  cd $srcdir/$_pkgname/externals/cubeb
  git config submodule.cmake/sanitizers-cmake.url ../../../sanitizers-cmake
  git -c protocol.file.allow=always submodule update
  
  cd $srcdir/$_pkgname/externals/nx_tzdb/tzdb_to_nx
  git config submodule.externals/tz/tz.url ../../../../tz
  git -c protocol.file.allow=always submodule update
}

build() {
  cd "$srcdir/torzu"
   # Fix to help cmake find libusb
  CXXFLAGS+=" -I/usr/include/libusb-1.0"
  
  cmake -B build -G Ninja \
    -DYUZU_USE_BUNDLED_VCPKG=OFF \
    -DYUZU_CHECK_SUBMODULES=OFF \
    -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_CXX_FLAGS="-march=x86-64-v2" \
    -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
    -DENABLE_QT_TRANSLATION=OFF \
    -DENABLE_QT6=ON \
    -DYUZU_USE_EXTERNAL_SDL2=OFF \
    -DYUZU_USE_FASTER_LD=OFF \
    -DYUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS=OFF \
    -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \
    -DYUZU_USE_BUNDLED_FFMPEG=OFF \
    -DYUZU_ENABLE_LTO=ON \
    -DYUZU_CRASH_DUMPS=OFF \
    -DCMAKE_INSTALL_PREFIX="/usr" \
    -DYUZU_ROOM=OFF \
    -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
    -Wno-dev
  ninja -C build
} 

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

}