about summary refs log tree commit diff
path: root/nixpkgs/pkgs/games/clonehero
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-06-16 06:56:35 +0000
committerAlyssa Ross <hi@alyssa.is>2023-06-16 06:56:35 +0000
commit99fcaeccb89621dd492203ce1f2d551c06f228ed (patch)
tree41cb730ae07383004789779b0f6e11cb3f4642a3 /nixpkgs/pkgs/games/clonehero
parent59c5f5ac8682acc13bb22bc29c7cf02f7d75f01f (diff)
parent75a5ebf473cd60148ba9aec0d219f72e5cf52519 (diff)
downloadnixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.gz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.bz2
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.lz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.xz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.zst
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/nixos/modules/config/console.nix
	nixpkgs/nixos/modules/services/mail/mailman.nix
	nixpkgs/nixos/modules/services/mail/public-inbox.nix
	nixpkgs/nixos/modules/services/mail/rss2email.nix
	nixpkgs/nixos/modules/services/networking/ssh/sshd.nix
	nixpkgs/pkgs/applications/networking/instant-messengers/dino/default.nix
	nixpkgs/pkgs/applications/networking/irc/weechat/default.nix
	nixpkgs/pkgs/applications/window-managers/sway/default.nix
	nixpkgs/pkgs/build-support/go/module.nix
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
	nixpkgs/pkgs/development/interpreters/python/default.nix
	nixpkgs/pkgs/development/node-packages/overrides.nix
	nixpkgs/pkgs/development/tools/b4/default.nix
	nixpkgs/pkgs/servers/dict/dictd-db.nix
	nixpkgs/pkgs/servers/mail/public-inbox/default.nix
	nixpkgs/pkgs/tools/security/pinentry/default.nix
	nixpkgs/pkgs/tools/text/unoconv/default.nix
	nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/games/clonehero')
-rw-r--r--nixpkgs/pkgs/games/clonehero/default.nix99
-rw-r--r--nixpkgs/pkgs/games/clonehero/fhs-wrapper.nix39
-rw-r--r--nixpkgs/pkgs/games/clonehero/xdg-wrapper.nix21
3 files changed, 73 insertions, 86 deletions
diff --git a/nixpkgs/pkgs/games/clonehero/default.nix b/nixpkgs/pkgs/games/clonehero/default.nix
index cf1fad8d945b..36d76195fb9a 100644
--- a/nixpkgs/pkgs/games/clonehero/default.nix
+++ b/nixpkgs/pkgs/games/clonehero/default.nix
@@ -2,24 +2,31 @@
 , stdenv
 , fetchurl
 , autoPatchelfHook
+, gtk3
+, zlib
 , alsa-lib
-, gtk2
+, dbus
+, libXcursor
+, libXext
+, libXi
+, libXinerama
+, libxkbcommon
 , libXrandr
 , libXScrnSaver
+, libXxf86vm
 , udev
-, zlib
+, vulkan-loader # (not used by default, enable in settings menu)
+, wayland # (not used by default, enable with SDL_VIDEODRIVER=wayland - doesn't support HiDPI)
+, makeDesktopItem
 }:
 
-let
-  name = "clonehero";
-in
-stdenv.mkDerivation rec {
-  pname = "${name}-unwrapped";
-  version = "0.23.2.2";
+stdenv.mkDerivation (finalAttrs: {
+  pname = "clonehero";
+  version = "1.0.0.4080";
 
   src = fetchurl {
-    url = "http://dl.clonehero.net/${name}-v${lib.removePrefix "0" version}/${name}-linux.tar.gz";
-    sha256 = "0k9jcnd55yhr42gj8cmysd18yldp4k3cpk4z884p2ww03fyfq7mi";
+    url = "https://pubdl.clonehero.net/clonehero-v${finalAttrs.version}-final/clonehero-linux.tar.xz";
+    hash = "sha256-YWLV+wgQ9RfKRSSWh/x0PMjB6tFA4YpHb9WtYOOgZZI=";
   };
 
   outputs = [ "out" "doc" ];
@@ -28,46 +35,86 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     # Load-time libraries (loaded from DT_NEEDED section in ELF binary)
-    gtk2
+    alsa-lib
+    gtk3
     stdenv.cc.cc.lib
     zlib
 
     # Run-time libraries (loaded with dlopen)
-    alsa-lib # ALSA sound
-    libXrandr # X11 resolution detection
-    libXScrnSaver # X11 screensaver prevention
-    udev # udev input drivers
+    dbus
+    libXcursor
+    libXext
+    libXi
+    libXinerama
+    libxkbcommon
+    libXrandr
+    libXScrnSaver
+    libXxf86vm
+    udev
+    vulkan-loader
+    wayland
   ];
 
+  desktopItem = makeDesktopItem {
+    name = "clonehero";
+    desktopName = "Clone Hero";
+    comment = finalAttrs.meta.description;
+    icon = "clonehero";
+    exec = "clonehero";
+    categories = [ "Game" ];
+  };
+
   installPhase = ''
-    mkdir -p "$out/bin" "$out/share"
-    install -Dm755 ${name} "$out/bin"
-    cp -r clonehero_Data "$out/share"
+    runHook preInstall
+
+    install -Dm755 clonehero "$out/bin/clonehero"
+    install -Dm644 UnityPlayer.so "$out/libexec/clonehero/UnityPlayer.so"
+
+    mkdir -p "$out/share/pixmaps"
+    cp -r clonehero_Data "$out/share/clonehero"
+    ln -s "$out/share/clonehero" "$out/bin/clonehero_Data"
+    ln -s "$out/share/clonehero/Resources/UnityPlayer.png" "$out/share/pixmaps/clonehero.png"
+    install -Dm644 "$desktopItem/share/applications/clonehero.desktop" "$out/share/applications/clonehero.desktop"
+
+    mkdir -p "$doc/share/doc/clonehero"
+    cp -r CLONE_HERO_MANUAL.{pdf,txt} Custom EULA.txt THIRDPARTY.txt "$doc/share/doc/clonehero"
 
-    mkdir -p "$doc/share/${name}"
-    cp README.txt "$doc/share/${name}"
+    runHook postInstall
   '';
 
   # Patch required run-time libraries as load-time libraries
   #
   # Libraries found with:
-  # > strings clonehero | grep '\.so'
-  # and
-  # > strace clonehero 2>&1 | grep '\.so'
+  # > strings UnityPlayer.so | grep '\.so'
+  # and:
+  # > LD_DEBUG=libs clonehero
   postFixup = ''
     patchelf \
       --add-needed libasound.so.2 \
+      --add-needed libdbus-1.so.3 \
+      --add-needed libpthread.so.0 \
       --add-needed libudev.so.1 \
+      --add-needed libvulkan.so.1 \
+      --add-needed libwayland-client.so.0 \
+      --add-needed libwayland-cursor.so.0 \
+      --add-needed libwayland-egl.so.1 \
+      --add-needed libX11.so.6 \
+      --add-needed libXcursor.so.1 \
+      --add-needed libXext.so.6 \
+      --add-needed libXi.so.6 \
+      --add-needed libXinerama.so.1 \
+      --add-needed libxkbcommon.so.0 \
       --add-needed libXrandr.so.2 \
       --add-needed libXss.so.1 \
-      "$out/bin/${name}"
+      --add-needed libXxf86vm.so.1 \
+      "$out/libexec/clonehero/UnityPlayer.so"
   '';
 
   meta = with lib; {
     description = "Clone of Guitar Hero and Rockband-style games";
     homepage = "https://clonehero.net";
     license = licenses.unfree;
-    maintainers = with maintainers; [ kira-bruneau ];
+    maintainers = with maintainers; [ kira-bruneau syboxez ];
     platforms = [ "x86_64-linux" ];
   };
-}
+})
diff --git a/nixpkgs/pkgs/games/clonehero/fhs-wrapper.nix b/nixpkgs/pkgs/games/clonehero/fhs-wrapper.nix
deleted file mode 100644
index cd7f3986b109..000000000000
--- a/nixpkgs/pkgs/games/clonehero/fhs-wrapper.nix
+++ /dev/null
@@ -1,39 +0,0 @@
-{ clonehero-unwrapped
-, makeDesktopItem
-, buildFHSUserEnv
-, liberation_ttf
-, callPackage
-}:
-
-let
-  name = "clonehero";
-  desktopName = "Clone Hero";
-  desktopItem = makeDesktopItem {
-    inherit name desktopName;
-    comment = clonehero-unwrapped.meta.description;
-    exec = name;
-    icon = name;
-    categories = [ "Game" ];
-  };
-in
-buildFHSUserEnv {
-  inherit name;
-  inherit (clonehero-unwrapped) meta;
-
-  # Clone Hero has /usr/share/fonts hard-coded in its binary for looking up fonts.
-  # This workaround is necessary for rendering text on the keybinding screen (and possibly elsewhere)
-  # If a better solution is found, the FHS environment can be removed.
-  extraBuildCommands = ''
-    chmod +w usr/share
-    mkdir -p usr/share/fonts/truetype
-    ln -s ${liberation_ttf}/share/fonts/truetype/* usr/share/fonts/truetype
-  '';
-
-  extraInstallCommands = ''
-    mkdir -p "$out/share/applications" "$out/share/pixmaps"
-    cp ${desktopItem}/share/applications/* "$out/share/applications"
-    ln -s ${clonehero-unwrapped}/share/clonehero_Data/Resources/UnityPlayer.png "$out/share/pixmaps/${name}.png"
-  '';
-
-  runScript = callPackage ./xdg-wrapper.nix { };
-}
diff --git a/nixpkgs/pkgs/games/clonehero/xdg-wrapper.nix b/nixpkgs/pkgs/games/clonehero/xdg-wrapper.nix
deleted file mode 100644
index 2890e469db05..000000000000
--- a/nixpkgs/pkgs/games/clonehero/xdg-wrapper.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{ stdenv, clonehero-unwrapped, writeScript }:
-
-# Clone Hero doesn't have an installer, so it just stores configuration & data relative to the binary.
-# This wrapper works around that limitation, storing game configuration & data in XDG_CONFIG_HOME.
-let
-  name = "clonehero";
-  desktopName = "Clone Hero";
-in
-writeScript "${name}-xdg-wrapper-${clonehero-unwrapped.version}" ''
-  #!${stdenv.shell} -e
-  configDir="''${XDG_CONFIG_HOME:-$HOME/.config}/unity3d/srylain Inc_/${desktopName}"
-  mkdir -p "$configDir"
-
-  # Force link shipped clonehero_Data, unless directory already exists (to allow modding)
-  if [ ! -d "$configDir/clonehero_Data" ] || [ -L "$configDir/clonehero_Data" ]; then
-    ln -snf ${clonehero-unwrapped}/share/clonehero_Data "$configDir"
-  fi
-
-  # Fake argv[0] to emulate running in the config directory
-  exec -a "$configDir/${name}" ${clonehero-unwrapped}/bin/${name} "$@"
-''