mirror of
https://notabug.org/litucks/torzu.git
synced 2026-01-12 02:32:25 +00:00
Compare commits
89 commits
2024-08-10
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63f808b365 | ||
|
|
e40391eedd | ||
|
|
6210feba12 | ||
|
|
641c18e1a8 | ||
|
|
295aa94a05 | ||
|
|
59bda52beb | ||
|
|
25c6aaec18 | ||
|
|
dee5dca459 | ||
|
|
fd908334af | ||
|
|
c72862af09 | ||
|
|
1ea9565cb4 | ||
|
|
945de31fb9 | ||
|
|
634acab40b | ||
|
|
8561b75518 | ||
|
|
15d00322a0 | ||
|
|
7bd0bfbb0c | ||
|
|
829fad8b66 | ||
|
|
b539eef054 | ||
|
|
f7849077e1 | ||
|
|
35f4aa964f | ||
|
|
5b478bdb9c | ||
|
|
b10bcac0cf | ||
|
|
cfbaa32d66 | ||
|
|
125f4e2372 | ||
|
|
4e6bf7e82e | ||
|
|
76516783d3 | ||
|
|
a426de1c51 | ||
|
|
335570dfd3 | ||
|
|
1319089702 | ||
|
|
a640bbee41 | ||
|
|
709f70a3b2 | ||
|
|
977ed0063a | ||
|
|
7c17d72b1a | ||
|
|
ff2e94b286 | ||
|
|
5de4fd6c76 | ||
|
|
8f1b45003b | ||
|
|
f78b30dbc4 | ||
|
|
e7e5906892 | ||
|
|
1526678a53 | ||
|
|
2384d30c2a | ||
|
|
e52e4ca429 | ||
|
|
a16e593fa8 | ||
|
|
f8ae0e4f2a | ||
|
|
b23dea24cd | ||
|
|
eaa9c9e3a4 | ||
|
|
3d24fc2f00 | ||
|
|
6ead429195 | ||
|
|
914def23f6 | ||
|
|
3f6a2bac86 | ||
|
|
bc4239dd9f | ||
|
|
20ac5cd42b | ||
|
|
d306ebea30 | ||
|
|
02cfee3f18 | ||
|
|
86f6184375 | ||
|
|
a04ba7cd1e | ||
|
|
bb142c9657 | ||
|
|
266eb0d318 | ||
|
|
d231c26e22 | ||
|
|
247f61e1f9 | ||
|
|
154aab7c4b | ||
|
|
56f062ac4d | ||
|
|
05ccbaa8fa | ||
|
|
95ef5431c5 | ||
|
|
066d0e7eaa | ||
|
|
14d40552e5 | ||
|
|
9efce71072 | ||
|
|
5de1cb53bb | ||
|
|
85dc40ad23 | ||
|
|
f45341ef55 | ||
|
|
4259889895 | ||
|
|
a9b7cae667 | ||
|
|
6d2368b07b | ||
|
|
f52a2c5d99 | ||
|
|
11cd91ea01 | ||
|
|
783e8952e0 | ||
|
|
15470284cf | ||
|
|
a41691dbbb | ||
|
|
1a0d98f984 | ||
|
|
eefc75732f | ||
|
|
d6ca4f11c1 | ||
|
|
ab4c093976 | ||
|
|
ec2e6dfdac | ||
|
|
7b143fb07e | ||
|
|
6e61673959 | ||
|
|
ee37c4989c | ||
|
|
e157415bd9 | ||
|
|
8eea774401 | ||
|
|
3785f2a2c8 | ||
|
|
587825f60a |
269 changed files with 52416 additions and 1087 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -5,6 +5,12 @@
|
|||
[Bb]uild*/
|
||||
doc-build/
|
||||
|
||||
# AppImageBuilder directory and torzu.AppImage
|
||||
AppImageBuilder/build/
|
||||
AppImageBuilder/appimagetool.AppImage
|
||||
AppImageBuilder/torzu.AppImage
|
||||
torzu.AppImage
|
||||
|
||||
# Generated source files
|
||||
src/common/scm_rev.cpp
|
||||
dist/english_plurals/generated_en.ts
|
||||
|
|
|
|||
9
.gitmodules
vendored
9
.gitmodules
vendored
|
|
@ -16,9 +16,6 @@
|
|||
[submodule "opus"]
|
||||
path = externals/opus
|
||||
url = https://github.com/xiph/opus.git
|
||||
[submodule "SDL"]
|
||||
path = externals/SDL
|
||||
url = https://github.com/libsdl-org/SDL.git
|
||||
[submodule "cpp-httplib"]
|
||||
path = externals/cpp-httplib
|
||||
url = https://github.com/yhirose/cpp-httplib.git
|
||||
|
|
@ -34,9 +31,6 @@
|
|||
[submodule "libadrenotools"]
|
||||
path = externals/libadrenotools
|
||||
url = https://github.com/bylaws/libadrenotools.git
|
||||
[submodule "tzdb_to_nx"]
|
||||
path = externals/nx_tzdb/tzdb_to_nx
|
||||
url = https://github.com/lat9nq/tzdb_to_nx.git
|
||||
[submodule "simpleini"]
|
||||
path = externals/simpleini
|
||||
url = https://github.com/brofield/simpleini.git
|
||||
|
|
@ -61,3 +55,6 @@
|
|||
[submodule "externals/Vulkan-Headers"]
|
||||
path = externals/Vulkan-Headers
|
||||
url = https://github.com/KhronosGroup/Vulkan-Headers.git
|
||||
[submodule "externals/SDL"]
|
||||
path = externals/SDL
|
||||
url = https://github.com/libsdl-org/SDL.git
|
||||
|
|
|
|||
99
AppImage-build-debian-inner.sh
Executable file
99
AppImage-build-debian-inner.sh
Executable file
|
|
@ -0,0 +1,99 @@
|
|||
#! /bin/bash
|
||||
set -e
|
||||
|
||||
# Make sure script is called from inside our container
|
||||
test -e /tmp/torzu-src-ro || (echo "Script MUST NOT be called directly!" ; exit 1)
|
||||
|
||||
# Set up environment
|
||||
export LANG=C.UTF-8
|
||||
export LC_ALL=C.UTF-8
|
||||
unset LC_ADDRESS LC_NAME LC_MONETARY LC_PAPER LC_TELEPHONE LC_MEASUREMENT LC_TIME
|
||||
|
||||
# Raise max open files count
|
||||
ulimit -n 50000
|
||||
|
||||
# Install dependencies
|
||||
apt -y install cmake ninja-build build-essential autoconf pkg-config locales wget git file mold libtool lsb-release wget software-properties-common gnupg \
|
||||
glslang-tools libssl-dev libavcodec-dev libavfilter-dev libavutil-dev libswscale-dev libpulse-dev libasound2-dev libudev-dev libice6
|
||||
if [ "$BUILD_QT" = 1 ]; then
|
||||
apt -y install libxcb-composite0-dev libxcb-damage0-dev libxcb-dpms0-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-ewmh-dev libxcb-present-dev libxcb-record0-dev libxcb-res0-dev libxcb-screensaver0-dev libxcb-xf86dri0-dev libxcb-xtest0-dev libxcb-xv0-dev libxcb-xvmc0-dev libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-cursor-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-util-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev libgl-dev
|
||||
else
|
||||
apt -y install qt6-base-dev qt6-base-private-dev qt6-multimedia-dev qt6-qpa-plugins
|
||||
fi
|
||||
if [ ! "$BUILD_USE_CPM" = 1 ]; then
|
||||
apt -y install libfmt-dev libenet-dev liblz4-dev nlohmann-json3-dev zlib1g-dev libopus-dev libsimpleini-dev libstb-dev libzstd-dev libusb-1.0-0-dev libcubeb-dev libcpp-jwt-dev libvulkan-dev gamemode-dev libasound2-dev libglu1-mesa-dev libxext-dev mesa-common-dev libva-dev
|
||||
|
||||
if [ ! -f /usr/local/lib/cmake/Boost-1.88.0/BoostConfigVersion.cmake ]; then
|
||||
# Install Boost
|
||||
wget https://archives.boost.io/release/1.88.0/source/boost_1_88_0.tar.bz2
|
||||
echo "Extracting Boost sources..."
|
||||
tar xf boost_1_88_0.tar.bz2
|
||||
cd boost_1_88_0
|
||||
./bootstrap.sh
|
||||
./b2 install --with-{headers,context,system,fiber,atomic,filesystem} link=static
|
||||
cd ..
|
||||
rm -rf boost_1_88_0 boost_1_88_0.tar.bz2
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install Clang
|
||||
if ([ "$BUILD_USE_CLANG" = 1 ] && ! clang-19 --version); then
|
||||
cd /tmp
|
||||
wget https://apt.llvm.org/llvm.sh
|
||||
chmod +x llvm.sh
|
||||
./llvm.sh 19
|
||||
rm llvm.sh
|
||||
fi
|
||||
|
||||
# Mount Torzu sources with temporary overlay
|
||||
cd /tmp
|
||||
mkdir torzu-src-upper torzu-src-work torzu-src
|
||||
mount -t overlay overlay -olowerdir=torzu-src-ro,upperdir=torzu-src-upper,workdir=torzu-src-work torzu-src
|
||||
|
||||
# Get extra configuration/compilation options
|
||||
EXTRA_COMPILE_FLAGS=""
|
||||
EXTRA_CMAKE_FLAGS=""
|
||||
if [ "$BUILD_USE_CLANG" = 1 ]; then
|
||||
export CC=clang-19 CXX=clang++-19
|
||||
EXTRA_CMAKE_FLAGS="-DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX"
|
||||
EXTRA_COMPILE_FLAGS="-fuse-ld=lld-19 -Wno-unused-command-line-argument"
|
||||
FATLTO_FLAG="-flto=full"
|
||||
else
|
||||
FATLTO_FLAG="-flto"
|
||||
fi
|
||||
if [ "$BUILD_USE_THIN_LTO" = 1 ]; then
|
||||
EXTRA_COMPILE_FLAGS="$EXTRA_COMPILE_FLAGS -flto=thin"
|
||||
fi
|
||||
if [ "$BUILD_USE_FAT_LTO" = 1 ]; then
|
||||
EXTRA_COMPILE_FLAGS="$EXTRA_COMPILE_FLAGS $FATLTO_FLAG"
|
||||
fi
|
||||
if [ "$BUILD_USE_CPM" = 1 ]; then
|
||||
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DYUZU_USE_CPM=ON"
|
||||
fi
|
||||
if [ "$BUILD_QT" = 1 ]; then
|
||||
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DYUZU_BUILD_QT6=ON"
|
||||
if [ "$BUILD_PREFER_STATIC" = 1 ]; then
|
||||
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DYUZU_BUILD_QT6_STATIC=ON"
|
||||
fi
|
||||
fi
|
||||
if [ "$BUILD_PREFER_STATIC" = 1 ]; then
|
||||
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DBUILD_SHARED_LIBS=OFF -DCMAKE_FIND_LIBRARY_SUFFIXES=.a;.so"
|
||||
fi
|
||||
|
||||
# Build Torzu
|
||||
cd /tmp
|
||||
mkdir torzu-build
|
||||
cd torzu-build
|
||||
cmake /tmp/torzu-src -GNinja -DCMAKE_BUILD_TYPE=Release -DYUZU_TESTS=OFF -DENABLE_QT_TRANSLATION=OFF -DSPIRV_WERROR=OFF -DSPIRV-Headers_SOURCE_DIR=/tmp/torzu-src/externals/SPIRV-Headers -DCMAKE_{C,CXX}_FLAGS="$EXTRA_COMPILE_FLAGS -fdata-sections -ffunction-sections" -DCMAKE_{EXE,SHARED}_LINKER_FLAGS="-Wl,--gc-sections" $EXTRA_CMAKE_FLAGS
|
||||
ninja || (
|
||||
echo "Compilation has failed. Dropping you into a shell so you can inspect the situation. Run 'ninja' to retry and exit shell once compilation has finished successfully."
|
||||
echo "Note that any changes made here will not be reflected to the host environment."
|
||||
bash
|
||||
)
|
||||
|
||||
# Generate AppImage
|
||||
cp -rv /tmp/torzu-src/AppImageBuilder /tmp/AppImageBuilder
|
||||
cd /tmp/AppImageBuilder
|
||||
./build.sh /tmp/torzu-build /tmp/torzu.AppImage || echo "This error is known. Using workaround..."
|
||||
cp /lib/$(uname -m)-linux-gnu/libICE.so.6 build/
|
||||
mv build /tmp/hosttmp/torzu-debian-appimage-rootfs
|
||||
85
AppImage-build-debian.sh
Executable file
85
AppImage-build-debian.sh
Executable file
|
|
@ -0,0 +1,85 @@
|
|||
#! /bin/bash
|
||||
set -e
|
||||
|
||||
# Parse options
|
||||
for i in "$@"
|
||||
do
|
||||
case $i in
|
||||
-l|--clang)
|
||||
export BUILD_USE_CLANG=1
|
||||
echo "-> Using Clang for compilation."
|
||||
;;
|
||||
-o|--thin-lto)
|
||||
export BUILD_USE_THIN_LTO=1
|
||||
echo "-> Thin link time optimization enabled."
|
||||
;;
|
||||
-O|--fat-lto)
|
||||
export BUILD_USE_FAT_LTO=1
|
||||
echo "-> Fat link time optimization enabled."
|
||||
;;
|
||||
-p|--use-cpm)
|
||||
export BUILD_USE_CPM=1
|
||||
echo "-> Using CPM to download most dependencies."
|
||||
;;
|
||||
-q|--build-qt)
|
||||
export BUILD_QT=1
|
||||
echo "-> Building Qt."
|
||||
;;
|
||||
-s|--prefer-static)
|
||||
export BUILD_PREFER_STATIC=1
|
||||
export QTSTATIC=true
|
||||
echo "-> Preferring static libraries."
|
||||
;;
|
||||
-k|--keep-rootfs)
|
||||
BUILD_KEEP_ROOTFS=1
|
||||
echo "-> Not deleting rootfs after successful build."
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 [--clang/-l] [--thin-lto/-o] [--fat-lto/-O] [--use-cpm/-p] [--build-qt/-q] [--prefer-static/-s] [--keep-rootfs/-k]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Make sure options are valid
|
||||
if [ "$BUILD_USE_THIN_LTO" = 1 ] && [ "$BUILD_USE_CLANG" != 1 ]; then
|
||||
echo "Thin LTO can't be used without Clang!"
|
||||
exit 2
|
||||
fi
|
||||
if [ "$BUILD_USE_THIN_LTO" = 1 ] && [ "$BUILD_USE_FAT_LTO" = 1 ]; then
|
||||
echo "Only either thin or fat LTO can be used!"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Get torzu source dir
|
||||
TORZU_SOURCE_DIR="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
|
||||
echo "-> Source dir is $TORZU_SOURCE_DIR"
|
||||
rm -rf "$TORZU_SOURCE_DIR/AppImageBuilder/build"
|
||||
|
||||
# Generate debian rootfs
|
||||
cd /tmp
|
||||
echo "Cleaning up before build..."
|
||||
rm -rf torzu-debian-appimage-rootfs
|
||||
if ! [ -d rootfs-torzu-appimage-build ]; then
|
||||
debootstrap bookworm rootfs-torzu-appimage-build http://deb.debian.org/debian/
|
||||
else
|
||||
rm -rf rootfs-torzu-appimage-build/tmp/*
|
||||
fi
|
||||
bwrap --bind rootfs-torzu-appimage-build / \
|
||||
--unshare-pid \
|
||||
--dev-bind /dev /dev --proc /proc --ro-bind /sys /sys --dev-bind /run /run \
|
||||
--tmpfs /var/tmp \
|
||||
--chmod 1777 /tmp \
|
||||
--ro-bind /etc/resolv.conf /etc/resolv.conf \
|
||||
--ro-bind "$TORZU_SOURCE_DIR" /tmp/torzu-src-ro \
|
||||
--chdir / \
|
||||
--tmpfs /home \
|
||||
--setenv HOME /home \
|
||||
--bind /tmp /tmp/hosttmp \
|
||||
/tmp/torzu-src-ro/AppImage-build-debian-inner.sh
|
||||
appimagetool torzu-debian-appimage-rootfs torzu.AppImage
|
||||
echo "AppImage generated at /tmp/torzu.AppImage! Cleaning up..."
|
||||
rm -rf torzu-debian-appimage-rootfs
|
||||
if [ ! "$BUILD_KEEP_ROOTFS" = 1 ]; then
|
||||
rm -rf rootfs-torzu-appimage-build
|
||||
fi
|
||||
42
AppImage-build-local.sh
Executable file
42
AppImage-build-local.sh
Executable file
|
|
@ -0,0 +1,42 @@
|
|||
#!/bin/bash
|
||||
|
||||
FILE=build/bin/yuzu
|
||||
if test -f "$FILE"; then
|
||||
# remove any previously made AppImage in the base torzu git folder
|
||||
rm ./torzu.AppImage
|
||||
|
||||
# enter AppImage utility folder
|
||||
cd AppImageBuilder
|
||||
|
||||
# run the build script to create the AppImage
|
||||
# (usage) ./build.sh [source torzu build folder] [destination .AppImage file]
|
||||
./build.sh ../build ./torzu.AppImage
|
||||
|
||||
FILE=./torzu.AppImage
|
||||
if test -f "$FILE"; then
|
||||
# move the AppImage to the main torzu folder
|
||||
mv torzu.AppImage ..
|
||||
# return to main torzu folder
|
||||
cd ..
|
||||
# show contents of current folder
|
||||
echo
|
||||
ls
|
||||
# show AppImages specifically
|
||||
echo
|
||||
ls *.AppImage
|
||||
echo
|
||||
echo "'torzu.AppImage' is now located in the current folder."
|
||||
echo
|
||||
else
|
||||
cd ..
|
||||
echo "AppImage was not built."
|
||||
fi
|
||||
else
|
||||
echo
|
||||
echo "$FILE does not exist."
|
||||
echo
|
||||
echo "No yuzu executable found in the /torzu/build/bin folder!"
|
||||
echo
|
||||
echo "You must first build a native linux version of torzu before running this script!"
|
||||
echo
|
||||
fi
|
||||
11
AppImageBuilder/assets/AppRun
Executable file
11
AppImageBuilder/assets/AppRun
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#! /bin/bash
|
||||
|
||||
cd "$APPDIR"
|
||||
|
||||
if [ -d /usr/lib/$(uname -m)-linux-gnu/qt5 ] || [ -d /usr/lib/qt ]; then
|
||||
# System-wide Qt5
|
||||
exec ./yuzu.sh "$@"
|
||||
else
|
||||
# Bundled Qt5
|
||||
exec ./yuzu-bqt.sh "$@"
|
||||
fi
|
||||
6
AppImageBuilder/assets/torzu.desktop
Normal file
6
AppImageBuilder/assets/torzu.desktop
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=torzu
|
||||
Icon=torzu
|
||||
Exec=AppRun
|
||||
Categories=Game;
|
||||
2
AppImageBuilder/assets/torzu.svg
Normal file
2
AppImageBuilder/assets/torzu.svg
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" version="1.1" viewBox="0 0 152 152" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><circle cx="75.585" cy="75.585" r="75.585" fill="url(#_Radial1)"/><clipPath id="_clip2"></clipPath><g clip-path="url(#_clip2)"><path d="m75.585 17.097c11.94-0 21.635 9.694 21.635 21.635s-9.695 21.635-21.635 21.635c-11.941 0-21.635-9.694-21.635-21.635s9.694-21.635 21.635-21.635zm-0 5.21c-9.066 0-16.425 7.36-16.425 16.425s7.359 16.425 16.425 16.425c9.065-0 16.424-7.36 16.424-16.425s-7.359-16.425-16.424-16.425z"/><path d="m75.585 27.343c6.285 0 11.388 5.103 11.388 11.389s-5.103 11.389-11.388 11.389c-6.286-0-11.389-5.103-11.389-11.389s5.103-11.389 11.389-11.389zm-0 5.21c-3.41 0-6.179 2.769-6.179 6.179s2.769 6.179 6.179 6.179 6.178-2.769 6.178-6.179-2.768-6.179-6.178-6.179z"/><path d="m112.44 53.95c11.941-0 21.635 9.694 21.635 21.635 0 11.94-9.694 21.635-21.635 21.635s-21.635-9.695-21.635-21.635c0-11.941 9.694-21.635 21.635-21.635zm0 5.21c-9.065-0-16.425 7.359-16.425 16.425 0 9.065 7.36 16.424 16.425 16.424s16.425-7.359 16.425-16.424c-0-9.066-7.36-16.425-16.425-16.425z"/><path d="m112.44 64.196c6.286-0 11.389 5.103 11.389 11.389-0 6.285-5.103 11.388-11.389 11.388s-11.389-5.103-11.389-11.388c0-6.286 5.103-11.389 11.389-11.389zm0 5.21c-3.41-0-6.178 2.769-6.178 6.179s2.768 6.178 6.178 6.178 6.179-2.768 6.179-6.178-2.769-6.179-6.179-6.179z"/><path d="m75.585 90.802c11.94 0 21.635 9.694 21.635 21.635s-9.695 21.635-21.635 21.635c-11.941 0-21.635-9.694-21.635-21.635s9.694-21.635 21.635-21.635zm-0 5.21c-9.066 0-16.425 7.36-16.425 16.425s7.359 16.425 16.425 16.425c9.065-0 16.424-7.36 16.424-16.425s-7.359-16.425-16.424-16.425z"/><path d="m75.585 101.05c6.285 0 11.388 5.103 11.388 11.389s-5.103 11.389-11.388 11.389c-6.286-0-11.389-5.103-11.389-11.389s5.103-11.389 11.389-11.389zm-0 5.211c-3.41-0-6.179 2.768-6.179 6.178s2.769 6.179 6.179 6.179 6.178-2.769 6.178-6.179-2.768-6.178-6.178-6.178z"/><path d="m38.732 53.95c11.941-0 21.635 9.694 21.635 21.635 0 11.94-9.694 21.635-21.635 21.635s-21.635-9.695-21.635-21.635c-0-11.941 9.694-21.635 21.635-21.635zm-0 5.21c-9.065-0-16.425 7.359-16.425 16.425 0 9.065 7.36 16.424 16.425 16.424s16.425-7.359 16.425-16.424c-0-9.066-7.36-16.425-16.425-16.425z"/><path d="m38.732 64.196c6.286-0 11.389 5.103 11.389 11.389-0 6.285-5.103 11.388-11.389 11.388s-11.389-5.103-11.389-11.388c0-6.286 5.103-11.389 11.389-11.389zm-0 5.21c-3.41-0-6.179 2.769-6.179 6.179s2.769 6.178 6.179 6.178 6.179-2.768 6.179-6.178-2.769-6.179-6.179-6.179z"/></g><defs><radialGradient id="_Radial1" cx="0" cy="0" r="1" gradientTransform="matrix(-81.196 -81.196 81.196 -81.196 114.32 116.87)" gradientUnits="userSpaceOnUse"><stop stop-color="#ff2088" offset="0"/><stop stop-color="#c24bac" offset=".44"/><stop stop-color="#37aeff" offset="1"/></radialGradient></defs></svg>
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
3
AppImageBuilder/assets/yuzu-bqt.sh
Executable file
3
AppImageBuilder/assets/yuzu-bqt.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#! /bin/sh
|
||||
|
||||
LD_LIBRARY_PATH=./qt5:/usr/lib/$(uname -m)-linux-gnu:/usr/lib:. QT_PLUGIN_PATH=./qt5 exec ./yuzu "$@"
|
||||
3
AppImageBuilder/assets/yuzu.sh
Executable file
3
AppImageBuilder/assets/yuzu.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#! /bin/sh
|
||||
|
||||
LD_LIBRARY_PATH=/usr/lib/$(uname -m)-linux-gnu:/usr/lib:. exec ./yuzu "$@"
|
||||
0
AppImageBuilder/assets_aarch64/.gitkeep
Normal file
0
AppImageBuilder/assets_aarch64/.gitkeep
Normal file
BIN
AppImageBuilder/assets_aarch64/bwrap
Normal file
BIN
AppImageBuilder/assets_aarch64/bwrap
Normal file
Binary file not shown.
1
AppImageBuilder/assets_aarch64/bwrap-info.txt
Normal file
1
AppImageBuilder/assets_aarch64/bwrap-info.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
This is a statically compiled bubblewrap 0.9.0 executable.
|
||||
BIN
AppImageBuilder/assets_x86_64/bwrap
Executable file
BIN
AppImageBuilder/assets_x86_64/bwrap
Executable file
Binary file not shown.
1
AppImageBuilder/assets_x86_64/bwrap-info.txt
Normal file
1
AppImageBuilder/assets_x86_64/bwrap-info.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
This is a statically compiled bubblewrap 0.9.0 executable.
|
||||
172
AppImageBuilder/build.sh
Executable file
172
AppImageBuilder/build.sh
Executable file
|
|
@ -0,0 +1,172 @@
|
|||
#! /bin/bash
|
||||
set -e
|
||||
|
||||
# Check arguments
|
||||
if [[ $# != 2 ]]; then
|
||||
>&2 echo "Bad usage!"
|
||||
echo "Usage: $0 <build dir> <output file>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get paths
|
||||
ARCH="$(uname -m)"
|
||||
SYSTEM_LIBS="/usr/lib"
|
||||
SYSTEM_LIBS64="/usr/lib64"
|
||||
YUZU_BIN="${1}/bin"
|
||||
YUZU_BIN_GUI="${YUZU_BIN}/yuzu"
|
||||
|
||||
# Make sure executable exists
|
||||
if [[ $(file -b --mime-type "$YUZU_BIN_GUI") != application/x-pie-executable ]]; then
|
||||
>&2 echo "Invalid yuzu executable!"
|
||||
fi
|
||||
|
||||
# Clean up build dir
|
||||
rm -rf build
|
||||
mkdir build
|
||||
|
||||
# NOTE: some of these aren't used now, but can be reordered in priority when torzu is converted to QT6
|
||||
# QT5 - /usr/lib/${ARCH}-linux-gnu/qt5 (debian), /usr/lib64/qt5 (fedora), /usr/lib/qt (steam deck)
|
||||
# QT5 - /usr/lib/${ARCH}-linux-gnu/qt6 (debian), /usr/lib64/qt6 (fedora), /usr/lib/qt6 (steam deck)
|
||||
QTFOUND="true"
|
||||
QTDIR="$SYSTEM_LIBS"/${ARCH}-linux-gnu/qt5/plugins
|
||||
if [ ! -d "$QTDIR" ]; then
|
||||
# default qt5 folder not found, check for 64-bit qt5 folder
|
||||
QTDIR="$SYSTEM_LIBS64"/qt5/plugins
|
||||
if [ ! -d "$QTDIR" ]; then
|
||||
# 64-bit qt5 folder not found, check for Steam Deck qt (qt5) folder
|
||||
QTDIR="$SYSTEM_LIBS"/qt/plugins
|
||||
if [ ! -d "$QTDIR" ]; then
|
||||
# Steam Deck qt (qt5) folder not found, check for regular qt6 folder
|
||||
QTDIR="$SYSTEM_LIBS"/${ARCH}-linux-gnu/qt6/plugins
|
||||
if [ ! -d "$QTDIR" ]; then
|
||||
# regular qt6 folder not found, check for 64-bit qt6 folder
|
||||
QTDIR="$SYSTEM_LIBS64"/qt6/plugins
|
||||
if [ ! -d "$QTDIR" ]; then
|
||||
# 64-bit qt6 folder not found, check for Steam Deck qt6 folder
|
||||
QTDIR="$SYSTEM_LIBS"/qt6/plugins
|
||||
if [ ! -d "$QTDIR" ]; then
|
||||
QTFOUND="false"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ $QTFOUND == "true" ] || [ -n "$QTSTATIC" ]; then
|
||||
echo "QT plugins from $QTDIR will be used."
|
||||
|
||||
# Copy system dependencies used to build and required by the yuzu binary
|
||||
# includes:
|
||||
# - '/lib64/ld-linux-x86-64.so.2' or `/lib/ld-linux-aarch64.so.1` file per architecture
|
||||
# - required files from `/usr/lib/x86_64-linux-gnu` or `/usr/lib/aarch64-linux-gnu`
|
||||
# - different for SteamDeck, but still does it automatically
|
||||
function copy_libs {
|
||||
for lib in $(ldd "$1"); do
|
||||
(cp -vn "$lib" ./build/ 2> /dev/null) || true
|
||||
done
|
||||
}
|
||||
echo "Copying main dependencies..."
|
||||
copy_libs "$YUZU_BIN_GUI"
|
||||
|
||||
# Copy QT dependency folders, path determined above
|
||||
if [ -z "$QTSTATIC" ]; then
|
||||
echo "Copying Qt dependencies..."
|
||||
mkdir ./build/qt5
|
||||
cp -rv "$QTDIR"/{imageformats,platforms,platformthemes,xcbglintegrations} ./build/qt5/
|
||||
fi
|
||||
|
||||
# Discover indirect dependencies (mostly from runtime-loaded Qt plugins)
|
||||
echo "Copying extra dependencies..."
|
||||
while true; do
|
||||
LIBS="$(find ./build -name \*.so\*)"
|
||||
LIB_COUNT=$(echo "$LIBS" | wc -l)
|
||||
echo "$LIB_COUNT dependency libraries discovered so far..."
|
||||
if [ $LIB_COUNT == "$PREV_LIB_COUNT" ]; then
|
||||
break
|
||||
fi
|
||||
PREV_LIB_COUNT=$LIB_COUNT
|
||||
|
||||
for plib in $LIBS; do
|
||||
if [ -f "$plib" ]; then
|
||||
copy_libs "$plib"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# Copy executable
|
||||
cp -v "$YUZU_BIN_GUI" ./build/
|
||||
|
||||
# Copy assets for the appropriate arch
|
||||
cp -v ./assets_"${ARCH}"/* ./build/
|
||||
# Copy common assets
|
||||
cp -v ./assets/* ./build/
|
||||
|
||||
# Strip all libraries and executables
|
||||
for file in $(find ./build -type f); do
|
||||
(strip -v "$file" 2> /dev/null) || true
|
||||
done
|
||||
|
||||
PASSED_CHECKSUM="false"
|
||||
FILE=appimagetool.AppImage
|
||||
# total number of times to try downloading if a checksum doesn't match
|
||||
DL_TRIES=3
|
||||
while [ $PASSED_CHECKSUM == "false" ] && [ "$DL_TRIES" -gt 0 ]; do
|
||||
case $ARCH in
|
||||
x86_64)
|
||||
# Static copy from the 'ext-linux-bin' repo.
|
||||
# Checksum will need to be changed when/if this file in the repo is updated.
|
||||
if ! test -f "$FILE"; then
|
||||
echo "Downloading appimagetool for architecture '$ARCH'"
|
||||
wget -O appimagetool.AppImage https://github.com/litucks/ext-linux-bin/raw/refs/heads/main/appimage/appimagetool-x86_64.AppImage
|
||||
fi
|
||||
if [ $(shasum -a 256 appimagetool.AppImage | cut -d' ' -f1) = "110751478abece165a18460acbd7fd1398701f74a9405ad8ac053427d937bd5d" ] ; then
|
||||
PASSED_CHECKSUM="true"
|
||||
fi
|
||||
# DISABLED TO USE THE ABOVE
|
||||
# The current continuous release channel option, until a static copy is put in 'ext-linux-bin'.
|
||||
# The checksum will pass until the continuous release is updated, then a new one needs to be
|
||||
# generated to update this script.
|
||||
#if ! test -f "$FILE"; then
|
||||
# echo "Downloading appimagetool for architecture '$ARCH'"
|
||||
# wget -O appimagetool.AppImage https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
|
||||
#fi
|
||||
#if [ $(shasum -a 256 appimagetool.AppImage | cut -d' ' -f1) = "46fdd785094c7f6e545b61afcfb0f3d98d8eab243f644b4b17698c01d06083d1" ] ; then
|
||||
# PASSED_CHECKSUM="true"
|
||||
#fi
|
||||
;;
|
||||
aarch64)
|
||||
# Currently set to the continuous release channel until a static copy is put in 'ext-linux-bin'.
|
||||
# The checksum will pass until the continuous release is updated, then a new one needs to be
|
||||
# generated to update this script.
|
||||
if ! test -f "$FILE"; then
|
||||
echo "Downloading appimagetool for architecture '$ARCH'"
|
||||
wget -O appimagetool.AppImage https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-aarch64.AppImage
|
||||
fi
|
||||
if [ $(shasum -a 256 appimagetool.AppImage | cut -d' ' -f1) = "04f45ea45b5aa07bb2b071aed9dbf7a5185d3953b11b47358c1311f11ea94a96" ] ; then
|
||||
PASSED_CHECKSUM="true"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
PASSED_CHECKSUM="invalid_arch"
|
||||
;;
|
||||
esac
|
||||
# delete the appimagetool downloaded if the checksum doesn't match.
|
||||
if [ ! $PASSED_CHECKSUM == "true" ]; then
|
||||
rm -f appimagetool.AppImage
|
||||
fi
|
||||
((DL_TRIES-=1))
|
||||
done
|
||||
if [ $PASSED_CHECKSUM == "true" ]; then
|
||||
echo "Checksum passed. Proceeding to build image."
|
||||
# Build AppImage
|
||||
chmod a+x appimagetool.AppImage
|
||||
./appimagetool.AppImage ./build "$2"
|
||||
elif [ $PASSED_CHECKSUM == "invalid_arch" ]; then
|
||||
echo "No download found for architecture '$ARCH'. Building halted."
|
||||
else
|
||||
echo "Checksum for appimagetool does not match. Building halted."
|
||||
echo "If the file to be downloaded has been changed, a new checksum will need to be generated for this script."
|
||||
fi
|
||||
else
|
||||
echo "QT not found, aborting AppImage build."
|
||||
fi
|
||||
592
CMakeLists.txt
592
CMakeLists.txt
|
|
@ -12,6 +12,13 @@ include(DownloadExternals)
|
|||
include(CMakeDependentOption)
|
||||
include(CTest)
|
||||
|
||||
option(YUZU_USE_BUNDLED_VCPKG "Use vcpkg for yuzu dependencies" "${MSVC}")
|
||||
if (NOT YUZU_USE_BUNDLED_VCPKG)
|
||||
option(YUZU_USE_CPM "Use CPM.cmake for yuzu dependencies" OFF)
|
||||
else()
|
||||
set(YUZU_USE_CPM OFF)
|
||||
endif()
|
||||
|
||||
# Set bundled sdl2/qt as dependent options.
|
||||
# OFF by default, but if ENABLE_SDL2 and MSVC are true then ON
|
||||
option(ENABLE_SDL2 "Enable the SDL2 frontend" ON)
|
||||
|
|
@ -24,30 +31,45 @@ cmake_dependent_option(ENABLE_LIBUSB "Enable the use of LibUSB" ON "NOT ANDROID"
|
|||
option(ENABLE_OPENGL "Enable OpenGL" ON)
|
||||
mark_as_advanced(FORCE ENABLE_OPENGL)
|
||||
option(ENABLE_QT "Enable the Qt frontend" ON)
|
||||
option(ENABLE_QT6 "Allow usage of Qt6 to be attempted" OFF)
|
||||
set(QT6_LOCATION "" CACHE PATH "Additional Location to search for Qt6 libraries like C:/Qt/6.3.1/msvc2019_64/")
|
||||
|
||||
option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" ON)
|
||||
CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF)
|
||||
if (ENABLE_QT)
|
||||
option(YUZU_BUILD_QT6 "Build Qt6 at configure time" OFF)
|
||||
if (YUZU_BUILD_QT6)
|
||||
option(YUZU_BUILD_QT6_STATIC "Build Qt6 statically" OFF)
|
||||
endif()
|
||||
|
||||
option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
|
||||
option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" ON)
|
||||
|
||||
option(YUZU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF)
|
||||
|
||||
option(YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF)
|
||||
endif()
|
||||
|
||||
set(ENABLE_WEB_SERVICE OFF)
|
||||
|
||||
option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" "${WIN32}")
|
||||
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" ON)
|
||||
if (NOT YUZU_USE_CPM)
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" ON)
|
||||
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES "Use Vulkan-Utility-Libraries from externals" ON)
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES "Use Vulkan-Utility-Libraries from externals" ON)
|
||||
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS "Use SPIRV-Tools from externals" ON)
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS "Use SPIRV-Tools from externals" ON)
|
||||
else()
|
||||
set(YUZU_USE_EXTERNAL_VULKAN_HEADERS OFF)
|
||||
|
||||
option(YUZU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF)
|
||||
set(YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES OFF)
|
||||
|
||||
option(YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF)
|
||||
set(YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS OFF)
|
||||
endif()
|
||||
|
||||
option(ENABLE_CUBEB "Enables the cubeb audio backend" ON)
|
||||
|
||||
option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)
|
||||
|
||||
option(YUZU_NO_CPU_DEBUGGER "Do not build debugging code" OFF)
|
||||
|
||||
option(YUZU_TESTS "Compile tests" "${BUILD_TESTING}")
|
||||
|
||||
option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
|
||||
|
|
@ -60,8 +82,6 @@ option(YUZU_CMD "Compile the -cmd executable (can disable if -cmd is unused)" ON
|
|||
|
||||
CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile crash dump (Minidump) support" OFF "WIN32 OR LINUX" OFF)
|
||||
|
||||
option(YUZU_USE_BUNDLED_VCPKG "Use vcpkg for yuzu dependencies" "${MSVC}")
|
||||
|
||||
option(YUZU_CHECK_SUBMODULES "Check if submodules are present" ON)
|
||||
|
||||
option(YUZU_ENABLE_LTO "Enable link-time optimization" OFF)
|
||||
|
|
@ -70,10 +90,72 @@ option(YUZU_DOWNLOAD_TIME_ZONE_DATA "Always download time zone binaries" OFF)
|
|||
|
||||
option(YUZU_ENABLE_PORTABLE "Allow yuzu to enable portable mode if a user folder is found in the CWD" ON)
|
||||
|
||||
option(YUZU_USE_LLVM_DEMANGLE "Use LLVM Demangle" ON)
|
||||
|
||||
CMAKE_DEPENDENT_OPTION(YUZU_USE_FASTER_LD "Check if a faster linker is available" ON "NOT WIN32" OFF)
|
||||
|
||||
CMAKE_DEPENDENT_OPTION(USE_SYSTEM_MOLTENVK "Use the system MoltenVK lib (instead of the bundled one)" OFF "APPLE" OFF)
|
||||
|
||||
# Detect current compilation architecture and create standard definitions
|
||||
# =======================================================================
|
||||
|
||||
include(CheckSymbolExists)
|
||||
function(detect_architecture symbol arch)
|
||||
if (NOT DEFINED ARCHITECTURE)
|
||||
set(CMAKE_REQUIRED_QUIET 1)
|
||||
check_symbol_exists("${symbol}" "" ARCHITECTURE_${arch})
|
||||
unset(CMAKE_REQUIRED_QUIET)
|
||||
|
||||
# The output variable needs to be unique across invocations otherwise
|
||||
# CMake's crazy scope rules will keep it defined
|
||||
if (ARCHITECTURE_${arch})
|
||||
set(ARCHITECTURE "${arch}" PARENT_SCOPE)
|
||||
set(ARCHITECTURE_${arch} 1 PARENT_SCOPE)
|
||||
add_definitions(-DARCHITECTURE_${arch}=1)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
if (NOT ENABLE_GENERIC)
|
||||
if (MSVC)
|
||||
detect_architecture("_M_AMD64" x86_64)
|
||||
detect_architecture("_M_IX86" x86)
|
||||
detect_architecture("_M_ARM" arm)
|
||||
detect_architecture("_M_ARM64" arm64)
|
||||
else()
|
||||
detect_architecture("__x86_64__" x86_64)
|
||||
detect_architecture("__i386__" x86)
|
||||
detect_architecture("__arm__" arm)
|
||||
detect_architecture("__aarch64__" arm64)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED ARCHITECTURE)
|
||||
set(ARCHITECTURE "GENERIC")
|
||||
set(ARCHITECTURE_GENERIC 1)
|
||||
add_definitions(-DARCHITECTURE_GENERIC=1)
|
||||
endif()
|
||||
message(STATUS "Target architecture: ${ARCHITECTURE} (${YUZU_MARCH})")
|
||||
|
||||
if (MSVC AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
set(YUZU_MARCH "SSE4.2" CACHE STRING "Compile for specified x86 arch (AVX, AVX2, etc.)")
|
||||
add_compile_options(/arch:${YUZU_MARCH})
|
||||
else()
|
||||
if (ARCHITECTURE STREQUAL "x86_64")
|
||||
set(YUZU_MARCH "x86-64-v2" CACHE STRING "Compile for specified x86 microarchitecture level (x86-64-v3, native, etc.)")
|
||||
add_compile_options(-march=${YUZU_MARCH})
|
||||
elseif (ARCHITECTURE STREQUAL "arm64")
|
||||
set(YUZU_MARCH "armv8-a" CACHE STRING "Compile for specified ARM architecture (armv8.1-a, native, etc.)")
|
||||
add_compile_options(-march=${YUZU_MARCH})
|
||||
else()
|
||||
message(WARNING "Architecture ${ARCHITECTURE} unknown, EXPECT THINGS TO GO WRONG.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
add_definitions(-DWIN32)
|
||||
endif()
|
||||
|
||||
set(DEFAULT_ENABLE_OPENSSL ON)
|
||||
if (ANDROID OR WIN32 OR APPLE)
|
||||
# - Windows defaults to the Schannel backend.
|
||||
|
|
@ -87,21 +169,26 @@ endif()
|
|||
option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENABLE_OPENSSL})
|
||||
|
||||
if (ANDROID AND YUZU_DOWNLOAD_ANDROID_VVL)
|
||||
set(vvl_version "sdk-1.3.261.1")
|
||||
set(vvl_version "1.4.304.1")
|
||||
set(vvl_zip_file "${CMAKE_BINARY_DIR}/externals/vvl-android.zip")
|
||||
if (NOT EXISTS "${vvl_zip_file}")
|
||||
# Download and extract validation layer release to externals directory
|
||||
set(vvl_base_url "https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases/download")
|
||||
file(DOWNLOAD "${vvl_base_url}/${vvl_version}/android-binaries-${vvl_version}-android.zip"
|
||||
"${vvl_zip_file}" SHOW_PROGRESS)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${vvl_zip_file}"
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals")
|
||||
endif()
|
||||
|
||||
# Copy the arm64 binary to src/android/app/main/jniLibs
|
||||
set(vvl_lib_path "${CMAKE_CURRENT_SOURCE_DIR}/src/android/app/src/main/jniLibs/arm64-v8a/")
|
||||
file(COPY "${CMAKE_BINARY_DIR}/externals/android-binaries-${vvl_version}/arm64-v8a/libVkLayer_khronos_validation.so"
|
||||
DESTINATION "${vvl_lib_path}")
|
||||
set(vvl_final_lib "${vvl_lib_path}/libVkLayer_khronos_validation.so")
|
||||
|
||||
if (NOT EXISTS "${vvl_final_lib}")
|
||||
# Download and extract validation layer release to externals directory
|
||||
if (NOT EXISTS "${vvl_zip_file}")
|
||||
set(vvl_base_url "https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases/download")
|
||||
file(DOWNLOAD "${vvl_base_url}/vulkan-sdk-${vvl_version}/android-binaries-${vvl_version}.zip"
|
||||
"${vvl_zip_file}" SHOW_PROGRESS)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${vvl_zip_file}"
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals")
|
||||
endif()
|
||||
|
||||
# Copy the arm64 binary to src/android/app/main/jniLibs
|
||||
file(COPY "${CMAKE_BINARY_DIR}/externals/android-binaries-${vvl_version}/arm64-v8a/libVkLayer_khronos_validation.so"
|
||||
DESTINATION "${vvl_lib_path}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ANDROID)
|
||||
|
|
@ -224,46 +311,6 @@ if (NOT EXISTS ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.
|
|||
file(WRITE ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.json "")
|
||||
endif()
|
||||
|
||||
# Detect current compilation architecture and create standard definitions
|
||||
# =======================================================================
|
||||
|
||||
include(CheckSymbolExists)
|
||||
function(detect_architecture symbol arch)
|
||||
if (NOT DEFINED ARCHITECTURE)
|
||||
set(CMAKE_REQUIRED_QUIET 1)
|
||||
check_symbol_exists("${symbol}" "" ARCHITECTURE_${arch})
|
||||
unset(CMAKE_REQUIRED_QUIET)
|
||||
|
||||
# The output variable needs to be unique across invocations otherwise
|
||||
# CMake's crazy scope rules will keep it defined
|
||||
if (ARCHITECTURE_${arch})
|
||||
set(ARCHITECTURE "${arch}" PARENT_SCOPE)
|
||||
set(ARCHITECTURE_${arch} 1 PARENT_SCOPE)
|
||||
add_definitions(-DARCHITECTURE_${arch}=1)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
if (NOT ENABLE_GENERIC)
|
||||
if (MSVC)
|
||||
detect_architecture("_M_AMD64" x86_64)
|
||||
detect_architecture("_M_IX86" x86)
|
||||
detect_architecture("_M_ARM" arm)
|
||||
detect_architecture("_M_ARM64" arm64)
|
||||
else()
|
||||
detect_architecture("__x86_64__" x86_64)
|
||||
detect_architecture("__i386__" x86)
|
||||
detect_architecture("__arm__" arm)
|
||||
detect_architecture("__aarch64__" arm64)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED ARCHITECTURE)
|
||||
set(ARCHITECTURE "GENERIC")
|
||||
set(ARCHITECTURE_GENERIC 1)
|
||||
add_definitions(-DARCHITECTURE_GENERIC=1)
|
||||
endif()
|
||||
message(STATUS "Target architecture: ${ARCHITECTURE}")
|
||||
|
||||
if (UNIX)
|
||||
add_definitions(-DYUZU_UNIX=1)
|
||||
|
|
@ -296,31 +343,222 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
|
|||
# =======================================================================
|
||||
|
||||
# Enforce the search mode of non-required packages for better and shorter failure messages
|
||||
find_package(Boost 1.79.0 REQUIRED context)
|
||||
find_package(enet 1.3 MODULE)
|
||||
find_package(fmt 9 REQUIRED)
|
||||
find_package(LLVM 17.0.2 MODULE COMPONENTS Demangle)
|
||||
find_package(lz4 REQUIRED)
|
||||
find_package(nlohmann_json 3.8 REQUIRED)
|
||||
find_package(Opus 1.3 MODULE)
|
||||
find_package(RenderDoc MODULE)
|
||||
find_package(SimpleIni MODULE)
|
||||
find_package(stb MODULE)
|
||||
find_package(VulkanMemoryAllocator CONFIG)
|
||||
find_package(ZLIB 1.2 REQUIRED)
|
||||
find_package(zstd 1.5 REQUIRED)
|
||||
if (NOT YUZU_USE_CPM)
|
||||
find_package(Boost 1.86.0 REQUIRED headers context system fiber)
|
||||
find_package(enet 1.3 MODULE)
|
||||
find_package(fmt REQUIRED)
|
||||
if (YUZU_USE_LLVM_DEMANGLE)
|
||||
find_package(LLVM 17.0.2 MODULE COMPONENTS Demangle)
|
||||
endif()
|
||||
find_package(lz4 REQUIRED)
|
||||
find_package(nlohmann_json 3.8 REQUIRED)
|
||||
find_package(Opus 1.3 MODULE)
|
||||
find_package(RenderDoc MODULE)
|
||||
find_package(SimpleIni MODULE)
|
||||
find_package(stb MODULE)
|
||||
find_package(VulkanMemoryAllocator CONFIG)
|
||||
find_package(ZLIB 1.2 REQUIRED)
|
||||
find_package(zstd 1.5 REQUIRED)
|
||||
else()
|
||||
include(CMakeModules/CPM.cmake)
|
||||
|
||||
# Disable tests in all externals supporting the standard option name
|
||||
set(BUILD_TESTING OFF)
|
||||
|
||||
# Some externals take these options instead
|
||||
set(BUILD_TESTS OFF)
|
||||
set(BUILD_TOOLS OFF)
|
||||
|
||||
# Build only static externals
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
|
||||
# Do not attempt to use Brotli in httplib since we're not downloading it
|
||||
set(HTTPLIB_USE_BROTLI_IF_AVAILABLE OFF)
|
||||
|
||||
# Configure Opus to not generate as much overhead
|
||||
set(OPUS_BUILD_TESTING OFF)
|
||||
set(OPUS_BUILD_PROGRAMS OFF)
|
||||
set(OPUS_INSTALL_PKG_CONFIG_MODULE OFF)
|
||||
set(OPUS_INSTALL_CMAKE_CONFIG_MODULE OFF)
|
||||
|
||||
message(STATUS "Downloading and extracting boost library sources. This will take some time...")
|
||||
CPMAddPackage(
|
||||
NAME boost
|
||||
URL "https://github.com/boostorg/boost/releases/download/boost-1.88.0/boost-1.88.0-cmake.7z"
|
||||
PATCHES boost-1.88.0-fix.patch
|
||||
VERSION 1.88.0
|
||||
)
|
||||
CPMAddPackage("gh:lsalzman/enet@1.3.18")
|
||||
CPMAddPackage("gh:fmtlib/fmt#11.1.4")
|
||||
CPMAddPackage(
|
||||
NAME lz4
|
||||
GIT_REPOSITORY https://github.com/lz4/lz4.git
|
||||
VERSION 1.10.0
|
||||
DOWNLOAD_ONLY YES
|
||||
)
|
||||
add_subdirectory(${lz4_SOURCE_DIR}/build/cmake lz4)
|
||||
CPMAddPackage("gh:nlohmann/json@3.8.0")
|
||||
CPMAddPackage("gh:xiph/opus@1.3.1")
|
||||
CPMAddPackage("gh:brofield/simpleini@4.22")
|
||||
CPMAddPackage("gh:GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator@3.2.1")
|
||||
CPMAddPackage("gh:madler/zlib@1.2.13")
|
||||
CPMAddPackage(
|
||||
NAME zstd
|
||||
GIT_REPOSITORY https://github.com/facebook/zstd.git
|
||||
VERSION 1.5.7
|
||||
DOWNLOAD_ONLY YES
|
||||
)
|
||||
add_subdirectory(${zstd_SOURCE_DIR}/build/cmake zstd)
|
||||
CPMAddPackage("gh:KhronosGroup/SPIRV-Headers#vulkan-sdk-1.3.280.0")
|
||||
CPMAddPackage("gh:yhirose/cpp-httplib@0.20.0")
|
||||
|
||||
# Set up required aliases
|
||||
add_library(Opus::opus ALIAS opus)
|
||||
add_library(lz4::lz4 ALIAS lz4)
|
||||
add_library(zstd::zstd ALIAS libzstd)
|
||||
if (NOT YUZU_BUILD_QT6)
|
||||
add_library(zstd::libzstd ALIAS libzstd)
|
||||
endif()
|
||||
add_library(nlohmann::json ALIAS nlohmann_json)
|
||||
|
||||
# Enet specific setup to add missing include dir
|
||||
add_library(enet_fixed INTERFACE)
|
||||
target_link_libraries(enet_fixed INTERFACE enet)
|
||||
target_include_directories(enet_fixed INTERFACE ${enet_SOURCE_DIR}/include)
|
||||
add_library(enet::enet ALIAS enet_fixed)
|
||||
endif()
|
||||
|
||||
if (YUZU_BUILD_QT6)
|
||||
set(QT_VERSION "6.9.1")
|
||||
set(QT_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/qt-install")
|
||||
set(QT_SOURCE_DIR "${CMAKE_BINARY_DIR}/qt-src")
|
||||
set(QT_TARBALL_PATH "${CMAKE_BINARY_DIR}/qt-${QT_VERSION}.tar.xz")
|
||||
|
||||
# Extract major and minor versions from QT_VERSION
|
||||
string(REPLACE "." ";" QT_VERSION_PARTS "${QT_VERSION}")
|
||||
list(GET QT_VERSION_PARTS 0 QT_MAJOR)
|
||||
list(GET QT_VERSION_PARTS 1 QT_MINOR)
|
||||
|
||||
set(QT_URL "https://download.qt.io/archive/qt/${QT_MAJOR}.${QT_MINOR}/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz")
|
||||
|
||||
set(QT_SUBMODULES "qtbase,qttranslations")
|
||||
if (YUZU_USE_QT_MULTIMEDIA)
|
||||
set(QT_SUBMODULES "${QT_SUBMODULES},qtmultimedia")
|
||||
endif()
|
||||
|
||||
if (YUZU_BUILD_QT6_STATIC)
|
||||
set(QT_LIBTYPE "-static")
|
||||
else()
|
||||
set(QT_LIBTYPE "-shared")
|
||||
endif()
|
||||
|
||||
# Check prerequisites
|
||||
find_program(NINJA_EXECUTABLE ninja)
|
||||
if(NOT NINJA_EXECUTABLE)
|
||||
message(FATAL_ERROR "'ninja' executable not found. Install it or ensure it's in your PATH. It's required for building Qt6.")
|
||||
endif()
|
||||
|
||||
# Download Qt source
|
||||
if (NOT EXISTS ${QT_TARBALL_PATH})
|
||||
message(STATUS "Downloading Qt library sources. This will take some time...")
|
||||
file(DOWNLOAD
|
||||
${QT_URL}
|
||||
${QT_TARBALL_PATH}
|
||||
SHOW_PROGRESS
|
||||
STATUS download_status
|
||||
)
|
||||
|
||||
# Check download success
|
||||
list(GET download_status 0 status_code)
|
||||
if(NOT status_code EQUAL 0)
|
||||
list(GET download_status 1 error_msg)
|
||||
message(FATAL_ERROR "Download failed: ${error_msg}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Extract source
|
||||
if (NOT EXISTS "${QT_SOURCE_DIR}/qt-everywhere-src-${QT_VERSION}/CMakeLists.txt")
|
||||
message(STATUS "Extracting Qt library sources. This will take some time...")
|
||||
file(ARCHIVE_EXTRACT
|
||||
INPUT ${QT_TARBALL_PATH}
|
||||
DESTINATION ${QT_SOURCE_DIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
# Configure Qt
|
||||
message(STATUS "Configuring Qt library. This will take some time...")
|
||||
if (MSVC)
|
||||
set(QT_CONFIGURE_COMMAND "${QT_SOURCE_DIR}/qt-everywhere-src-${QT_VERSION}/configure.bat")
|
||||
else()
|
||||
set(QT_CONFIGURE_COMMAND "${QT_SOURCE_DIR}/qt-everywhere-src-${QT_VERSION}/configure")
|
||||
endif()
|
||||
message(STATUS "Configuring Qt library using ${QT_CONFIGURE_COMMAND}")
|
||||
file(MAKE_DIRECTORY "${QT_SOURCE_DIR}/build")
|
||||
execute_process(COMMAND ${QT_CONFIGURE_COMMAND}
|
||||
-opensource -confirm-license
|
||||
-prefix "${QT_INSTALL_PREFIX}"
|
||||
-release ${QT_LIBTYPE} -ltcg
|
||||
-submodules ${QT_SUBMODULES}
|
||||
-no-feature-vulkan
|
||||
-nomake examples -nomake tests
|
||||
-qt-doubleconversion -no-glib -qt-pcre -qt-zlib -qt-harfbuzz -qt-libpng -qt-libjpeg
|
||||
WORKING_DIRECTORY "${QT_SOURCE_DIR}/build"
|
||||
RESULT_VARIABLE ret
|
||||
)
|
||||
if (NOT ret EQUAL "0")
|
||||
message(FATAL_ERROR "Qt library failed to configure.")
|
||||
endif()
|
||||
|
||||
# Build and install Qt
|
||||
message(STATUS "Building Qt library. This will take some time...")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} --build "${QT_SOURCE_DIR}/build" --parallel
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
RESULT_VARIABLE ret
|
||||
)
|
||||
if (NOT ret EQUAL "0")
|
||||
message(FATAL_ERROR "Qt library failed to build.")
|
||||
endif()
|
||||
|
||||
message(STATUS "Installing Qt library. This will take some time...")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} --install "${QT_SOURCE_DIR}/build"
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
RESULT_VARIABLE ret
|
||||
)
|
||||
if (NOT ret EQUAL "0")
|
||||
message(FATAL_ERROR "Qt library failed to install.")
|
||||
endif()
|
||||
|
||||
# Add Qt installation to search path
|
||||
message(STATUS "Qt library installed to ${QT_INSTALL_PREFIX}")
|
||||
list(PREPEND CMAKE_PREFIX_PATH ${QT_INSTALL_PREFIX})
|
||||
list(PREPEND CMAKE_MODULE_PATH ${QT_INSTALL_PREFIX}/lib/cmake)
|
||||
set(Qt6_DIR "${QT_INSTALL_PREFIX}/lib/cmake/Qt6" CACHE PATH "" FORCE)
|
||||
set(QT_QMAKE_EXECUTABLE "${QT_INSTALL_PREFIX}/bin/qmake6" CACHE PATH "" FORCE)
|
||||
endif()
|
||||
|
||||
if (NOT YUZU_USE_EXTERNAL_VULKAN_HEADERS)
|
||||
find_package(VulkanHeaders 1.3.274 REQUIRED)
|
||||
if (NOT YUZU_USE_CPM)
|
||||
find_package(VulkanHeaders 1.3.274 REQUIRED)
|
||||
else()
|
||||
CPMAddPackage("gh:KhronosGroup/Vulkan-Headers@1.3.274")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES)
|
||||
find_package(VulkanUtilityLibraries REQUIRED)
|
||||
if (NOT YUZU_USE_CPM)
|
||||
find_package(VulkanUtilityLibraries REQUIRED)
|
||||
else()
|
||||
CPMAddPackage("gh:KhronosGroup/Vulkan-Utility-Libraries#fce11d52fee0344bb10a098b0a398dff42cb5d51")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(SPIRV-Tools REQUIRED SPIRV-Tools)
|
||||
if (NOT YUZU_USE_CPM)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(SPIRV-Tools REQUIRED SPIRV-Tools)
|
||||
else()
|
||||
CPMAddPackage("gh:KhronosGroup/SPIRV-Tools#dd4b663e13c07fea4fbb3f70c1c91c86731099f7") # This is tag v2024.2, but some weird but is preventing us from using it here
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ENABLE_LIBUSB)
|
||||
|
|
@ -349,7 +587,6 @@ endif()
|
|||
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
find_package(cpp-jwt 1.4 CONFIG)
|
||||
find_package(httplib 0.12 MODULE COMPONENTS OpenSSL)
|
||||
endif()
|
||||
|
||||
if (YUZU_TESTS)
|
||||
|
|
@ -370,7 +607,7 @@ if (UNIX AND NOT APPLE)
|
|||
endif()
|
||||
|
||||
# Please consider this as a stub
|
||||
if(ENABLE_QT6 AND Qt6_LOCATION)
|
||||
if(Qt6_LOCATION)
|
||||
list(APPEND CMAKE_PREFIX_PATH "${Qt6_LOCATION}")
|
||||
endif()
|
||||
|
||||
|
|
@ -400,142 +637,22 @@ endfunction(set_yuzu_qt_components)
|
|||
|
||||
# Qt5 requires that we find components, so it doesn't fit our pretty little find package function
|
||||
if(ENABLE_QT)
|
||||
set(QT_VERSION 5.15)
|
||||
set(QT_VERSION 6.3.1)
|
||||
# These are used to specify minimum versions
|
||||
set(QT5_VERSION 5.15)
|
||||
set(QT6_VERSION 6.3.1)
|
||||
|
||||
set_yuzu_qt_components()
|
||||
if (ENABLE_QT6)
|
||||
find_package(Qt6 ${QT6_VERSION} COMPONENTS ${YUZU_QT_COMPONENTS})
|
||||
endif()
|
||||
find_package(Qt6 ${QT6_VERSION} COMPONENTS ${YUZU_QT_COMPONENTS})
|
||||
if (Qt6_FOUND)
|
||||
message(STATUS "yuzu/CMakeLists.txt: Found Qt6 at ${Qt6_CONFIG} (widgets at ${Qt6Widgets_CONFIG})")
|
||||
message(STATUS "yuzu/CMakeLists.txt: Qt6Widgets_VERSION ${Qt6Widgets_VERSION}, setting QT_VERSION")
|
||||
set(QT_VERSION ${Qt6Widgets_VERSION})
|
||||
set(QT_MAJOR_VERSION 6)
|
||||
# Qt6 sets cxx_std_17 and we need to undo that
|
||||
set_target_properties(Qt6::Platform PROPERTIES INTERFACE_COMPILE_FEATURES "")
|
||||
else()
|
||||
message(STATUS "yuzu/CMakeLists.txt: Qt6 not found/not selected, trying for Qt5")
|
||||
# When Qt6 partially found, need this set to use Qt5 when not specifying version
|
||||
set(QT_DEFAULT_MAJOR_VERSION 5)
|
||||
set(QT_MAJOR_VERSION 5)
|
||||
|
||||
set(YUZU_USE_QT_MULTIMEDIA ON)
|
||||
# Check for system Qt on Linux, fallback to bundled Qt
|
||||
if (UNIX AND NOT APPLE)
|
||||
if (NOT YUZU_USE_BUNDLED_QT)
|
||||
find_package(Qt5 ${QT5_VERSION} COMPONENTS Widgets DBus Multimedia)
|
||||
endif()
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND (NOT Qt5_FOUND OR YUZU_USE_BUNDLED_QT))
|
||||
# Check for dependencies, then enable bundled Qt download
|
||||
|
||||
# Check that the system GLIBCXX version is compatible
|
||||
find_program(OBJDUMP objdump)
|
||||
if (NOT OBJDUMP)
|
||||
message(FATAL_ERROR "Required program `objdump` not found.")
|
||||
endif()
|
||||
find_library(LIBSTDCXX libstdc++.so.6)
|
||||
execute_process(
|
||||
COMMAND
|
||||
${OBJDUMP} -T ${LIBSTDCXX}
|
||||
COMMAND
|
||||
grep GLIBCXX_3.4.28
|
||||
COMMAND
|
||||
sed "s/[0-9a-f]*.* //"
|
||||
COMMAND
|
||||
sed "s/ .*//"
|
||||
COMMAND
|
||||
sort -u
|
||||
OUTPUT_VARIABLE
|
||||
GLIBCXX_MET
|
||||
)
|
||||
if (NOT GLIBCXX_MET)
|
||||
message(FATAL_ERROR "Qt too old or not found, and bundled Qt package is not \
|
||||
compatible with this system. Either install Qt ${QT_VERSION}, or provide the path \
|
||||
to Qt by setting the variable Qt5_ROOT.")
|
||||
endif()
|
||||
|
||||
# Check for headers
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(QT_DEP_GLU QUIET glu>=9.0.0)
|
||||
if (NOT QT_DEP_GLU_FOUND)
|
||||
message(FATAL_ERROR "Qt bundled package dependency `glu` not found. \
|
||||
Perhaps `libglu1-mesa-dev` needs to be installed?")
|
||||
endif()
|
||||
pkg_check_modules(QT_DEP_MESA QUIET dri>=20.0.8)
|
||||
if (NOT QT_DEP_MESA_FOUND)
|
||||
message(FATAL_ERROR "Qt bundled package dependency `dri` not found. \
|
||||
Perhaps `mesa-common-dev` needs to be installed?")
|
||||
endif()
|
||||
|
||||
# Check for X libraries
|
||||
set(BUNDLED_QT_REQUIREMENTS
|
||||
libxcb-icccm.so.4
|
||||
libxcb-image.so.0
|
||||
libxcb-keysyms.so.1
|
||||
libxcb-randr.so.0
|
||||
libxcb-render-util.so.0
|
||||
libxcb-render.so.0
|
||||
libxcb-shape.so.0
|
||||
libxcb-shm.so.0
|
||||
libxcb-sync.so.1
|
||||
libxcb-xfixes.so.0
|
||||
libxcb-xinerama.so.0
|
||||
libxcb-xkb.so.1
|
||||
libxcb.so.1
|
||||
libxkbcommon-x11.so.0
|
||||
libxkbcommon.so.0
|
||||
)
|
||||
set(UNRESOLVED_QT_DEPS "")
|
||||
foreach (REQUIREMENT ${BUNDLED_QT_REQUIREMENTS})
|
||||
find_library(BUNDLED_QT_${REQUIREMENT} ${REQUIREMENT})
|
||||
if (NOT BUNDLED_QT_${REQUIREMENT})
|
||||
set(UNRESOLVED_QT_DEPS ${UNRESOLVED_QT_DEPS} ${REQUIREMENT})
|
||||
endif()
|
||||
unset(BUNDLED_QT_${REQUIREMENT})
|
||||
endforeach()
|
||||
unset(BUNDLED_QT_REQUIREMENTS)
|
||||
|
||||
if (NOT "${UNRESOLVED_QT_DEPS}" STREQUAL "")
|
||||
message(FATAL_ERROR "Bundled Qt package missing required dependencies: ${UNRESOLVED_QT_DEPS}")
|
||||
endif()
|
||||
|
||||
set(YUZU_USE_BUNDLED_QT ON CACHE BOOL "Download bundled Qt" FORCE)
|
||||
endif()
|
||||
if (YUZU_USE_BUNDLED_QT)
|
||||
# Binary package currently does not support Qt webengine, so make sure it's disabled
|
||||
set(YUZU_USE_QT_WEB_ENGINE OFF CACHE BOOL "Use Qt Webengine" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(YUZU_QT_NO_CMAKE_SYSTEM_PATH)
|
||||
|
||||
if(YUZU_USE_BUNDLED_QT)
|
||||
## if ((MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1940) AND ARCHITECTURE_x86_64)
|
||||
if ((MSVC_VERSION GREATER_EQUAL 1920) AND ARCHITECTURE_x86_64)
|
||||
set(QT_BUILD qt-5.15.2-msvc2019_64)
|
||||
elseif ((${CMAKE_SYSTEM_NAME} STREQUAL "Linux") AND NOT MINGW AND ARCHITECTURE_x86_64)
|
||||
set(QT_BUILD qt5_5_15_2)
|
||||
else()
|
||||
message(FATAL_ERROR "No bundled Qt binaries for your toolchain. Disable YUZU_USE_BUNDLED_QT and provide your own.")
|
||||
endif()
|
||||
|
||||
if (DEFINED QT_BUILD)
|
||||
download_bundled_external("qt/" ${QT_BUILD} QT_PREFIX)
|
||||
endif()
|
||||
|
||||
set(QT_PREFIX_HINT HINTS "${QT_PREFIX}")
|
||||
|
||||
set(YUZU_QT_NO_CMAKE_SYSTEM_PATH "NO_CMAKE_SYSTEM_PATH")
|
||||
# Binary package for Qt5 has Qt Multimedia
|
||||
set(YUZU_USE_QT_MULTIMEDIA ON CACHE BOOL "Use Qt Multimedia" FORCE)
|
||||
endif()
|
||||
|
||||
set_yuzu_qt_components()
|
||||
find_package(Qt5 ${QT5_VERSION} COMPONENTS ${YUZU_QT_COMPONENTS} ${QT_PREFIX_HINT} ${YUZU_QT_NO_CMAKE_SYSTEM_PATH})
|
||||
message(FATAL_ERROR "yuzu/CMakeLists.txt: Qt6 not found, but is now required")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
# find SDL2 exports a bunch of variables that are needed, so its easier to do this outside of the yuzu_find_package
|
||||
|
|
@ -548,7 +665,6 @@ if (ENABLE_SDL2)
|
|||
else()
|
||||
message(FATAL_ERROR "No bundled SDL2 binaries for your toolchain. Disable YUZU_USE_BUNDLED_SDL2 and provide your own.")
|
||||
endif()
|
||||
|
||||
if (DEFINED SDL2_VER)
|
||||
download_bundled_external("sdl2/" ${SDL2_VER} SDL2_PREFIX)
|
||||
endif()
|
||||
|
|
@ -689,7 +805,10 @@ function(create_target_directory_groups target_name)
|
|||
endfunction()
|
||||
|
||||
# Prevent boost from linking against libs when building
|
||||
target_link_libraries(Boost::headers INTERFACE Boost::disable_autolinking)
|
||||
if (NOT TARGET Boost::headers)
|
||||
target_link_libraries(Boost::headers INTERFACE Boost::disable_autolinking)
|
||||
endif()
|
||||
|
||||
# Adjustments for MSVC + Ninja
|
||||
if (MSVC AND CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
add_compile_options(
|
||||
|
|
@ -699,6 +818,59 @@ if (MSVC AND CMAKE_GENERATOR STREQUAL "Ninja")
|
|||
)
|
||||
endif()
|
||||
|
||||
# Adjustments for Clang-cl
|
||||
if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND ARCHITECTURE STREQUAL "x86_64")
|
||||
set(LLVM_MINGW_VERSION 20250402)
|
||||
|
||||
# Set download URL and library path within the ZIP
|
||||
set(ZIP_URL "https://github.com/mstorsjo/llvm-mingw/releases/download/${LLVM_MINGW_VERSION}/llvm-mingw-${LLVM_MINGW_VERSION}-ucrt-x86_64.zip")
|
||||
set(LIB_PATH "llvm-mingw-${LLVM_MINGW_VERSION}-ucrt-x86_64/lib/clang/20/lib/windows/libclang_rt.builtins-x86_64.a")
|
||||
|
||||
# Set paths for download and extraction
|
||||
set(DOWNLOAD_DIR "${CMAKE_BINARY_DIR}/llvm-mingw-download")
|
||||
set(ZIP_FILE "${DOWNLOAD_DIR}/llvm-mingw.zip")
|
||||
set(EXTRACTED_LIB "${DOWNLOAD_DIR}/${LIB_PATH}")
|
||||
|
||||
# Create download directory if it doesn't exist
|
||||
file(MAKE_DIRECTORY "${DOWNLOAD_DIR}")
|
||||
|
||||
# Download and extract if the library doesn't exist
|
||||
if(NOT EXISTS "${EXTRACTED_LIB}")
|
||||
message(STATUS "Downloading llvm-mingw runtime libraries...")
|
||||
|
||||
# Download the ZIP file
|
||||
file(DOWNLOAD
|
||||
${ZIP_URL}
|
||||
${ZIP_FILE}
|
||||
SHOW_PROGRESS
|
||||
# Uncomment and add EXPECTED_HASH if you know the SHA256 checksum
|
||||
EXPECTED_HASH SHA256=4edc13d878b4ec49c2f1a6e9161abb093bbaefc8b7d129f3b3f57a22a4a41d38
|
||||
)
|
||||
|
||||
message(STATUS "Extracting compiler-rt builtins library...")
|
||||
|
||||
# Extract the specific file from the ZIP
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E tar xvf "${ZIP_FILE}" "${LIB_PATH}"
|
||||
WORKING_DIRECTORY "${DOWNLOAD_DIR}"
|
||||
RESULT_VARIABLE extraction_result
|
||||
)
|
||||
|
||||
if(NOT extraction_result EQUAL 0)
|
||||
message(FATAL_ERROR "Failed to extract library: ${extraction_result}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Create imported target for the library
|
||||
add_library(llvm-mingw-runtime STATIC IMPORTED)
|
||||
set_target_properties(llvm-mingw-runtime PROPERTIES
|
||||
IMPORTED_LOCATION "${EXTRACTED_LIB}"
|
||||
)
|
||||
|
||||
# Link the library to all executables in the project
|
||||
link_libraries(llvm-mingw-runtime)
|
||||
endif()
|
||||
|
||||
if (YUZU_USE_FASTER_LD AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# We will assume that if the compiler is GCC, it will attempt to use ld.bfd by default.
|
||||
# Try to pick a faster linker.
|
||||
|
|
@ -706,10 +878,10 @@ if (YUZU_USE_FASTER_LD AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|||
find_program(MOLD mold)
|
||||
|
||||
if (MOLD AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12.1")
|
||||
message(NOTICE "Selecting mold as linker")
|
||||
message(STATUS "Selecting mold as linker")
|
||||
add_link_options("-fuse-ld=mold")
|
||||
elseif (LLD)
|
||||
message(NOTICE "Selecting lld as linker")
|
||||
message(STATUS "Selecting lld as linker")
|
||||
add_link_options("-fuse-ld=lld")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
|||
1291
CMakeModules/CPM.cmake
Normal file
1291
CMakeModules/CPM.cmake
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -98,22 +98,22 @@ function(copy_yuzu_Qt5_deps target_dir)
|
|||
"${Qt5_XCBGLINTEGRATIONS_DIR}libqxcb-glx-integration.so"
|
||||
)
|
||||
foreach(LIB ${Qt5_DLLS})
|
||||
file(COPY ${LIB} DESTINATION "${DLL_DEST}/lib" FOLLOW_SYMLINK_CHAIN)
|
||||
file(COPY "${LIB}" DESTINATION "${DLL_DEST}/lib" FOLLOW_SYMLINK_CHAIN)
|
||||
endforeach()
|
||||
foreach(LIB ${Qt5_IMAGEFORMAT_DLLS})
|
||||
file(COPY ${LIB} DESTINATION "${DLL_DEST}plugins/imageformats/" FOLLOW_SYMLINK_CHAIN)
|
||||
file(COPY "${LIB}" DESTINATION "${DLL_DEST}plugins/imageformats/" FOLLOW_SYMLINK_CHAIN)
|
||||
endforeach()
|
||||
foreach(LIB ${Qt5_PLATFORMTHEME_DLLS})
|
||||
file(COPY ${LIB} DESTINATION "${DLL_DEST}plugins/platformthemes/" FOLLOW_SYMLINK_CHAIN)
|
||||
file(COPY "${LIB}" DESTINATION "${DLL_DEST}plugins/platformthemes/" FOLLOW_SYMLINK_CHAIN)
|
||||
endforeach()
|
||||
foreach(LIB ${Qt5_PLATFORM_DLLS})
|
||||
file(COPY ${LIB} DESTINATION "${DLL_DEST}plugins/platforms/" FOLLOW_SYMLINK_CHAIN)
|
||||
file(COPY "${LIB}" DESTINATION "${DLL_DEST}plugins/platforms/" FOLLOW_SYMLINK_CHAIN)
|
||||
endforeach()
|
||||
foreach(LIB ${Qt5_PLATFORMINPUTCONTEXT_DLLS})
|
||||
file(COPY ${LIB} DESTINATION "${DLL_DEST}plugins/platforminputcontexts/" FOLLOW_SYMLINK_CHAIN)
|
||||
file(COPY "${LIB}" DESTINATION "${DLL_DEST}plugins/platforminputcontexts/" FOLLOW_SYMLINK_CHAIN)
|
||||
endforeach()
|
||||
foreach(LIB ${Qt5_XCBGLINTEGRATION_DLLS})
|
||||
file(COPY ${LIB} DESTINATION "${DLL_DEST}plugins/xcbglintegrations/" FOLLOW_SYMLINK_CHAIN)
|
||||
file(COPY "${LIB}" DESTINATION "${DLL_DEST}plugins/xcbglintegrations/" FOLLOW_SYMLINK_CHAIN)
|
||||
endforeach()
|
||||
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -12,16 +12,25 @@ set(__windows_copy_files YES)
|
|||
|
||||
# Any number of files to copy from SOURCE_DIR to DEST_DIR can be specified after DEST_DIR.
|
||||
# This copying happens post-build.
|
||||
function(windows_copy_files TARGET SOURCE_DIR DEST_DIR)
|
||||
# windows commandline expects the / to be \ so switch them
|
||||
string(REPLACE "/" "\\\\" SOURCE_DIR ${SOURCE_DIR})
|
||||
string(REPLACE "/" "\\\\" DEST_DIR ${DEST_DIR})
|
||||
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
||||
function(windows_copy_files TARGET SOURCE_DIR DEST_DIR)
|
||||
# windows commandline expects the / to be \ so switch them
|
||||
string(REPLACE "/" "\\\\" SOURCE_DIR ${SOURCE_DIR})
|
||||
string(REPLACE "/" "\\\\" DEST_DIR ${DEST_DIR})
|
||||
|
||||
# /NJH /NJS /NDL /NFL /NC /NS /NP - Silence any output
|
||||
# cmake adds an extra check for command success which doesn't work too well with robocopy
|
||||
# so trick it into thinking the command was successful with the || cmd /c "exit /b 0"
|
||||
add_custom_command(TARGET ${TARGET} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEST_DIR}
|
||||
COMMAND robocopy ${SOURCE_DIR} ${DEST_DIR} ${ARGN} /NJH /NJS /NDL /NFL /NC /NS /NP || cmd /c "exit /b 0"
|
||||
)
|
||||
endfunction()
|
||||
# /NJH /NJS /NDL /NFL /NC /NS /NP - Silence any output
|
||||
# cmake adds an extra check for command success which doesn't work too well with robocopy
|
||||
# so trick it into thinking the command was successful with the || cmd /c "exit /b 0"
|
||||
add_custom_command(TARGET ${TARGET} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEST_DIR}
|
||||
COMMAND robocopy ${SOURCE_DIR} ${DEST_DIR} ${ARGN} /NJH /NJS /NDL /NFL /NC /NS /NP || cmd /c "exit /b 0"
|
||||
)
|
||||
endfunction()
|
||||
else()
|
||||
function(windows_copy_files TARGET SOURCE_DIR DEST_DIR)
|
||||
add_custom_command(TARGET ${TARGET} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEST_DIR}
|
||||
COMMAND cp -ra ${SOURCE_DIR}/. ${DEST_DIR}
|
||||
)
|
||||
endfunction()
|
||||
endif()
|
||||
|
|
|
|||
72
README.md
72
README.md
|
|
@ -5,7 +5,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
||||
<h1 align="center">
|
||||
<br>
|
||||
<a href="http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu"><img src="https://codeberg.org/litucks/torzu/raw/branch/master/dist/yuzu.bmp" alt="torzu" width="200"></a>
|
||||
<a href="http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu"><img src="https://notabug.org/litucks/torzu/raw/master/dist/yuzu.png" alt="torzu" width="200"></a>
|
||||
<br>
|
||||
<b>torzu</b>
|
||||
<br>
|
||||
|
|
@ -21,29 +21,6 @@ It is written in C++ with portability in mind and runs on Linux, Windows and And
|
|||
A lot of fake Torzu websites have popped up. These are not mine. **This project will not have a clearnet website for the foreseeable future!**
|
||||
I highly advice against downloading anything from these websites, specially if their intention is clearly to make money through advertisements.
|
||||
|
||||
## Limited public development
|
||||
|
||||
I feel like working publicly on this has taken away the fun. You may not understand, but it's quite stressful to have the public eye on a project.
|
||||
Keep in mind, this is just a hobby project. I feel like I always have to keep updating so I don't disappoint you. It's just not a good situation for a hobby project to be in.
|
||||
Turns out: running an open source project takes a lot more time than I have.
|
||||
And then stupid and unnecessary issues like Windows Defender flagging the emulator as malware ruin the rest. I am grateful for all your bug reports, help and support, but all that has distracted me from taking the project into the direction I would've liked.
|
||||
|
||||
Today I've accidentally locked myself out of the Tor site out of pure stupidity and one of the things I didn't make a backup of for was the key required to get the same Tor site set back up.
|
||||
|
||||
For these reasons, I have decided to limit public development.
|
||||
It is not all over though. My plan is to:
|
||||
- continue the blog
|
||||
- move the blog into a seperate repository
|
||||
- keep this repository updated just enough so it stays compilable on Linux and Windows
|
||||
- keep the externals updated
|
||||
- push some bigger updates from my private upstream whenever I feel like (no promises)
|
||||
- NOT publish releases. If someone feels like publishing builds they should feel free to do that
|
||||
- NOT offer support in any way
|
||||
- feel free to open issues on the main repository though if you feel like an issue REALLY needs my attention
|
||||
- accept pull requests as long as they are of reasonable quality
|
||||
|
||||
Again, thanks to everyone who has supported my efforts so far in any way (even by creating bug reports), I really appreciate it.
|
||||
|
||||
## Compatibility
|
||||
|
||||
The emulator is capable of running most commercial games at full speed, provided you meet the [necessary hardware requirements](http://web.archive.org/web/20240130133811/https://yuzu-emu.org/help/quickstart/#hardware-requirements).
|
||||
|
|
@ -52,40 +29,43 @@ It runs most Nintendo Switch games released until the date of the Yuzu takedown.
|
|||
|
||||
## Goals
|
||||
|
||||
The first and foremost goal is long-term maintenance. Even if I stop commiting new features I will always do my best to keep the emulator functional and third party dependencies updated. This also means most of the changes made will eventually be bug fixes.
|
||||
Essentially, the main goal is that you can still use this emulator on modern systems in 20 years.
|
||||
It is very important to me that this project is going to be a good base to fork once grass has grown over the whole legal dilemma and people are willing to do real work on this emulator non-anonymously.
|
||||
**Consider this project in feature freeze!** This means no new features are going to be added. All further updates are going to be focused on maintaining compatibility with modern systems.
|
||||
|
||||
A secondary goal is the improvement of usability on low-end systems. This includes both improving the performance of the emulator as well as making games more playable below 100% speed whenever possible (the sync CPU to render speed limit option already helps with that in few cases).
|
||||
I think this project has done a really good job with keeping regressions from Yuzu to the minimum. If a game runs on Yuzu, and on the current version of Torzu, it's extremely likely that it works just as well on all future versions of Torzu.
|
||||
|
||||
Regardless, I am very happy with how things are right now.
|
||||
If you're looking for a Yuzu fork that definitely runs the games the original Yuzu emulator did well without any regressions, Torzu is probably your best bet for now.
|
||||
|
||||
## Development
|
||||
|
||||
Most of the development happens on [Dark Git](http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/). It's also where [our central repository](http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu) is hosted.
|
||||
All development happens on [Dark Git](http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/). It's also where [our central repository](http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu) is hosted.
|
||||
|
||||
To clone this git repository, you can use these commands given tor is installed and running:
|
||||
To clone this git repository, use these commands (assuming tor is installed as a service and running):
|
||||
|
||||
git -c http.proxy=socks5h://127.0.0.1:9050 clone --depth 1 http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu.git
|
||||
cd torzu
|
||||
git submodule update --init --recursive
|
||||
```bash
|
||||
git -c http.proxy=socks5h://127.0.0.1:9050 clone --depth 1 http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu.git
|
||||
cd torzu
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
Alternatively, you can clone from the [Codeberg mirror repository](https://codeberg.org/litucks/torzu):
|
||||
Alternatively, you can clone from the [NotABug mirror repository](https://notabug.org/litucks/torzu):
|
||||
|
||||
git clone https://codeberg.org/litucks/torzu.git --depth 1 --recursive
|
||||
```bash
|
||||
git clone --depth 1 https://notabug.org/litucks/torzu.git
|
||||
cd torzu
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
Note that above repository may be taken down any time. Do not rely on its existence in production. In case the Codeberg mirror goes down, another mirror will be most likely be set up on Bitbucket.
|
||||
Note that above repository may be taken down any time. Do not rely on its existence in production. In case the NotABug mirror goes down, another mirror will be most likely be set up on Bitbucket.
|
||||
|
||||
This project incorporates several commits from the [Suyu](https://suyu.dev) and [Sudachi](https://github.com/sudachi-emu/sudachi) forks (but cleaned up due to the typically mediocre code/commit quality from both projects) as well as changes listed in **Changes**.
|
||||
|
||||
## GitHub mirror repository
|
||||
|
||||
The GitHub mirror repository has been taken down. The new mirror repository is located on [Codeberg](https://codeberg.org/litucks/torzu).
|
||||
This project incorporates several commits from the [Suyu](https://suyu.dev), [Sudachi](https://github.com/sudachi-emu/sudachi) and [Citron](https://github.com/ong19th/Citron) forks, as well as changes listed in **Changes**.
|
||||
|
||||
## Building
|
||||
|
||||
* [Android Build](http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/src/branch/master/build-for-android.md) (Codeberg [alt](https://codeberg.org/litucks/torzu/src/branch/master/build-for-android.md))
|
||||
* [Linux Build](http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/src/branch/master/build-for-linux.md) (Codeberg [alt](https://codeberg.org/litucks/torzu/src/branch/master/build-for-linux.md))
|
||||
* [Windows Build](http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/src/branch/master/build-for-windows.md) (Codeberg [alt](https://codeberg.org/litucks/torzu/src/branch/master/build-for-windows.md))
|
||||
<!-- -->
|
||||
* [Android Build](http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/src/branch/master/build-for-android.md) (NotABug [alt](https://notabug.org/litucks/torzu/src/master/build-for-android.md))
|
||||
* [Linux Build](http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/src/branch/master/build-for-linux.md) (NotABug [alt](https://notabug.org/litucks/torzu/src/master/build-for-linux.md))
|
||||
* [Windows Build](http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/src/branch/master/build-for-windows.md) (NotABug [alt](https://notabug.org/litucks/torzu/src/master/build-for-windows.md))
|
||||
|
||||
## License
|
||||
|
||||
yuzu is licensed under the GPLv3 (or any later version). Refer to the [LICENSE.txt](https://github.com/yuzu-emu/yuzu/blob/master/LICENSE.txt) file.
|
||||
torzu is licensed under the GPLv3 (or any later version). Refer to the [LICENSE.txt](./LICENSE.txt) file.
|
||||
|
|
|
|||
99
blog/002-puzzle-pieces.md
Normal file
99
blog/002-puzzle-pieces.md
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
# Blog Entry 2: The puzzle pieces
|
||||
|
||||
I've been excited about this for a long time! Users typically think of applications as one big piece of software.
|
||||
In almost all cases this is not true.
|
||||
|
||||
In this post, I'd like to break Yuzu down into pieces for you. If you take a look at Torzu's `src/` directory, you'll see that there are several subdirectories. These are the main components, which are compiled as separate libraries (and then linked together). If you take a look at the `externals/` directory, you'll see a large list of other projects that Yuzu depends on.
|
||||
|
||||
I will focus on the `core` library here, as it contains most of the interesting stuff.
|
||||
|
||||
## ARM code execution
|
||||
|
||||
The `core/arm' directory is one of the most important: it is responsible for executing ARM instructions. It originally contained only code for dynamic integration, but was extended last year to include Native Code Execution (NCE).
|
||||
Interestingly, it doesn't have an ARM interpreter, which usually helps a lot when debugging JIT-related issues in other emulators. Although Dynarmic already has some debug-friendly options, it might be worthwhile to add an interpreter at some point.
|
||||
|
||||
## Crypto
|
||||
|
||||
Probably the most controversial part of Yuzu so far as it contains those "access-control circumvention measures". Not much to say about it, it is the core part of key derivation, ROM decryption, etc.
|
||||
|
||||
## Filesystem
|
||||
|
||||
There are file systems everywhere: Inside game ROMs, on the SD card, the internal flash, etc. `core/file_sys` is responsible for organizing them and their contents, as well as applying patches and overlays.
|
||||
|
||||
## Frontend
|
||||
|
||||
Despite the name, there is no actual frontend code here. It's just support code that can be used by different frontends.
|
||||
|
||||
There are currently 2 frontends that come with Yuzu:
|
||||
|
||||
- `yuzu`: Simply being called Yuzu, this is what you're interacting with most of the time. It is written in Qt Widgets.
|
||||
- `yuzu-cmd`: An SDL2 based frontend useful for light debugging. There's rarely a reason to use this.
|
||||
|
||||
## High-level emulation
|
||||
|
||||
Finally! This is where things get interesting.
|
||||
|
||||
Processes on an operating system can't do anything useful on their own. Typically, they can only access a small, predefined piece of RAM, and that's it. This is where the operating system APIs come in. Whenever a user process wants to access a file on a file system, query user input, or do just about anything else, it must use the operating system API to ask the operating system to perform that action on behalf of the process.
|
||||
|
||||
On modern operating systems, all of these things happen inside the operating system kernel. These kernels are called "monolithic kernels", but the operating system on the Nintendo Switch ("Horizon") doesn't work this way; it's called a "microkernel". Basically, instead of having the kernel handle hardware access, there are dedicated user processes called "services" that have direct access to the hardware they are responsible for. All the kernel does is manage memory, schedule tasks, and pass API calls to these services.
|
||||
|
||||
This is what a process accessing a driver would look like on a monolithic kernel like Linux or Windows:
|
||||
|
||||
```
|
||||
[Userspace ] [Kernel ]
|
||||
User process -> Kernel API -> Driver
|
||||
```
|
||||
|
||||
And this is what the same thing would look like on a microkernel like Horizon:
|
||||
|
||||
```
|
||||
[Userspace-] [Kernel------------------] [Userspace------]
|
||||
User process -> Kernel API -> Services API -> Service -> Driver
|
||||
```
|
||||
|
||||
As you can see, the path is much longer and therefore less efficient. Also note that each switch between userspace and kernel is quite slow, and that this path also has to be traversed backwards after the requested action is completed. However, this also means that if there is an exploit in a service, the rest of the system remains inaccessible to the attacker, and bugs can't bring down the kernel (which would kill the entire system).
|
||||
|
||||
Yes, Nintendo really did prioritize good security so that the Switch wouldn't be so easily hacked over performance on already weak hardware. Thanks, Nintendo.
|
||||
|
||||
Anyway, since Yuzu is a high-level emulator, it has to implement the kernel API and all those services itself. This is done in the `core/hle` directory. If you'd like to learn more, check out these Switchbrew pages:
|
||||
|
||||
- https://switchbrew.org/wiki/SVC: Kernel API
|
||||
- https://switchbrew.org/wiki/Services_API: Services API + Service list
|
||||
|
||||
## Internal network
|
||||
|
||||
This part of the code handles the lowest level of networking, as well as redirection to a multiplayer server (Did you know? Yuzu multiplayer servers work kind of like a VPN!). Nothing special or noteworthy here at all.
|
||||
|
||||
## Loader
|
||||
|
||||
This is where ROM files are loaded:
|
||||
|
||||
- Mapping of executable code and data to memory
|
||||
- Filesystem setup
|
||||
|
||||
## Memory
|
||||
|
||||
Nope, no memory management here. Not sure why this directory is called "memory" at all, since all it contains is the code responsible for applying cheats. Yes, cheats end up only interacting with memory, but it should have just been called "cheat".
|
||||
|
||||
Of note is the cheat VM, which is a nice, tiny cheat interpreter. Pretty cool!
|
||||
|
||||
## Tools
|
||||
|
||||
Here you'll find some debugging tools, including a "memory freezer" that allows you to silently prevent the game from changing data at certain memory addresses.
|
||||
|
||||
Quoting from `freezer.h`:
|
||||
|
||||
> This class allows the user to prevent an application from writing new values to certain memory
|
||||
> locations. This has a variety of uses when attempting to reverse a game.
|
||||
>
|
||||
> One example could be a cheat to prevent Mario from taking damage in SMO. One could freeze the
|
||||
> memory address that the game uses to store Mario's health so when he takes damage (and the game
|
||||
> tries to write the new health value to memory), the value won't change.
|
||||
|
||||
And then there's also RenderDoc integration for graphics debugging.
|
||||
|
||||
## Conclusion
|
||||
|
||||
There are many more components I could have listed here, especially outside the `core' directory, but I feel these are the most important ones, and I don't want this article to go on forever.
|
||||
|
||||
Thank you for reading and making it to the end. I welcome you to create issues for any mistgakes you find here!
|
||||
BIN
blog/002-puzzle-pieces.md.sig
Normal file
BIN
blog/002-puzzle-pieces.md.sig
Normal file
Binary file not shown.
24
boost-1.88.0-fix.patch
Normal file
24
boost-1.88.0-fix.patch
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
diff -ruN boost-src/libs/cobalt/include/boost/cobalt/concepts.hpp boost-src-patched/libs/cobalt/include/boost/cobalt/concepts.hpp
|
||||
--- boost-src/libs/cobalt/include/boost/cobalt/concepts.hpp 2025-04-12 18:25:53.791233755 +0200
|
||||
+++ boost-src-patched/libs/cobalt/include/boost/cobalt/concepts.hpp 2025-04-12 18:29:50.304496166 +0200
|
||||
@@ -62,7 +62,7 @@
|
||||
template <typename T>
|
||||
concept with_get_executor = requires (T& t)
|
||||
{
|
||||
- {t.get_executor()} -> asio::execution::executor;
|
||||
+ t.get_executor();
|
||||
};
|
||||
|
||||
|
||||
diff -ruN boost-src/libs/context/CMakeLists.txt boost-src-patched/libs/context/CMakeLists.txt
|
||||
--- boost-src/libs/context/CMakeLists.txt 2025-04-12 18:25:53.847233801 +0200
|
||||
+++ boost-src-patched/libs/context/CMakeLists.txt 2025-04-12 18:29:33.436479899 +0200
|
||||
@@ -189,7 +189,7 @@
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set_property(SOURCE ${ASM_SOURCES} APPEND PROPERTY COMPILE_OPTIONS "-x" "assembler-with-cpp")
|
||||
- elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
+ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT MSVC)
|
||||
set_property(SOURCE ${ASM_SOURCES} APPEND PROPERTY COMPILE_OPTIONS "-Wno-unused-command-line-argument")
|
||||
endif()
|
||||
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
### Dependencies
|
||||
* [Android Studio](https://developer.android.com/studio)
|
||||
* [NDK 25.2.9519653 and CMake 3.22.1](https://developer.android.com/studio/projects/install-ndk#default-version)
|
||||
* [NDK 26.3.11579264 and CMake 3.22.1](https://developer.android.com/studio/projects/install-ndk#default-version)
|
||||
* [Git](https://git-scm.com/download)
|
||||
|
||||
#### WINDOWS ONLY - Additional Dependencies
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
### Cloning yuzu with Git
|
||||
**from Codeberg repo (the `--recursive` option automatically clones the required Git submodules):**
|
||||
```
|
||||
git clone --depth 1 --recursive https://codeberg.org/litucks/torzu.git
|
||||
git clone --depth 1 --recursive https://notabug.org/litucks/torzu.git
|
||||
cd torzu
|
||||
```
|
||||
**from Torzu repo (assuming Tor is installed as a service):**
|
||||
|
|
@ -44,9 +44,9 @@ https://developer.android.com/studio/intro
|
|||
### Dependencies
|
||||
```
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y sdkmanager openjdk-17-jdk build-essential curl git pkg-config glslang-tools zip
|
||||
sudo sdkmanager "ndk;26.1.10909125" "platforms;android-34" "build-tools;33.0.1" "cmake;3.22.1" "platform-tools"
|
||||
sudo update-alternatives --config java # Select Java 17 here if possible
|
||||
sudo apt-get install -y sdkmanager openjdk-21-jdk build-essential curl git pkg-config glslang-tools zip
|
||||
sudo sdkmanager "ndk;26.3.11579264" "platforms;android-35" "build-tools;35.0.0" "cmake;3.22.1" "platform-tools;35.0.2"
|
||||
sudo update-alternatives --config java # Select Java 21 here if possible
|
||||
```
|
||||
|
||||
### Cloning Yuzu with Git
|
||||
|
|
@ -61,3 +61,69 @@ cd src/android
|
|||
```
|
||||
|
||||
The APK will be at `src/android/app/build/outputs/apk/mainline/release/app-mainline-release.apk`
|
||||
|
||||
## Building an installable turnip driver package
|
||||
|
||||
Adapted from the mesa documentation [here](https://docs.mesa3d.org/android.html#building-using-the-android-ndk) and the released zip in [this](https://github.com/K11MCH1/AdrenoToolsDrivers) GitHub repo.
|
||||
|
||||
### Dependencies
|
||||
|
||||
Follow the steps to setup a CLI build above and additionally run
|
||||
```
|
||||
sudo apt-get install -y python3-mako python3-yaml byacc flex
|
||||
```
|
||||
to install some additional required packages.
|
||||
|
||||
Create a file `~/.local/share/meson/cross/android-aarch64` with the following content:
|
||||
```
|
||||
[binaries]
|
||||
ar = '/opt/android-sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar'
|
||||
c = ['/opt/android-sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang']
|
||||
cpp = ['/opt/android-sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang++', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
|
||||
c_ld = 'lld'
|
||||
cpp_ld = 'lld'
|
||||
strip = '/opt/android-sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip'
|
||||
pkg-config = ['env', 'PKG_CONFIG_LIBDIR=/opt/android-sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/linux-x86_64/python3/lib/pkgconfig', '/usr/bin/pkg-config']
|
||||
[host_machine]
|
||||
system = 'android'
|
||||
cpu_family = 'aarch64'
|
||||
cpu = 'armv8'
|
||||
endian = 'little'
|
||||
```
|
||||
This informs `meson` (the build system used by mesa) about the Android NDK tools.
|
||||
If you need to modify this file with newer versions you can use a command like `find /opt/android-sdk -name "aarch64-linux-android*-clang"` to find the new paths.
|
||||
|
||||
### Clone the mesa git repo
|
||||
```
|
||||
git clone https://gitlab.freedesktop.org/mesa/mesa.git
|
||||
```
|
||||
Then use `git checkout <version>` to checkout the version you want to build (for example `mesa-24.2.0`).
|
||||
|
||||
### Compiling the turnip driver
|
||||
```
|
||||
meson setup build-android-aarch64 --cross-file android-aarch64 -Dplatforms=android -Dplatform-sdk-version=30 -Dandroid-stub=true -Dgallium-drivers= -Dvulkan-drivers=freedreno -Dfreedreno-kmds=kgsl -Dbuildtype=release
|
||||
meson compile -C build-android-aarch64
|
||||
```
|
||||
|
||||
### Create an installable driver package
|
||||
Check the file `VERSION` for the Mesa version and the file `include/vulkan/vulkan_core.h` and look for `VK_HEADER_VERSION_COMPLETE` for the Vulkan version.
|
||||
|
||||
Create a file named `meta.json` with the following content (replacing the `<placeholders>`)
|
||||
```
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"name": "Mesa Turnip Driver <mesa_version>",
|
||||
"description": "Compiled from source.",
|
||||
"author": "<name>",
|
||||
"packageVersion": "1",
|
||||
"vendor": "Mesa",
|
||||
"driverVersion": "Vulkan <vulkan_version>",
|
||||
"minApi": 30,
|
||||
"libraryName": "libvulkan_freedreno.so"
|
||||
}
|
||||
```
|
||||
and run these commands to create the package
|
||||
```
|
||||
mv ./build-android-aarch64/src/freedreno/vulkan/libvulkan_freedreno.so libvulkan_freedreno.so
|
||||
zip turnip.zip meta.json libvulkan_freedreno.so
|
||||
```
|
||||
|
|
|
|||
|
|
@ -1,13 +1,87 @@
|
|||
### Dependencies
|
||||
# Flatpak Build
|
||||
|
||||
You'll need to download and install the following to build yuzu:
|
||||
**NOTE: Flatpaks are built with a wrapper repo, which downloads everything needed including the main torzu repo.**
|
||||
|
||||
First install `flatpak` and `flatpak-builder` for your specific distro:
|
||||
|
||||
* Arch / Manjaro:
|
||||
```bash
|
||||
sudo pacman -Syu --needed flatpak flatpak-builder
|
||||
```
|
||||
* Debian / Ubuntu / Linux Mint:
|
||||
```bash
|
||||
sudo apt-get install flatpak flatpak-builder
|
||||
```
|
||||
* Fedora:
|
||||
```bash
|
||||
sudo dnf install flatpak flatpak-builder
|
||||
```
|
||||
|
||||
Then install flatpak dependencies from within flatpak:
|
||||
|
||||
```bash
|
||||
flatpak install org.kde.Sdk//5.15-23.08 io.qt.qtwebengine.BaseApp//5.15-23.08
|
||||
```
|
||||
Clone the torzu-flatpak repo and dependencies **(assuming tor is installed as a service and running)**:
|
||||
```bash
|
||||
git -c http.proxy=socks5h://127.0.0.1:9050 clone --depth 1 --recursive http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/onion.torzu_emu.torzu torzuFlatpak
|
||||
```
|
||||
Alternatively, you can clone from the github repo:
|
||||
```bash
|
||||
git clone --depth 1 --recursive https://github.com/litucks/onion.torzu_emu.torzu.git torzuFlatpak
|
||||
```
|
||||
Enter the cloned directory and run the build script:
|
||||
```bash
|
||||
cd torzuFlatpak && ./build.sh
|
||||
```
|
||||
The resulting `torzu.flatpak` will be in the same directory as the build script.
|
||||
|
||||
To install:
|
||||
```bash
|
||||
flatpak install torzu.flatpak
|
||||
```
|
||||
---
|
||||
---
|
||||
---
|
||||
|
||||
# AppImage Build
|
||||
|
||||
The AppImage Builder is included in the main torzu repo.
|
||||
|
||||
First you must build a native linux version from the section below, with the resulting executables in the `torzu/build/bin` folder. Leave everything where it is.
|
||||
|
||||
After that you only have to run the following (assuming you're still in the `build` folder after running `ninja`):
|
||||
```bash
|
||||
cd .. && ./AppImage-build.sh
|
||||
```
|
||||
The script enters the `AppImageBuilder` folder and generates the AppImage executable.
|
||||
|
||||
The resulting `torzu.AppImage` file is moved back into the main root `torzu` folder where `AppImage-build.sh` is.
|
||||
|
||||
To run it:
|
||||
```bash
|
||||
./torzu.AppImage
|
||||
```
|
||||
***These steps are included as an option in the native build instructions below!***
|
||||
|
||||
**NOTE: the native binaries will still be in the `torzu/build/bin` folder, so you can archive them to have both versions.**
|
||||
|
||||
---
|
||||
---
|
||||
---
|
||||
|
||||
# Native Builds
|
||||
|
||||
### Dependencies (easy copy/paste commands provided after)
|
||||
|
||||
You'll need to download and install the following:
|
||||
|
||||
* [GCC](https://gcc.gnu.org/) v11+ (for C++20 support) & misc
|
||||
* This page is being updated as we transition to GCC 11
|
||||
* If GCC 12 is installed, [Clang](https://clang.llvm.org/) v14+ is required for compiling
|
||||
* [CMake](https://www.cmake.org/) 3.15+
|
||||
|
||||
The following are handled by yuzu's externals:
|
||||
The following are handled by torzu's externals:
|
||||
|
||||
* [FFmpeg](https://ffmpeg.org/)
|
||||
* [SDL2](https://www.libsdl.org/download-2.0.php) 2.0.18+
|
||||
|
|
@ -19,7 +93,7 @@ If version 5.15.2 is not already installed, pre-compiled binaries for Qt 5.15.2
|
|||
|
||||
All other dependencies will be downloaded by [vcpkg](https://vcpkg.io/) if needed:
|
||||
|
||||
* [Boost](https://www.boost.org/users/download/) 1.79.0+
|
||||
* [Boost](https://www.boost.org/users/download/) 1.86.0+
|
||||
* [Catch2](https://github.com/catchorg/Catch2) 2.13.7 - 2.13.9
|
||||
* [fmt](https://fmt.dev/) 8.0.1+
|
||||
* [lz4](http://www.lz4.org) 1.8+
|
||||
|
|
@ -28,98 +102,150 @@ All other dependencies will be downloaded by [vcpkg](https://vcpkg.io/) if neede
|
|||
* [ZLIB](https://www.zlib.net/) 1.2+
|
||||
* [zstd](https://facebook.github.io/zstd/) 1.5+
|
||||
|
||||
If an ARM64 build is intended, export `VCPKG_FORCE_SYSTEM_BINARIES=1`.
|
||||
### Dependencies are listed here as commands that can be copied/pasted. Of course, they should be inspected before being run.
|
||||
|
||||
Dependencies are listed here as commands that can be copied/pasted. Of course, they should be inspected before being run.
|
||||
- All Distros
|
||||
|
||||
- If an ARM64 build is intended, export `VCPKG_FORCE_SYSTEM_BINARIES=1`.
|
||||
|
||||
- Arch / Manjaro:
|
||||
- `sudo pacman -Syu --needed base-devel boost catch2 cmake ffmpeg fmt git glslang libzip lz4 mbedtls ninja nlohmann-json openssl opus qt5 sdl2 zlib zstd zip unzip`
|
||||
|
||||
```bash
|
||||
sudo pacman -Syu --needed base-devel boost catch2 cmake ffmpeg fmt git glslang libzip lz4 mbedtls ninja nlohmann-json openssl opus qt5 sdl2 unzip zip zlib zstd perl
|
||||
```
|
||||
- Building with QT Web Engine needs to be specified when running CMake with the param `-DCMAKE_CXX_FLAGS="-I/usr/include/qt/QtWebEngineWidgets"` with qt5-webengine installed.
|
||||
- GCC 11 or later is required.
|
||||
- Ubuntu / Linux Mint / Debian:
|
||||
- `sudo apt-get install autoconf cmake g++-11 gcc-11 git glslang-tools libasound2 libboost-context-dev libglu1-mesa-dev libhidapi-dev libpulse-dev libtool libudev-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-xkb1 libxext-dev libxkbcommon-x11-0 mesa-common-dev nasm ninja-build qtbase5-dev qtbase5-private-dev qtwebengine5-dev qtmultimedia5-dev libmbedtls-dev catch2 libfmt-dev liblz4-dev nlohmann-json3-dev libzstd-dev libssl-dev libavfilter-dev libavcodec-dev libswscale-dev`
|
||||
- Ubuntu 22.04, Linux Mint 20, or Debian Bullseye or later is required.
|
||||
- Users need to manually specify building with QT Web Engine enabled. This is done using the parameter `-DYUZU_USE_QT_WEB_ENGINE=ON` when running CMake.
|
||||
|
||||
- Debian / Ubuntu / Linux Mint:
|
||||
|
||||
```bash
|
||||
sudo apt-get install autoconf catch2 cmake g++-11 gcc-11 git glslang-tools libasound2 libavcodec-dev libavfilter-dev libboost-context-dev libfmt-dev libglu1-mesa-dev libhidapi-dev liblz4-dev libmbedtls-dev libpulse-dev libssl-dev libswscale-dev libtool libudev-dev libva-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-xkb1 libxext-dev libxkbcommon-x11-0 libxxhash-dev libzstd-dev mesa-common-dev nasm ninja-build nlohmann-json3-dev qtbase5-dev qtbase5-private-dev qtmultimedia5-dev qttools5-dev qtwebengine5-dev shasum
|
||||
```
|
||||
- Debian 11 (Bullseye), Ubuntu 22.04, Linux Mint 20 or later is required.
|
||||
- Users need to manually specify building with QT Web Engine enabled. This is done using the parameter `-DYUZU_USE_QT_WEB_ENGINE=ON` when running CMake.
|
||||
- Users need to manually specify building with GCC 11. This can be done by adding the parameters `-DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11` when running CMake. i.e.
|
||||
- Users need to manually disable building SDL2 from externals if they intend to use the version provided by their system by adding the parameters `-DYUZU_USE_EXTERNAL_SDL2=OFF`
|
||||
|
||||
```
|
||||
git submodule update --init --recursive
|
||||
cmake .. -GNinja -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11
|
||||
```
|
||||
|
||||
- ***example cmake without system SDL2 (swap into full build commands below):***
|
||||
```bash
|
||||
cmake .. -GNinja -DYUZU_USE_BUNDLED_VCPKG=ON -DYUZU_TESTS=OFF -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -DYUZU_USE_QT_WEB_ENGINE=ON
|
||||
```
|
||||
- Fedora:
|
||||
- `sudo dnf install autoconf ccache cmake fmt-devel gcc{,-c++} glslang hidapi-devel json-devel libtool libusb1-devel libzstd-devel lz4-devel nasm ninja-build openssl-devel pulseaudio-libs-devel qt5-linguist qt5-qtbase{-private,}-devel qt5-qtwebengine-devel qt5-qtmultimedia-devel speexdsp-devel wayland-devel zlib-devel ffmpeg-devel libXext-devel`
|
||||
|
||||
```bash
|
||||
sudo dnf install autoconf ccache cmake ffmpeg-devel fmt-devel gcc{,-c++} glslang hidapi-devel json-devel libtool libusb1-devel libXext-devel libzstd-devel lz4-devel nasm ninja-build openssl-devel pulseaudio-libs-devel qt5-linguist qt5-qtbase{-private,}-devel qt5-qtmultimedia-devel qt5-qtwebengine-devel shasum speexdsp-devel wayland-devel zlib-devel perl-Digest-SHA
|
||||
```
|
||||
- Fedora 32 or later is required.
|
||||
- Due to GCC 12, Fedora 36 or later users need to install `clang`, and configure CMake to use it via `-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang`
|
||||
- CMake arguments to force system libraries:
|
||||
- SDL2: `-DYUZU_USE_BUNDLED_SDL2=OFF -DYUZU_USE_EXTERNAL_SDL2=OFF`
|
||||
- FFmpeg: `-DYUZU_USE_EXTERNAL_FFMPEG=OFF`
|
||||
- [RPM Fusion](https://rpmfusion.org/) (free) is required to install `ffmpeg-devel`
|
||||
|
||||
- Gentoo:
|
||||
|
||||
- **\*\*Disclaimer\*\***: this dependency list was written by a novice Gentoo user who first set it up with a DE, and then based this list off of the Fedora dependency list. This may be missing some requirements, or includes too many. Caveat emptor.
|
||||
- `emerge --ask app-arch/lz4 dev-libs/boost dev-libs/hidapi dev-libs/libzip dev-libs/openssl dev-qt/linguist dev-qt/qtconcurrent dev-qt/qtcore dev-util/cmake dev-util/glslang dev-vcs/git media-libs/alsa-lib media-libs/opus media-sound/pulseaudio media-video/ffmpeg net-libs/mbedtls sys-libs/zlib x11-libs/libXext`
|
||||
```bash
|
||||
emerge --ask app-arch/lz4 dev-libs/boost dev-libs/hidapi dev-libs/libzip dev-libs/openssl dev-qt/linguist dev-qt/qtconcurrent dev-qt/qtcore dev-util/cmake dev-util/glslang dev-vcs/git media-libs/alsa-lib media-libs/opus media-sound/pulseaudio media-video/ffmpeg net-libs/mbedtls sys-libs/zlib x11-libs/libXext
|
||||
```
|
||||
- GCC 11 or later is required.
|
||||
- Users may need to append `pulseaudio`, `bindist` and `context` to the `USE` flag.
|
||||
|
||||
### Cloning yuzu with Git
|
||||
# Building
|
||||
|
||||
**from Codeberg repo (the `--recursive` option automatically clones the required Git submodules):**
|
||||
```
|
||||
git clone --depth 1 --recursive https://codeberg.org/litucks/torzu.git
|
||||
cd torzu
|
||||
### Clone the source with Git
|
||||
|
||||
**from Notabug repo:**
|
||||
```bash
|
||||
git clone --depth 1 https://notabug.org/litucks/torzu.git
|
||||
```
|
||||
|
||||
**from Torzu repo (assuming Tor is installed as a service):**
|
||||
```
|
||||
**from Torzu repo (assuming Tor is installed as a service, such as `sudo apt install tor` using default settings):**
|
||||
```bash
|
||||
git -c http.proxy=socks5h://127.0.0.1:9050 clone --depth 1 http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu.git
|
||||
cd torzu
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
### Building yuzu in Release Mode (Optimized)
|
||||
### Build in Release Mode (Optimized)
|
||||
|
||||
If you need to run ctests, you can disable `-DYUZU_TESTS=OFF` and install Catch2.
|
||||
|
||||
***Be sure to swap your above distro-specific commands into the line starting with*** `cmake` (the options already included below should still be used):
|
||||
|
||||
```bash
|
||||
cd torzu
|
||||
git submodule update --init --recursive
|
||||
mkdir build && cd build
|
||||
cmake .. -GNinja -DYUZU_USE_BUNDLED_VCPKG=ON -DYUZU_TESTS=OFF
|
||||
ninja
|
||||
```
|
||||
|
||||
If building for the Steam Deck and you have LLVM 17 installed, you need to disable linking against it in the CMake command. The Steam Deck, as of SteamOS v3.6.20, includes `libLLVM-16`.
|
||||
|
||||
To verify which libraries your application is linking against, you can use the ldd command. For example:
|
||||
|
||||
```bash
|
||||
ldd torzu/build/bin/yuzu
|
||||
```
|
||||
|
||||
Look for entries related to `libLLVM` (or grep the ldd output). If it shows `libLLVM-17`, you need to adjust your configuration.
|
||||
|
||||
Use the following CMake command to disable linking against LLVM 17, instead of the one above:
|
||||
|
||||
```bash
|
||||
cmake .. -GNinja -DYUZU_USE_BUNDLED_VCPKG=ON -DYUZU_TESTS=OFF -DYUZU_USE_LLVM_DEMANGLE=OFF
|
||||
ninja
|
||||
```
|
||||
|
||||
There should now be executable binaries located in the `torzu/build/bin` folder.
|
||||
|
||||
You can choose to (all starting from the `build` folder):
|
||||
|
||||
* **Make an AppImage** (the resulting `torzu.AppImage` will be in the `torzu` folder):
|
||||
```bash
|
||||
cd .. && ./AppImage-build.sh
|
||||
```
|
||||
|
||||
* **Install the binaries to your system with shortcuts**:
|
||||
```bash
|
||||
sudo ninja install
|
||||
```
|
||||
|
||||
Optionally, you can use `cmake-gui ..` to adjust various options (e.g. disable the Qt GUI).
|
||||
|
||||
### Building yuzu in Debug Mode (Slow)
|
||||
|
||||
* **Run them without installing**:
|
||||
```bash
|
||||
cd bin
|
||||
./yuzu
|
||||
# or
|
||||
./yuzu-cmd
|
||||
```
|
||||
|
||||
* **PORTABLE INSTALL** - use the native binaries (without being installed to the system) and add a `user` folder next to them (does not work with AppImage or Flatpak):
|
||||
```bash
|
||||
cd bin
|
||||
mkdir user
|
||||
./yuzu
|
||||
```
|
||||
All data usually in the `~/.local/share/yuzu` folder will now be located in the `user` folder instead, so you can easily archive and restore a working install.
|
||||
|
||||
Optionally, you can use `cmake-gui ..` instead to adjust various options (e.g. disable the Qt GUI).
|
||||
|
||||
---
|
||||
---
|
||||
---
|
||||
|
||||
### Build in Debug Mode (Slow)
|
||||
|
||||
Same as above, but add `-DCMAKE_BUILD_TYPE=Debug`:
|
||||
```bash
|
||||
mkdir build && cd build
|
||||
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug -DYUZU_USE_BUNDLED_VCPKG=ON -DYUZU_TESTS=OFF
|
||||
ninja
|
||||
```
|
||||
|
||||
### Building with debug symbols
|
||||
### Build with debug symbols
|
||||
|
||||
Same as above, but use `-DCMAKE_BUILD_TYPE=RelWithDebInfo`:
|
||||
|
||||
```bash
|
||||
mkdir build && cd build
|
||||
cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_USE_BUNDLED_VCPKG=ON -DYUZU_TESTS=OFF
|
||||
ninja
|
||||
```
|
||||
|
||||
### Running without installing
|
||||
|
||||
After building, the binaries `yuzu` and `yuzu-cmd` (depending on your build options) will end up in `build/bin/`.
|
||||
|
||||
```bash
|
||||
# SDL
|
||||
cd build/bin/
|
||||
./yuzu-cmd
|
||||
|
||||
# Qt
|
||||
cd build/bin/
|
||||
./yuzu
|
||||
```
|
||||
|
||||
### Debugging
|
||||
|
||||
1. Enable CPU debugging
|
||||
|
|
|
|||
|
|
@ -16,8 +16,6 @@ cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_USE_BUNDLED_VCPKG=OFF
|
|||
ninja
|
||||
```
|
||||
|
||||
TODO: use newer vcpkg. This fixes the boost context library, and allows using the web service
|
||||
TODO: figure out what's up with libusb
|
||||
- TODO: use newer vcpkg. This fixes the boost context library, and allows using the web service
|
||||
- TODO: figure out what's up with libusb
|
||||
|
||||
|
|
|
|||
|
|
@ -1,58 +1,122 @@
|
|||
## Method I: MSVC Build for Windows
|
||||
# Method I: MSVC Build for Windows (MS Visual Studio)
|
||||
|
||||
### Minimal Dependencies
|
||||
### MSVC: Overview
|
||||
|
||||
On Windows, all library dependencies are automatically included within the `externals` folder, or can be downloaded on-demand. To build yuzu, you need to install:
|
||||
* Install Minimal Dependencies (details and setup below)
|
||||
* Visual Studio Community 2022
|
||||
* CMake
|
||||
* Vulkan SDK
|
||||
* Python
|
||||
* Git for Windows
|
||||
* Build via Command Line (simplest if dependencies are installed correctly)
|
||||
* (or) Build with GUI Tools (backup graphical interface)
|
||||
|
||||
* **[Visual Studio 2022 Community](https://visualstudio.microsoft.com/downloads/)** - **Make sure to select C++ support in the installer. Make sure to update to the latest version if already installed.**
|
||||
|
||||
### MSVC: Install Minimal Dependencies
|
||||
|
||||
To build torzu on Windows with Visual Studio, you need to install:
|
||||
|
||||
* **[Visual Studio 2022 Community](https://visualstudio.microsoft.com/downloads/)**
|
||||
* **Update to the latest version if already installed. (continued below)**
|
||||
|
||||

|
||||
|
||||
* **[CMake](https://cmake.org/download/)** - Used to generate Visual Studio project files. Does not matter if either 32-bit or 64-bit version is installed.
|
||||
* **Visual Studio 2022 Community (continued)**
|
||||
* Be sure to select "Desktop development with C++"
|
||||
* Select the MSVC components outlined in red below (**especially VS 2019 build tools**.)
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
* **[CMake](https://cmake.org/download/)** - Used to generate Visual Studio project files. Choose 32-bit or 64-bit according to your system.
|
||||
* **If it asks to be added to your system PATH, say YES.**
|
||||
|
||||

|
||||
|
||||
* **[Vulkan SDK](https://vulkan.lunarg.com/sdk/home#windows)** - **Make sure to select Latest SDK.**
|
||||
* **[Vulkan SDK](https://vulkan.lunarg.com/sdk/home#windows)** - Make sure to select Latest SDK.
|
||||
* **If it asks to be added to your system PATH, say YES.**
|
||||
|
||||

|
||||
|
||||
* **[Python](https://www.python.org/downloads/windows/)** - Select latest stable Windows installer. Does not matter if either 32-bit or 64-bit version is installed.
|
||||
* **[Python](https://www.python.org/downloads/windows/)** - Select latest stable Windows installer. Choose 32-bit or 64-bit according to your system.
|
||||
* **If it asks to be added to your system PATH, say YES.**
|
||||
|
||||

|
||||
|
||||
* **Git** - We recommend [Git for Windows](https://gitforwindows.org).
|
||||
* **[Git for Windows](https://gitforwindows.org)** - (see next step)
|
||||
|
||||

|
||||
|
||||
* While installing Git Bash, you should tell it to include Git in your system path. (Choose the "Git from the command line and also from 3rd-party software" option.) If you missed that, don't worry, you'll just have to manually tell CMake where your git.exe is, since it's used to include version info into the built executable.
|
||||
* When installing Git, include it in your system PATH by choosing the "**Git from the command line and also from 3rd-party software**" option.
|
||||
|
||||

|
||||
|
||||
### Cloning yuzu with Git
|
||||
* **REBOOT YOUR SYSTEM, to be sure all dependencies are registered before proceeding.**
|
||||
|
||||
**from Codeberg repo (the `--recursive` option automatically clones the required Git submodules):**
|
||||
---
|
||||
---
|
||||
|
||||
## MSVC: Build from the Command Line
|
||||
|
||||
* Open a command line (cmd.exe), navigate to a directory where you want to download the repo, then pick one option to clone into a subdirectory named "torzu":
|
||||
|
||||
**from Notabug repo:**
|
||||
```
|
||||
git clone --depth 1 --recursive https://codeberg.org/litucks/torzu.git
|
||||
cd torzu
|
||||
git clone --depth 1 https://notabug.org/litucks/torzu.git
|
||||
```
|
||||
**from Torzu repo (assuming Tor is installed as a service):**
|
||||
```
|
||||
git -c http.proxy=socks5h://127.0.0.1:9050 clone --depth 1 http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu.git
|
||||
```
|
||||
|
||||
* Assuming all dependencies were installed correctly, you should be able to continue from the above `git clone` and run the following commands to build:
|
||||
|
||||
```
|
||||
cd torzu
|
||||
git submodule update --init --recursive
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G "Visual Studio 17 2022" -A x64 -DYUZU_TESTS=OFF -DYUZU_BUILD_QT6=ON
|
||||
cmake --build . --config Release
|
||||
```
|
||||
* You'll find the resulting files in the `build/bin/Release` folder. To make it a portable install with all AppData files local to the torzu folder, add a "user" folder:
|
||||
```
|
||||
cd bin
|
||||
cd Release
|
||||
mkdir user
|
||||
```
|
||||
|
||||
* **ERRORS:** If you get an error after running the first cmake command (such as a missing library or CMakeLists.txt), first try running `git submodule update --init --recursive` from inside "torzu" folder again. If that doesn't work, try deleting the whole "torzu" folder and recloning via git from the beginning (as sometimes submodules will be incomplete without throwing an error.)
|
||||
|
||||
---
|
||||
---
|
||||
|
||||
## MSVC: Build with GUI Tools (Graphical Interface)
|
||||
|
||||
* Open a command line (cmd.exe), navigate to a directory where you want to download the repo, then pick one option to clone into a subdirectory named "torzu":
|
||||
|
||||
**from Notabug repo:**
|
||||
```
|
||||
git clone --depth 1 https://notabug.org/litucks/torzu.git
|
||||
```
|
||||
**from Torzu repo (assuming Tor is installed as a service):**
|
||||
```
|
||||
git -c http.proxy=socks5h://127.0.0.1:9050 clone --depth 1 http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu.git
|
||||
```
|
||||
then download dependencies with:
|
||||
```
|
||||
cd torzu
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||

|
||||
<!--* *(Note: yuzu by default downloads to `C:\Users\<user-name>\yuzu` (Master) or `C:\Users\<user-name>\yuzu-mainline` (Mainline)*-->
|
||||
|
||||
* *(Note: yuzu by default downloads to `C:\Users\<user-name>\yuzu` (Master) or `C:\Users\<user-name>\yuzu-mainline` (Mainline)*
|
||||
|
||||
### Building
|
||||
|
||||
* Open the CMake GUI application and point it to the `torzu` directory.
|
||||
* Open the CMake GUI application and point it to the `torzu` directory (instead of `yuzu-canary`).
|
||||
|
||||

|
||||
|
||||
* For the build directory, use a `/build` subdirectory inside the source directory or some other directory of your choice. (Tell CMake to create it.)
|
||||
* Use a `/build` subdirectory inside the `torzu` directory or some other directory of your choice. (Tell CMake to create it.)
|
||||
|
||||

|
||||

|
||||
|
|
@ -63,27 +127,23 @@ git submodule update --init --recursive
|
|||
|
||||
* *(Note: If you used GitHub's own app to clone, run `git submodule update --init --recursive` to get the remaining dependencies)*
|
||||
|
||||
* If you get an error about missing packages, enable `YUZU_USE_BUNDLED_VCPKG`, and then click Configure again.
|
||||
* **ERRORS:** If you get an error about missing packages, enable `YUZU_USE_BUNDLED_VCPKG`, and then click Configure again.
|
||||
|
||||
* *(You may also want to disable `YUZU_TESTS` in this case since Catch2 is not yet supported with this.)*
|
||||
|
||||

|
||||
|
||||
* If you get an error "Unable to find a valid Visual Studio instance", make sure that you installed following MSVC components (**especially VS 2019 build tools**.) and then try again.
|
||||
|
||||

|
||||
|
||||

|
||||
* **ERRORS:** If you get an error "Unable to find a valid Visual Studio instance", make sure that you installed the required MSVC components displayed above (**especially VS 2019 build tools**) and then try again.
|
||||
|
||||
* Click "Generate" to create the project files.
|
||||
|
||||

|
||||
|
||||
* Open the solution file `yuzu.sln` in Visual Studio 2022, which is located in the build folder.
|
||||
* Open the solution file `yuzu.sln` in Visual Studio 2022, which is located in the `build` directory.
|
||||
|
||||

|
||||
|
||||
* Depending if you want a graphical user interface or not (`yuzu` has the graphical user interface, while `yuzu-cmd` doesn't), select `yuzu` or `yuzu-cmd` in the Solution Explorer, right-click and `Set as StartUp Project`.
|
||||
* Select `yuzu` in the Solution Explorer, right-click and `Set as StartUp Project` (the yuzu, yuzu-cmd and yuzu-room executables will all be built.)
|
||||
|
||||
 
|
||||
|
||||
|
|
@ -95,87 +155,166 @@ git submodule update --init --recursive
|
|||
|
||||

|
||||
|
||||
* After build completed you can find the Torzu executable in directory specified in output log.
|
||||
* After build completed you can find the Torzu program files in a directory specified in the output log (usually `build\bin\Release`.)
|
||||
|
||||

|
||||
|
||||
---
|
||||
---
|
||||
---
|
||||
---
|
||||
---
|
||||
|
||||
## Method II: MinGW-w64 Build with MSYS2
|
||||
# Method II: Clang-CL on Linux
|
||||
|
||||
### Prerequisites to install
|
||||
Yet to be written. These loose snippets may help you:
|
||||
|
||||
https://github.com/mstorsjo/msvc-wine
|
||||
|
||||
https://apt.llvm.org
|
||||
|
||||
https://kb.firedaemon.com/support/solutions/articles/4000121705#Download-OpenSSL
|
||||
|
||||
https://github.com/clamwin/openssl
|
||||
|
||||
```
|
||||
# Probably not needed, use if include files can't be found
|
||||
exec bwrap --bind / / --tmpfs /usr/include --tmpfs /usr/lib/pkgconfig --tmpfs /usr/lib/x86_64-linux-gnu/pkgconfig --tmpfs /usr/lib/cmake --dev /dev /bin/bash
|
||||
```
|
||||
```
|
||||
# in build/linux
|
||||
../../configure -opensource -confirm-license -prefix ~/qt-everywhere-src-6.9.1/inst/linux -release ${QT_LIBTYPE} -ltcg -submodules qtbase,qttranslations,qtmultimedia -no-feature-vulkan -nomake examples -nomake tests -qt-doubleconversion -no-glib -qt-pcre -qt-zlib -qt-harfbuzz -qt-libpng -qt-libjpeg
|
||||
ninja install
|
||||
|
||||
# in build/windows
|
||||
cp -rv ../../qtmultimedia/src/multimedia/windows qtbase/include/QtMultimedia/private
|
||||
CC=clang-cl-19 CXX=clang-cl-19 CFLAGS="--target=x86_64-windows-msvc -fuse-ld=lld-link-19" CXXFLAGS="--target=x86_64-windows-msvc -fuse-ld=lld-link-19" ../../configure -opensource -confirm-license -prefix ~/qt-everywhere-src-6.9.1/inst/windows -release -static -ltcg -submodules qtbase,qtdeclarative,qtmultimedia -skip qtactiveqt -no-feature-vulkan -nomake examples -nomake tests -qt-doubleconversion -no-glib -qt-pcre -qt-zlib -qt-harfbuzz -qt-libpng -qt-libjpeg -platform win32-clang-msvc -qt-host-path ~/qt-everywhere-src-6.9.1/inst/linux -- -DCMAKE_SYSTEM_NAME=Windows
|
||||
ninja
|
||||
ninja install
|
||||
```
|
||||
```
|
||||
CC=clang-cl-19 CXX=clang-cl-19 cmake /tmp/torzu -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_ASM_FLAGS="--target=x86_64-windows-msvc" -DCMAKE_{C,CXX}_FLAGS:STRING="--target=x86_64-windows-msvc -DNOMINMAX /EHa -Wno-unused-command-line-argument -Wno-unknown-argument -flto=full -fdata-sections -ffunction-sections" -DCMAKE_EXE_LINKER_FLAGS="-Wl,--gc-sections" -DCMAKE_SYSTEM_NAME:STRING=Windows -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_USE_CPM=ON -DENABLE_OPENSSL=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_LIBUSB=OFF -DYUZU_TESTS=OFF -DQT_QMAKE_EXECUTABLE:FILEPATH=/home/user/qt-everywhere-src-6.9.1/inst/windows/bin/qmake -DCMAKE_PREFIX_PATH:PATH=/home/user/qt-everywhere-src-6.9.1/inst -GNinja
|
||||
```
|
||||
|
||||
---
|
||||
---
|
||||
---
|
||||
---
|
||||
---
|
||||
|
||||
# Method III: MinGW-w64 Build with MSYS2
|
||||
|
||||
## Prerequisites to install
|
||||
|
||||
* [MSYS2](https://www.msys2.org)
|
||||
* [Vulkan SDK](https://vulkan.lunarg.com/sdk/home#windows) - **Make sure to select Latest SDK.**
|
||||
* Make sure to follow the instructions and update to the latest version by running `pacman -Syu` as many times as needed.
|
||||
|
||||
### Install yuzu dependencies for MinGW-w64
|
||||
* Make sure to follow the instructions and update to the latest version by running `pacman -Syu` as many times as needed.
|
||||
|
||||
## Install other dependencies
|
||||
* Open the `MSYS2 MinGW 64-bit` (mingw64.exe) shell
|
||||
* Download and install all dependencies using: `pacman -Syu git make mingw-w64-x86_64-SDL2 mingw-w64-x86_64-cmake mingw-w64-x86_64-python-pip mingw-w64-x86_64-qt5 mingw-w64-x86_64-toolchain autoconf libtool automake-wrapper`
|
||||
* Add MinGW binaries to the PATH: `echo 'PATH=/mingw64/bin:$PATH' >> ~/.bashrc`
|
||||
* Add glslangValidator to the PATH: `echo 'PATH=$(readlink -e /c/VulkanSDK/*/Bin/):$PATH' >> ~/.bashrc`
|
||||
|
||||
### Clone the yuzu repository with Git
|
||||

|
||||
|
||||
**from Codeberg repo (the `--recursive` option automatically clones the required Git submodules):**
|
||||
* Download and install all dependencies using: `pacman -Syu git make mingw-w64-x86_64-SDL2 mingw-w64-x86_64-cmake mingw-w64-x86_64-qt5 mingw-w64-x86_64-toolchain`
|
||||
|
||||
## Setup environment variables
|
||||
```
|
||||
git clone --depth 1 --recursive https://codeberg.org/litucks/torzu.git
|
||||
cd torzu
|
||||
export PATH="<Absolute path to the Bin folder in Vulkan SDK>:$PATH"
|
||||
export VCPKG_DEFAULT_HOST_TRIPLET=x64-mingw-static
|
||||
export VCPKG_DEFAULT_TRIPLET=x64-mingw-static
|
||||
```
|
||||
We have to manually set some VCPKG variables for some reason.
|
||||
This issue probably already exists in the original Yuzu.
|
||||
|
||||
## Clone the torzu repository with Git
|
||||
|
||||
Navigate to a directory where you want the repo, then use one option below to clone into a subdirectory named "torzu":
|
||||
|
||||
<!---->
|
||||
|
||||
**from NotABug repo:**
|
||||
```
|
||||
git clone --depth 1 https://notabug.org/litucks/torzu.git
|
||||
```
|
||||
**from Torzu repo (assuming Tor is installed as a service):**
|
||||
```
|
||||
git -c http.proxy=socks5h://127.0.0.1:9050 clone --depth 1 http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu.git
|
||||
```
|
||||
then download the submodule dependencies with:
|
||||
```
|
||||
cd torzu
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
### Run the following commands to build yuzu (dynamically linked build)
|
||||
|
||||
```bash
|
||||
## Generating makefile
|
||||
```
|
||||
mkdir build && cd build
|
||||
cmake -G "MSYS Makefiles" -DYUZU_USE_BUNDLED_VCPKG=ON -DYUZU_TESTS=OFF ..
|
||||
make -j$(nproc)
|
||||
# test yuzu out with
|
||||
./bin/yuzu.exe
|
||||
cmake -G "MSYS Makefiles" -DYUZU_USE_BUNDLED_VCPKG=ON -DYUZU_TESTS=OFF -DVCPKG_TARGET_TRIPLET=x64-mingw-static ..
|
||||
```
|
||||
`DVCPKG_TARGET_TRIPLET` has to be overriden to `x64-mingw-static` here to generate a static build that doesn't require extra DLLs to be packaged.
|
||||
|
||||
* *(Note: This build is not a static build meaning that you need to include all of the DLLs with the .exe in order to use it!)*
|
||||
|
||||
e.g.
|
||||
```Bash
|
||||
cp externals/ffmpeg-*/bin/*.dll bin/
|
||||
## Build torzu
|
||||
```
|
||||
make -j$(nproc) yuzu
|
||||
```
|
||||
The reason we are not using `make all` is that linker will fail.
|
||||
This is because Yuzu developer didn't set linker flags properly in their `CMakeLists.txt` for some reason. So we have add something manually.
|
||||
```
|
||||
VERBOSE=1 make yuzu
|
||||
```
|
||||
This will shows the exact link command, should be something like:
|
||||
```
|
||||
cd ***/src/yuzu && /mingw64/bin/c++.exe -O3 -DNDEBUG -Wl,--subsystem,windows -Wl,--whole-archive ...
|
||||
```
|
||||
Copy the command line and add the following arguments:
|
||||
```
|
||||
-static-libstdc++ -lws2_32 -s -Wl,--Map,../../bin/yuzu.map
|
||||
```
|
||||
Explanation of the extra arguments:
|
||||
- `-static-libstdc++`: Force usage of static libstdc++, without this argument the binary will have no entrypoint.
|
||||
- `-lws2_32`: Link the ws2_32.a provided by mingw.
|
||||
- `-s`: Optional, strip the symbols from the output binary.
|
||||
- `-Wl,--Map,../../bin/yuzu.map`: Optional, output a separated linker map to `../../bin/yuzu.map`
|
||||
Please note that `-lw2_32` is already added, but the order is not correct and hence cause linking fails.
|
||||
|
||||
Bonus Note: Running programs from inside `MSYS2 MinGW x64` shell has a different %PATH% than directly from explorer. This different %PATH% has the locations of the other DLLs required.
|
||||

|
||||
Now the built executable should work properly. Repeating step 4 should build `yuzu-cmd` as well.
|
||||
Some DLLs (e.g., Qt) are still required as they cannot being linked statically. Copying those DLLs from the latest release is one option.
|
||||
|
||||
|
||||
### Building without Qt (Optional)
|
||||
## Building without Qt (Optional)
|
||||
|
||||
Doesn't require the rather large Qt dependency, but you will lack a GUI frontend:
|
||||
|
||||
* Pass the `-DENABLE_QT=no` flag to cmake
|
||||
* Pass the `-DENABLE_QT=NO` flag to cmake
|
||||
|
||||
## Method III: CLion Environment Setup
|
||||
---
|
||||
---
|
||||
---
|
||||
---
|
||||
---
|
||||
|
||||
### Minimal Dependencies
|
||||
# Method IV: CLion Environment Setup
|
||||
|
||||
## Minimal Dependencies
|
||||
|
||||
To build yuzu, you need to install the following:
|
||||
|
||||
* [CLion](https://www.jetbrains.com/clion/) - This IDE is not free; for a free alternative, check Method I
|
||||
* [Vulkan SDK](https://vulkan.lunarg.com/sdk/home#windows) - Make sure to select the Latest SDK.
|
||||
|
||||
### Cloning yuzu with CLion
|
||||
## Cloning yuzu with CLion
|
||||
|
||||
* Clone the Repository:
|
||||
|
||||

|
||||
|
||||
* using `https://notabug.org/litucks/torzu.git` (instead of the shown yuzu repo):
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
|
||||
### Building & Setup
|
||||
## Building & Setup
|
||||
|
||||
* Once Cloned, You will be taken to a prompt like the image below:
|
||||
|
||||
|
|
@ -200,23 +339,3 @@ To build yuzu, you need to install the following:
|
|||
|
||||

|
||||
|
||||
## Building from the command line with MSVC
|
||||
|
||||
**from Codeberg repo (the `--recursive` option automatically clones the required Git submodules):**
|
||||
```
|
||||
git clone --depth 1 --recursive https://codeberg.org/litucks/torzu.git
|
||||
cd torzu
|
||||
```
|
||||
**from Torzu repo (assuming Tor is installed as a service):**
|
||||
```
|
||||
git -c http.proxy=socks5h://127.0.0.1:9050 clone --depth 1 http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu.git
|
||||
cd torzu
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
followed by:
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G "Visual Studio 17 2022" -A x64
|
||||
cmake --build . --config Release
|
||||
```
|
||||
6
dist/72-yuzu-input.rules
vendored
6
dist/72-yuzu-input.rules
vendored
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
# Switch Pro Controller (USB/Bluetooth)
|
||||
KERNEL=="hidraw*", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="2009", MODE="0660", TAG+="uaccess"
|
||||
KERNEL=="hidraw*", KERNELS=="*057e:2009*", MODE="0660", TAG+="uaccess"
|
||||
KERNEL=="hidraw*", KERNELS=="*057E:2009*", MODE="0660", TAG+="uaccess"
|
||||
|
||||
# Joy-Con L (Bluetooth)
|
||||
KERNEL=="hidraw*", KERNELS=="*057e:2006*", MODE="0660", TAG+="uaccess"
|
||||
KERNEL=="hidraw*", KERNELS=="*057E:2006*", MODE="0660", TAG+="uaccess"
|
||||
|
||||
# Joy-Con R (Bluetooth)
|
||||
KERNEL=="hidraw*", KERNELS=="*057e:2007*", MODE="0660", TAG+="uaccess"
|
||||
KERNEL=="hidraw*", KERNELS=="*057E:2007*", MODE="0660", TAG+="uaccess"
|
||||
|
||||
# Joy-Con Charging Grip (USB)
|
||||
KERNEL=="hidraw*", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="200e", MODE="0660", TAG+="uaccess"
|
||||
|
|
|
|||
4
dist/languages/ar.ts
vendored
4
dist/languages/ar.ts
vendored
|
|
@ -754,7 +754,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/ca.ts
vendored
4
dist/languages/ca.ts
vendored
|
|
@ -752,7 +752,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/cs.ts
vendored
4
dist/languages/cs.ts
vendored
|
|
@ -752,7 +752,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/da.ts
vendored
4
dist/languages/da.ts
vendored
|
|
@ -754,7 +754,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/de.ts
vendored
4
dist/languages/de.ts
vendored
|
|
@ -753,7 +753,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/el.ts
vendored
4
dist/languages/el.ts
vendored
|
|
@ -754,7 +754,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/es.ts
vendored
4
dist/languages/es.ts
vendored
|
|
@ -783,7 +783,9 @@ Esta opción recomprime RGBA8 al formato BC1 o BC3, sacrificando calidad de imag
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
8
dist/languages/fr.ts
vendored
8
dist/languages/fr.ts
vendored
|
|
@ -784,8 +784,12 @@ Cette option recomprime le RGBA8 en format BC1 ou BC3, économisant ainsi la VRA
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<translation>Sélectionne si l'émulateur doit privilégier la conservation de la mémoire ou utiliser au maximum la mémoire vidéo disponible pour les performances. N'a aucun effet sur les graphiques intégrés. Le mode agressif peut avoir un impact sévère sur les performances d'autres applications telles que les logiciels d'enregistrement.</translation>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation>Sélectionne si l'émulateur doit privilégier la conservation de la mémoire ou utiliser au maximum la mémoire vidéo disponible pour les performances.
|
||||
Le mode agressif peut avoir un impact sévère sur les performances d'autres applications telles que les logiciels d'enregistrement.
|
||||
N'a aucun effet sur les graphiques intégrés.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="173"/>
|
||||
|
|
|
|||
8
dist/languages/hu.ts
vendored
8
dist/languages/hu.ts
vendored
|
|
@ -783,8 +783,12 @@ Ez az opció az RGBA8-at BC1 vagy BC3 formátumra tömöríti vissza, ami VRAM-o
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<translation>Kiválasztja, hogy az emulátor a teljesítmény érdekében inkább takarékoskodjon a memóriával, vagy maximálisan kihasználja a rendelkezésre álló videomemóriát. Integrált grafikára nincs hatással. Az agresszív üzemmód jelentősen befolyásolhatja más alkalmazások, például a rögzítő szoftverek teljesítményét.</translation>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation>Kiválasztja, hogy az emulátor a teljesítmény érdekében inkább takarékoskodjon a memóriával, vagy maximálisan kihasználja a rendelkezésre álló videomemóriát.
|
||||
Az agresszív üzemmód jelentősen befolyásolhatja más alkalmazások, például a rögzítő szoftverek teljesítményét.
|
||||
Integrált grafikára nincs hatással.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="173"/>
|
||||
|
|
|
|||
4
dist/languages/id.ts
vendored
4
dist/languages/id.ts
vendored
|
|
@ -783,7 +783,9 @@ Opsi ini merekompres RGBA8 ke format BC1 atau BC3, menghemat VRAM tetapi mempeng
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/it.ts
vendored
4
dist/languages/it.ts
vendored
|
|
@ -754,7 +754,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/ja_JP.ts
vendored
4
dist/languages/ja_JP.ts
vendored
|
|
@ -754,7 +754,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/ko_KR.ts
vendored
4
dist/languages/ko_KR.ts
vendored
|
|
@ -754,7 +754,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/nb.ts
vendored
4
dist/languages/nb.ts
vendored
|
|
@ -754,7 +754,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/nl.ts
vendored
4
dist/languages/nl.ts
vendored
|
|
@ -754,7 +754,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/pl.ts
vendored
4
dist/languages/pl.ts
vendored
|
|
@ -754,7 +754,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
8
dist/languages/pt_BR.ts
vendored
8
dist/languages/pt_BR.ts
vendored
|
|
@ -784,8 +784,12 @@ Esta opção recompacta o RGBA8 ou pro formato BC1 ou pro BC3, economizando VRAM
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<translation>Define se o emulador deve preferir conservar ou fazer o uso máximo da memória de vídeo disponível para melhorar a performance. Não tem efeito em gráficos integrados. O modo Agressivo pode impactar fortemente na performance de outras aplicações, tipo programas de gravação de tela.</translation>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation>Define se o emulador deve preferir conservar ou fazer o uso máximo da memória de vídeo disponível para melhorar a performance.
|
||||
O modo Agressivo pode impactar fortemente na performance de outras aplicações, tipo programas de gravação de tela.
|
||||
Não tem efeito em gráficos integrados.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="173"/>
|
||||
|
|
|
|||
8
dist/languages/pt_PT.ts
vendored
8
dist/languages/pt_PT.ts
vendored
|
|
@ -784,8 +784,12 @@ Esta opção recompacta o RGBA8 ou pro formato BC1 ou pro BC3, economizando VRAM
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<translation>Define se o emulador deve preferir conservar ou fazer o uso máximo da memória de vídeo disponível para melhorar a performance. Não tem efeito em gráficos integrados. O modo Agressivo pode impactar fortemente na performance de outras aplicações, tipo programas de gravação de tela.</translation>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation>Define se o emulador deve preferir conservar ou fazer o uso máximo da memória de vídeo disponível para melhorar a performance.
|
||||
O modo Agressivo pode impactar fortemente na performance de outras aplicações, tipo programas de gravação de tela.
|
||||
Não tem efeito em gráficos integrados.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="173"/>
|
||||
|
|
|
|||
4
dist/languages/ru_RU.ts
vendored
4
dist/languages/ru_RU.ts
vendored
|
|
@ -780,7 +780,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/sv.ts
vendored
4
dist/languages/sv.ts
vendored
|
|
@ -754,7 +754,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/tr_TR.ts
vendored
4
dist/languages/tr_TR.ts
vendored
|
|
@ -754,7 +754,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/uk.ts
vendored
4
dist/languages/uk.ts
vendored
|
|
@ -754,7 +754,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/vi.ts
vendored
4
dist/languages/vi.ts
vendored
|
|
@ -754,7 +754,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/vi_VN.ts
vendored
4
dist/languages/vi_VN.ts
vendored
|
|
@ -754,7 +754,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
4
dist/languages/zh_CN.ts
vendored
4
dist/languages/zh_CN.ts
vendored
|
|
@ -784,7 +784,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation>指定模拟器使用 VRAM 的方式。此选项对核芯显卡没有影响。
|
||||
保守模式:模拟器更倾向于节省 VRAM。
|
||||
激进模式:最大限度利用 VRAM 来提高性能。
|
||||
|
|
|
|||
4
dist/languages/zh_TW.ts
vendored
4
dist/languages/zh_TW.ts
vendored
|
|
@ -784,7 +784,9 @@ This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/shared_translation.cpp" line="168"/>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance. Has no effect on integrated graphics. Aggressive mode may severely impact the performance of other applications such as recording software.</source>
|
||||
<source>Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.
|
||||
Aggressive mode may severely impact the performance of other applications such as recording software.
|
||||
Has no effect on integrated graphics.</source>
|
||||
<translation>指定模拟器倾向于节省 VRAM 或最大限度利用 VRAM 来提高性能。对核芯显卡没有影响。激进模式可能会严重影响其他应用程序(如录屏软件)的性能。</translation>
|
||||
</message>
|
||||
<message>
|
||||
|
|
|
|||
BIN
dist/yuzu.png
vendored
Normal file
BIN
dist/yuzu.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
47
externals/CMakeLists.txt
vendored
47
externals/CMakeLists.txt
vendored
|
|
@ -15,17 +15,21 @@ set(BUILD_SHARED_LIBS OFF)
|
|||
set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL ON)
|
||||
|
||||
# SPIRV Headers
|
||||
find_package(SPIRV-Headers)
|
||||
if (NOT TARGET SPIRV-Headers::SPIRV-Headers)
|
||||
add_subdirectory(SPIRV-Headers)
|
||||
find_package(SPIRV-Headers)
|
||||
if (NOT TARGET SPIRV-Headers::SPIRV-Headers)
|
||||
add_subdirectory(SPIRV-Headers)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# fmt (also used by Dynarmic, so needs to be added first)
|
||||
find_package(fmt)
|
||||
if (NOT TARGET fmt::fmt)
|
||||
# fmtlib formatting library
|
||||
set(FMT_INSTALL ON)
|
||||
add_subdirectory(fmt)
|
||||
find_package(fmt)
|
||||
if (NOT TARGET fmt::fmt)
|
||||
# fmtlib formatting library
|
||||
set(FMT_INSTALL ON)
|
||||
add_subdirectory(fmt)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Xbyak (also used by Dynarmic, so needs to be added first)
|
||||
|
|
@ -46,10 +50,31 @@ if ((ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) AND NOT TARGET dynarmic::dynarmi
|
|||
endif()
|
||||
|
||||
# getopt
|
||||
if (MSVC)
|
||||
include(CheckIncludeFile)
|
||||
check_include_file(getopt.h HAS_GETOPT)
|
||||
if (NOT HAS_GETOPT)
|
||||
message(STATUS "Using bundled getopt")
|
||||
add_subdirectory(getopt)
|
||||
endif()
|
||||
|
||||
# clang_rt_builtins
|
||||
check_c_source_compiles("
|
||||
#include <stdint.h>
|
||||
|
||||
volatile __uint128_t a = 100;
|
||||
volatile __uint128_t b = 2;
|
||||
|
||||
int main() {
|
||||
__uint128_t result = a / b;
|
||||
(void)result;
|
||||
return 0;
|
||||
}
|
||||
" HAVE_UDIVTI3)
|
||||
if(NOT HAVE_UDIVTI3)
|
||||
message(STATUS "Adding clang_rt_builtins due to missing __udivti3")
|
||||
add_subdirectory(clang_rt_builtins)
|
||||
endif()
|
||||
|
||||
# Glad
|
||||
add_subdirectory(glad)
|
||||
|
||||
|
|
@ -142,7 +167,7 @@ endif()
|
|||
if (ENABLE_WEB_SERVICE AND NOT TARGET cpp-jwt::cpp-jwt)
|
||||
set(CPP_JWT_BUILD_EXAMPLES OFF)
|
||||
set(CPP_JWT_BUILD_TESTS OFF)
|
||||
set(CPP_JWT_USE_VENDORED_NLOHMANN_JSON OFF)
|
||||
set(CPP_JWT_USE_VENDORED_NLOHMANN_JSON ${YUZU_USE_CPM})
|
||||
add_subdirectory(cpp-jwt)
|
||||
endif()
|
||||
|
||||
|
|
@ -197,8 +222,10 @@ if (NOT TARGET LLVM::Demangle)
|
|||
add_library(LLVM::Demangle ALIAS demangle)
|
||||
endif()
|
||||
|
||||
add_library(stb stb/stb_dxt.cpp)
|
||||
target_include_directories(stb PUBLIC ./stb)
|
||||
if (NOT TARGET stb)
|
||||
add_library(stb stb/stb_dxt.cpp)
|
||||
target_include_directories(stb PUBLIC ./stb)
|
||||
endif()
|
||||
|
||||
if (NOT TARGET stb::headers)
|
||||
add_library(stb::headers ALIAS stb)
|
||||
|
|
|
|||
2
externals/SDL
vendored
2
externals/SDL
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit cc016b0046d563287f0aa9f09b958b5e70d43696
|
||||
Subproject commit 2359383fc187386204c3bb22de89655a494cd128
|
||||
2
externals/SPIRV-Headers
vendored
2
externals/SPIRV-Headers
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 8b246ff75c6615ba4532fe4fde20f1be090c3764
|
||||
Subproject commit 2a9b6f951c7d6b04b6c21fe1bf3f475b68b84801
|
||||
2
externals/SPIRV-Tools
vendored
2
externals/SPIRV-Tools
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 3983d15a1d34fb95656818af0fc89c6260cbf316
|
||||
Subproject commit 6dcc7e350a0b9871a825414d42329e44b0eb8109
|
||||
2
externals/Vulkan-Headers
vendored
2
externals/Vulkan-Headers
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 5677bafb820e476441e9e1f745371b72133407d3
|
||||
Subproject commit 36872f9062b17b1a30b8ed1d81ca5ea6bb608a72
|
||||
2
externals/Vulkan-Utility-Libraries
vendored
2
externals/Vulkan-Utility-Libraries
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 777358fdad21132866be4a835327fbc28eabc1a4
|
||||
Subproject commit b538fb5b08513aa78346cd414ad5e576a2a3e920
|
||||
2
externals/VulkanMemoryAllocator
vendored
2
externals/VulkanMemoryAllocator
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 009ecd192c1289c7529bff248a16cfe896254816
|
||||
Subproject commit c788c52156f3ef7bc7ab769cb03c110a53ac8fcb
|
||||
4
externals/clang_rt_builtins/CMakeLists.txt
vendored
Normal file
4
externals/clang_rt_builtins/CMakeLists.txt
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
cmake_minimum_required(VERSION 3.10)
|
||||
project(clang_rt_builtins C)
|
||||
|
||||
add_library(clang_rt_builtins STATIC udivti3.c)
|
||||
36
externals/clang_rt_builtins/udivti3.c
vendored
Normal file
36
externals/clang_rt_builtins/udivti3.c
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
typedef unsigned __int128 tu_int;
|
||||
|
||||
tu_int __udivti3(tu_int a, tu_int b)
|
||||
{
|
||||
if (b == 0) {
|
||||
// Handle division by zero (could also trigger a fault)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (b > a) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int shift;
|
||||
for (shift = 0;; shift++) {
|
||||
if (shift >= 128) {
|
||||
break;
|
||||
}
|
||||
tu_int shifted_b = b << shift;
|
||||
if (shifted_b > a || (shifted_b >> shift) != b) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
shift--;
|
||||
|
||||
tu_int quotient = 0;
|
||||
for (; shift >= 0; shift--) {
|
||||
tu_int shifted_b = b << shift;
|
||||
if (shifted_b <= a) {
|
||||
quotient |= (tu_int) 1 << shift;
|
||||
a -= shifted_b;
|
||||
}
|
||||
}
|
||||
|
||||
return quotient;
|
||||
}
|
||||
47
externals/dynarmic/CMakeLists.txt
vendored
47
externals/dynarmic/CMakeLists.txt
vendored
|
|
@ -140,7 +140,9 @@ if (DYNARMIC_USE_BUNDLED_EXTERNALS)
|
|||
set(CMAKE_DISABLE_FIND_PACKAGE_Zydis ON)
|
||||
endif()
|
||||
|
||||
find_package(Boost 1.57 REQUIRED)
|
||||
if (NOT TARGET boost_headers)
|
||||
find_package(Boost 1.57 REQUIRED)
|
||||
endif()
|
||||
find_package(fmt 9 CONFIG)
|
||||
find_package(mcl 0.1.12 EXACT CONFIG)
|
||||
find_package(tsl-robin-map CONFIG)
|
||||
|
|
@ -182,26 +184,29 @@ endif()
|
|||
#
|
||||
# Install
|
||||
#
|
||||
include(GNUInstallDirs)
|
||||
include(CMakePackageConfigHelpers)
|
||||
# Only try to install if boost wasn't included as submodule
|
||||
if (NOT TARGET boost_headers)
|
||||
include(GNUInstallDirs)
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
install(TARGETS dynarmic EXPORT dynarmicTargets)
|
||||
install(EXPORT dynarmicTargets
|
||||
NAMESPACE dynarmic::
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/dynarmic"
|
||||
)
|
||||
install(TARGETS dynarmic EXPORT dynarmicTargets)
|
||||
install(EXPORT dynarmicTargets
|
||||
NAMESPACE dynarmic::
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/dynarmic"
|
||||
)
|
||||
|
||||
configure_package_config_file(CMakeModules/dynarmicConfig.cmake.in
|
||||
dynarmicConfig.cmake
|
||||
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/dynarmic"
|
||||
)
|
||||
write_basic_package_version_file(dynarmicConfigVersion.cmake
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/dynarmicConfig.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/dynarmicConfigVersion.cmake"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/dynarmic"
|
||||
)
|
||||
configure_package_config_file(CMakeModules/dynarmicConfig.cmake.in
|
||||
dynarmicConfig.cmake
|
||||
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/dynarmic"
|
||||
)
|
||||
write_basic_package_version_file(dynarmicConfigVersion.cmake
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/dynarmicConfig.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/dynarmicConfigVersion.cmake"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/dynarmic"
|
||||
)
|
||||
|
||||
install(DIRECTORY src/dynarmic TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
|
||||
install(DIRECTORY src/dynarmic TYPE INCLUDE FILES_MATCHING PATTERN "*.h")
|
||||
endif()
|
||||
|
|
|
|||
13
externals/dynarmic/src/dynarmic/CMakeLists.txt
vendored
13
externals/dynarmic/src/dynarmic/CMakeLists.txt
vendored
|
|
@ -503,11 +503,22 @@ set_target_properties(dynarmic PROPERTIES
|
|||
target_compile_options(dynarmic PRIVATE ${DYNARMIC_CXX_FLAGS})
|
||||
target_link_libraries(dynarmic
|
||||
PRIVATE
|
||||
Boost::boost
|
||||
fmt::fmt
|
||||
merry::mcl
|
||||
tsl::robin_map
|
||||
)
|
||||
if (TARGET boost_headers)
|
||||
target_link_libraries(dynarmic
|
||||
PRIVATE
|
||||
boost_headers boost_variant boost_icl
|
||||
)
|
||||
else()
|
||||
target_link_libraries(dynarmic
|
||||
PRIVATE
|
||||
Boost::boost
|
||||
)
|
||||
endif()
|
||||
|
||||
if (DYNARMIC_USE_LLVM)
|
||||
target_include_directories(dynarmic PRIVATE ${LLVM_INCLUDE_DIRS})
|
||||
target_compile_definitions(dynarmic PRIVATE DYNARMIC_USE_LLVM=1 ${LLVM_DEFINITIONS})
|
||||
|
|
|
|||
2
externals/fmt
vendored
2
externals/fmt
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit e69e5f977d458f2650bb346dadf2ad30c5320281
|
||||
Subproject commit 0c9fce2ffefecfdce794e1859584e25877b7b592
|
||||
4
externals/getopt/CMakeLists.txt
vendored
4
externals/getopt/CMakeLists.txt
vendored
|
|
@ -1,7 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2015 Greg Wicks <gpwicks@email.wm.edu>
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
add_library(getopt
|
||||
add_library(getopt STATIC
|
||||
getopt.c
|
||||
getopt.h
|
||||
)
|
||||
|
|
@ -9,4 +9,4 @@ add_library(getopt
|
|||
create_target_directory_groups(getopt)
|
||||
|
||||
target_compile_definitions(getopt PUBLIC STATIC_GETOPT)
|
||||
target_include_directories(getopt INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_include_directories(getopt PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
|
|
|||
2
externals/libadrenotools
vendored
2
externals/libadrenotools
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 5cd3f5c5ceea6d9e9d435ccdd922d9b99e55d10b
|
||||
Subproject commit 5deac9f1ab2bd833ad664bc3386ac1e8998cecb3
|
||||
1
externals/nx_tzdb/tzdb_to_nx
vendored
1
externals/nx_tzdb/tzdb_to_nx
vendored
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 97929690234f2b4add36b33657fe3fe09bd57dfd
|
||||
52
externals/nx_tzdb/tzdb_to_nx/.github/workflows/cmake.yml
vendored
Normal file
52
externals/nx_tzdb/tzdb_to_nx/.github/workflows/cmake.yml
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
name: CMake
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
env:
|
||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||
BUILD_TYPE: Release
|
||||
|
||||
jobs:
|
||||
build:
|
||||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
|
||||
# You can convert this to a matrix build if you need cross-platform coverage.
|
||||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [ubuntu-latest,macos-latest]
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: 'true'
|
||||
|
||||
- name: Configure CMake
|
||||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
||||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
||||
run: |
|
||||
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
echo "nx_tzdb_dir=$(grep NX_TZDB_DIR ${{github.workspace}}/build/CMakeCache.txt | sed 's/.*=//g')" > "$GITHUB_ENV"
|
||||
|
||||
- name: Build
|
||||
# Build your program with the given configuration
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target x80e
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
mkdir -p ${{github.workspace}}/artifacts
|
||||
cp -Rv ${{ env.nx_tzdb_dir }} ${{github.workspace}}/artifacts/
|
||||
|
||||
- name: Version
|
||||
run: |
|
||||
echo "nx_version=$(cat ${{ env.nx_tzdb_dir }}/version.txt)" > "$GITHUB_ENV"
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.nx_version }}_${{ matrix.platform }}
|
||||
path: artifacts/nx
|
||||
2
externals/nx_tzdb/tzdb_to_nx/.gitignore
vendored
Normal file
2
externals/nx_tzdb/tzdb_to_nx/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
.cache
|
||||
build
|
||||
3
externals/nx_tzdb/tzdb_to_nx/.gitmodules
vendored
Normal file
3
externals/nx_tzdb/tzdb_to_nx/.gitmodules
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[submodule "externals/tz/tz"]
|
||||
path = externals/tz/tz
|
||||
url = https://github.com/eggert/tz.git
|
||||
21
externals/nx_tzdb/tzdb_to_nx/CMakeLists.txt
vendored
Normal file
21
externals/nx_tzdb/tzdb_to_nx/CMakeLists.txt
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
project(tzdb2nx VERSION 1.0)
|
||||
|
||||
option(TZDB2NX_ZONEINFO_DIR "Specify a custom zoneinfo directory containing time zone data you wish to use" "")
|
||||
option(TZDB2NX_VERSION "Specify a custom zoneinfo version with the directory" "")
|
||||
|
||||
if (TZDB2NX_ZONEINFO_DIR AND NOT TZDB2NX_VERSION)
|
||||
message(FATAL_ERROR "TZDB2NX_ZONEINFO_DIR was specified but TZDB2NX_VERSION was left undefined.")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
option(TZ_LINK_INTL "Enable if gettext needs to link with libintl" ${APPLE})
|
||||
|
||||
if (TZ_LINK_INTL)
|
||||
find_package(Intl REQUIRED)
|
||||
endif()
|
||||
|
||||
add_subdirectory(externals)
|
||||
add_subdirectory(src)
|
||||
10
externals/nx_tzdb/tzdb_to_nx/CMakeModules/list_directory.cmake
vendored
Normal file
10
externals/nx_tzdb/tzdb_to_nx/CMakeModules/list_directory.cmake
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
set(WITH_DIRECTORIES ${CMAKE_ARGV3})
|
||||
set(RECURSE ${CMAKE_ARGV4})
|
||||
|
||||
set(HOW_TO_GLOB "GLOB")
|
||||
if (RECURSE)
|
||||
set(HOW_TO_GLOB "GLOB_RECURSE")
|
||||
endif()
|
||||
|
||||
file(${HOW_TO_GLOB} FILE_LIST LIST_DIRECTORIES ${WITH_DIRECTORIES} RELATIVE ${CMAKE_SOURCE_DIR} "*")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${FILE_LIST};")
|
||||
21
externals/nx_tzdb/tzdb_to_nx/LICENSE
vendored
Normal file
21
externals/nx_tzdb/tzdb_to_nx/LICENSE
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright © 2023 lat9nq
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the “Software”), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
22
externals/nx_tzdb/tzdb_to_nx/README.md
vendored
Normal file
22
externals/nx_tzdb/tzdb_to_nx/README.md
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# tzdb_to_nx
|
||||
|
||||
This is a CMake/C++ project to convert RFC 8536 time zone data to the Nintendo Switch's format.
|
||||
This makes use a lot of Unix system calls as well as a bash script to convert the data, so it likely requires a bit of work to port to a non-POSIX platform, such as Windows.
|
||||
|
||||
Intended for use with the [yuzu Emulator](https://yuzu-emu.org/) project, but the project in the future likely won't ship synthesized Switch archives.
|
||||
That leaves this project in a place where it is not likely to be used, but will remain here as a reference.
|
||||
|
||||
- tzdb: CMake and bash script to build and convert time zone data from https://www.iana.org/time-zones into the Nintendo Switch's format.
|
||||
- tzdb2nx: C++ program that converts a single tzif file to the Nintendo's format.
|
||||
|
||||
The fine folks over at [SwitchBrew](https://switchbrew.org/wiki/PSC_services#ITimeZoneService) have left very helpful information on reading the data.
|
||||
Nintendo's file is simply the TZif version 2 data, with standard_indicators and ut_indicators data stripped out (and the necessary modifications needed in the header to make the data valid).
|
||||
This means the TZif 1 data is not present, so essentially we are left with the second half of each file.
|
||||
|
||||
Nintendo also does not seem to run the `zic` program on their output when they build the time zone data.
|
||||
I have left the relevant build command for that in src/tzdb/CMakeLists.txt commented out, but it isn't used here.
|
||||
This lets the project produce data identical to Nintendo's firmware for time zones, however this code does not produce the time zone data on US/Pacific-New or America/East-Saskatchewan (I may have bunged up the actual paths for these as this is 3 day old memory).
|
||||
|
||||
The CMake and C++ code in this repository is licensed under the MIT License.
|
||||
The source files date.c, newstrftime.3 and strftime.c from submodule eggert/tz use the BSD-3 clause license [[source]](https://github.com/eggert/tz/blob/main/LICENSE).
|
||||
The time zone data output from this repository, like those found in archives in the Release setcion, is in the public domain [[source]](https://github.com/eggert/tz/blob/main/LICENSE).
|
||||
1
externals/nx_tzdb/tzdb_to_nx/externals/CMakeLists.txt
vendored
Normal file
1
externals/nx_tzdb/tzdb_to_nx/externals/CMakeLists.txt
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
add_subdirectory(tz)
|
||||
73
externals/nx_tzdb/tzdb_to_nx/externals/tz/CMakeLists.txt
vendored
Normal file
73
externals/nx_tzdb/tzdb_to_nx/externals/tz/CMakeLists.txt
vendored
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
set(TZ_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tz" CACHE PATH "Time zone source directory")
|
||||
set(TZ_DIR "${CMAKE_CURRENT_BINARY_DIR}/tz")
|
||||
set(TZ_TMP_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmpsrc")
|
||||
set(TZIF_LIST_FILE "${CMAKE_CURRENT_BINARY_DIR}/tzif_list.txt" CACHE PATH "List of zone info files")
|
||||
if (TZDB2NX_ZONEINFO_DIR)
|
||||
set(TZ_ZONEINFO_DIR "${TZDB2NX_ZONEINFO_DIR}" CACHE PATH "Time zone info data directory")
|
||||
else()
|
||||
set(TZ_ZONEINFO_DIR "${TZ_DIR}/usr/share/zoneinfo" CACHE PATH "Time zone info data directory")
|
||||
endif()
|
||||
|
||||
find_program(GNU_MAKE make)
|
||||
if (NOT GNU_MAKE)
|
||||
message(FATAL_ERROR "GNU make not found")
|
||||
endif()
|
||||
|
||||
if (NOT EXISTS "${TZ_DIR}" OR NOT EXISTS "${TZIF_LIST_FILE}")
|
||||
if (NOT TZDB2NX_ZONEINFO_DIR) # If a custom zoneinfo directory was specified
|
||||
# tz's makefile can only build in-tree, so copy the whole source tree to a
|
||||
# separate directory before building.
|
||||
execute_process(
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy_directory "${TZ_SOURCE_DIR}" "${TZ_TMP_SOURCE_DIR}"
|
||||
COMMAND_ERROR_IS_FATAL ANY
|
||||
)
|
||||
|
||||
if (TZ_LINK_INTL)
|
||||
set(TZ_MAKEFLAGS "LDLIBS=${Intl_LIBRARY}")
|
||||
else()
|
||||
set(TZ_MAKEFLAGS)
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND
|
||||
${GNU_MAKE} DESTDIR=${TZ_DIR} ${TZ_MAKEFLAGS} install
|
||||
WORKING_DIRECTORY
|
||||
${TZ_TMP_SOURCE_DIR}
|
||||
COMMAND_ERROR_IS_FATAL ANY
|
||||
)
|
||||
|
||||
unset(TZ_MAKEFLAGS)
|
||||
|
||||
# Step taken by Arch Linux packaging, but Nintendo apparently skips it
|
||||
# execute_process(
|
||||
# COMMAND
|
||||
# "${TZDB_LOCATION}/zic" -b fat -d ${TZDB_ZONEINFO} africa antarctica asia australasia europe northamerica southamerica etcetera backward factory
|
||||
# WORKING_DIRECTORY
|
||||
# "${TZDB_LOCATION}"
|
||||
# COMMAND_ERROR_IS_FATAL ANY
|
||||
# )
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/CMakeModules/list_directory.cmake false ON
|
||||
WORKING_DIRECTORY
|
||||
"${TZ_ZONEINFO_DIR}"
|
||||
OUTPUT_VARIABLE
|
||||
TZIF_SCAN
|
||||
)
|
||||
|
||||
set(TZIF_LIST "")
|
||||
foreach(CANDIDATE ${TZIF_SCAN})
|
||||
if (CANDIDATE STREQUAL "\n")
|
||||
continue()
|
||||
endif()
|
||||
set(TZIF_FILE "${TZ_ZONEINFO_DIR}/${CANDIDATE}")
|
||||
file(READ "${TZIF_FILE}" HEADER LIMIT 4)
|
||||
string(SUBSTRING "${HEADER}" 0 4 HEADER) # Remove trailing newline
|
||||
if (HEADER STREQUAL "TZif")
|
||||
file(APPEND "${TZIF_LIST_FILE}" "${TZIF_FILE}\n")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
26
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/.gitignore
vendored
Normal file
26
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# Files intentionally not tracked by Git.
|
||||
# This file is in the public domain.
|
||||
*.a
|
||||
*.asc
|
||||
*.diff
|
||||
*.i
|
||||
*.o
|
||||
*.orig
|
||||
*.patch
|
||||
*.rej
|
||||
*.tar
|
||||
*.tar.*
|
||||
*.txt
|
||||
*.tzs
|
||||
*.zi
|
||||
*~
|
||||
ChangeLog
|
||||
check_*
|
||||
date
|
||||
leapseconds
|
||||
tzselect
|
||||
version
|
||||
version.h
|
||||
yearistype
|
||||
zdump
|
||||
zic
|
||||
97
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/CONTRIBUTING
vendored
Normal file
97
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/CONTRIBUTING
vendored
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
# Contributing to the tz code and data
|
||||
|
||||
Please do not create issues or pull requests on GitHub, as the
|
||||
proper procedure for proposing and distributing patches is via
|
||||
email as described below.
|
||||
|
||||
The time zone database is by no means authoritative: governments
|
||||
change timekeeping rules erratically and sometimes with little
|
||||
warning, the data entries do not cover all of civil time before
|
||||
1970, and undoubtedly errors remain in the code and data. Feel
|
||||
free to fill gaps or fix mistakes, and please email improvements
|
||||
to <tz@iana.org> for use in the future. In your email, please give
|
||||
reliable sources that reviewers can check.
|
||||
|
||||
## Contributing technical changes
|
||||
|
||||
To email small changes, please run a POSIX shell command like
|
||||
'diff -u old/europe new/europe >myfix.patch', and attach
|
||||
'myfix.patch' to the email.
|
||||
|
||||
For more-elaborate or possibly-controversial changes,
|
||||
such as renaming, adding or removing zones, please read
|
||||
"Theory and pragmatics of the tz code and data"
|
||||
<https://www.iana.org/time-zones/repository/theory.html>.
|
||||
It is also good to browse the mailing list archives
|
||||
<https://mm.icann.org/pipermail/tz/> for examples of patches that tend
|
||||
to work well. Additions to data should contain commentary citing
|
||||
reliable sources as justification. Citations should use "https:" URLs
|
||||
if available.
|
||||
|
||||
For changes that fix sensitive security-related bugs, please see the
|
||||
distribution's 'SECURITY' file.
|
||||
|
||||
Please submit changes against either the latest release
|
||||
<https://www.iana.org/time-zones> or the main branch of the development
|
||||
repository. The latter is preferred.
|
||||
|
||||
## Sample Git workflow for developing contributions
|
||||
|
||||
If you use Git the following workflow may be helpful:
|
||||
|
||||
* Copy the development repository.
|
||||
|
||||
git clone https://github.com/eggert/tz.git
|
||||
cd tz
|
||||
|
||||
* Get current with the main branch.
|
||||
|
||||
git checkout main
|
||||
git pull
|
||||
|
||||
* Switch to a new branch for the changes. Choose a different
|
||||
branch name for each change set.
|
||||
|
||||
git checkout -b mybranch
|
||||
|
||||
* Sleuth by using 'git blame'. For example, when fixing data for
|
||||
Africa/Sao_Tome, if the command 'git blame africa' outputs a line
|
||||
'2951fa3b (Paul Eggert 2018-01-08 09:03:13 -0800 1068) Zone
|
||||
Africa/Sao_Tome 0:26:56 - LMT 1884', commit 2951fa3b should
|
||||
provide some justification for the 'Zone Africa/Sao_Tome' line.
|
||||
|
||||
* Edit source files. Include commentary that justifies the
|
||||
changes by citing reliable sources.
|
||||
|
||||
* Debug the changes, e.g.:
|
||||
|
||||
make check
|
||||
make install
|
||||
./zdump -v America/Los_Angeles
|
||||
|
||||
* For each separable change, commit it in the new branch, e.g.:
|
||||
|
||||
git add northamerica
|
||||
git commit
|
||||
|
||||
See recent 'git log' output for the commit-message style.
|
||||
|
||||
* Create patch files 0001-..., 0002-..., ...
|
||||
|
||||
git format-patch main
|
||||
|
||||
* After reviewing the patch files, send the patches to <tz@iana.org>
|
||||
for others to review.
|
||||
|
||||
git send-email main
|
||||
|
||||
For an archived example of such an email, see
|
||||
"[PROPOSED] Fix off-by-1 error for Jamaica and T&C before 1913"
|
||||
<https://mm.icann.org/pipermail/tz/2018-February/026122.html>.
|
||||
|
||||
* Start anew by getting current with the main branch again
|
||||
(the second step above).
|
||||
|
||||
-----
|
||||
|
||||
This file is in the public domain.
|
||||
5
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/LICENSE
vendored
Normal file
5
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/LICENSE
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
Unless specified below, all files in the tz code and data (including
|
||||
this LICENSE file) are in the public domain.
|
||||
|
||||
If the files date.c, newstrftime.3, and strftime.c are present, they
|
||||
contain material derived from BSD and use the BSD 3-clause license.
|
||||
1254
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/Makefile
vendored
Normal file
1254
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/Makefile
vendored
Normal file
File diff suppressed because it is too large
Load diff
5922
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/NEWS
vendored
Normal file
5922
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/NEWS
vendored
Normal file
File diff suppressed because it is too large
Load diff
52
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/README
vendored
Normal file
52
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/README
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
README for the tz distribution
|
||||
|
||||
"Where do I set the hands of the clock?" -- Les Tremayne as The King
|
||||
"Oh that--you can set them any place you want." -- Frank Baxter as The Scientist
|
||||
(from the Bell System film "About Time")
|
||||
|
||||
The Time Zone Database (called tz, tzdb or zoneinfo) contains code and
|
||||
data that represent the history of local time for many representative
|
||||
locations around the globe. It is updated periodically to reflect
|
||||
changes made by political bodies to time zone boundaries, UTC offsets,
|
||||
and daylight-saving rules.
|
||||
|
||||
See <https://www.iana.org/time-zones/repository/tz-link.html> or the
|
||||
file tz-link.html for how to acquire the code and data. Once acquired,
|
||||
read the comments in the file 'Makefile' and make any changes needed
|
||||
to make things right for your system, especially if you are using some
|
||||
platform other than GNU/Linux. Then run the following commands,
|
||||
substituting your desired installation directory for "$HOME/tzdir":
|
||||
|
||||
make TOPDIR=$HOME/tzdir install
|
||||
$HOME/tzdir/usr/bin/zdump -v America/Los_Angeles
|
||||
|
||||
See the file tz-how-to.html for examples of how to read the data files.
|
||||
|
||||
This database of historical local time information has several goals:
|
||||
|
||||
* Provide a compendium of data about the history of civil time that
|
||||
is useful even if not 100% accurate.
|
||||
|
||||
* Give an idea of the variety of local time rules that have existed
|
||||
in the past and thus may be expected in the future.
|
||||
|
||||
* Test the generality of the local time rule description system.
|
||||
|
||||
The information in the time zone data files is by no means authoritative;
|
||||
fixes and enhancements are welcome. Please see the file CONTRIBUTING
|
||||
for details.
|
||||
|
||||
Thanks to these Time Zone Caballeros who've made major contributions to the
|
||||
time conversion package: Keith Bostic; Bob Devine; Paul Eggert; Robert Elz;
|
||||
Guy Harris; Mark Horton; John Mackin; and Bradley White. Thanks also to
|
||||
Michael Bloom, Art Neilson, Stephen Prince, John Sovereign, and Frank Wales
|
||||
for testing work, and to Gwillim Law for checking local mean time data.
|
||||
Thanks in particular to Arthur David Olson, the project's founder and first
|
||||
maintainer, to whom the time zone community owes the greatest debt of all.
|
||||
None of them are responsible for remaining errors.
|
||||
|
||||
-----
|
||||
|
||||
This file is in the public domain, so clarified as of 2009-05-17 by
|
||||
Arthur David Olson. The other files in this distribution are either
|
||||
public domain or BSD licensed; see the file LICENSE for details.
|
||||
15
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/SECURITY
vendored
Normal file
15
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/SECURITY
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
Please report any sensitive security-related bugs via email to the
|
||||
tzdb designated coordinators, currently Paul Eggert
|
||||
<eggert@cs.ucla.edu> and Tim Parenti <tim@timtimeonline.com>.
|
||||
Put "tzdb security" at the start of your email's subject line.
|
||||
We prefer communications to be in English.
|
||||
|
||||
You should receive a response within a week. If not, please follow up
|
||||
via email to make sure we received your original message.
|
||||
|
||||
If we confirm the bug, we plan to notify affected third-party services
|
||||
or software that we know about, prepare an advisory, commit fixes to
|
||||
the main development branch as quickly as is practical, and finally
|
||||
publish the advisory on tz@iana.org. As with all tzdb contributions,
|
||||
we give credit to security contributors unless they wish to remain
|
||||
anonymous.
|
||||
1436
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/africa
vendored
Normal file
1436
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/africa
vendored
Normal file
File diff suppressed because it is too large
Load diff
309
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/antarctica
vendored
Normal file
309
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/antarctica
vendored
Normal file
|
|
@ -0,0 +1,309 @@
|
|||
# tzdb data for Antarctica and environs
|
||||
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
# From Paul Eggert (1999-11-15):
|
||||
# To keep things manageable, we list only locations occupied year-round; see
|
||||
# COMNAP - Stations and Bases
|
||||
# http://www.comnap.aq/comnap/comnap.nsf/P/Stations/
|
||||
# and
|
||||
# Summary of the Peri-Antarctic Islands (1998-07-23)
|
||||
# http://www.spri.cam.ac.uk/bob/periant.htm
|
||||
# for information.
|
||||
# Unless otherwise specified, we have no time zone information.
|
||||
|
||||
# FORMAT is '-00' and STDOFF is 0 for locations while uninhabited.
|
||||
|
||||
# Argentina - year-round bases
|
||||
# Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
|
||||
# Carlini, Potter Cove, King George Island, -6414-0602320, since 1982-01
|
||||
# Esperanza, Hope Bay, -6323-05659, since 1952-12-17
|
||||
# Marambio, -6414-05637, since 1969-10-29
|
||||
# Orcadas, Laurie I, -6016-04444, since 1904-02-22
|
||||
# San Martín, Barry I, -6808-06706, since 1951-03-21
|
||||
# (except 1960-03 / 1976-03-21)
|
||||
|
||||
# Australia - territories
|
||||
# Heard Island, McDonald Islands (uninhabited)
|
||||
# previously sealers and scientific personnel wintered
|
||||
# Margaret Turner reports
|
||||
# https://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html
|
||||
# (1999-09-30) that they're UT +05, with no DST;
|
||||
# presumably this is when they have visitors.
|
||||
#
|
||||
# year-round bases
|
||||
# Casey, Bailey Peninsula, -6617+11032, since 1969
|
||||
# Davis, Vestfold Hills, -6835+07759, since 1957-01-13
|
||||
# (except 1964-11 - 1969-02)
|
||||
# Mawson, Holme Bay, -6736+06253, since 1954-02-13
|
||||
|
||||
# From Steffen Thorsen (2009-03-11):
|
||||
# Three Australian stations in Antarctica have changed their time zone:
|
||||
# Casey moved from UTC+8 to UTC+11
|
||||
# Davis moved from UTC+7 to UTC+5
|
||||
# Mawson moved from UTC+6 to UTC+5
|
||||
# The changes occurred on 2009-10-18 at 02:00 (local times).
|
||||
#
|
||||
# Government source: (Australian Antarctic Division)
|
||||
# http://www.aad.gov.au/default.asp?casid=37079
|
||||
#
|
||||
# We have more background information here:
|
||||
# https://www.timeanddate.com/news/time/antarctica-new-times.html
|
||||
|
||||
# From Steffen Thorsen (2010-03-10):
|
||||
# We got these changes from the Australian Antarctic Division: ...
|
||||
#
|
||||
# - Casey station reverted to its normal time of UTC+8 on 5 March 2010.
|
||||
# The change to UTC+11 is being considered as a regular summer thing but
|
||||
# has not been decided yet.
|
||||
#
|
||||
# - Davis station will revert to its normal time of UTC+7 at 10 March 2010
|
||||
# 20:00 UTC.
|
||||
#
|
||||
# - Mawson station stays on UTC+5.
|
||||
#
|
||||
# Background:
|
||||
# https://www.timeanddate.com/news/time/antartica-time-changes-2010.html
|
||||
|
||||
# From Steffen Thorsen (2016-10-28):
|
||||
# Australian Antarctica Division informed us that Casey changed time
|
||||
# zone to UTC+11 in "the morning of 22nd October 2016".
|
||||
|
||||
# From Steffen Thorsen (2020-10-02, as corrected):
|
||||
# Based on information we have received from the Australian Antarctic
|
||||
# Division, Casey station and Macquarie Island station will move to Tasmanian
|
||||
# daylight savings time on Sunday 4 October. This will take effect from 0001
|
||||
# hrs on Sunday 4 October 2020 and will mean Casey and Macquarie Island will
|
||||
# be on the same time zone as Hobart. Some past dates too for this 3 hour
|
||||
# time change back and forth between UTC+8 and UTC+11 for Casey:
|
||||
# - 2018 Oct 7 4:00 - 2019 Mar 17 3:00 - 2019 Oct 4 3:00 - 2020 Mar 8 3:00
|
||||
# and now - 2020 Oct 4 0:01
|
||||
|
||||
# Zone NAME STDOFF RULES FORMAT [UNTIL]
|
||||
Zone Antarctica/Casey 0 - -00 1969
|
||||
8:00 - +08 2009 Oct 18 2:00
|
||||
11:00 - +11 2010 Mar 5 2:00
|
||||
8:00 - +08 2011 Oct 28 2:00
|
||||
11:00 - +11 2012 Feb 21 17:00u
|
||||
8:00 - +08 2016 Oct 22
|
||||
11:00 - +11 2018 Mar 11 4:00
|
||||
8:00 - +08 2018 Oct 7 4:00
|
||||
11:00 - +11 2019 Mar 17 3:00
|
||||
8:00 - +08 2019 Oct 4 3:00
|
||||
11:00 - +11 2020 Mar 8 3:00
|
||||
8:00 - +08 2020 Oct 4 0:01
|
||||
11:00 - +11
|
||||
Zone Antarctica/Davis 0 - -00 1957 Jan 13
|
||||
7:00 - +07 1964 Nov
|
||||
0 - -00 1969 Feb
|
||||
7:00 - +07 2009 Oct 18 2:00
|
||||
5:00 - +05 2010 Mar 10 20:00u
|
||||
7:00 - +07 2011 Oct 28 2:00
|
||||
5:00 - +05 2012 Feb 21 20:00u
|
||||
7:00 - +07
|
||||
Zone Antarctica/Mawson 0 - -00 1954 Feb 13
|
||||
6:00 - +06 2009 Oct 18 2:00
|
||||
5:00 - +05
|
||||
# References:
|
||||
# Casey Weather (1998-02-26)
|
||||
# http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html
|
||||
# Davis Station, Antarctica (1998-02-26)
|
||||
# http://www.antdiv.gov.au/aad/exop/sfo/davis/video.html
|
||||
# Mawson Station, Antarctica (1998-02-25)
|
||||
# http://www.antdiv.gov.au/aad/exop/sfo/mawson/video.html
|
||||
|
||||
# Belgium - year-round base
|
||||
# Princess Elisabeth, Queen Maud Land, -713412+0231200, since 2007
|
||||
|
||||
# Brazil - year-round base
|
||||
# Ferraz, King George Island, -6205+05824, since 1983/4
|
||||
|
||||
# Bulgaria - year-round base
|
||||
# St. Kliment Ohridski, Livingston Island, -623829-0602153, since 1988
|
||||
|
||||
# Chile - year-round bases and towns
|
||||
# Escudero, South Shetland Is, -621157-0585735, since 1994
|
||||
# Frei Montalva, King George Island, -6214-05848, since 1969-03-07
|
||||
# O'Higgins, Antarctic Peninsula, -6319-05704, since 1948-02
|
||||
# Prat, -6230-05941
|
||||
# Villa Las Estrellas (a town), around the Frei base, since 1984-04-09
|
||||
# These locations employ Region of Magallanes time; use
|
||||
# TZ='America/Punta_Arenas'.
|
||||
|
||||
# China - year-round bases
|
||||
# Great Wall, King George Island, -6213-05858, since 1985-02-20
|
||||
# Zhongshan, Larsemann Hills, Prydz Bay, -6922+07623, since 1989-02-26
|
||||
|
||||
# France - year-round bases (also see "France & Italy")
|
||||
#
|
||||
# From Antoine Leca (1997-01-20):
|
||||
# Time data entries are from Nicole Pailleau at the IFRTP
|
||||
# (French Institute for Polar Research and Technology).
|
||||
# She confirms that French Southern Territories and Terre Adélie bases
|
||||
# don't observe daylight saving time, even if Terre Adélie supplies came
|
||||
# from Tasmania.
|
||||
#
|
||||
# French Southern Territories with year-round inhabitants
|
||||
#
|
||||
# Alfred Faure, Possession Island, Crozet Islands, -462551+0515152, since 1964;
|
||||
# sealing & whaling stations operated variously 1802/1911+;
|
||||
# see Asia/Dubai.
|
||||
#
|
||||
# Martin-de-Viviès, Amsterdam Island, -374105+0773155, since 1950
|
||||
# Port-aux-Français, Kerguelen Islands, -492110+0701303, since 1951;
|
||||
# whaling & sealing station operated 1908/1914, 1920/1929, and 1951/1956
|
||||
#
|
||||
# St Paul Island - near Amsterdam, uninhabited
|
||||
# fishing stations operated variously 1819/1931
|
||||
#
|
||||
# Kerguelen - see Indian/Maldives.
|
||||
#
|
||||
# year-round base in the main continent
|
||||
# Dumont d'Urville - see Pacific/Port_Moresby.
|
||||
|
||||
# France & Italy - year-round base
|
||||
# Concordia, -750600+1232000, since 2005
|
||||
|
||||
# Germany - year-round base
|
||||
# Neumayer III, -704080-0081602, since 2009
|
||||
|
||||
# India - year-round bases
|
||||
# Bharati, -692428+0761114, since 2012
|
||||
# Maitri, -704558+0114356, since 1989
|
||||
|
||||
# Italy - year-round base (also see "France & Italy")
|
||||
# Zuchelli, Terra Nova Bay, -744140+1640647, since 1986
|
||||
|
||||
# Japan - year-round bases
|
||||
# See Asia/Riyadh.
|
||||
|
||||
# S Korea - year-round base
|
||||
# Jang Bogo, Terra Nova Bay, -743700+1641205 since 2014
|
||||
# King Sejong, King George Island, -6213-05847, since 1988
|
||||
|
||||
# New Zealand - claims
|
||||
# Balleny Islands (never inhabited)
|
||||
# Scott Island (never inhabited)
|
||||
#
|
||||
# year-round base
|
||||
# Scott Base, Ross Island, since 1957-01.
|
||||
# See Pacific/Auckland.
|
||||
|
||||
# Norway - territories
|
||||
# Bouvet (never inhabited)
|
||||
#
|
||||
# claims
|
||||
# Peter I Island (never inhabited)
|
||||
#
|
||||
# year-round base
|
||||
# Troll, Queen Maud Land, -720041+0023206, since 2005-02-12
|
||||
#
|
||||
# From Paul-Inge Flakstad (2014-03-10):
|
||||
# I recently had a long dialog about this with the developer of timegenie.com.
|
||||
# In the absence of specific dates, he decided to choose some likely ones:
|
||||
# GMT +1 - From March 1 to the last Sunday in March
|
||||
# GMT +2 - From the last Sunday in March until the last Sunday in October
|
||||
# GMT +1 - From the last Sunday in October until November 7
|
||||
# GMT +0 - From November 7 until March 1
|
||||
# The dates for switching to and from UTC+0 will probably not be absolutely
|
||||
# correct, but they should be quite close to the actual dates.
|
||||
#
|
||||
# From Paul Eggert (2014-03-21):
|
||||
# The CET-switching Troll rules require zic from tz 2014b or later, so as
|
||||
# suggested by Bengt-Inge Larsson comment them out for now, and approximate
|
||||
# with only UTC and CEST. Uncomment them when 2014b is more prevalent.
|
||||
#
|
||||
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
|
||||
#Rule Troll 2005 max - Mar 1 1:00u 1:00 +01
|
||||
Rule Troll 2005 max - Mar lastSun 1:00u 2:00 +02
|
||||
#Rule Troll 2005 max - Oct lastSun 1:00u 1:00 +01
|
||||
#Rule Troll 2004 max - Nov 7 1:00u 0:00 +00
|
||||
# Remove the following line when uncommenting the above '#Rule' lines.
|
||||
Rule Troll 2004 max - Oct lastSun 1:00u 0:00 +00
|
||||
# Zone NAME STDOFF RULES FORMAT [UNTIL]
|
||||
Zone Antarctica/Troll 0 - -00 2005 Feb 12
|
||||
0:00 Troll %s
|
||||
|
||||
# Poland - year-round base
|
||||
# Arctowski, King George Island, -620945-0582745, since 1977
|
||||
|
||||
# Romania - year-bound base
|
||||
# Law-Racoviță, Larsemann Hills, -692319+0762251, since 1986
|
||||
|
||||
# Russia - year-round bases
|
||||
# Bellingshausen, King George Island, -621159-0585337, since 1968-02-22
|
||||
# Mirny, Davis coast, -6633+09301, since 1956-02
|
||||
# Molodezhnaya, Alasheyev Bay, -6740+04551,
|
||||
# year-round from 1962-02 to 1999-07-01
|
||||
# Novolazarevskaya, Queen Maud Land, -7046+01150,
|
||||
# year-round from 1960/61 to 1992
|
||||
|
||||
# Vostok, since 1957-12-16, temporarily closed 1994-02/1994-11
|
||||
# See Asia/Urumqi.
|
||||
|
||||
# S Africa - year-round bases
|
||||
# Marion Island, -4653+03752
|
||||
# SANAE IV, Vesleskarvet, Queen Maud Land, -714022-0025026, since 1997
|
||||
|
||||
# Ukraine - year-round base
|
||||
# Vernadsky (formerly Faraday), Galindez Island, -651445-0641526, since 1954
|
||||
|
||||
# United Kingdom
|
||||
#
|
||||
# British Antarctic Territories (BAT) claims
|
||||
# South Orkney Islands
|
||||
# scientific station from 1903
|
||||
# whaling station at Signy I 1920/1926
|
||||
# South Shetland Islands
|
||||
#
|
||||
# year-round bases
|
||||
# Bird Island, South Georgia, -5400-03803, since 1983
|
||||
# Deception Island, -6259-06034, whaling station 1912/1931,
|
||||
# scientific station 1943/1967,
|
||||
# previously sealers and a scientific expedition wintered by accident,
|
||||
# and a garrison was deployed briefly
|
||||
# Halley, Coates Land, -7535-02604, since 1956-01-06
|
||||
# Halley is on a moving ice shelf and is periodically relocated
|
||||
# so that it is never more than 10km from its nominal location.
|
||||
# Rothera, Adelaide Island, -6734-6808, since 1976-12-01
|
||||
#
|
||||
# From Paul Eggert (2002-10-22)
|
||||
# <http://webexhibits.org/daylightsaving/g.html> says Rothera is -03 all year.
|
||||
#
|
||||
# Zone NAME STDOFF RULES FORMAT [UNTIL]
|
||||
Zone Antarctica/Rothera 0 - -00 1976 Dec 1
|
||||
-3:00 - -03
|
||||
|
||||
# Uruguay - year round base
|
||||
# Artigas, King George Island, -621104-0585107
|
||||
|
||||
# USA - year-round bases
|
||||
#
|
||||
# Palmer, Anvers Island, since 1965 (moved 2 miles in 1968)
|
||||
# See 'southamerica' for Antarctica/Palmer, since it uses South American DST.
|
||||
#
|
||||
# McMurdo Station, Ross Island, since 1955-12
|
||||
# Amundsen-Scott South Pole Station, continuously occupied since 1956-11-20
|
||||
#
|
||||
# From Chris Carrier (1996-06-27):
|
||||
# Siple, the first commander of the South Pole station,
|
||||
# stated that he would have liked to have kept GMT at the station,
|
||||
# but that he found it more convenient to keep GMT+12
|
||||
# as supplies for the station were coming from McMurdo Sound,
|
||||
# which was on GMT+12 because New Zealand was on GMT+12 all year
|
||||
# at that time (1957). (Source: Siple's book 90 Degrees South.)
|
||||
#
|
||||
# From Susan Smith
|
||||
# http://www.cybertours.com/whs/pole10.html
|
||||
# (1995-11-13 16:24:56 +1300, no longer available):
|
||||
# We use the same time as McMurdo does.
|
||||
# And they use the same time as Christchurch, NZ does....
|
||||
# One last quirk about South Pole time.
|
||||
# All the electric clocks are usually wrong.
|
||||
# Something about the generators running at 60.1hertz or something
|
||||
# makes all of the clocks run fast. So every couple of days,
|
||||
# we have to go around and set them back 5 minutes or so.
|
||||
# Maybe if we let them run fast all of the time, we'd get to leave here sooner!!
|
||||
#
|
||||
# See Pacific/Auckland.
|
||||
131
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/asctime.c
vendored
Normal file
131
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/asctime.c
vendored
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
/* asctime and asctime_r a la POSIX and ISO C, except pad years before 1000. */
|
||||
|
||||
/*
|
||||
** This file is in the public domain, so clarified as of
|
||||
** 1996-06-05 by Arthur David Olson.
|
||||
*/
|
||||
|
||||
/*
|
||||
** Avoid the temptation to punt entirely to strftime;
|
||||
** the output of strftime is supposed to be locale specific
|
||||
** whereas the output of asctime is supposed to be constant.
|
||||
*/
|
||||
|
||||
/*LINTLIBRARY*/
|
||||
|
||||
#include "private.h"
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
** All years associated with 32-bit time_t values are exactly four digits long;
|
||||
** some years associated with 64-bit time_t values are not.
|
||||
** Vintage programs are coded for years that are always four digits long
|
||||
** and may assume that the newline always lands in the same place.
|
||||
** For years that are less than four digits, we pad the output with
|
||||
** leading zeroes to get the newline in the traditional place.
|
||||
** The -4 ensures that we get four characters of output even if
|
||||
** we call a strftime variant that produces fewer characters for some years.
|
||||
** The ISO C and POSIX standards prohibit padding the year,
|
||||
** but many implementations pad anyway; most likely the standards are buggy.
|
||||
*/
|
||||
static char const ASCTIME_FMT[] = "%s %s%3d %.2d:%.2d:%.2d %-4s\n";
|
||||
/*
|
||||
** For years that are more than four digits we put extra spaces before the year
|
||||
** so that code trying to overwrite the newline won't end up overwriting
|
||||
** a digit within a year and truncating the year (operating on the assumption
|
||||
** that no output is better than wrong output).
|
||||
*/
|
||||
static char const ASCTIME_FMT_B[] = "%s %s%3d %.2d:%.2d:%.2d %s\n";
|
||||
|
||||
enum { STD_ASCTIME_BUF_SIZE = 26 };
|
||||
/*
|
||||
** Big enough for something such as
|
||||
** ??? ???-2147483648 -2147483648:-2147483648:-2147483648 -2147483648\n
|
||||
** (two three-character abbreviations, five strings denoting integers,
|
||||
** seven explicit spaces, two explicit colons, a newline,
|
||||
** and a trailing NUL byte).
|
||||
** The values above are for systems where an int is 32 bits and are provided
|
||||
** as an example; the size expression below is a bound for the system at
|
||||
** hand.
|
||||
*/
|
||||
static char buf_asctime[2*3 + 5*INT_STRLEN_MAXIMUM(int) + 7 + 2 + 1 + 1];
|
||||
|
||||
/* A similar buffer for ctime.
|
||||
C89 requires that they be the same buffer.
|
||||
This requirement was removed in C99, so support it only if requested,
|
||||
as support is more likely to lead to bugs in badly-written programs. */
|
||||
#if SUPPORT_C89
|
||||
# define buf_ctime buf_asctime
|
||||
#else
|
||||
static char buf_ctime[sizeof buf_asctime];
|
||||
#endif
|
||||
|
||||
char *
|
||||
asctime_r(register const struct tm *timeptr, char *buf)
|
||||
{
|
||||
static const char wday_name[][4] = {
|
||||
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
|
||||
};
|
||||
static const char mon_name[][4] = {
|
||||
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
||||
};
|
||||
register const char * wn;
|
||||
register const char * mn;
|
||||
char year[INT_STRLEN_MAXIMUM(int) + 2];
|
||||
char result[sizeof buf_asctime];
|
||||
|
||||
if (timeptr == NULL) {
|
||||
errno = EINVAL;
|
||||
return strcpy(buf, "??? ??? ?? ??:??:?? ????\n");
|
||||
}
|
||||
if (timeptr->tm_wday < 0 || timeptr->tm_wday >= DAYSPERWEEK)
|
||||
wn = "???";
|
||||
else wn = wday_name[timeptr->tm_wday];
|
||||
if (timeptr->tm_mon < 0 || timeptr->tm_mon >= MONSPERYEAR)
|
||||
mn = "???";
|
||||
else mn = mon_name[timeptr->tm_mon];
|
||||
/*
|
||||
** Use strftime's %Y to generate the year, to avoid overflow problems
|
||||
** when computing timeptr->tm_year + TM_YEAR_BASE.
|
||||
** Assume that strftime is unaffected by other out-of-range members
|
||||
** (e.g., timeptr->tm_mday) when processing "%Y".
|
||||
*/
|
||||
strftime(year, sizeof year, "%Y", timeptr);
|
||||
/*
|
||||
** We avoid using snprintf since it's not available on all systems.
|
||||
*/
|
||||
sprintf(result,
|
||||
((strlen(year) <= 4) ? ASCTIME_FMT : ASCTIME_FMT_B),
|
||||
wn, mn,
|
||||
timeptr->tm_mday, timeptr->tm_hour,
|
||||
timeptr->tm_min, timeptr->tm_sec,
|
||||
year);
|
||||
if (strlen(result) < STD_ASCTIME_BUF_SIZE
|
||||
|| buf == buf_ctime || buf == buf_asctime)
|
||||
return strcpy(buf, result);
|
||||
else {
|
||||
errno = EOVERFLOW;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
asctime(register const struct tm *timeptr)
|
||||
{
|
||||
return asctime_r(timeptr, buf_asctime);
|
||||
}
|
||||
|
||||
char *
|
||||
ctime_r(const time_t *timep, char *buf)
|
||||
{
|
||||
struct tm mytm;
|
||||
struct tm *tmp = localtime_r(timep, &mytm);
|
||||
return tmp ? asctime_r(tmp, buf) : NULL;
|
||||
}
|
||||
|
||||
char *
|
||||
ctime(const time_t *timep)
|
||||
{
|
||||
return ctime_r(timep, buf_ctime);
|
||||
}
|
||||
3955
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/asia
vendored
Normal file
3955
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/asia
vendored
Normal file
File diff suppressed because it is too large
Load diff
2222
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/australasia
vendored
Normal file
2222
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/australasia
vendored
Normal file
File diff suppressed because it is too large
Load diff
318
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/backward
vendored
Normal file
318
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/backward
vendored
Normal file
|
|
@ -0,0 +1,318 @@
|
|||
# tzdb links for backward compatibility
|
||||
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
# This file provides links from old or merged timezone names to current ones.
|
||||
# Many names changed in 1993 and in 1995, and many merged names moved here
|
||||
# in the period from 2013 through 2022. Several of these names are
|
||||
# also present in the file 'backzone', which has data important only
|
||||
# for pre-1970 timestamps and so is out of scope for tzdb proper.
|
||||
|
||||
# Although this file is optional and tzdb will work if you omit it by
|
||||
# building with 'make BACKWARD=', in practice downstream users
|
||||
# typically use this file for backward compatibility.
|
||||
|
||||
# This file is divided into sections, one for each major reason for a
|
||||
# backward compatibility link. Each section is sorted by link name.
|
||||
|
||||
# A "#= TARGET1" comment labels each link inserted only because some
|
||||
# .zi parsers (including tzcode through 2022e) mishandle links to links.
|
||||
# The comment says what the target would be if these parsers were fixed
|
||||
# so that data could contain links to links. For example, the line
|
||||
# "Link Australia/Sydney Australia/ACT #= Australia/Canberra" would be
|
||||
# "Link Australia/Canberra Australia/ACT" were it not that data lines
|
||||
# refrain from linking to links like Australia/Canberra, which means
|
||||
# the Australia/ACT line links instead to Australia/Sydney,
|
||||
# Australia/Canberra's target.
|
||||
|
||||
|
||||
# Pre-1993 naming conventions
|
||||
|
||||
# Link TARGET LINK-NAME #= TARGET1
|
||||
Link Australia/Sydney Australia/ACT #= Australia/Canberra
|
||||
Link Australia/Lord_Howe Australia/LHI
|
||||
Link Australia/Sydney Australia/NSW
|
||||
Link Australia/Darwin Australia/North
|
||||
Link Australia/Brisbane Australia/Queensland
|
||||
Link Australia/Adelaide Australia/South
|
||||
Link Australia/Hobart Australia/Tasmania
|
||||
Link Australia/Melbourne Australia/Victoria
|
||||
Link Australia/Perth Australia/West
|
||||
Link Australia/Broken_Hill Australia/Yancowinna
|
||||
Link America/Rio_Branco Brazil/Acre #= America/Porto_Acre
|
||||
Link America/Noronha Brazil/DeNoronha
|
||||
Link America/Sao_Paulo Brazil/East
|
||||
Link America/Manaus Brazil/West
|
||||
Link America/Halifax Canada/Atlantic
|
||||
Link America/Winnipeg Canada/Central
|
||||
# This line is commented out, as the name exceeded the 14-character limit
|
||||
# and was an unused misnomer.
|
||||
#Link America/Regina Canada/East-Saskatchewan
|
||||
Link America/Toronto Canada/Eastern
|
||||
Link America/Edmonton Canada/Mountain
|
||||
Link America/St_Johns Canada/Newfoundland
|
||||
Link America/Vancouver Canada/Pacific
|
||||
Link America/Regina Canada/Saskatchewan
|
||||
Link America/Whitehorse Canada/Yukon
|
||||
Link America/Santiago Chile/Continental
|
||||
Link Pacific/Easter Chile/EasterIsland
|
||||
Link America/Havana Cuba
|
||||
Link Africa/Cairo Egypt
|
||||
Link Europe/Dublin Eire
|
||||
# Vanguard section, for most .zi parsers.
|
||||
#Link GMT Etc/GMT
|
||||
#Link GMT Etc/GMT+0
|
||||
#Link GMT Etc/GMT-0
|
||||
#Link GMT Etc/GMT0
|
||||
#Link GMT Etc/Greenwich
|
||||
# Rearguard section, for TZUpdater 2.3.2 and earlier.
|
||||
Link Etc/GMT Etc/GMT+0
|
||||
Link Etc/GMT Etc/GMT-0
|
||||
Link Etc/GMT Etc/GMT0
|
||||
Link Etc/GMT Etc/Greenwich
|
||||
# End of rearguard section.
|
||||
Link Etc/UTC Etc/UCT
|
||||
Link Etc/UTC Etc/Universal
|
||||
Link Etc/UTC Etc/Zulu
|
||||
Link Europe/London GB
|
||||
Link Europe/London GB-Eire
|
||||
# Vanguard section, for most .zi parsers.
|
||||
#Link GMT GMT+0
|
||||
#Link GMT GMT-0
|
||||
#Link GMT GMT0
|
||||
#Link GMT Greenwich
|
||||
# Rearguard section, for TZUpdater 2.3.2 and earlier.
|
||||
Link Etc/GMT GMT+0
|
||||
Link Etc/GMT GMT-0
|
||||
Link Etc/GMT GMT0
|
||||
Link Etc/GMT Greenwich
|
||||
# End of rearguard section.
|
||||
Link Asia/Hong_Kong Hongkong
|
||||
Link Africa/Abidjan Iceland #= Atlantic/Reykjavik
|
||||
Link Asia/Tehran Iran
|
||||
Link Asia/Jerusalem Israel
|
||||
Link America/Jamaica Jamaica
|
||||
Link Asia/Tokyo Japan
|
||||
Link Pacific/Kwajalein Kwajalein
|
||||
Link Africa/Tripoli Libya
|
||||
Link America/Tijuana Mexico/BajaNorte
|
||||
Link America/Mazatlan Mexico/BajaSur
|
||||
Link America/Mexico_City Mexico/General
|
||||
Link Pacific/Auckland NZ
|
||||
Link Pacific/Chatham NZ-CHAT
|
||||
Link America/Denver Navajo #= America/Shiprock
|
||||
Link Asia/Shanghai PRC
|
||||
Link Europe/Warsaw Poland
|
||||
Link Europe/Lisbon Portugal
|
||||
Link Asia/Taipei ROC
|
||||
Link Asia/Seoul ROK
|
||||
Link Asia/Singapore Singapore
|
||||
Link Europe/Istanbul Turkey
|
||||
Link Etc/UTC UCT
|
||||
Link America/Anchorage US/Alaska
|
||||
Link America/Adak US/Aleutian
|
||||
Link America/Phoenix US/Arizona
|
||||
Link America/Chicago US/Central
|
||||
Link America/Indiana/Indianapolis US/East-Indiana
|
||||
Link America/New_York US/Eastern
|
||||
Link Pacific/Honolulu US/Hawaii
|
||||
Link America/Indiana/Knox US/Indiana-Starke
|
||||
Link America/Detroit US/Michigan
|
||||
Link America/Denver US/Mountain
|
||||
Link America/Los_Angeles US/Pacific
|
||||
Link Pacific/Pago_Pago US/Samoa
|
||||
Link Etc/UTC UTC
|
||||
Link Etc/UTC Universal
|
||||
Link Europe/Moscow W-SU
|
||||
Link Etc/UTC Zulu
|
||||
|
||||
|
||||
# Two-part names that were renamed mostly to three-part names in 1995
|
||||
|
||||
# Link TARGET LINK-NAME #= TARGET1
|
||||
Link America/Argentina/Buenos_Aires America/Buenos_Aires
|
||||
Link America/Argentina/Catamarca America/Catamarca
|
||||
Link America/Argentina/Cordoba America/Cordoba
|
||||
Link America/Indiana/Indianapolis America/Indianapolis
|
||||
Link America/Argentina/Jujuy America/Jujuy
|
||||
Link America/Indiana/Knox America/Knox_IN
|
||||
Link America/Kentucky/Louisville America/Louisville
|
||||
Link America/Argentina/Mendoza America/Mendoza
|
||||
Link America/Puerto_Rico America/Virgin #= America/St_Thomas
|
||||
Link Pacific/Pago_Pago Pacific/Samoa
|
||||
|
||||
|
||||
# Pre-2013 practice, which typically had a Zone per zone.tab line
|
||||
|
||||
# Link TARGET LINK-NAME
|
||||
Link Africa/Abidjan Africa/Accra
|
||||
Link Africa/Nairobi Africa/Addis_Ababa
|
||||
Link Africa/Nairobi Africa/Asmara
|
||||
Link Africa/Abidjan Africa/Bamako
|
||||
Link Africa/Lagos Africa/Bangui
|
||||
Link Africa/Abidjan Africa/Banjul
|
||||
Link Africa/Maputo Africa/Blantyre
|
||||
Link Africa/Lagos Africa/Brazzaville
|
||||
Link Africa/Maputo Africa/Bujumbura
|
||||
Link Africa/Abidjan Africa/Conakry
|
||||
Link Africa/Abidjan Africa/Dakar
|
||||
Link Africa/Nairobi Africa/Dar_es_Salaam
|
||||
Link Africa/Nairobi Africa/Djibouti
|
||||
Link Africa/Lagos Africa/Douala
|
||||
Link Africa/Abidjan Africa/Freetown
|
||||
Link Africa/Maputo Africa/Gaborone
|
||||
Link Africa/Maputo Africa/Harare
|
||||
Link Africa/Nairobi Africa/Kampala
|
||||
Link Africa/Maputo Africa/Kigali
|
||||
Link Africa/Lagos Africa/Kinshasa
|
||||
Link Africa/Lagos Africa/Libreville
|
||||
Link Africa/Abidjan Africa/Lome
|
||||
Link Africa/Lagos Africa/Luanda
|
||||
Link Africa/Maputo Africa/Lubumbashi
|
||||
Link Africa/Maputo Africa/Lusaka
|
||||
Link Africa/Lagos Africa/Malabo
|
||||
Link Africa/Johannesburg Africa/Maseru
|
||||
Link Africa/Johannesburg Africa/Mbabane
|
||||
Link Africa/Nairobi Africa/Mogadishu
|
||||
Link Africa/Lagos Africa/Niamey
|
||||
Link Africa/Abidjan Africa/Nouakchott
|
||||
Link Africa/Abidjan Africa/Ouagadougou
|
||||
Link Africa/Lagos Africa/Porto-Novo
|
||||
Link America/Puerto_Rico America/Anguilla
|
||||
Link America/Puerto_Rico America/Antigua
|
||||
Link America/Puerto_Rico America/Aruba
|
||||
Link America/Panama America/Atikokan
|
||||
Link America/Puerto_Rico America/Blanc-Sablon
|
||||
Link America/Panama America/Cayman
|
||||
Link America/Phoenix America/Creston
|
||||
Link America/Puerto_Rico America/Curacao
|
||||
Link America/Puerto_Rico America/Dominica
|
||||
Link America/Puerto_Rico America/Grenada
|
||||
Link America/Puerto_Rico America/Guadeloupe
|
||||
Link America/Puerto_Rico America/Kralendijk
|
||||
Link America/Puerto_Rico America/Lower_Princes
|
||||
Link America/Puerto_Rico America/Marigot
|
||||
Link America/Puerto_Rico America/Montserrat
|
||||
Link America/Toronto America/Nassau
|
||||
Link America/Puerto_Rico America/Port_of_Spain
|
||||
Link America/Puerto_Rico America/St_Barthelemy
|
||||
Link America/Puerto_Rico America/St_Kitts
|
||||
Link America/Puerto_Rico America/St_Lucia
|
||||
Link America/Puerto_Rico America/St_Thomas
|
||||
Link America/Puerto_Rico America/St_Vincent
|
||||
Link America/Puerto_Rico America/Tortola
|
||||
Link Pacific/Port_Moresby Antarctica/DumontDUrville
|
||||
Link Pacific/Auckland Antarctica/McMurdo
|
||||
Link Asia/Riyadh Antarctica/Syowa
|
||||
Link Asia/Urumqi Antarctica/Vostok
|
||||
Link Europe/Berlin Arctic/Longyearbyen
|
||||
Link Asia/Riyadh Asia/Aden
|
||||
Link Asia/Qatar Asia/Bahrain
|
||||
Link Asia/Kuching Asia/Brunei
|
||||
Link Asia/Singapore Asia/Kuala_Lumpur
|
||||
Link Asia/Riyadh Asia/Kuwait
|
||||
Link Asia/Dubai Asia/Muscat
|
||||
Link Asia/Bangkok Asia/Phnom_Penh
|
||||
Link Asia/Bangkok Asia/Vientiane
|
||||
Link Africa/Abidjan Atlantic/Reykjavik
|
||||
Link Africa/Abidjan Atlantic/St_Helena
|
||||
Link Europe/Brussels Europe/Amsterdam
|
||||
Link Europe/Prague Europe/Bratislava
|
||||
Link Europe/Zurich Europe/Busingen
|
||||
Link Europe/Berlin Europe/Copenhagen
|
||||
Link Europe/London Europe/Guernsey
|
||||
Link Europe/London Europe/Isle_of_Man
|
||||
Link Europe/London Europe/Jersey
|
||||
Link Europe/Belgrade Europe/Ljubljana
|
||||
Link Europe/Brussels Europe/Luxembourg
|
||||
Link Europe/Helsinki Europe/Mariehamn
|
||||
Link Europe/Paris Europe/Monaco
|
||||
Link Europe/Berlin Europe/Oslo
|
||||
Link Europe/Belgrade Europe/Podgorica
|
||||
Link Europe/Rome Europe/San_Marino
|
||||
Link Europe/Belgrade Europe/Sarajevo
|
||||
Link Europe/Belgrade Europe/Skopje
|
||||
Link Europe/Berlin Europe/Stockholm
|
||||
Link Europe/Zurich Europe/Vaduz
|
||||
Link Europe/Rome Europe/Vatican
|
||||
Link Europe/Belgrade Europe/Zagreb
|
||||
Link Africa/Nairobi Indian/Antananarivo
|
||||
Link Asia/Bangkok Indian/Christmas
|
||||
Link Asia/Yangon Indian/Cocos
|
||||
Link Africa/Nairobi Indian/Comoro
|
||||
Link Indian/Maldives Indian/Kerguelen
|
||||
Link Asia/Dubai Indian/Mahe
|
||||
Link Africa/Nairobi Indian/Mayotte
|
||||
Link Asia/Dubai Indian/Reunion
|
||||
Link Pacific/Port_Moresby Pacific/Chuuk
|
||||
Link Pacific/Tarawa Pacific/Funafuti
|
||||
Link Pacific/Tarawa Pacific/Majuro
|
||||
Link Pacific/Pago_Pago Pacific/Midway
|
||||
Link Pacific/Guadalcanal Pacific/Pohnpei
|
||||
Link Pacific/Guam Pacific/Saipan
|
||||
Link Pacific/Tarawa Pacific/Wake
|
||||
Link Pacific/Tarawa Pacific/Wallis
|
||||
|
||||
|
||||
# Non-zone.tab locations with timestamps since 1970 that duplicate
|
||||
# those of an existing location
|
||||
|
||||
# Link TARGET LINK-NAME
|
||||
Link Africa/Abidjan Africa/Timbuktu
|
||||
Link America/Argentina/Catamarca America/Argentina/ComodRivadavia
|
||||
Link America/Adak America/Atka
|
||||
Link America/Panama America/Coral_Harbour
|
||||
Link America/Tijuana America/Ensenada
|
||||
Link America/Indiana/Indianapolis America/Fort_Wayne
|
||||
Link America/Toronto America/Montreal
|
||||
Link America/Toronto America/Nipigon
|
||||
Link America/Iqaluit America/Pangnirtung
|
||||
Link America/Rio_Branco America/Porto_Acre
|
||||
Link America/Winnipeg America/Rainy_River
|
||||
Link America/Argentina/Cordoba America/Rosario
|
||||
Link America/Tijuana America/Santa_Isabel
|
||||
Link America/Denver America/Shiprock
|
||||
Link America/Toronto America/Thunder_Bay
|
||||
Link Pacific/Auckland Antarctica/South_Pole
|
||||
Link Asia/Shanghai Asia/Chongqing
|
||||
Link Asia/Shanghai Asia/Harbin
|
||||
Link Asia/Urumqi Asia/Kashgar
|
||||
Link Asia/Jerusalem Asia/Tel_Aviv
|
||||
Link Europe/Berlin Atlantic/Jan_Mayen
|
||||
Link Australia/Sydney Australia/Canberra
|
||||
Link Australia/Hobart Australia/Currie
|
||||
Link Europe/London Europe/Belfast
|
||||
Link Europe/Chisinau Europe/Tiraspol
|
||||
Link Europe/Kyiv Europe/Uzhgorod
|
||||
Link Europe/Kyiv Europe/Zaporozhye
|
||||
Link Pacific/Kanton Pacific/Enderbury
|
||||
Link Pacific/Honolulu Pacific/Johnston
|
||||
Link Pacific/Port_Moresby Pacific/Yap
|
||||
|
||||
|
||||
# Alternate names for the same location
|
||||
|
||||
# Link TARGET LINK-NAME #= TARGET1
|
||||
Link Africa/Nairobi Africa/Asmera #= Africa/Asmara
|
||||
Link America/Nuuk America/Godthab
|
||||
Link Asia/Ashgabat Asia/Ashkhabad
|
||||
Link Asia/Kolkata Asia/Calcutta
|
||||
Link Asia/Shanghai Asia/Chungking #= Asia/Chongqing
|
||||
Link Asia/Dhaka Asia/Dacca
|
||||
# Istanbul is in both continents.
|
||||
Link Europe/Istanbul Asia/Istanbul
|
||||
Link Asia/Kathmandu Asia/Katmandu
|
||||
Link Asia/Macau Asia/Macao
|
||||
Link Asia/Yangon Asia/Rangoon
|
||||
Link Asia/Ho_Chi_Minh Asia/Saigon
|
||||
Link Asia/Thimphu Asia/Thimbu
|
||||
Link Asia/Makassar Asia/Ujung_Pandang
|
||||
Link Asia/Ulaanbaatar Asia/Ulan_Bator
|
||||
Link Atlantic/Faroe Atlantic/Faeroe
|
||||
Link Europe/Kyiv Europe/Kiev
|
||||
# Classically, Cyprus is in Asia; e.g. see Herodotus, Histories, I.72.
|
||||
# However, for various reasons many users expect to find it under Europe.
|
||||
Link Asia/Nicosia Europe/Nicosia
|
||||
Link Pacific/Guadalcanal Pacific/Ponape #= Pacific/Pohnpei
|
||||
Link Pacific/Port_Moresby Pacific/Truk #= Pacific/Chuuk
|
||||
1858
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/backzone
vendored
Normal file
1858
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/backzone
vendored
Normal file
File diff suppressed because it is too large
Load diff
173
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/calendars
vendored
Normal file
173
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/calendars
vendored
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
----- Calendrical issues -----
|
||||
|
||||
As mentioned in Theory.html, although calendrical issues are out of
|
||||
scope for tzdb, they indicate the sort of problems that we would run
|
||||
into if we extended tzdb further into the past. The following
|
||||
information and sources go beyond Theory.html's brief discussion.
|
||||
They sometimes disagree.
|
||||
|
||||
|
||||
France
|
||||
|
||||
Gregorian calendar adopted 1582-12-20.
|
||||
French Revolutionary calendar used 1793-11-24 through 1805-12-31,
|
||||
and (in Paris only) 1871-05-06 through 1871-05-23.
|
||||
|
||||
|
||||
Russia
|
||||
|
||||
From Chris Carrier (1996-12-02):
|
||||
On 1929-10-01 the Soviet Union instituted an "Eternal Calendar"
|
||||
with 30-day months plus 5 holidays, with a 5-day week.
|
||||
On 1931-12-01 it changed to a 6-day week; in 1934 it reverted to the
|
||||
Gregorian calendar while retaining the 6-day week; on 1940-06-27 it
|
||||
reverted to the 7-day week. With the 6-day week the usual days
|
||||
off were the 6th, 12th, 18th, 24th and 30th of the month.
|
||||
(Source: Evitiar Zerubavel, _The Seven Day Circle_)
|
||||
|
||||
|
||||
Mark Brader reported a similar story in "The Book of Calendars", edited
|
||||
by Frank Parise (1982, Facts on File, ISBN 0-8719-6467-8), page 377. But:
|
||||
|
||||
From: Petteri Sulonen (via Usenet)
|
||||
Date: 14 Jan 1999 00:00:00 GMT
|
||||
...
|
||||
|
||||
If your source is correct, how come documents between 1929 and 1940 were
|
||||
still dated using the conventional, Gregorian calendar?
|
||||
|
||||
I can post a scan of a document dated December 1, 1934, signed by
|
||||
Yenukidze, the secretary, on behalf of Kalinin, the President of the
|
||||
Executive Committee of the Supreme Soviet, if you like.
|
||||
|
||||
|
||||
|
||||
Sweden (and Finland)
|
||||
|
||||
From: Mark Brader
|
||||
Subject: Re: Gregorian reform - a part of locale?
|
||||
<news:1996Jul6.012937.29190@sq.com>
|
||||
Date: 1996-07-06
|
||||
|
||||
In 1700, Denmark made the transition from Julian to Gregorian. Sweden
|
||||
decided to *start* a transition in 1700 as well, but rather than have one of
|
||||
those unsightly calendar gaps :-), they simply decreed that the next leap
|
||||
year after 1696 would be in 1744 - putting the whole country on a calendar
|
||||
different from both Julian and Gregorian for a period of 40 years.
|
||||
|
||||
However, in 1704 something went wrong and the plan was not carried through;
|
||||
they did, after all, have a leap year that year. And one in 1708. In 1712
|
||||
they gave it up and went back to Julian, putting 30 days in February that
|
||||
year!...
|
||||
|
||||
Then in 1753, Sweden made the transition to Gregorian in the usual manner,
|
||||
getting there only 13 years behind the original schedule.
|
||||
|
||||
(A previous posting of this story was challenged, and Swedish readers
|
||||
produced the following references to support it: "Tideräkning och historia"
|
||||
by Natanael Beckman (1924) and "Tid, en bok om tideräkning och
|
||||
kalenderväsen" by Lars-Olof Lodén (1968).
|
||||
|
||||
|
||||
Grotefend's data
|
||||
|
||||
From: "Michael Palmer" [with two obvious typos fixed]
|
||||
Subject: Re: Gregorian Calendar (was Re: Another FHC related question
|
||||
Newsgroups: soc.genealogy.german
|
||||
Date: Tue, 9 Feb 1999 02:32:48 -800
|
||||
...
|
||||
|
||||
The following is a(n incomplete) listing, arranged chronologically, of
|
||||
European states, with the date they converted from the Julian to the
|
||||
Gregorian calendar:
|
||||
|
||||
04/15 Oct 1582 - Italy (with exceptions), Spain, Portugal, Poland (Roman
|
||||
Catholics and Danzig only)
|
||||
09/20 Dec 1582 - France, Lorraine
|
||||
|
||||
21 Dec 1582/
|
||||
01 Jan 1583 - Holland, Brabant, Flanders, Hennegau
|
||||
10/21 Feb 1583 - bishopric of Liege (Lüttich)
|
||||
13/24 Feb 1583 - bishopric of Augsburg
|
||||
04/15 Oct 1583 - electorate of Trier
|
||||
05/16 Oct 1583 - Bavaria, bishoprics of Freising, Eichstedt, Regensburg,
|
||||
Salzburg, Brixen
|
||||
13/24 Oct 1583 - Austrian Oberelsaß and Breisgau
|
||||
20/31 Oct 1583 - bishopric of Basel
|
||||
02/13 Nov 1583 - duchy of Jülich-Berg
|
||||
02/13 Nov 1583 - electorate and city of Köln
|
||||
04/15 Nov 1583 - bishopric of Würzburg
|
||||
11/22 Nov 1583 - electorate of Mainz
|
||||
16/27 Nov 1583 - bishopric of Strassburg and the margraviate of Baden
|
||||
17/28 Nov 1583 - bishopric of Münster and duchy of Cleve
|
||||
14/25 Dec 1583 - Steiermark
|
||||
|
||||
06/17 Jan 1584 - Austria and Bohemia
|
||||
11/22 Jan 1584 - Lucerne, Uri, Schwyz, Zug, Freiburg, Solothurn
|
||||
12/23 Jan 1584 - Silesia and the Lausitz
|
||||
22 Jan/
|
||||
02 Feb 1584 - Hungary (legally on 21 Oct 1587)
|
||||
Jun 1584 - Unterwalden
|
||||
01/12 Jul 1584 - duchy of Westfalen
|
||||
|
||||
16/27 Jun 1585 - bishopric of Paderborn
|
||||
|
||||
14/25 Dec 1590 - Transylvania
|
||||
|
||||
22 Aug/
|
||||
02 Sep 1612 - duchy of Prussia
|
||||
|
||||
13/24 Dec 1614 - Pfalz-Neuburg
|
||||
|
||||
1617 - duchy of Kurland (reverted to the Julian calendar in
|
||||
1796)
|
||||
|
||||
1624 - bishopric of Osnabrück
|
||||
|
||||
1630 - bishopric of Minden
|
||||
|
||||
15/26 Mar 1631 - bishopric of Hildesheim
|
||||
|
||||
1655 - Kanton Wallis
|
||||
|
||||
05/16 Feb 1682 - city of Strassburg
|
||||
|
||||
18 Feb/
|
||||
01 Mar 1700 - Protestant Germany (including Swedish possessions in
|
||||
Germany), Denmark, Norway
|
||||
30 Jun/
|
||||
12 Jul 1700 - Gelderland, Zutphen
|
||||
10 Nov/
|
||||
12 Dec 1700 - Utrecht, Overijssel
|
||||
|
||||
31 Dec 1700/
|
||||
12 Jan 1701 - Friesland, Groningen, Zürich, Bern, Basel, Geneva,
|
||||
Thurgau, and Schaffhausen
|
||||
|
||||
1724 - Glarus, Appenzell, and the city of St. Gallen
|
||||
|
||||
01 Jan 1750 - Pisa and Florence
|
||||
|
||||
02/14 Sep 1752 - Great Britain
|
||||
|
||||
17 Feb/
|
||||
01 Mar 1753 - Sweden
|
||||
|
||||
1760-1812 - Graubünden
|
||||
|
||||
The Russian empire (including Finland and the Baltic states) did not
|
||||
convert to the Gregorian calendar until the Soviet revolution of 1917.
|
||||
|
||||
Source: H. Grotefend, _Taschenbuch der Zeitrechnung des deutschen
|
||||
Mittelalters und der Neuzeit_, herausgegeben von Dr. O. Grotefend
|
||||
(Hannover: Hahnsche Buchhandlung, 1941), pp. 26-28.
|
||||
|
||||
-----
|
||||
|
||||
This file is in the public domain, so clarified as of 2009-05-17 by
|
||||
Arthur David Olson.
|
||||
|
||||
-----
|
||||
Local Variables:
|
||||
coding: utf-8
|
||||
End:
|
||||
70
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/checklinks.awk
vendored
Normal file
70
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/checklinks.awk
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
# Check links in tz tables.
|
||||
|
||||
# Contributed by Paul Eggert. This file is in the public domain.
|
||||
|
||||
BEGIN {
|
||||
# Special marker indicating that the name is defined as a Zone.
|
||||
# It is a newline so that it cannot match a valid name.
|
||||
# It is not null so that its slot does not appear unset.
|
||||
Zone = "\n"
|
||||
}
|
||||
|
||||
/^Z/ {
|
||||
if (defined[$2]) {
|
||||
if (defined[$2] == Zone) {
|
||||
printf "%s: Zone has duplicate definition\n", $2
|
||||
} else {
|
||||
printf "%s: Link with same name as Zone\n", $2
|
||||
}
|
||||
status = 1
|
||||
}
|
||||
defined[$2] = Zone
|
||||
}
|
||||
|
||||
/^L/ {
|
||||
if (defined[$3]) {
|
||||
if (defined[$3] == Zone) {
|
||||
printf "%s: Link with same name as Zone\n", $3
|
||||
} else if (defined[$3] == $2) {
|
||||
printf "%s: Link has duplicate definition\n", $3
|
||||
} else {
|
||||
printf "%s: Link to both %s and %s\n", $3, defined[$3], $2
|
||||
}
|
||||
status = 1
|
||||
}
|
||||
if (backcheck && FILENAME != backcheck && $3 != "GMT") {
|
||||
printf "%s: Link should be in '%s'\n", $3, backcheck
|
||||
status = 1
|
||||
}
|
||||
if ($4 == "#=") {
|
||||
shortcut[$5] = $3
|
||||
}
|
||||
used[$2] = 1
|
||||
defined[$3] = $2
|
||||
}
|
||||
|
||||
END {
|
||||
for (tz in used) {
|
||||
if (defined[tz] != Zone) {
|
||||
if (!defined[tz]) {
|
||||
printf "%s: Link to nowhere\n", tz
|
||||
status = 1
|
||||
} else if (DATAFORM != "vanguard") {
|
||||
printf "%s: Link to link\n", tz
|
||||
status = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
for (tz in shortcut) {
|
||||
if (defined[shortcut[tz]] != defined[tz]) {
|
||||
target = (!defined[tz] ? "absence" \
|
||||
: defined[tz] == "\n" ? "zone" \
|
||||
: defined[tz])
|
||||
printf "%s: target %s disagrees with %s's target %s\n", \
|
||||
tz, target, shortcut[tz], defined[shortcut[tz]]
|
||||
status = 1
|
||||
}
|
||||
}
|
||||
|
||||
exit status
|
||||
}
|
||||
191
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/checktab.awk
vendored
Normal file
191
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/checktab.awk
vendored
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
# Check tz tables for consistency.
|
||||
|
||||
# Contributed by Paul Eggert. This file is in the public domain.
|
||||
|
||||
BEGIN {
|
||||
FS = "\t"
|
||||
|
||||
if (!iso_table) iso_table = "iso3166.tab"
|
||||
if (!zone_table) zone_table = "zone1970.tab"
|
||||
if (!want_warnings) want_warnings = -1
|
||||
|
||||
while (getline <iso_table) {
|
||||
iso_NR++
|
||||
if ($0 ~ /^#/) continue
|
||||
if (NF != 2) {
|
||||
printf "%s:%d: wrong number of columns\n", \
|
||||
iso_table, iso_NR >>"/dev/stderr"
|
||||
status = 1
|
||||
}
|
||||
cc = $1
|
||||
name = $2
|
||||
if (cc !~ /^[A-Z][A-Z]$/) {
|
||||
printf "%s:%d: invalid country code '%s'\n", \
|
||||
iso_table, iso_NR, cc >>"/dev/stderr"
|
||||
status = 1
|
||||
}
|
||||
if (cc <= cc0) {
|
||||
if (cc == cc0) {
|
||||
s = "duplicate";
|
||||
} else {
|
||||
s = "out of order";
|
||||
}
|
||||
|
||||
printf "%s:%d: country code '%s' is %s\n", \
|
||||
iso_table, iso_NR, cc, s \
|
||||
>>"/dev/stderr"
|
||||
status = 1
|
||||
}
|
||||
cc0 = cc
|
||||
if (name2cc[name]) {
|
||||
printf "%s:%d: '%s' and '%s' have the same name\n", \
|
||||
iso_table, iso_NR, name2cc[name], cc \
|
||||
>>"/dev/stderr"
|
||||
status = 1
|
||||
}
|
||||
name2cc[name] = cc
|
||||
cc2name[cc] = name
|
||||
cc2NR[cc] = iso_NR
|
||||
}
|
||||
|
||||
cc0 = ""
|
||||
|
||||
while (getline <zone_table) {
|
||||
zone_NR++
|
||||
if ($0 ~ /^#/) continue
|
||||
if (NF != 3 && NF != 4) {
|
||||
printf "%s:%d: wrong number of columns\n", \
|
||||
zone_table, zone_NR >>"/dev/stderr"
|
||||
status = 1
|
||||
}
|
||||
ccs = input_ccs[zone_NR] = $1
|
||||
coordinates = $2
|
||||
tz = $3
|
||||
comments = input_comments[zone_NR] = $4
|
||||
split(ccs, cca, /,/)
|
||||
cc = cca[1]
|
||||
|
||||
# Don't complain about a special case for Crimea in zone.tab.
|
||||
# FIXME: zone.tab should be removed, since it is obsolete.
|
||||
# Or at least put just "XX" in its country-code column.
|
||||
if (cc < cc0 \
|
||||
&& !(zone_table == "zone.tab" \
|
||||
&& tz0 == "Europe/Simferopol")) {
|
||||
printf "%s:%d: country code '%s' is out of order\n", \
|
||||
zone_table, zone_NR, cc >>"/dev/stderr"
|
||||
status = 1
|
||||
}
|
||||
cc0 = cc
|
||||
tz0 = tz
|
||||
tztab[tz] = 1
|
||||
tz2NR[tz] = zone_NR
|
||||
for (i in cca) {
|
||||
cc = cca[i]
|
||||
if (cc2name[cc]) {
|
||||
cc_used[cc]++
|
||||
} else {
|
||||
printf "%s:%d: %s: unknown country code\n", \
|
||||
zone_table, zone_NR, cc >>"/dev/stderr"
|
||||
status = 1
|
||||
}
|
||||
}
|
||||
if (coordinates !~ /^[-+][0-9][0-9][0-5][0-9][-+][01][0-9][0-9][0-5][0-9]$/ \
|
||||
&& coordinates !~ /^[-+][0-9][0-9][0-5][0-9][0-5][0-9][-+][01][0-9][0-9][0-5][0-9][0-5][0-9]$/) {
|
||||
printf "%s:%d: %s: invalid coordinates\n", \
|
||||
zone_table, zone_NR, coordinates >>"/dev/stderr"
|
||||
status = 1
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 1; i <= zone_NR; i++) {
|
||||
ccs = input_ccs[i]
|
||||
if (!ccs) continue
|
||||
comments = input_comments[i]
|
||||
split(ccs, cca, /,/)
|
||||
used_max = 0
|
||||
for (j in cca) {
|
||||
cc = cca[j]
|
||||
if (used_max < cc_used[cc]) {
|
||||
used_max = cc_used[cc]
|
||||
}
|
||||
}
|
||||
if (used_max <= 1 && comments) {
|
||||
printf "%s:%d: unnecessary comment '%s'\n", \
|
||||
zone_table, i, comments \
|
||||
>>"/dev/stderr"
|
||||
status = 1
|
||||
} else if (1 < cc_used[cc] && !comments) {
|
||||
printf "%s:%d: missing comment for %s\n", \
|
||||
zone_table, i, cc \
|
||||
>>"/dev/stderr"
|
||||
status = 1
|
||||
}
|
||||
}
|
||||
FS = " "
|
||||
}
|
||||
|
||||
$1 ~ /^#/ { next }
|
||||
|
||||
{
|
||||
tz = rules = ""
|
||||
if ($1 == "Zone") {
|
||||
tz = $2
|
||||
ruleUsed[$4] = 1
|
||||
if ($5 ~ /%/) rulePercentUsed[$4] = 1
|
||||
} else if ($1 == "Link" && zone_table == "zone.tab") {
|
||||
# Ignore Link commands if source and destination basenames
|
||||
# are identical, e.g. Europe/Istanbul versus Asia/Istanbul.
|
||||
src = $2
|
||||
dst = $3
|
||||
while ((i = index(src, "/"))) src = substr(src, i+1)
|
||||
while ((i = index(dst, "/"))) dst = substr(dst, i+1)
|
||||
if (src != dst) tz = $3
|
||||
} else if ($1 == "Rule") {
|
||||
ruleDefined[$2] = 1
|
||||
if ($10 != "-") ruleLetters[$2] = 1
|
||||
} else {
|
||||
ruleUsed[$2] = 1
|
||||
if ($3 ~ /%/) rulePercentUsed[$2] = 1
|
||||
}
|
||||
if (tz && tz ~ /\// && tz !~ /^Etc\//) {
|
||||
if (!tztab[tz] && FILENAME != "backward") {
|
||||
printf "%s: no data for '%s'\n", zone_table, tz \
|
||||
>>"/dev/stderr"
|
||||
status = 1
|
||||
}
|
||||
zoneSeen[tz] = 1
|
||||
}
|
||||
}
|
||||
|
||||
END {
|
||||
for (tz in ruleDefined) {
|
||||
if (!ruleUsed[tz]) {
|
||||
printf "%s: Rule never used\n", tz
|
||||
status = 1
|
||||
}
|
||||
}
|
||||
for (tz in ruleLetters) {
|
||||
if (!rulePercentUsed[tz]) {
|
||||
printf "%s: Rule contains letters never used\n", tz
|
||||
status = 1
|
||||
}
|
||||
}
|
||||
for (tz in tztab) {
|
||||
if (!zoneSeen[tz] && tz !~ /^Etc\//) {
|
||||
printf "%s:%d: no Zone table for '%s'\n", \
|
||||
zone_table, tz2NR[tz], tz >>"/dev/stderr"
|
||||
status = 1
|
||||
}
|
||||
}
|
||||
if (0 < want_warnings) {
|
||||
for (cc in cc2name) {
|
||||
if (!cc_used[cc]) {
|
||||
printf "%s:%d: warning: " \
|
||||
"no Zone entries for %s (%s)\n", \
|
||||
iso_table, cc2NR[cc], cc, cc2name[cc]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exit status
|
||||
}
|
||||
167
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/date.1
vendored
Normal file
167
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/date.1
vendored
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
.\" This file is in the public domain, so clarified as of
|
||||
.\" 2009-05-17 by Arthur David Olson.
|
||||
.TH date 1
|
||||
.SH NAME
|
||||
date \- show and set date and time
|
||||
.SH SYNOPSIS
|
||||
.if n .nh
|
||||
.if n .na
|
||||
.ie \n(.g .ds - \f(CR-\fP
|
||||
.el .ds - \-
|
||||
.B date
|
||||
[
|
||||
.B \*-u
|
||||
] [
|
||||
.B \*-c
|
||||
] [
|
||||
.B \*-r
|
||||
.I seconds
|
||||
] [
|
||||
.BI + format
|
||||
] [
|
||||
\fR[\fIyyyy\fR]\fImmddhhmm\fR[\fIyy\fR][\fB.\fIss\fR]
|
||||
]
|
||||
.SH DESCRIPTION
|
||||
.ie '\(lq'' .ds lq \&"\"
|
||||
.el .ds lq \(lq\"
|
||||
.ie '\(rq'' .ds rq \&"\"
|
||||
.el .ds rq \(rq\"
|
||||
.de q
|
||||
\\$3\*(lq\\$1\*(rq\\$2
|
||||
..
|
||||
The
|
||||
.B date
|
||||
command
|
||||
without arguments writes the date and time to the standard output in
|
||||
the form
|
||||
.ce 1
|
||||
Wed Mar 8 14:54:40 EST 1989
|
||||
.br
|
||||
with
|
||||
.B EST
|
||||
replaced by the local time zone's abbreviation
|
||||
(or by the abbreviation for the time zone specified in the
|
||||
.B TZ
|
||||
environment variable if set).
|
||||
The exact output format depends on the locale.
|
||||
.PP
|
||||
If a command-line argument starts with a plus sign (\c
|
||||
.q "\fB+\fP" ),
|
||||
the rest of the argument is used as a
|
||||
.I format
|
||||
that controls what appears in the output.
|
||||
In the format, when a percent sign (\c
|
||||
.q "\fB%\fP"
|
||||
appears,
|
||||
it and the character after it are not output,
|
||||
but rather identify part of the date or time
|
||||
to be output in a particular way
|
||||
(or identify a special character to output):
|
||||
.nf
|
||||
.sp
|
||||
.if t .in +.5i
|
||||
.if n .in +2
|
||||
.ta \w'%M\0\0'u +\w'Wed Mar 8 14:54:40 EST 1989\0\0'u
|
||||
Sample output Explanation
|
||||
%a Wed Abbreviated weekday name*
|
||||
%A Wednesday Full weekday name*
|
||||
%b Mar Abbreviated month name*
|
||||
%B March Full month name*
|
||||
%c Wed Mar 08 14:54:40 1989 Date and time*
|
||||
%C 19 Century
|
||||
%d 08 Day of month (always two digits)
|
||||
%D 03/08/89 Month/day/year (eight characters)
|
||||
%e 8 Day of month (leading zero blanked)
|
||||
%h Mar Abbreviated month name*
|
||||
%H 14 24-hour-clock hour (two digits)
|
||||
%I 02 12-hour-clock hour (two digits)
|
||||
%j 067 Julian day number (three digits)
|
||||
%k 2 12-hour-clock hour (leading zero blanked)
|
||||
%l 14 24-hour-clock hour (leading zero blanked)
|
||||
%m 03 Month number (two digits)
|
||||
%M 54 Minute (two digits)
|
||||
%n \\n newline character
|
||||
%p PM AM/PM designation
|
||||
%r 02:54:40 PM Hour:minute:second AM/PM designation
|
||||
%R 14:54 Hour:minute
|
||||
%S 40 Second (two digits)
|
||||
%t \\t tab character
|
||||
%T 14:54:40 Hour:minute:second
|
||||
%U 10 Sunday-based week number (two digits)
|
||||
%w 3 Day number (one digit, Sunday is 0)
|
||||
%W 10 Monday-based week number (two digits)
|
||||
%x 03/08/89 Date*
|
||||
%X 14:54:40 Time*
|
||||
%y 89 Last two digits of year
|
||||
%Y 1989 Year in full
|
||||
%z -0500 Numeric time zone
|
||||
%Z EST Time zone abbreviation
|
||||
%+ Wed Mar 8 14:54:40 EST 1989 Default output format*
|
||||
.if t .in -.5i
|
||||
.if n .in -2
|
||||
* The exact output depends on the locale.
|
||||
.sp
|
||||
.fi
|
||||
If a character other than one of those shown above appears after
|
||||
a percent sign in the format,
|
||||
that following character is output.
|
||||
All other characters in the format are copied unchanged to the output;
|
||||
a newline character is always added at the end of the output.
|
||||
.PP
|
||||
In Sunday-based week numbering,
|
||||
the first Sunday of the year begins week 1;
|
||||
days preceding it are part of
|
||||
.q "week 0" .
|
||||
In Monday-based week numbering,
|
||||
the first Monday of the year begins week 1.
|
||||
.PP
|
||||
To set the date, use a command line argument with one of the following forms:
|
||||
.nf
|
||||
.if t .in +.5i
|
||||
.if n .in +2
|
||||
.ta \w'198903081454\0'u
|
||||
1454 24-hour-clock hours (first two digits) and minutes
|
||||
081454 Month day (first two digits), hours, and minutes
|
||||
03081454 Month (two digits, January is 01), month day, hours, minutes
|
||||
8903081454 Year, month, month day, hours, minutes
|
||||
0308145489 Month, month day, hours, minutes, year
|
||||
(on System V-compatible systems)
|
||||
030814541989 Month, month day, hours, minutes, four-digit year
|
||||
198903081454 Four-digit year, month, month day, hours, minutes
|
||||
.if t .in -.5i
|
||||
.if n .in -2
|
||||
.fi
|
||||
If the century, year, month, or month day is not given,
|
||||
the current value is used.
|
||||
Any of the above forms may be followed by a period and two digits that give
|
||||
the seconds part of the new time; if no seconds are given, zero is assumed.
|
||||
.PP
|
||||
These options are available:
|
||||
.TP
|
||||
.BR \*-u " or " \*-c
|
||||
Use Universal Time when setting and showing the date and time.
|
||||
.TP
|
||||
.BI "\*-r " seconds
|
||||
Output the date that corresponds to
|
||||
.I seconds
|
||||
past the epoch of 1970-01-01 00:00:00 UTC, where
|
||||
.I seconds
|
||||
should be an integer, either decimal, octal (leading 0), or
|
||||
hexadecimal (leading 0x), preceded by an optional sign.
|
||||
.SH FILES
|
||||
.ta \w'/usr/share/zoneinfo/posixrules\0\0'u
|
||||
/etc/localtime local timezone file
|
||||
.br
|
||||
/usr/lib/locale/\f2L\fP/LC_TIME description of time locale \f2L\fP
|
||||
.br
|
||||
/usr/share/zoneinfo timezone information directory
|
||||
.br
|
||||
/usr/share/zoneinfo/posixrules used with POSIX-style TZ's
|
||||
.br
|
||||
/usr/share/zoneinfo/GMT for UTC leap seconds
|
||||
.sp
|
||||
If
|
||||
.B /usr/share/zoneinfo/GMT
|
||||
is absent,
|
||||
UTC leap seconds are loaded from
|
||||
.BR /usr/share/zoneinfo/posixrules .
|
||||
216
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/date.c
vendored
Normal file
216
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/date.c
vendored
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
/* Display or set the current time and date. */
|
||||
|
||||
/* Copyright 1985, 1987, 1988 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the University nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE. */
|
||||
|
||||
#include "private.h"
|
||||
#include <locale.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if !HAVE_POSIX_DECLS
|
||||
extern char * optarg;
|
||||
extern int optind;
|
||||
#endif
|
||||
|
||||
static int retval = EXIT_SUCCESS;
|
||||
|
||||
static void display(const char *, time_t);
|
||||
static void dogmt(void);
|
||||
static void errensure(void);
|
||||
static void timeout(FILE *, const char *, const struct tm *);
|
||||
ATTRIBUTE_NORETURN static void usage(void);
|
||||
|
||||
int
|
||||
main(const int argc, char *argv[])
|
||||
{
|
||||
register const char * format = "+%+";
|
||||
register int ch;
|
||||
register bool rflag = false;
|
||||
time_t t;
|
||||
intmax_t secs;
|
||||
char * endarg;
|
||||
|
||||
#ifdef LC_ALL
|
||||
setlocale(LC_ALL, "");
|
||||
#endif /* defined(LC_ALL) */
|
||||
#if HAVE_GETTEXT
|
||||
# ifdef TZ_DOMAINDIR
|
||||
bindtextdomain(TZ_DOMAIN, TZ_DOMAINDIR);
|
||||
# endif /* defined(TEXTDOMAINDIR) */
|
||||
textdomain(TZ_DOMAIN);
|
||||
#endif /* HAVE_GETTEXT */
|
||||
t = time(NULL);
|
||||
while ((ch = getopt(argc, argv, "ucr:")) != EOF && ch != -1) {
|
||||
switch (ch) {
|
||||
default:
|
||||
usage();
|
||||
case 'u': /* do it in UT */
|
||||
case 'c':
|
||||
dogmt();
|
||||
break;
|
||||
case 'r': /* seconds since 1970 */
|
||||
if (rflag) {
|
||||
fprintf(stderr,
|
||||
_("date: error: multiple -r's used"));
|
||||
usage();
|
||||
}
|
||||
rflag = true;
|
||||
errno = 0;
|
||||
secs = strtoimax(optarg, &endarg, 0);
|
||||
if (*endarg || optarg == endarg)
|
||||
errno = EINVAL;
|
||||
else if (! (TIME_T_MIN <= secs && secs <= TIME_T_MAX))
|
||||
errno = ERANGE;
|
||||
if (errno) {
|
||||
perror(optarg);
|
||||
errensure();
|
||||
exit(retval);
|
||||
}
|
||||
t = secs;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (optind < argc) {
|
||||
if (argc - optind != 1) {
|
||||
fprintf(stderr,
|
||||
_("date: error: multiple operands in command line\n"));
|
||||
usage();
|
||||
}
|
||||
format = argv[optind];
|
||||
if (*format != '+') {
|
||||
fprintf(stderr, _("date: unknown operand: %s\n"), format);
|
||||
usage();
|
||||
}
|
||||
}
|
||||
|
||||
display(format, t);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
dogmt(void)
|
||||
{
|
||||
static char ** fakeenv;
|
||||
|
||||
if (fakeenv == NULL) {
|
||||
static char tzeutc0[] = "TZ=UTC0";
|
||||
ptrdiff_t from, to, n;
|
||||
|
||||
for (n = 0; environ[n] != NULL; ++n)
|
||||
continue;
|
||||
#if defined ckd_add && defined ckd_mul
|
||||
if (!ckd_add(&n, n, 2) && !ckd_mul(&n, n, sizeof *fakeenv)
|
||||
&& n <= SIZE_MAX)
|
||||
fakeenv = malloc(n);
|
||||
#else
|
||||
if (n <= min(PTRDIFF_MAX, SIZE_MAX) / sizeof *fakeenv - 2)
|
||||
fakeenv = malloc((n + 2) * sizeof *fakeenv);
|
||||
#endif
|
||||
if (fakeenv == NULL) {
|
||||
fprintf(stderr, _("date: Memory exhausted\n"));
|
||||
errensure();
|
||||
exit(retval);
|
||||
}
|
||||
to = 0;
|
||||
fakeenv[to++] = tzeutc0;
|
||||
for (from = 1; environ[from] != NULL; ++from)
|
||||
if (strncmp(environ[from], "TZ=", 3) != 0)
|
||||
fakeenv[to++] = environ[from];
|
||||
fakeenv[to] = NULL;
|
||||
environ = fakeenv;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
errensure(void)
|
||||
{
|
||||
if (retval == EXIT_SUCCESS)
|
||||
retval = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("date: usage: date [-u] [-c] [-r seconds]"
|
||||
" [+format]\n"));
|
||||
errensure();
|
||||
exit(retval);
|
||||
}
|
||||
|
||||
static void
|
||||
display(char const *format, time_t now)
|
||||
{
|
||||
struct tm *tmp;
|
||||
|
||||
tmp = localtime(&now);
|
||||
if (!tmp) {
|
||||
fprintf(stderr,
|
||||
_("date: error: time out of range\n"));
|
||||
errensure();
|
||||
return;
|
||||
}
|
||||
timeout(stdout, format, tmp);
|
||||
putchar('\n');
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
if (ferror(stdout) || ferror(stderr)) {
|
||||
fprintf(stderr,
|
||||
_("date: error: couldn't write results\n"));
|
||||
errensure();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
timeout(FILE *fp, char const *format, struct tm const *tmp)
|
||||
{
|
||||
char *cp = NULL;
|
||||
ptrdiff_t result;
|
||||
ptrdiff_t size = 1024 / 2;
|
||||
|
||||
for ( ; ; ) {
|
||||
#ifdef ckd_mul
|
||||
bool bigger = !ckd_mul(&size, size, 2) && size <= SIZE_MAX;
|
||||
#else
|
||||
bool bigger = (size <= min(PTRDIFF_MAX, SIZE_MAX) / 2
|
||||
&& (size *= 2, true));
|
||||
#endif
|
||||
char *newcp = bigger ? realloc(cp, size) : NULL;
|
||||
if (!newcp) {
|
||||
fprintf(stderr,
|
||||
_("date: error: can't get memory\n"));
|
||||
errensure();
|
||||
exit(retval);
|
||||
}
|
||||
cp = newcp;
|
||||
result = strftime(cp, size, format, tmp);
|
||||
if (result != 0)
|
||||
break;
|
||||
}
|
||||
fwrite(cp + 1, 1, result - 1, fp);
|
||||
free(cp);
|
||||
}
|
||||
60
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/difftime.c
vendored
Normal file
60
externals/nx_tzdb/tzdb_to_nx/externals/tz/tz/difftime.c
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
/* Return the difference between two timestamps. */
|
||||
|
||||
/*
|
||||
** This file is in the public domain, so clarified as of
|
||||
** 1996-06-05 by Arthur David Olson.
|
||||
*/
|
||||
|
||||
/*LINTLIBRARY*/
|
||||
|
||||
#include "private.h" /* for time_t and TYPE_SIGNED */
|
||||
|
||||
/* Return -X as a double. Using this avoids casting to 'double'. */
|
||||
static double
|
||||
dminus(double x)
|
||||
{
|
||||
return -x;
|
||||
}
|
||||
|
||||
double
|
||||
difftime(time_t time1, time_t time0)
|
||||
{
|
||||
/*
|
||||
** If double is large enough, simply convert and subtract
|
||||
** (assuming that the larger type has more precision).
|
||||
*/
|
||||
if (sizeof(time_t) < sizeof(double)) {
|
||||
double t1 = time1, t0 = time0;
|
||||
return t1 - t0;
|
||||
}
|
||||
|
||||
/*
|
||||
** The difference of two unsigned values can't overflow
|
||||
** if the minuend is greater than or equal to the subtrahend.
|
||||
*/
|
||||
if (!TYPE_SIGNED(time_t))
|
||||
return time0 <= time1 ? time1 - time0 : dminus(time0 - time1);
|
||||
|
||||
/* Use uintmax_t if wide enough. */
|
||||
if (sizeof(time_t) <= sizeof(uintmax_t)) {
|
||||
uintmax_t t1 = time1, t0 = time0;
|
||||
return time0 <= time1 ? t1 - t0 : dminus(t0 - t1);
|
||||
}
|
||||
|
||||
/*
|
||||
** Handle cases where both time1 and time0 have the same sign
|
||||
** (meaning that their difference cannot overflow).
|
||||
*/
|
||||
if ((time1 < 0) == (time0 < 0))
|
||||
return time1 - time0;
|
||||
|
||||
/*
|
||||
** The values have opposite signs and uintmax_t is too narrow.
|
||||
** This suffers from double rounding; attempt to lessen that
|
||||
** by using long double temporaries.
|
||||
*/
|
||||
{
|
||||
long double t1 = time1, t0 = time0;
|
||||
return t1 - t0;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue