11# Maintainer: username227 <gfrank227 [at] gmail [dot] com>
22_pkgname=Citron
3+ _xbyak_tag=7.24.2
34pkgname=${_pkgname,,} -git
4- pkgver=0.6.1.canary.refresh.r14
5+ pkgver=0.6.1.canary.refresh.r15
56pkgrel=1
67pkgdesc=" Nintendo Switch emulator forked from yuzu"
78arch=(x86_64)
89url=https://git.citron-emu.org/Citron/Citron
910license=(GPL-3.0-or-later)
1011provides=(' citron' )
1112conflicts=(' citron' )
12- depends=(' boost-libs' ' hicolor-icon-theme' ' sdl2' ' qt6-base' ' qt6-webengine' ' fmt' ' opus' ' lz4' ' openssl ' ' zstd ' ' cubeb ' ' enet ' ' discord-rpc ' ' cpp-httplib ' ' dynarmic ' )
13- makedepends=( ' llvm ' ' git ' ' glslang ' ' cmake '
14- # 'xbyak' 'mbedtls'
15- # with xbyak we got the runtime err: terminate called after throwing an instance of 'Xbyak::Error' what(): bad size of register
13+ depends=(' boost-libs' ' hicolor-icon-theme' ' sdl2' ' qt6-base' ' qt6-webengine' ' fmt' ' opus' ' lz4'
14+ ' openssl ' ' zstd ' ' cubeb ' ' enet ' ' discord-rpc ' ' cpp-httplib ' ' dynarmic ' ' mbedtls2 ' ' ffmpeg '
15+ )
16+ makedepends=( ' llvm ' ' git ' ' glslang ' ' cmake ' ' ninja ' ' perl ' ' clang '
1617 ' qt6-tools' ' qt6-multimedia' ' libxkbcommon-x11' ' libzip' ' libfdk-aac' ' libinih'
17- ' vulkan-memory-allocator' ' vulkan-utility-libraries'
18- ' ninja' ' graphviz' ' doxygen' ' boost' ' catch2' ' nlohmann-json' ' rapidjson' ' robin-map' ' cpp-jwt' ' vulkan-headers' ' spirv-headers' ' clang' ' python' ' renderdoc'
19- ' gamemode' ' perl' ' yasm' ' python-jsonschema' ' python-jinja' )
18+ ' vulkan-memory-allocator' ' vulkan-utility-libraries' ' vulkan-headers' ' spirv-headers'
19+ ' boost' ' nlohmann-json' ' robin-map' ' cpp-jwt' ' gamemode' ' python'
20+
21+ # 'xbyak'
22+ # with xbyak we get the runtime err:
23+ # terminate called after throwing an instance of 'Xbyak::Error' what(): bad size of register
24+
25+ # for documentation
26+ # 'doxygen' 'renderdoc' 'python-jinja' 'python-jsonschema' 'graphviz'
27+
28+ # for testing
29+ # 'catch2'
30+ )
2031optdepends=(' qt6-wayland: for Wayland support' )
2132source=(
2233 git+${url} .git
2334 git+https://github.com/yuzu-mirror/sirit.git#commit=ab75463
24- git+https://github.com/yuzu-mirror/mbedtls.git#commit=8c88150
25- git+https://github.com/herumi/xbyak.git#commit=a1ac3750f9
26- ffmpeg::git+https://github.com/FFmpeg/FFmpeg.git#commit=99e2af4e78
35+ git+https://github.com/herumi/xbyak.git#tag=v${_xbyak_tag:- 7.22}
36+ # citron use xbyak v6.68 by default, but v7.22 is okay
2737 git+https://github.com/brofield/simpleini.git#commit=6048871ea9
2838 " https://github.com/lat9nq/tzdb_to_nx/releases/download/221202/221202.zip"
2939)
3040noextract=(' 221202.zip' )
3141b2sums=(' SKIP'
3242 ' 91e4cd03d67c930b6d751ca19cf6fbaaba86084412bd13b172186387ea27b461457a3e19bc0af315c807839e64f91c865298678af748e2d6e07df2abc85430ed'
33- ' 6198d4eea1f6618d4bed5fc3e6103245d42080a1b7a327ae566c6cae609fde64819c8b67284ec6a79ad42afb1c07bb809411f9277ea3e03325ef1ddfa181c2d1'
34- ' 10564f981204fe52c4c737a5c98ff4431e156ea0936355ee999656b7564329531fe832dfbf742642c33fbb86ab95b2a082dcd9415ef91b9089e282f535f10057'
35- ' ebc933862e140d108fa13328f8c4a6a3dbdf2a2155fbe9318c950fea2a700d0e64a646dcc96e9b54a68c2f261b1b2b12587a7fe0fc2490566e370a76a1470fc2'
43+ ' c3cd6fdac08d04ff996a082d51b87c98a46a0c07b17cf1c9e794c4fbb284860e6355c7c4d7b41a66293d8181ec17a18dac772fac384a324b6e7e144540430ac5'
3644 ' fae42bb13f180ab991f6bfc8a45ea3df08ced1d77db77f54cf5a222f93ea468bd6fc0d36d65f9f3739e9813d77dbae31931948dc9afa28e884c53b8128c13c94'
3745 ' 7bd0ff5ca80cf560344ae7edbfeb7c9466c096dc499a7348276cff5d30aa07464f7e2ea391ca9cedac0e21ba6f563169a8b38f2df729a230a0acfb1125ea1b66' )
3846pkgver () {
@@ -44,7 +52,6 @@ prepare() {
4452 local submods=(
4553 sirit
4654 simpleini
47- mbedtls
4855 xbyak
4956 )
5057
@@ -56,7 +63,6 @@ prepare() {
5663 fi
5764 done
5865
59- cp -rf ffmpeg/* $srcdir /$_pkgname /externals/ffmpeg/ffmpeg
6066 cd $srcdir /$_pkgname
6167 sed -i CMakeLists.txt \
6268 -e ' /-DBOOST_ASIO_DISABLE_CONCEPTS/d' \
@@ -66,27 +72,41 @@ prepare() {
6672 -e ' s|^add\_subdirectory(src)|add_subdirectory(externals)\n add_subdirectory(src)#|g'
6773 sed -i src/CMakeLists.txt \
6874 -e ' s|-Werror=shadow$|-Wno-error=shadow|g' \
69- -e ' s|-Werror=unused$|-Wno-error=unused|g'
70-
75+ -e ' s|-Werror=unused$|-Wno-error=unused|g' \
76+ -e ' s|include_directories(.|include_directories(. /usr/include/mbedtls2|g' \
77+ -e ' /include_directories/a link_directories(/usr/lib/mbedtls2)'
78+ sed -i src/${_pkgname,,} _cmd/CMakeLists.txt \
79+ -e " /target_include_directories(${_pkgname,,} -cmd/a target_link_libraries(${_pkgname,,} -cmd PRIVATE mbedtls mbedcrypto)"
80+ sed -i src/${_pkgname,,} /CMakeLists.txt \
81+ -e " /target_sources(${_pkgname,,} /i target_link_libraries(${_pkgname,,} PRIVATE mbedtls mbedcrypto)"
7182 sed -i src/video_core/host_shaders/CMakeLists.txt \
7283 -e ' s/--quiet //g' \
7384 -e ' s#${SPIRV_HEADER_FILE} ${SOURCE_FILE}#${SPIRV_HEADER_FILE} ${SOURCE_FILE} 2>/dev/null#g'
7485 sed -i -e ' s| (%2)||' src/${_pkgname,,} /aboutdialog.ui
7586 sed -i -e ' s|io_service|io_context|g' src/input_common/drivers/udp_client.cpp src/tests/input_common/calibration_configuration_job.cpp
76- sed -i -e ' s|u64|std::uint64_t|g' src/citron /discord_impl.h
87+ sed -i -e ' s|u64|std::uint64_t|g' src/${_pkgname,,} /discord_impl.h
7788 sed -i -e " s|https://github.com/lat9nq/tzdb_to_nx/releases/download/\$ {NX_TZDB_VERSION}|file://${srcdir} |g" externals/nx_tzdb/CMakeLists.txt
7889
7990 perl -0777 -i.original -pe ' s/(\s*target_compile_options\(video_core PRIVATE\s*-Wno-sign-conversion)/$1\n -msse4.1/igs' src/video_core/CMakeLists.txt
80-
8191 # see dynarmic 6.7.0 changelog
8292 sed -i src/core/arm/dynarmic/arm_dynarmic_{32,64}.cpp \
8393 -e ' /fastmem_pointer/s/nullptr/std::nullopt/g' \
8494 -e ' s|page_table->fastmem_arena;|(page_table->fastmem_arena != nullptr) ? std::optional<uintptr_t>{reinterpret_cast<uintptr_t>(page_table->fastmem_arena)} : std::nullopt;|g'
95+
96+ # this line causes crash, introduced in commit 54173384271
97+ sed -i externals/xbyak/xbyak/xbyak.h \
98+ -e ' /if (!(type & T_ALLOW_DIFF_SIZE) && r1.isREG() && r2.isREG() && r1.getBit() != r2.getBit()) XBYAK_THROW(ERR_BAD_SIZE_OF_REGISTER)/d'
99+ # system mbedtls
100+ sed -i externals/CMakeLists.txt \
101+ -e ' /add_subdirectory(mbedtls)/c pkg_check_modules(MbedTLS REQUIRED IMPORTED_TARGET GLOBAL mbedtls mbedcrypto)' \
102+ -e ' /target_include_directories(mbedtls/d' \
103+ -e ' /^ *target_compile_options(mbedcrypto/,/)/ { s/^/#/ }'
85104}
86105
87106build () {
88107 export CC=clang
89108 export CXX=clang++
109+ export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} :/usr/lib/mbedtls2/pkgconfig
90110
91111 local cmake_args=(
92112 -GNinja
0 commit comments