diff options
Diffstat (limited to 'pkgs/tools/games/minecraft')
-rw-r--r-- | pkgs/tools/games/minecraft/optifine/default.nix | 102 | ||||
-rw-r--r-- | pkgs/tools/games/minecraft/optifine/generic.nix | 44 |
2 files changed, 109 insertions, 37 deletions
diff --git a/pkgs/tools/games/minecraft/optifine/default.nix b/pkgs/tools/games/minecraft/optifine/default.nix index b7ca74822c40d..7152cb1eec462 100644 --- a/pkgs/tools/games/minecraft/optifine/default.nix +++ b/pkgs/tools/games/minecraft/optifine/default.nix @@ -1,39 +1,67 @@ -{ lib -, stdenv -, fetchurl -, makeWrapper -, jre }: - -stdenv.mkDerivation rec { - pname = "optifine"; - version = "1.18.1_HD_U_H4"; - - src = fetchurl { - url = "https://optifine.net/download?f=OptiFine_${version}.jar"; - sha256 = "325168569b21a2dcde82999876f69ec9d8af75202a7021691f2abede4d81dcec"; - }; - - dontUnpack = true; - - nativeBuildInputs = [ jre makeWrapper ]; - - installPhase = '' - mkdir -p $out/{bin,lib/optifine} - cp $src $out/lib/optifine/optifine.jar - - makeWrapper ${jre}/bin/java $out/bin/optifine \ - --add-flags "-jar $out/lib/optifine/optifine.jar" - ''; - - meta = with lib; { - homepage = "https://optifine.net/"; - description = "A Minecraft optimization mod"; - longDescription = '' - OptiFine is a Minecraft optimization mod. - It allows Minecraft to run faster and look better with full support for HD textures and many configuration options. - ''; - license = licenses.unfree; - maintainers = [ maintainers.ivar ]; - platforms = platforms.unix; +{ recurseIntoAttrs +, callPackage +}: + +recurseIntoAttrs rec { + optifine-latest = optifine_1_18_1; + + optifine_1_18_1 = callPackage ./generic.nix { + version = "1.18.1_HD_U_H4"; + sha256 = "sha256-MlFoVpshotzegpmYdvaeydivdSAqcCFpHyq+3k2B3Ow="; + }; + + optifine_1_17_1 = callPackage ./generic.nix { + version = "1.17.1_HD_U_H1"; + sha256 = "sha256-HHt747bIHYY/WNAx19mNgvnLrLCqaKIqwXmmB7A895M="; + }; + + optifine_1_16_5 = callPackage ./generic.nix { + version = "1.16.5_HD_U_G8"; + sha256 = "sha256-PHa8kO1EvOVnzufCDrLENhkm8jqG5TZ9WW9uYk0LSU8="; + }; + + optifine_1_15_2 = callPackage ./generic.nix { + version = "1.16.5_HD_U_G8"; + sha256 = "sha256-PHa8kO1EvOVnzufCDrLENhkm8jqG5TZ9WW9uYk0LSU8="; + }; + + optifine_1_14_4 = callPackage ./generic.nix { + version = "1.14.4_HD_U_G5"; + sha256 = "sha256-I+65vQO6yG4AQ0ZLAfX73ImsFKAQkTyrIOnQHldTibs="; + }; + + optifine_1_13_2 = callPackage ./generic.nix { + version = "1.13.2_HD_U_G5"; + sha256 = "sha256-sjUQot8fPdbZTiLqt+exbF5T8kI5bLQevu7atW9Xu3E="; + }; + + optifine_1_12_2 = callPackage ./generic.nix { + version = "1.12.2_HD_U_G5"; + sha256 = "sha256-OwAGeXdx/rl/LQ0pCK58mnjO+y5zCvHC6F0IqDm6Jx4="; + }; + + optifine_1_11_2 = callPackage ./generic.nix { + version = "1.11.2_HD_U_G5"; + sha256 = "sha256-1sLUBtM5e5LDTUFCRZf9UeH6WOA8zY6TAmB9PCS5iv4="; + }; + + optifine_1_10 = callPackage ./generic.nix { + version = "1.10_HD_U_I5"; + sha256 = "sha256-oKOsaNFnOKfhWLDDYG/0Z4h/ZCDtyJWS9LXPaKAApc0="; + }; + + optifine_1_9_4 = callPackage ./generic.nix { + version = "1.9.4_HD_U_I5"; + sha256 = "sha256-t+OxIf0Tl/NZxUTl+LGnWRUhEwZ+vxiZfhclxEAf6yI="; + }; + + optifine_1_8_9 = callPackage ./generic.nix { + version = "1.8.9_HD_U_M5"; + sha256 = "sha256-Jzl2CnD8pq5cfcgXvMYoPxj1Xjj6I3eNp/OHprckssQ="; + }; + + optifine_1_7_10 = callPackage ./generic.nix { + version = "1.7.10_HD_U_E7"; + sha256 = "sha256-i82dg94AGgWR9JgQXzafBwxH0skZJ3TVpbafZG5E+rQ="; }; } diff --git a/pkgs/tools/games/minecraft/optifine/generic.nix b/pkgs/tools/games/minecraft/optifine/generic.nix new file mode 100644 index 0000000000000..d33e7d75126dc --- /dev/null +++ b/pkgs/tools/games/minecraft/optifine/generic.nix @@ -0,0 +1,44 @@ +{ version +, sha256 +, lib +, runCommand +, fetchurl +, makeWrapper +, jre +}: + +let + mcVersion = builtins.head (lib.splitString "_" version); +in +runCommand "optifine-${mcVersion}" { + pname = "optifine"; + inherit version; + + src = fetchurl { + url = "https://optifine.net/download?f=OptiFine_${version}.jar"; + inherit sha256; + name = "OptiFine_${version}.jar"; + }; + + nativeBuildInputs = [ jre makeWrapper ]; + + meta = with lib; { + homepage = "https://optifine.net/"; + description = "A Minecraft ${mcVersion} optimization mod"; + longDescription = '' + OptiFine is a Minecraft optimization mod. + It allows Minecraft to run faster and look better with full support for HD textures and many configuration options. + This is for version ${mcVersion} of Minecraft. + ''; + license = licenses.unfree; + maintainers = [ maintainers.ivar ]; + platforms = platforms.unix; + mainProgram = "optifine"; + }; +} '' + mkdir -p $out/{bin,lib/optifine} + cp $src $out/lib/optifine/optifine.jar + + makeWrapper ${jre}/bin/java $out/bin/optifine \ + --add-flags "-jar $out/lib/optifine/optifine.jar" +'' |