depot/third_party/nixpkgs/pkgs/by-name/at/atlauncher/package.nix
Default email 23b612e36f Project import generated by Copybara.
GitOrigin-RevId: ae5c332cbb5827f6b1f02572496b141021de335f
2024-01-25 23:12:00 +09:00

60 lines
1.9 KiB
Nix

{ copyDesktopItems, fetchurl, jre, lib, makeDesktopItem, makeWrapper, stdenv, udev, xorg }:
stdenv.mkDerivation (finalAttrs: {
pname = "atlauncher";
version = "3.4.35.4";
src = fetchurl {
url = "https://github.com/ATLauncher/ATLauncher/releases/download/v${finalAttrs.version}/ATLauncher-${finalAttrs.version}.jar";
hash = "sha256-M8ygN70yizJM6VEffBh/lH/DneKAzQ5UFzc3g51dja0=";
};
env.ICON = fetchurl {
url = "https://atlauncher.com/assets/images/logo.svg";
hash = "sha256-XoqpsgLmkpa2SdjZvPkgg6BUJulIBIeu6mBsJJCixfo=";
};
dontUnpack = true;
buildInputs = [ ];
nativeBuildInputs = [ copyDesktopItems makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/java
cp $src $out/share/java/ATLauncher.jar
makeWrapper ${jre}/bin/java $out/bin/atlauncher \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ xorg.libXxf86vm udev ]}" \
--add-flags "-jar $out/share/java/ATLauncher.jar" \
--add-flags "--working-dir \"\''${XDG_DATA_HOME:-\$HOME/.local/share}/ATLauncher\"" \
--add-flags "--no-launcher-update"
mkdir -p $out/share/icons/hicolor/scalable/apps
cp $ICON $out/share/icons/hicolor/scalable/apps/${finalAttrs.pname}.svg
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = finalAttrs.pname;
exec = finalAttrs.pname;
icon = finalAttrs.pname;
desktopName = "ATLauncher";
categories = [ "Game" ];
})
];
meta = with lib; {
description = "A simple and easy to use Minecraft launcher which contains many different modpacks for you to choose from and play";
downloadPage = "https://atlauncher.com/downloads";
homepage = "https://atlauncher.com/";
license = licenses.gpl3;
maintainers = [ maintainers.getpsyched ];
platforms = platforms.all;
mainProgram = "atlauncher";
sourceProvenance = [ sourceTypes.binaryBytecode ];
};
})