Merge pull request #155442 from IvarWithoutBones/init/optifine-versions

This commit is contained in:
legendofmiracles 2022-01-23 07:36:47 -06:00 committed by GitHub
commit c07b988286
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 104 additions and 30 deletions

View File

@ -1,39 +1,67 @@
{ lib
, stdenv
, fetchurl
, makeWrapper
, jre }:
{ recurseIntoAttrs
, callPackage
}:
stdenv.mkDerivation rec {
pname = "optifine";
version = "1.18.1_HD_U_H4";
recurseIntoAttrs rec {
optifine-latest = optifine_1_18_1;
src = fetchurl {
url = "https://optifine.net/download?f=OptiFine_${version}.jar";
sha256 = "325168569b21a2dcde82999876f69ec9d8af75202a7021691f2abede4d81dcec";
optifine_1_18_1 = callPackage ./generic.nix {
version = "1.18.1_HD_U_H4";
sha256 = "sha256-MlFoVpshotzegpmYdvaeydivdSAqcCFpHyq+3k2B3Ow=";
};
dontUnpack = true;
optifine_1_17_1 = callPackage ./generic.nix {
version = "1.17.1_HD_U_H1";
sha256 = "sha256-HHt747bIHYY/WNAx19mNgvnLrLCqaKIqwXmmB7A895M=";
};
nativeBuildInputs = [ jre makeWrapper ];
optifine_1_16_5 = callPackage ./generic.nix {
version = "1.16.5_HD_U_G8";
sha256 = "sha256-PHa8kO1EvOVnzufCDrLENhkm8jqG5TZ9WW9uYk0LSU8=";
};
installPhase = ''
mkdir -p $out/{bin,lib/optifine}
cp $src $out/lib/optifine/optifine.jar
optifine_1_15_2 = callPackage ./generic.nix {
version = "1.16.5_HD_U_G8";
sha256 = "sha256-PHa8kO1EvOVnzufCDrLENhkm8jqG5TZ9WW9uYk0LSU8=";
};
makeWrapper ${jre}/bin/java $out/bin/optifine \
--add-flags "-jar $out/lib/optifine/optifine.jar"
'';
optifine_1_14_4 = callPackage ./generic.nix {
version = "1.14.4_HD_U_G5";
sha256 = "sha256-I+65vQO6yG4AQ0ZLAfX73ImsFKAQkTyrIOnQHldTibs=";
};
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;
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=";
};
}

View File

@ -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"
''

View File

@ -8459,7 +8459,9 @@ with pkgs;
openvswitch-lts = callPackage ../os-specific/linux/openvswitch/lts.nix { };
optifine = callPackage ../tools/games/minecraft/optifine { };
optifinePackages = callPackage ../tools/games/minecraft/optifine { };
optifine = optifinePackages.optifine-latest;
optipng = callPackage ../tools/graphics/optipng {
libpng = libpng12;