mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-31 17:23:34 +00:00
atlauncher: build from source (#327592)
This commit is contained in:
commit
4c7acf930a
1278
pkgs/by-name/at/atlauncher/deps.json
generated
Normal file
1278
pkgs/by-name/at/atlauncher/deps.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,8 @@
|
||||
{
|
||||
copyDesktopItems,
|
||||
fetchurl,
|
||||
fetchFromGitHub,
|
||||
gradle,
|
||||
jre,
|
||||
lib,
|
||||
makeDesktopItem,
|
||||
makeWrapper,
|
||||
stdenvNoCC,
|
||||
|
||||
@ -24,23 +23,37 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
pname = "atlauncher";
|
||||
version = "3.4.36.10";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/ATLauncher/ATLauncher/releases/download/v${finalAttrs.version}/ATLauncher-${finalAttrs.version}.jar";
|
||||
hash = "sha256-JZTiYcea5ik8a4RmNLxZcuea7spGWftUGRiRW2Ive7c=";
|
||||
src = fetchFromGitHub {
|
||||
owner = "ATLauncher";
|
||||
repo = "ATLauncher";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-EMV/M5W/acJaQJsi4COoRQC2YVfuJG9HGcwvGfakoNo=";
|
||||
};
|
||||
|
||||
env.ICON = fetchurl {
|
||||
url = "https://atlauncher.com/assets/images/logo.svg";
|
||||
hash = "sha256-XoqpsgLmkpa2SdjZvPkgg6BUJulIBIeu6mBsJJCixfo=";
|
||||
};
|
||||
|
||||
dontUnpack = true;
|
||||
postPatch = ''
|
||||
# exclude UI tests
|
||||
sed -i "/test {/a\ exclude '**/BasicLauncherUiTest.class'" build.gradle
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
copyDesktopItems
|
||||
gradle
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
mitmCache = gradle.fetchDeps {
|
||||
inherit (finalAttrs) pname;
|
||||
data = ./deps.json;
|
||||
};
|
||||
|
||||
doCheck = true;
|
||||
|
||||
gradleBuildTask = "shadowJar";
|
||||
|
||||
gradleFlags = [
|
||||
"--exclude-task"
|
||||
"createExe"
|
||||
];
|
||||
|
||||
installPhase =
|
||||
let
|
||||
runtimeLibraries =
|
||||
@ -59,30 +72,28 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin $out/share/java
|
||||
cp $src $out/share/java/ATLauncher.jar
|
||||
mkdir -p $out/{bin,share/java}
|
||||
cp build/libs/ATLauncher-${finalAttrs.version}.jar $out/share/java/ATLauncher.jar
|
||||
|
||||
makeWrapper ${jre}/bin/java $out/bin/atlauncher \
|
||||
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"
|
||||
|
||||
mkdir -p $out/share/icons/hicolor/scalable/apps
|
||||
cp $ICON $out/share/icons/hicolor/scalable/apps/atlauncher.svg
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
desktopItems = [
|
||||
(makeDesktopItem {
|
||||
categories = [ "Game" ];
|
||||
desktopName = "ATLauncher";
|
||||
exec = "atlauncher";
|
||||
icon = "atlauncher";
|
||||
name = "atlauncher";
|
||||
})
|
||||
];
|
||||
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
|
||||
'';
|
||||
|
||||
meta = {
|
||||
changelog = "https://github.com/ATLauncher/ATLauncher/blob/v${finalAttrs.version}/CHANGELOG.md";
|
||||
@ -93,6 +104,9 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
mainProgram = "atlauncher";
|
||||
maintainers = with lib.maintainers; [ getpsyched ];
|
||||
platforms = lib.platforms.all;
|
||||
sourceProvenance = [ lib.sourceTypes.binaryBytecode ];
|
||||
sourceProvenance = with lib.sourceTypes; [
|
||||
fromSource
|
||||
binaryBytecode # mitm cache
|
||||
];
|
||||
};
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user