legends-of-equestria: init at 2024.05.01 (#296316)

authored by Arne Keller and committed by GitHub ce8a0da4 3de5332b

+158
+141
pkgs/by-name/le/legends-of-equestria/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + runCommand, 5 + megacmd, 6 + unzip, 7 + makeWrapper, 8 + autoPatchelfHook, 9 + makeDesktopItem, 10 + copyDesktopItems, 11 + libgcc, 12 + dbus, 13 + xorg_sys_opengl, 14 + systemd, 15 + libcap, 16 + libdrm, 17 + pulseaudio, 18 + libsndfile, 19 + flac, 20 + libvorbis, 21 + libopus, 22 + mpg123, 23 + lame, 24 + libGL, 25 + vulkan-loader, 26 + libasyncns, 27 + xorg, 28 + }: 29 + 30 + let 31 + pname = "legends-of-equestria"; 32 + version = "2024.05.01"; 33 + description = "Free-to-play MMORPG"; 34 + runtimeDeps = 35 + [ 36 + dbus.lib 37 + xorg_sys_opengl 38 + systemd 39 + libcap.lib 40 + libdrm 41 + pulseaudio 42 + libsndfile 43 + flac 44 + libvorbis 45 + mpg123 46 + lame.lib 47 + libGL 48 + vulkan-loader 49 + libasyncns 50 + ] 51 + ++ (with xorg; [ 52 + libX11 53 + libxcb 54 + libXau 55 + libXdmcp 56 + libXext 57 + libXcursor 58 + libXrender 59 + libXfixes 60 + libXinerama 61 + libXi 62 + libXrandr 63 + libXScrnSaver 64 + ]); 65 + in 66 + stdenv.mkDerivation { 67 + inherit pname version; 68 + src = 69 + runCommand "mega-loe" 70 + { 71 + inherit pname version; 72 + nativeBuildInputs = [ 73 + megacmd 74 + unzip 75 + ]; 76 + url = "https://mega.nz/file/NjIwwJoK#MVi3C3FAcSQPd7FRpQc0CoStBG8jSFuPn0jD-pG3zY0"; 77 + outputHashAlgo = "sha256"; 78 + outputHash = "VXBtEB3G5MTrWn9OOvmCG3sDoasjbKkLJruhdQZa4SQ="; 79 + outputHashMode = "recursive"; 80 + } 81 + '' 82 + export HOME=$(mktemp -d) 83 + dest=$HOME/mega-loe 84 + mkdir -p $dest 85 + mega-get "$url" $dest 86 + mkdir -p $out 87 + unzip -d $out $dest/*.zip 88 + ''; 89 + 90 + dontBuild = true; 91 + buildInputs = [ 92 + libgcc 93 + ]; 94 + nativeBuildInputs = [ 95 + makeWrapper 96 + copyDesktopItems 97 + autoPatchelfHook 98 + ]; 99 + 100 + installPhase = '' 101 + runHook preInstall 102 + 103 + loeHome=$out/lib/${pname} 104 + mkdir -p $loeHome 105 + cp -r LoE/* $loeHome 106 + 107 + makeWrapper $loeHome/LoE.x86_64 $out/bin/LoE \ 108 + --suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeDeps}" 109 + 110 + icon=$out/share/icons/hicolor/128x128/apps/legends-of-equestria.png 111 + mkdir -p $(dirname $icon) 112 + ln -s $loeHome/LoE_Data/Resources/UnityPlayer.png $icon 113 + 114 + runHook postInstall 115 + ''; 116 + 117 + passthru.updateScript = ./update.sh; 118 + 119 + desktopItems = [ 120 + (makeDesktopItem { 121 + name = "legends-of-equestria"; 122 + comment = description; 123 + desktopName = "Legends of Equestria"; 124 + genericName = "Legends of Equestria"; 125 + exec = "LoE"; 126 + icon = "legends-of-equestria"; 127 + categories = [ "Game" ]; 128 + }) 129 + ]; 130 + 131 + meta = { 132 + inherit description; 133 + license = lib.licenses.unfree; 134 + platforms = [ "x86_64-linux" ]; 135 + maintainers = with lib.maintainers; [ ulysseszhan ]; 136 + mainProgram = "LoE"; 137 + homepage = "https://www.legendsofequestria.com"; 138 + downloadPage = "https://www.legendsofequestria.com/downloads"; 139 + }; 140 + 141 + }
+17
pkgs/by-name/le/legends-of-equestria/update.sh
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p curl common-updater-scripts 3 + 4 + set -eu -o pipefail 5 + 6 + DOWNLOADS_PAGE_URL=https://www.legendsofequestria.com/downloads 7 + REGEX='href="(https.+)".+Linux.+v(([0-9]+\.)+[0-9]+)' 8 + 9 + if [[ $(curl -s $DOWNLOADS_PAGE_URL | grep -Fi Linux) =~ $REGEX ]]; then 10 + url="${BASH_REMATCH[1]}" 11 + version="${BASH_REMATCH[2]}" 12 + else 13 + echo "cannot find the latest version" 14 + exit 1 15 + fi 16 + 17 + update-source-version legends-of-equestria "$version" "" "$url"