nixpkgs/pkgs/tools/games/minecraft/optifine/generic.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.2 KiB
Nix
Raw Normal View History

2022-01-18 01:12:32 +00:00
{ 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 ];
2022-09-20 07:45:26 +00:00
passthru.updateScript = {
command = [ ./update.py ];
supportedFeatures = [ "commit" ];
};
2022-01-18 01:12:32 +00:00
meta = with lib; {
homepage = "https://optifine.net/";
description = "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.
'';
sourceProvenance = with sourceTypes; [ binaryBytecode ];
2022-01-18 01:12:32 +00:00
license = licenses.unfree;
2024-06-24 21:05:06 +00:00
maintainers = [ ];
2022-01-18 01:12:32 +00:00
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"
''