Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / games / atlauncher / default.nix
blobd6e3dc05a802a5978843245538441e1c4fb664cb
1 { copyDesktopItems, fetchurl, jre, lib, makeDesktopItem, makeWrapper, stdenv, udev, xorg }:
3 stdenv.mkDerivation (finalAttrs: {
4   pname = "atlauncher";
5   version = "3.4.34.2";
7   src = fetchurl {
8     url = "https://github.com/ATLauncher/ATLauncher/releases/download/v${finalAttrs.version}/ATLauncher-${finalAttrs.version}.jar";
9     hash = "sha256-l9OoHunK0xfY6xbNpjs9lfsVd3USM1GHgutTMMVq8S8=";
10   };
12   env.ICON = fetchurl {
13     url = "https://atlauncher.com/assets/images/logo.svg";
14     hash = "sha256-XoqpsgLmkpa2SdjZvPkgg6BUJulIBIeu6mBsJJCixfo=";
15   };
17   dontUnpack = true;
19   buildInputs = [ ];
20   nativeBuildInputs = [ copyDesktopItems makeWrapper ];
22   installPhase = ''
23     runHook preInstall
25     mkdir -p $out/bin $out/share/java
26     cp $src $out/share/java/ATLauncher.jar
28     makeWrapper ${jre}/bin/java $out/bin/${finalAttrs.pname} \
29       --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ xorg.libXxf86vm udev ]}" \
30       --add-flags "-jar $out/share/java/ATLauncher.jar" \
31       --add-flags "--working-dir \"\''${XDG_DATA_HOME:-\$HOME/.local/share}/ATLauncher\"" \
32       --add-flags "--no-launcher-update"
34     mkdir -p $out/share/icons/hicolor/scalable/apps
35     cp $ICON $out/share/icons/hicolor/scalable/apps/${finalAttrs.pname}.svg
37     runHook postInstall
38   '';
40   desktopItems = [
41     (makeDesktopItem {
42       name = finalAttrs.pname;
43       exec = finalAttrs.pname;
44       icon = finalAttrs.pname;
45       desktopName = "ATLauncher";
46       categories = [ "Game" ];
47     })
48   ];
50   meta = with lib; {
51     description = "A simple and easy to use Minecraft launcher which contains many different modpacks for you to choose from and play";
52     downloadPage = "https://atlauncher.com/downloads";
53     homepage = "https://atlauncher.com/";
54     license = licenses.gpl3;
55     maintainers = [ maintainers.getpsyched ];
56     platforms = platforms.all;
57   };