2019-08-23 12:12:52 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, autoPatchelfHook
|
2023-04-25 05:29:28 +00:00
|
|
|
, gtk3
|
|
|
|
, zlib
|
2021-06-10 02:57:09 +00:00
|
|
|
, alsa-lib
|
2023-04-25 05:29:28 +00:00
|
|
|
, dbus
|
2023-12-18 03:38:59 +00:00
|
|
|
, libGL
|
2023-04-25 05:29:28 +00:00
|
|
|
, libXcursor
|
|
|
|
, libXext
|
|
|
|
, libXi
|
|
|
|
, libXinerama
|
|
|
|
, libxkbcommon
|
2019-08-23 12:12:52 +00:00
|
|
|
, libXrandr
|
|
|
|
, libXScrnSaver
|
2023-04-25 05:29:28 +00:00
|
|
|
, libXxf86vm
|
2019-08-23 12:12:52 +00:00
|
|
|
, udev
|
2023-04-25 05:29:28 +00:00
|
|
|
, 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
|
2019-08-23 12:12:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-04-25 05:29:28 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "clonehero";
|
|
|
|
version = "1.0.0.4080";
|
2019-08-23 12:12:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-09-24 18:23:34 +00:00
|
|
|
url = "https://github.com/clonehero-game/releases/releases/download/V${finalAttrs.version}/CloneHero-linux.tar.xz";
|
2023-04-25 05:29:28 +00:00
|
|
|
hash = "sha256-YWLV+wgQ9RfKRSSWh/x0PMjB6tFA4YpHb9WtYOOgZZI=";
|
2019-08-23 12:12:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "doc" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoPatchelfHook ];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
# Load-time libraries (loaded from DT_NEEDED section in ELF binary)
|
2023-04-25 05:29:28 +00:00
|
|
|
alsa-lib
|
|
|
|
gtk3
|
2019-08-23 12:12:52 +00:00
|
|
|
stdenv.cc.cc.lib
|
|
|
|
zlib
|
|
|
|
|
|
|
|
# Run-time libraries (loaded with dlopen)
|
2023-04-25 05:29:28 +00:00
|
|
|
dbus
|
2023-12-18 03:38:59 +00:00
|
|
|
libGL
|
2023-04-25 05:29:28 +00:00
|
|
|
libXcursor
|
|
|
|
libXext
|
|
|
|
libXi
|
|
|
|
libXinerama
|
|
|
|
libxkbcommon
|
|
|
|
libXrandr
|
|
|
|
libXScrnSaver
|
|
|
|
libXxf86vm
|
|
|
|
udev
|
|
|
|
vulkan-loader
|
|
|
|
wayland
|
2019-08-23 12:12:52 +00:00
|
|
|
];
|
|
|
|
|
2023-04-25 05:29:28 +00:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "clonehero";
|
|
|
|
desktopName = "Clone Hero";
|
|
|
|
comment = finalAttrs.meta.description;
|
|
|
|
icon = "clonehero";
|
|
|
|
exec = "clonehero";
|
|
|
|
categories = [ "Game" ];
|
|
|
|
};
|
|
|
|
|
2019-08-23 12:12:52 +00:00
|
|
|
installPhase = ''
|
2023-04-25 05:29:28 +00:00
|
|
|
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"
|
2019-08-23 12:12:52 +00:00
|
|
|
|
2023-04-25 05:29:28 +00:00
|
|
|
runHook postInstall
|
2019-08-23 12:12:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# Patch required run-time libraries as load-time libraries
|
|
|
|
#
|
|
|
|
# Libraries found with:
|
2023-04-25 05:29:28 +00:00
|
|
|
# > strings UnityPlayer.so | grep '\.so'
|
|
|
|
# and:
|
|
|
|
# > LD_DEBUG=libs clonehero
|
2019-08-23 12:12:52 +00:00
|
|
|
postFixup = ''
|
|
|
|
patchelf \
|
|
|
|
--add-needed libasound.so.2 \
|
2023-04-25 05:29:28 +00:00
|
|
|
--add-needed libdbus-1.so.3 \
|
2023-12-18 03:38:59 +00:00
|
|
|
--add-needed libGL.so.1 \
|
2023-04-25 05:29:28 +00:00
|
|
|
--add-needed libpthread.so.0 \
|
2019-08-23 12:12:52 +00:00
|
|
|
--add-needed libudev.so.1 \
|
2023-04-25 05:29:28 +00:00
|
|
|
--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 \
|
2019-08-23 12:12:52 +00:00
|
|
|
--add-needed libXrandr.so.2 \
|
|
|
|
--add-needed libXss.so.1 \
|
2023-04-25 05:29:28 +00:00
|
|
|
--add-needed libXxf86vm.so.1 \
|
|
|
|
"$out/libexec/clonehero/UnityPlayer.so"
|
2019-08-23 12:12:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Clone of Guitar Hero and Rockband-style games";
|
|
|
|
homepage = "https://clonehero.net";
|
|
|
|
license = licenses.unfree;
|
2023-04-25 05:29:28 +00:00
|
|
|
maintainers = with maintainers; [ kira-bruneau syboxez ];
|
2019-08-23 12:12:52 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
2023-04-25 05:29:28 +00:00
|
|
|
})
|