2024-12-17 12:10:05 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
python3Packages,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchurl,
|
|
|
|
installShellFiles,
|
|
|
|
libX11,
|
|
|
|
libXext,
|
|
|
|
libXcursor,
|
|
|
|
libXrandr,
|
|
|
|
libXxf86vm,
|
|
|
|
libpulseaudio,
|
|
|
|
libGL,
|
|
|
|
glfw,
|
|
|
|
openal,
|
|
|
|
udev,
|
|
|
|
flite,
|
|
|
|
java ? [ ],
|
|
|
|
}:
|
2024-12-06 12:57:22 +00:00
|
|
|
let
|
|
|
|
runtimeLibs = [
|
|
|
|
libX11
|
|
|
|
libXext
|
|
|
|
libXcursor
|
|
|
|
libXrandr
|
|
|
|
libXxf86vm
|
|
|
|
libpulseaudio
|
|
|
|
libGL
|
|
|
|
glfw
|
|
|
|
openal
|
|
|
|
(lib.getLib stdenv.cc.cc)
|
|
|
|
udev
|
|
|
|
] ++ lib.optional flite;
|
|
|
|
patch = fetchurl {
|
2024-12-17 12:10:05 +00:00
|
|
|
url = "https://raw.githubusercontent.com/NixOS/nixpkgs/refs/heads/nixos-unstable/pkgs/by-name/po/portablemc/use-builtin-java.patch";
|
2024-12-06 12:57:22 +00:00
|
|
|
hash = "";
|
|
|
|
};
|
2024-12-17 12:10:05 +00:00
|
|
|
in
|
|
|
|
python3Packages.buildPythonApplication rec {
|
2024-12-06 12:57:22 +00:00
|
|
|
pname = "portablemc";
|
|
|
|
version = "4.4.0";
|
|
|
|
pyproject = true;
|
|
|
|
disabled = python3Packages.pythonOlder "3.8";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mindstorm38";
|
|
|
|
repo = "portablemc";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-JDosvjbpoDC+xJ15ejcMJd+jA09RLR+whVZblMu+ljk=";
|
|
|
|
};
|
|
|
|
patches = [ patch ];
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
build-system = [ python3Packages.poetry-core ];
|
|
|
|
dependencies = [ python3Packages.certifi ];
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd portablemc \
|
|
|
|
--bash <($out/bin/portablemc show completion bash) \
|
|
|
|
--zsh <($out/bin/portablemc show completion zsh)
|
|
|
|
'';
|
|
|
|
preFixup = ''
|
|
|
|
makeWrapperArgs+=(
|
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath runtimeLibs}
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ java ]}
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
meta = {
|
|
|
|
mainProgram = "portablemc";
|
2024-12-17 12:10:05 +00:00
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
tomasajt
|
|
|
|
uwugda
|
|
|
|
];
|
2024-12-06 12:57:22 +00:00
|
|
|
};
|
|
|
|
}
|