lol

Merge pull request #229321 from kira-bruneau/clonehero

clonehero: 0.23.2.2 -> 1.0.0.4080

authored by

Weijia Wang and committed by
GitHub
94dca479 3aad03a4

+82 -90
+7
maintainers/maintainer-list.nix
··· 15305 15305 githubId = 20063502; 15306 15306 name = "Sybrand Aarnoutse"; 15307 15307 }; 15308 + syboxez = { 15309 + email = "syboxez@gmail.com"; 15310 + matrix = "@Syboxez:matrix.org"; 15311 + github = "syboxez"; 15312 + githubId = 12841859; 15313 + name = "Syboxez Blank"; 15314 + }; 15308 15315 symphorien = { 15309 15316 email = "symphorien_nixpkgs@xlumurb.eu"; 15310 15317 matrix = "@symphorien:xlumurb.eu";
+1 -1
nixos/doc/manual/release-notes/rl-2311.section.md
··· 12 12 13 13 ## Backward Incompatibilities {#sec-release-23.11-incompatibilities} 14 14 15 - - Create the first release note entry in this section! 15 + - The latest version of `clonehero` now stores custom content in `~/.clonehero`. See the [migration instructions](https://clonehero.net/2022/11/29/v23-to-v1-migration-instructions.html). Typically, these content files would exist along side the binary, but the previous build used a wrapper script that would store them in `~/.config/unity3d/srylain Inc_/Clone Hero`. 16 16 17 17 ## Other Notable Changes {#sec-release-23.11-notable-changes} 18 18
+73 -26
pkgs/games/clonehero/default.nix
··· 2 2 , stdenv 3 3 , fetchurl 4 4 , autoPatchelfHook 5 + , gtk3 6 + , zlib 5 7 , alsa-lib 6 - , gtk2 8 + , dbus 9 + , libXcursor 10 + , libXext 11 + , libXi 12 + , libXinerama 13 + , libxkbcommon 7 14 , libXrandr 8 15 , libXScrnSaver 16 + , libXxf86vm 9 17 , udev 10 - , zlib 18 + , vulkan-loader # (not used by default, enable in settings menu) 19 + , wayland # (not used by default, enable with SDL_VIDEODRIVER=wayland - doesn't support HiDPI) 20 + , makeDesktopItem 11 21 }: 12 22 13 - let 14 - name = "clonehero"; 15 - in 16 - stdenv.mkDerivation rec { 17 - pname = "${name}-unwrapped"; 18 - version = "0.23.2.2"; 23 + stdenv.mkDerivation (finalAttrs: { 24 + pname = "clonehero"; 25 + version = "1.0.0.4080"; 19 26 20 27 src = fetchurl { 21 - url = "http://dl.clonehero.net/${name}-v${lib.removePrefix "0" version}/${name}-linux.tar.gz"; 22 - sha256 = "0k9jcnd55yhr42gj8cmysd18yldp4k3cpk4z884p2ww03fyfq7mi"; 28 + url = "https://pubdl.clonehero.net/clonehero-v${finalAttrs.version}-final/clonehero-linux.tar.xz"; 29 + hash = "sha256-YWLV+wgQ9RfKRSSWh/x0PMjB6tFA4YpHb9WtYOOgZZI="; 23 30 }; 24 31 25 32 outputs = [ "out" "doc" ]; ··· 28 35 29 36 buildInputs = [ 30 37 # Load-time libraries (loaded from DT_NEEDED section in ELF binary) 31 - gtk2 38 + alsa-lib 39 + gtk3 32 40 stdenv.cc.cc.lib 33 41 zlib 34 42 35 43 # Run-time libraries (loaded with dlopen) 36 - alsa-lib # ALSA sound 37 - libXrandr # X11 resolution detection 38 - libXScrnSaver # X11 screensaver prevention 39 - udev # udev input drivers 44 + dbus 45 + libXcursor 46 + libXext 47 + libXi 48 + libXinerama 49 + libxkbcommon 50 + libXrandr 51 + libXScrnSaver 52 + libXxf86vm 53 + udev 54 + vulkan-loader 55 + wayland 40 56 ]; 41 57 58 + desktopItem = makeDesktopItem { 59 + name = "clonehero"; 60 + desktopName = "Clone Hero"; 61 + comment = finalAttrs.meta.description; 62 + icon = "clonehero"; 63 + exec = "clonehero"; 64 + categories = [ "Game" ]; 65 + }; 66 + 42 67 installPhase = '' 43 - mkdir -p "$out/bin" "$out/share" 44 - install -Dm755 ${name} "$out/bin" 45 - cp -r clonehero_Data "$out/share" 68 + runHook preInstall 69 + 70 + install -Dm755 clonehero "$out/bin/clonehero" 71 + install -Dm644 UnityPlayer.so "$out/libexec/clonehero/UnityPlayer.so" 72 + 73 + mkdir -p "$out/share/pixmaps" 74 + cp -r clonehero_Data "$out/share/clonehero" 75 + ln -s "$out/share/clonehero" "$out/bin/clonehero_Data" 76 + ln -s "$out/share/clonehero/Resources/UnityPlayer.png" "$out/share/pixmaps/clonehero.png" 77 + install -Dm644 "$desktopItem/share/applications/clonehero.desktop" "$out/share/applications/clonehero.desktop" 46 78 47 - mkdir -p "$doc/share/${name}" 48 - cp README.txt "$doc/share/${name}" 79 + mkdir -p "$doc/share/doc/clonehero" 80 + cp -r CLONE_HERO_MANUAL.{pdf,txt} Custom EULA.txt THIRDPARTY.txt "$doc/share/doc/clonehero" 81 + 82 + runHook postInstall 49 83 ''; 50 84 51 85 # Patch required run-time libraries as load-time libraries 52 86 # 53 87 # Libraries found with: 54 - # > strings clonehero | grep '\.so' 55 - # and 56 - # > strace clonehero 2>&1 | grep '\.so' 88 + # > strings UnityPlayer.so | grep '\.so' 89 + # and: 90 + # > LD_DEBUG=libs clonehero 57 91 postFixup = '' 58 92 patchelf \ 59 93 --add-needed libasound.so.2 \ 94 + --add-needed libdbus-1.so.3 \ 95 + --add-needed libpthread.so.0 \ 60 96 --add-needed libudev.so.1 \ 97 + --add-needed libvulkan.so.1 \ 98 + --add-needed libwayland-client.so.0 \ 99 + --add-needed libwayland-cursor.so.0 \ 100 + --add-needed libwayland-egl.so.1 \ 101 + --add-needed libX11.so.6 \ 102 + --add-needed libXcursor.so.1 \ 103 + --add-needed libXext.so.6 \ 104 + --add-needed libXi.so.6 \ 105 + --add-needed libXinerama.so.1 \ 106 + --add-needed libxkbcommon.so.0 \ 61 107 --add-needed libXrandr.so.2 \ 62 108 --add-needed libXss.so.1 \ 63 - "$out/bin/${name}" 109 + --add-needed libXxf86vm.so.1 \ 110 + "$out/libexec/clonehero/UnityPlayer.so" 64 111 ''; 65 112 66 113 meta = with lib; { 67 114 description = "Clone of Guitar Hero and Rockband-style games"; 68 115 homepage = "https://clonehero.net"; 69 116 license = licenses.unfree; 70 - maintainers = with maintainers; [ kira-bruneau ]; 117 + maintainers = with maintainers; [ kira-bruneau syboxez ]; 71 118 platforms = [ "x86_64-linux" ]; 72 119 }; 73 - } 120 + })
-39
pkgs/games/clonehero/fhs-wrapper.nix
··· 1 - { clonehero-unwrapped 2 - , makeDesktopItem 3 - , buildFHSEnv 4 - , liberation_ttf 5 - , callPackage 6 - }: 7 - 8 - let 9 - name = "clonehero"; 10 - desktopName = "Clone Hero"; 11 - desktopItem = makeDesktopItem { 12 - inherit name desktopName; 13 - comment = clonehero-unwrapped.meta.description; 14 - exec = name; 15 - icon = name; 16 - categories = [ "Game" ]; 17 - }; 18 - in 19 - buildFHSEnv { 20 - inherit name; 21 - inherit (clonehero-unwrapped) meta; 22 - 23 - # Clone Hero has /usr/share/fonts hard-coded in its binary for looking up fonts. 24 - # This workaround is necessary for rendering text on the keybinding screen (and possibly elsewhere) 25 - # If a better solution is found, the FHS environment can be removed. 26 - extraBuildCommands = '' 27 - chmod +w usr/share 28 - mkdir -p usr/share/fonts/truetype 29 - ln -s ${liberation_ttf}/share/fonts/truetype/* usr/share/fonts/truetype 30 - ''; 31 - 32 - extraInstallCommands = '' 33 - mkdir -p "$out/share/applications" "$out/share/pixmaps" 34 - cp ${desktopItem}/share/applications/* "$out/share/applications" 35 - ln -s ${clonehero-unwrapped}/share/clonehero_Data/Resources/UnityPlayer.png "$out/share/pixmaps/${name}.png" 36 - ''; 37 - 38 - runScript = callPackage ./xdg-wrapper.nix { }; 39 - }
-21
pkgs/games/clonehero/xdg-wrapper.nix
··· 1 - { stdenv, clonehero-unwrapped, writeScript }: 2 - 3 - # Clone Hero doesn't have an installer, so it just stores configuration & data relative to the binary. 4 - # This wrapper works around that limitation, storing game configuration & data in XDG_CONFIG_HOME. 5 - let 6 - name = "clonehero"; 7 - desktopName = "Clone Hero"; 8 - in 9 - writeScript "${name}-xdg-wrapper-${clonehero-unwrapped.version}" '' 10 - #!${stdenv.shell} -e 11 - configDir="''${XDG_CONFIG_HOME:-$HOME/.config}/unity3d/srylain Inc_/${desktopName}" 12 - mkdir -p "$configDir" 13 - 14 - # Force link shipped clonehero_Data, unless directory already exists (to allow modding) 15 - if [ ! -d "$configDir/clonehero_Data" ] || [ -L "$configDir/clonehero_Data" ]; then 16 - ln -snf ${clonehero-unwrapped}/share/clonehero_Data "$configDir" 17 - fi 18 - 19 - # Fake argv[0] to emulate running in the config directory 20 - exec -a "$configDir/${name}" ${clonehero-unwrapped}/bin/${name} "$@" 21 - ''
+1 -3
pkgs/top-level/all-packages.nix
··· 36293 36293 36294 36294 chromium-bsu = callPackage ../games/chromium-bsu { }; 36295 36295 36296 - clonehero-unwrapped = callPackage ../games/clonehero { }; 36297 - 36298 - clonehero = callPackage ../games/clonehero/fhs-wrapper.nix { }; 36296 + clonehero = callPackage ../games/clonehero { }; 36299 36297 36300 36298 vintagestory = callPackage ../games/vintagestory { }; 36301 36299