nixpkgs/pkgs/by-name/gi/gitnuro/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

74 lines
2.0 KiB
Nix

{ lib
, stdenv
, fetchurl
, makeWrapper
, copyDesktopItems
, makeDesktopItem
, jre
, libGL
}:
stdenv.mkDerivation rec {
pname = "gitnuro";
version = "1.3.1";
src = fetchurl (
if stdenv.hostPlatform.system == "x86_64-linux" then
{
url = "https://github.com/JetpackDuba/Gitnuro/releases/download/v${version}/Gitnuro-linux-x86_64-${version}.jar";
hash = "sha256-7yne9dD/7VT+H4tIBJvpOf8ksECCpoNAa8TSmFmjYMw=";
}
else if stdenv.hostPlatform.system == "aarch64-linux" then
{
url = "https://github.com/JetpackDuba/Gitnuro/releases/download/v${version}/Gitnuro-linux-arm_aarch64-${version}.jar";
hash = "sha256-6TRQfIhaKBjNPn3tEVWoUF92JAmwlHUtQZE8gKEZ/ZI=";
}
else throw "Unsupported architecture: ${stdenv.hostPlatform.system}"
);
icon = fetchurl {
url = "https://raw.githubusercontent.com/JetpackDuba/Gitnuro/4cfc45069c176f807d9bfb1a7cba410257078d3c/icons/logo.svg";
hash = "sha256-QGJcWTSJesIpDArOWiS3Kn1iznzeMFzvqS+CuNXh3as=";
};
dontUnpack = true;
nativeBuildInputs = [
makeWrapper
copyDesktopItems
];
installPhase = ''
runHook preInstall
makeWrapper ${jre}/bin/java $out/bin/gitnuro \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libGL ]}" \
--add-flags "-jar $src"
install -Dm444 $icon $out/share/icons/hicolor/scalable/apps/com.jetpackduba.Gitnuro.svg
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = "Gitnuro";
exec = "gitnuro";
icon = "com.jetpackduba.Gitnuro";
desktopName = "Gitnuro";
categories = [ "Development" ];
comment = meta.description;
})
];
meta = with lib; {
description = "A FOSS Git multiplatform client based on Compose and JGit";
homepage = "https://gitnuro.com/";
license = licenses.gpl3Plus;
platforms = [ "x86_64-linux" "aarch64-linux" ];
sourceProvenance = with sourceTypes; [ binaryBytecode ];
maintainers = with maintainers; [ zendo ];
mainProgram = "gitnuro";
};
}