nixpkgs/pkgs/by-name/at/atlauncher/package.nix

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

114 lines
2.9 KiB
Nix
Raw Normal View History

2024-07-09 15:25:10 +00:00
{
2024-08-12 04:07:26 +00:00
fetchFromGitHub,
gradle,
2024-07-09 15:25:10 +00:00
jre,
lib,
makeWrapper,
stdenvNoCC,
gamemodeSupport ? stdenvNoCC.hostPlatform.isLinux,
textToSpeechSupport ? stdenvNoCC.hostPlatform.isLinux,
additionalLibs ? [ ],
# dependencies
flite,
gamemode,
libglvnd,
libpulseaudio,
udev,
xorg,
}:
2023-06-11 20:44:18 +00:00
2024-06-30 13:39:35 +00:00
stdenvNoCC.mkDerivation (finalAttrs: {
2023-06-11 20:44:18 +00:00
pname = "atlauncher";
version = "3.4.38.0";
2023-06-11 20:44:18 +00:00
2024-08-12 04:07:26 +00:00
src = fetchFromGitHub {
owner = "ATLauncher";
repo = "ATLauncher";
rev = "v${finalAttrs.version}";
hash = "sha256-0cn4qTdNH8VHRuypdRInrmU7gh792NSYL7P2rkz/4xc=";
2023-06-11 20:44:18 +00:00
};
2024-08-12 04:07:26 +00:00
postPatch = ''
# exclude UI tests
sed -i "/test {/a\ exclude '**/BasicLauncherUiTest.class'" build.gradle
'';
2023-06-11 20:44:18 +00:00
2024-07-09 15:25:10 +00:00
nativeBuildInputs = [
2024-08-12 04:07:26 +00:00
gradle
2024-07-09 15:25:10 +00:00
makeWrapper
];
2023-06-11 20:44:18 +00:00
2024-08-12 04:07:26 +00:00
mitmCache = gradle.fetchDeps {
inherit (finalAttrs) pname;
data = ./deps.json;
};
doCheck = true;
gradleBuildTask = "shadowJar";
gradleFlags = [
"--exclude-task"
"createExe"
];
installPhase =
let
2024-07-09 15:25:10 +00:00
runtimeLibraries =
[
libglvnd
libpulseaudio
udev
2024-07-09 15:25:48 +00:00
xorg.libX11
xorg.libXcursor
2024-07-09 15:25:10 +00:00
xorg.libXxf86vm
]
++ lib.optional gamemodeSupport gamemode.lib
++ lib.optional textToSpeechSupport flite
++ additionalLibs;
in
''
runHook preInstall
2024-08-12 04:07:26 +00:00
mkdir -p $out/{bin,share/java}
cp build/libs/ATLauncher-${finalAttrs.version}.jar $out/share/java/ATLauncher.jar
2024-08-12 04:07:26 +00:00
makeWrapper ${lib.getExe jre} $out/bin/atlauncher \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeLibraries}" \
--add-flags "-jar $out/share/java/ATLauncher.jar" \
--add-flags "--working-dir \"\''${XDG_DATA_HOME:-\$HOME/.local/share}/ATLauncher\"" \
--add-flags "--no-launcher-update"
runHook postInstall
'';
2023-06-11 20:44:18 +00:00
2024-08-12 04:07:26 +00:00
postInstall =
let
packagingDir = "${finalAttrs.src}/packaging/linux/_common";
in
''
install -D -m444 ${packagingDir}/atlauncher.desktop -t $out/share/applications
install -D -m444 ${packagingDir}/atlauncher.metainfo.xml -t $out/share/metainfo
install -D -m444 ${packagingDir}/atlauncher.png -t $out/share/pixmaps
install -D -m444 ${packagingDir}/atlauncher.svg -t $out/share/icons/hicolor/scalable/apps
'';
2023-06-11 20:44:18 +00:00
meta = {
2024-11-15 19:37:26 +00:00
broken = stdenvNoCC.hostPlatform.isDarwin; # https://github.com/NixOS/nixpkgs/issues/356259
changelog = "https://github.com/ATLauncher/ATLauncher/blob/v${finalAttrs.version}/CHANGELOG.md";
2023-06-11 20:44:18 +00:00
description = "Simple and easy to use Minecraft launcher which contains many different modpacks for you to choose from and play";
downloadPage = "https://atlauncher.com/downloads";
2024-02-02 13:49:16 +00:00
homepage = "https://atlauncher.com";
license = lib.licenses.gpl3;
2024-02-02 13:49:16 +00:00
mainProgram = "atlauncher";
maintainers = with lib.maintainers; [ getpsyched ];
platforms = lib.platforms.all;
2024-08-12 04:07:26 +00:00
sourceProvenance = with lib.sourceTypes; [
fromSource
binaryBytecode # mitm cache
];
2023-06-11 20:44:18 +00:00
};
})