From 3b421626dd8d54dc5fddd42ffb131f7cbbc2decf Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Wed, 13 Mar 2024 23:11:19 +0100 Subject: smartgithg: move to pkgs/by-name --- pkgs/by-name/sm/smartgithg/package.nix | 97 ++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 pkgs/by-name/sm/smartgithg/package.nix (limited to 'pkgs/by-name') diff --git a/pkgs/by-name/sm/smartgithg/package.nix b/pkgs/by-name/sm/smartgithg/package.nix new file mode 100644 index 000000000000..693505b20305 --- /dev/null +++ b/pkgs/by-name/sm/smartgithg/package.nix @@ -0,0 +1,97 @@ +{ lib +, stdenv +, fetchurl +, makeDesktopItem +, openjdk19 +, gtk3 +, glib +, gnome +, wrapGAppsHook +, libXtst +, which +}: +let + jre = openjdk19; +in +stdenv.mkDerivation rec { + pname = "smartgithg"; + version = "23.1.1"; + + src = fetchurl { + url = "https://www.syntevo.com/downloads/smartgit/smartgit-linux-${builtins.replaceStrings [ "." ] [ "_" ] version}.tar.gz"; + sha256 = "sha256-LXB+OymApJjL4bgOZ8Vfd193jZHVbQ6G2zmrHNE/OJk="; + }; + + nativeBuildInputs = [ wrapGAppsHook ]; + + buildInputs = [ jre gnome.adwaita-icon-theme gtk3 ]; + + preFixup = with lib; '' + gappsWrapperArgs+=( \ + --prefix PATH : ${makeBinPath [ jre which ]} \ + --prefix LD_LIBRARY_PATH : ${makeLibraryPath [ + gtk3 + glib + libXtst + ]} \ + --prefix JRE_HOME : ${jre} \ + --prefix JAVA_HOME : ${jre} \ + --prefix SMARTGITHG_JAVA_HOME : ${jre} \ + ) + # add missing shebang for start script + sed -i $out/bin/smartgit \ + -e '1i#!/bin/bash' + ''; + + installPhase = '' + runHook preInstall + + sed -i '/ --login/d' bin/smartgit.sh + mkdir -pv $out/{bin,share/applications,share/icons/hicolor/scalable/apps/} + cp -av ./{dictionaries,lib} $out/ + cp -av bin/smartgit.sh $out/bin/smartgit + ln -sfv $out/bin/smartgit $out/bin/smartgithg + + cp -av $desktopItem/share/applications/* $out/share/applications/ + for icon_size in 32 48 64 128 256; do + path=$icon_size'x'$icon_size + icon=bin/smartgit-$icon_size.png + mkdir -p $out/share/icons/hicolor/$path/apps + cp $icon $out/share/icons/hicolor/$path/apps/smartgit.png + done + + cp -av bin/smartgit.svg $out/share/icons/hicolor/scalable/apps/ + + runHook postInstall + ''; + + desktopItem = with lib; makeDesktopItem rec { + name = "smartgit"; + exec = "smartgit"; + comment = meta.description; + icon = "smartgit"; + desktopName = "SmartGit"; + categories = [ + "Application" + "Development" + "RevisionControl" + ]; + mimeTypes = [ + "x-scheme-handler/git" + "x-scheme-handler/smartgit" + "x-scheme-handler/sourcetree" + ]; + startupNotify = true; + startupWMClass = name; + keywords = [ "git" ]; + }; + + meta = with lib; { + description = "GUI for Git, Mercurial, Subversion"; + homepage = "https://www.syntevo.com/smartgit/"; + changelog = "https://www.syntevo.com/smartgit/changelog.txt"; + license = licenses.unfree; + platforms = platforms.linux; + maintainers = with lib.maintainers; [ jraygauthier ]; + }; +} -- cgit 1.4.1