···45stdenv.mkDerivation rec {
46 inherit pname version src;
4748- # Replace icons licensed under CC BY-ND 3.0 with free ones to allow
49- # for binary redistribution: https://github.com/yuzu-emu/yuzu/pull/8104
50- # The patch hosted on GitHub has the binary information in git format, which
51- # can’t be applied with patch(1), so it has been regenerated with
52- # "git format-patch --text --full-index --binary".
53- # Because pineapple strips all files beginning with a dot, the patch needs to
54- # be edited manually afterwards to remove all changes to those.
55- patches = [ ./yuzu-free-icons.patch ];
56-57 nativeBuildInputs = [
58 cmake
59 doxygen
···111 "-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF" # We provide this deterministically
112 ];
1130000000114 preConfigure = ''
115 # This prevents a check for submodule directories.
116 rm -f .gitmodules
···125 # This must be done after cmake finishes as it overwrites the file
126 postConfigure = ''
127 ln -sf ${compat-list} ./dist/compatibility_list/compatibility_list.json
128- '';
129-130- # Fix vulkan detection
131- postFixup = ''
132- for bin in $out/bin/yuzu $out/bin/yuzu-cmd; do
133- wrapProgram $bin --prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib
134- done
135 '';
136137 passthru.updateScript = runCommandLocal "yuzu-${branch}-updateScript" {
···154 platforms = [ "x86_64-linux" ];
155 license = with licenses; [
156 gpl3Plus
157- # Icons. Note that this would be cc0 and cc-by-nd-30 without the "yuzu-free-icons" patch
158 asl20 mit cc0
159 ];
160 maintainers = with maintainers; [
···45stdenv.mkDerivation rec {
46 inherit pname version src;
4700000000048 nativeBuildInputs = [
49 cmake
50 doxygen
···102 "-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF" # We provide this deterministically
103 ];
104105+ qtWrapperArgs = [
106+ # Fixes vulkan detection
107+ "--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib"
108+ # Without yuzu doesnt start on wayland. See https://github.com/yuzu-emu/yuzu/issues/6088
109+ "--set QT_QPA_PLATFORM xcb"
110+ ];
111+112 preConfigure = ''
113 # This prevents a check for submodule directories.
114 rm -f .gitmodules
···123 # This must be done after cmake finishes as it overwrites the file
124 postConfigure = ''
125 ln -sf ${compat-list} ./dist/compatibility_list/compatibility_list.json
0000000126 '';
127128 passthru.updateScript = runCommandLocal "yuzu-${branch}-updateScript" {
···145 platforms = [ "x86_64-linux" ];
146 license = with licenses; [
147 gpl3Plus
148+ # Icons
149 asl20 mit cc0
150 ];
151 maintainers = with maintainers; [
+78-57
pkgs/applications/emulators/yuzu/update.sh
···1#! /usr/bin/env nix-shell
2-#! nix-shell -i bash -p nix nix-prefetch-git coreutils curl jq gnused
34-set -e
56# Will be replaced with the actual branch when running this from passthru.updateScript
7BRANCH="@branch@"
089-if [[ ! "$(basename $PWD)" = "yuzu" ]]; then
10- echo "error: Script must be ran from yuzu's directory!"
11 exit 1
12fi
1314-getLocalVersion() {
15- pushd ../../../.. >/dev/null
16- nix eval --raw -f default.nix "$1".version
17- popd >/dev/null
18-}
19-20-getLocalHash() {
21- pushd ../../../.. >/dev/null
22- nix eval --raw -f default.nix "$1".src.drvAttrs.outputHash
23- popd >/dev/null
24-}
25-26-updateMainline() {
27- OLD_MAINLINE_VERSION="$(getLocalVersion "yuzu-mainline")"
28- OLD_MAINLINE_HASH="$(getLocalHash "yuzu-mainline")"
29-30- NEW_MAINLINE_VERSION="$(curl -s ${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
31- "https://api.github.com/repos/yuzu-emu/yuzu-mainline/releases?per_page=1" | jq -r '.[0].name' | cut -d" " -f2)"
3233- if [[ "${OLD_MAINLINE_VERSION}" = "${NEW_MAINLINE_VERSION}" ]]; then
34- echo "yuzu-mainline is already up to date!"
000003536- [ "$KEEP_GOING" ] && return || exit
0037 else
38- echo "yuzu-mainline: ${OLD_MAINLINE_VERSION} -> ${NEW_MAINLINE_VERSION}"
39 fi
4041- echo " Fetching source code..."
0000004243- NEW_MAINLINE_HASH="$(nix-prefetch-git --quiet --fetch-submodules --rev "mainline-0-${NEW_MAINLINE_VERSION}" "https://github.com/yuzu-emu/yuzu-mainline" | jq -r '.sha256')"
0004445- echo " Succesfully fetched. hash: ${NEW_MAINLINE_HASH}"
004647- sed -i "s/${OLD_MAINLINE_VERSION}/${NEW_MAINLINE_VERSION}/" ./default.nix
48- sed -i "s/${OLD_MAINLINE_HASH}/${NEW_MAINLINE_HASH}/" ./default.nix
49-}
5051-updateEarlyAccess() {
52- OLD_EA_VERSION="$(getLocalVersion "yuzu-ea")"
53- OLD_EA_HASH="$(getLocalHash "yuzu-ea")"
5455- NEW_EA_VERSION="$(curl -s ${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
56- "https://api.github.com/repos/pineappleEA/pineapple-src/releases?per_page=2" | jq -r '.[].tag_name' | grep '^EA-[0-9]*' | head -n1 | cut -d"-" -f2 | cut -d" " -f1)"
57-58- if [[ "${OLD_EA_VERSION}" = "${NEW_EA_VERSION}" ]]; then
59- echo "yuzu-ea is already up to date!"
6061- [ "$KEEP_GOING" ] && return || exit
0062 else
63- echo "yuzu-ea: ${OLD_EA_VERSION} -> ${NEW_EA_VERSION}"
64 fi
6566- echo " Fetching source code..."
00006768- NEW_EA_HASH="$(nix-prefetch-git --quiet --fetch-submodules --rev "EA-${NEW_EA_VERSION}" "https://github.com/pineappleEA/pineapple-src" | jq -r '.sha256')"
00000006970- echo " Succesfully fetched. hash: ${NEW_EA_HASH}"
71-72- sed -i "s/${OLD_EA_VERSION}/${NEW_EA_VERSION}/" ./default.nix
73- sed -i "s/${OLD_EA_HASH}/${NEW_EA_HASH}/" ./default.nix
74-}
000000000007576-if [[ "$BRANCH" = "mainline" ]]; then
77- updateMainline
78-elif [[ "$BRANCH" = "early-access" ]]; then
79- updateEarlyAccess
80-else
81- KEEP_GOING=1
82- updateMainline
83- updateEarlyAccess
84fi
···1#! /usr/bin/env nix-shell
2+#! nix-shell -I nixpkgs=./. -i bash -p nix nix-prefetch-git coreutils curl jq gnused
34+set -euo pipefail
56# Will be replaced with the actual branch when running this from passthru.updateScript
7BRANCH="@branch@"
8+DEFAULT_NIX="$(dirname "${BASH_SOURCE[@]}")/default.nix"
910+if [[ "$(basename "$PWD")" = "yuzu" ]]; then
11+ echo "error: Script must be ran from nixpkgs's root directory for compatibility with the maintainer script"
12 exit 1
13fi
1415+updateBranch() {
16+ local branch attribute oldVersion oldHash newVersion newHash
17+ branch="$1"
18+ attribute="yuzu-$branch"
19+ [[ "$branch" = "early-access" ]] && attribute="yuzu-ea" # Attribute path doesnt match the branch name
20+ oldVersion="$(nix eval --raw -f "./default.nix" "$attribute".version)"
21+ oldHash="$(nix eval --raw -f "./default.nix" "$attribute".src.drvAttrs.outputHash)"
000000000002223+ if [[ "$branch" = "mainline" ]]; then
24+ newVersion="$(curl -s ${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/yuzu-emu/yuzu-mainline/releases?per_page=1" \
25+ | jq -r '.[0].name' | cut -d" " -f2)"
26+ elif [[ "$branch" = "early-access" ]]; then
27+ newVersion="$(curl -s ${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/pineappleEA/pineapple-src/releases?per_page=2" \
28+ | jq -r '.[].tag_name' | grep '^EA-[0-9]*' | head -n1 | cut -d"-" -f2 | cut -d" " -f1)"
29+ fi
3031+ if [[ "${oldVersion}" = "${newVersion}" ]]; then
32+ echo "$attribute is already up to date."
33+ return
34 else
35+ echo "$attribute: ${oldVersion} -> ${newVersion}"
36 fi
3738+ echo " fetching source code to generate hash..."
39+ if [[ "$branch" = "mainline" ]]; then
40+ newHash="$(nix-prefetch-git --quiet --fetch-submodules --rev "mainline-0-${newVersion}" "https://github.com/yuzu-emu/yuzu-mainline" | jq -r '.sha256')"
41+ elif [[ "$branch" = "early-access" ]]; then
42+ newHash="$(nix-prefetch-git --quiet --fetch-submodules --rev "EA-${newVersion}" "https://github.com/pineappleEA/pineapple-src" | jq -r '.sha256')"
43+ fi
44+ newHash="$(nix hash to-sri --type sha256 "${newHash}")"
4546+ sed -i "s,${oldVersion},${newVersion}," "$DEFAULT_NIX"
47+ sed -i "s,${oldHash},${newHash},g" "$DEFAULT_NIX"
48+ echo " succesfully updated $attribute. new hash: $newHash"
49+}
5051+updateCompatibilityList() {
52+ local latestRevision oldUrl newUrl oldHash newHash oldDate newDate
53+ latestRevision="$(curl -s ${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/flathub/org.yuzu_emu.yuzu/commits/master" | jq -r '.sha')"
5455+ oldUrl="$(sed -n '/yuzu-compat-list/,/url/p' "$DEFAULT_NIX" | tail -n1 | cut -d'"' -f2)"
56+ newUrl="https://raw.githubusercontent.com/flathub/org.yuzu_emu.yuzu/${latestRevision}/compatibility_list.json"
05758+ oldDate="$(sed -n '/last updated.*/p' "$DEFAULT_NIX" | rev | cut -d' ' -f1 | rev)"
59+ newDate="$(curl -s ${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/flathub/org.yuzu_emu.yuzu/commits/${latestRevision}" \
60+ | jq -r '.commit.committer.date' | cut -d'T' -f1)"
6162+ oldHash="$(sed -n '/yuzu-compat-list/,/sha256/p' "$DEFAULT_NIX" | tail -n1 | cut -d'"' -f2)"
63+ newHash="$(nix hash to-sri --type sha256 "$(nix-prefetch-url --quiet "$newUrl")")"
0006465+ if [[ "$oldHash" = "$newHash" ]]; then
66+ echo "compatibility_list is already up to date."
67+ return
68 else
69+ echo "compatibility_list: $oldDate -> $newDate"
70 fi
7172+ sed -i "s,${oldUrl},${newUrl},g" "$DEFAULT_NIX"
73+ sed -i "s,${oldHash},${newHash},g" "$DEFAULT_NIX"
74+ sed -i "s,${oldDate},${newDate},g" "$DEFAULT_NIX"
75+ echo " succesfully updated compatibility_list. new hash: $newHash"
76+}
7778+if [[ "$BRANCH" = "mainline" ]] || [[ "$BRANCH" = "early-access" ]]; then
79+ updateBranch "$BRANCH"
80+ updateCompatibilityList
81+else # Script is not ran from passthru.updateScript
82+ if (( $# == 0 )); then
83+ updateBranch "mainline"
84+ updateBranch "early-access"
85+ fi
8687+ while (( "$#" > 0 )); do
88+ case "$1" in
89+ mainline|yuzu-mainline)
90+ updateBranch "mainline"
91+ ;;
92+ early-access|yuzu-early-access|ea|yuzu-ea)
93+ updateBranch "early-access"
94+ ;;
95+ *)
96+ echo "error: invalid branch: $1."
97+ echo "usage: $(basename "$0") [mainline|early-access]"
98+ exit 1
99+ ;;
100+ esac
101+ shift
102+ done
103104+ updateCompatibilityList
0000000105fi
···1549 youtubeDL = throw "'youtubeDL' has been renamed to/replaced by 'youtube-dl'"; # Converted to throw 2022-02-22
1550 ytop = throw "ytop has been abandoned by upstream. Consider switching to bottom instead";
1551 yubikey-neo-manager = throw "yubikey-neo-manager has been removed because it was broken. Use yubikey-manager-qt instead"; # Added 2021-03-08
01552 yuzu = yuzu-mainline; # Added 2021-01-25
15531554 ### Z ###
···1549 youtubeDL = throw "'youtubeDL' has been renamed to/replaced by 'youtube-dl'"; # Converted to throw 2022-02-22
1550 ytop = throw "ytop has been abandoned by upstream. Consider switching to bottom instead";
1551 yubikey-neo-manager = throw "yubikey-neo-manager has been removed because it was broken. Use yubikey-manager-qt instead"; # Added 2021-03-08
1552+ yuzu-ea = yuzu-early-access; # Added 2022-08-18
1553 yuzu = yuzu-mainline; # Added 2021-01-25
15541555 ### Z ###