mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-09-29 15:43:00 +00:00
clonehero: 0.23.2.2 -> 1.0.0.4080
Co-authored-by: Kira Bruneau <kira.bruneau@pm.me>
This commit is contained in:
parent
dfe6d817db
commit
47a2d457b0
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
## Backward Incompatibilities {#sec-release-23.11-incompatibilities}
|
## Backward Incompatibilities {#sec-release-23.11-incompatibilities}
|
||||||
|
|
||||||
- Create the first release note entry in this section!
|
- 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`.
|
||||||
|
|
||||||
## Other Notable Changes {#sec-release-23.11-notable-changes}
|
## Other Notable Changes {#sec-release-23.11-notable-changes}
|
||||||
|
|
||||||
|
@ -2,24 +2,31 @@
|
|||||||
, stdenv
|
, stdenv
|
||||||
, fetchurl
|
, fetchurl
|
||||||
, autoPatchelfHook
|
, autoPatchelfHook
|
||||||
|
, gtk3
|
||||||
|
, zlib
|
||||||
, alsa-lib
|
, alsa-lib
|
||||||
, gtk2
|
, dbus
|
||||||
|
, libXcursor
|
||||||
|
, libXext
|
||||||
|
, libXi
|
||||||
|
, libXinerama
|
||||||
|
, libxkbcommon
|
||||||
, libXrandr
|
, libXrandr
|
||||||
, libXScrnSaver
|
, libXScrnSaver
|
||||||
|
, libXxf86vm
|
||||||
, udev
|
, 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
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
name = "clonehero";
|
pname = "clonehero";
|
||||||
in
|
version = "1.0.0.4080";
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "${name}-unwrapped";
|
|
||||||
version = "0.23.2.2";
|
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://dl.clonehero.net/${name}-v${lib.removePrefix "0" version}/${name}-linux.tar.gz";
|
url = "https://pubdl.clonehero.net/clonehero-v${finalAttrs.version}-final/clonehero-linux.tar.xz";
|
||||||
sha256 = "0k9jcnd55yhr42gj8cmysd18yldp4k3cpk4z884p2ww03fyfq7mi";
|
hash = "sha256-YWLV+wgQ9RfKRSSWh/x0PMjB6tFA4YpHb9WtYOOgZZI=";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = [ "out" "doc" ];
|
outputs = [ "out" "doc" ];
|
||||||
@ -28,46 +35,86 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
# Load-time libraries (loaded from DT_NEEDED section in ELF binary)
|
# Load-time libraries (loaded from DT_NEEDED section in ELF binary)
|
||||||
gtk2
|
alsa-lib
|
||||||
|
gtk3
|
||||||
stdenv.cc.cc.lib
|
stdenv.cc.cc.lib
|
||||||
zlib
|
zlib
|
||||||
|
|
||||||
# Run-time libraries (loaded with dlopen)
|
# Run-time libraries (loaded with dlopen)
|
||||||
alsa-lib # ALSA sound
|
dbus
|
||||||
libXrandr # X11 resolution detection
|
libXcursor
|
||||||
libXScrnSaver # X11 screensaver prevention
|
libXext
|
||||||
udev # udev input drivers
|
libXi
|
||||||
|
libXinerama
|
||||||
|
libxkbcommon
|
||||||
|
libXrandr
|
||||||
|
libXScrnSaver
|
||||||
|
libXxf86vm
|
||||||
|
udev
|
||||||
|
vulkan-loader
|
||||||
|
wayland
|
||||||
];
|
];
|
||||||
|
|
||||||
installPhase = ''
|
desktopItem = makeDesktopItem {
|
||||||
mkdir -p "$out/bin" "$out/share"
|
name = "clonehero";
|
||||||
install -Dm755 ${name} "$out/bin"
|
desktopName = "Clone Hero";
|
||||||
cp -r clonehero_Data "$out/share"
|
comment = finalAttrs.meta.description;
|
||||||
|
icon = "clonehero";
|
||||||
|
exec = "clonehero";
|
||||||
|
categories = [ "Game" ];
|
||||||
|
};
|
||||||
|
|
||||||
mkdir -p "$doc/share/${name}"
|
installPhase = ''
|
||||||
cp README.txt "$doc/share/${name}"
|
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"
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Patch required run-time libraries as load-time libraries
|
# Patch required run-time libraries as load-time libraries
|
||||||
#
|
#
|
||||||
# Libraries found with:
|
# Libraries found with:
|
||||||
# > strings clonehero | grep '\.so'
|
# > strings UnityPlayer.so | grep '\.so'
|
||||||
# and
|
# and:
|
||||||
# > strace clonehero 2>&1 | grep '\.so'
|
# > LD_DEBUG=libs clonehero
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
patchelf \
|
patchelf \
|
||||||
--add-needed libasound.so.2 \
|
--add-needed libasound.so.2 \
|
||||||
|
--add-needed libdbus-1.so.3 \
|
||||||
|
--add-needed libpthread.so.0 \
|
||||||
--add-needed libudev.so.1 \
|
--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 libXrandr.so.2 \
|
||||||
--add-needed libXss.so.1 \
|
--add-needed libXss.so.1 \
|
||||||
"$out/bin/${name}"
|
--add-needed libXxf86vm.so.1 \
|
||||||
|
"$out/libexec/clonehero/UnityPlayer.so"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Clone of Guitar Hero and Rockband-style games";
|
description = "Clone of Guitar Hero and Rockband-style games";
|
||||||
homepage = "https://clonehero.net";
|
homepage = "https://clonehero.net";
|
||||||
license = licenses.unfree;
|
license = licenses.unfree;
|
||||||
maintainers = with maintainers; [ kira-bruneau ];
|
maintainers = with maintainers; [ kira-bruneau syboxez ];
|
||||||
platforms = [ "x86_64-linux" ];
|
platforms = [ "x86_64-linux" ];
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
{ clonehero-unwrapped
|
|
||||||
, makeDesktopItem
|
|
||||||
, buildFHSEnv
|
|
||||||
, 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
|
|
||||||
buildFHSEnv {
|
|
||||||
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 { };
|
|
||||||
}
|
|
@ -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} "$@"
|
|
||||||
''
|
|
@ -36285,9 +36285,7 @@ with pkgs;
|
|||||||
|
|
||||||
chromium-bsu = callPackage ../games/chromium-bsu { };
|
chromium-bsu = callPackage ../games/chromium-bsu { };
|
||||||
|
|
||||||
clonehero-unwrapped = callPackage ../games/clonehero { };
|
clonehero = callPackage ../games/clonehero { };
|
||||||
|
|
||||||
clonehero = callPackage ../games/clonehero/fhs-wrapper.nix { };
|
|
||||||
|
|
||||||
vintagestory = callPackage ../games/vintagestory { };
|
vintagestory = callPackage ../games/vintagestory { };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user