Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 makeWrapper, 6 copyDesktopItems, 7 makeDesktopItem, 8 jre, 9 libGL, 10}: 11 12stdenv.mkDerivation rec { 13 pname = "gitnuro"; 14 version = "1.4.2"; 15 16 src = fetchurl ( 17 if stdenv.hostPlatform.system == "x86_64-linux" then 18 { 19 url = "https://github.com/JetpackDuba/Gitnuro/releases/download/v${version}/Gitnuro-linux-x86_64-${version}.jar"; 20 hash = "sha256-1lwuLPR6b1+I2SWaYaVrZkMcYVRAf1R7j/AwjQf03UM="; 21 } 22 else if stdenv.hostPlatform.system == "aarch64-linux" then 23 { 24 url = "https://github.com/JetpackDuba/Gitnuro/releases/download/v${version}/Gitnuro-linux-arm_aarch64-${version}.jar"; 25 hash = "sha256-wnHW1YK4FKi5EDF/E0S+yr0tugtv3qVlCbT3+x9bM8s="; 26 } 27 else 28 throw "Unsupported architecture: ${stdenv.hostPlatform.system}" 29 ); 30 31 icon = fetchurl { 32 url = "https://raw.githubusercontent.com/JetpackDuba/Gitnuro/4cfc45069c176f807d9bfb1a7cba410257078d3c/icons/logo.svg"; 33 hash = "sha256-QGJcWTSJesIpDArOWiS3Kn1iznzeMFzvqS+CuNXh3as="; 34 }; 35 36 dontUnpack = true; 37 38 nativeBuildInputs = [ 39 makeWrapper 40 copyDesktopItems 41 ]; 42 43 installPhase = '' 44 runHook preInstall 45 46 makeWrapper ${jre}/bin/java $out/bin/gitnuro \ 47 --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libGL ]}" \ 48 --add-flags "-jar $src" 49 50 install -Dm444 $icon $out/share/icons/hicolor/scalable/apps/com.jetpackduba.Gitnuro.svg 51 52 runHook postInstall 53 ''; 54 55 desktopItems = [ 56 (makeDesktopItem { 57 name = "Gitnuro"; 58 exec = "gitnuro"; 59 icon = "com.jetpackduba.Gitnuro"; 60 desktopName = "Gitnuro"; 61 categories = [ "Development" ]; 62 comment = meta.description; 63 }) 64 ]; 65 66 meta = with lib; { 67 description = "FOSS Git multiplatform client based on Compose and JGit"; 68 homepage = "https://gitnuro.com/"; 69 license = licenses.gpl3Plus; 70 platforms = [ 71 "x86_64-linux" 72 "aarch64-linux" 73 ]; 74 sourceProvenance = with sourceTypes; [ binaryBytecode ]; 75 maintainers = with maintainers; [ zendo ]; 76 mainProgram = "gitnuro"; 77 }; 78}