Merge pull request #65473 from plumelo/feature/smartgithg
smartgithg: 18.2.4 -> 18.2.9
This commit is contained in:
commit
f646d1c80d
@ -1,64 +1,90 @@
|
|||||||
{ stdenv, fetchurl, lib, makeWrapper
|
{ stdenv
|
||||||
, substituteAll
|
, fetchurl
|
||||||
|
, makeDesktopItem
|
||||||
, jre
|
, jre
|
||||||
, gtk2, glib
|
, gtk3
|
||||||
|
, glib
|
||||||
|
, gnome3
|
||||||
|
, wrapGAppsHook
|
||||||
|
, hicolor-icon-theme
|
||||||
, libXtst
|
, libXtst
|
||||||
, which
|
, which
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "smartgithg-${version}";
|
pname = "smartgithg";
|
||||||
version = "18.2.4";
|
version = "18.2.9";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://www.syntevo.com/downloads/smartgit/smartgit-linux-${builtins.replaceStrings [ "." ] [ "_" ] version}.tar.gz";
|
url = "https://www.syntevo.com/downloads/smartgit/smartgit-linux-${builtins.replaceStrings [ "." ] [ "_" ] version}.tar.gz";
|
||||||
sha256 = "0ch6vcvndn1fpx05ym9yp2ssfw2af6ac0pw8ssvjkc676zc0jr73";
|
sha256 = "0d08awb2s3w1w8n8048abw2x4wnqhfx96sls9kdsnxj0xrszgz67";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [ wrapGAppsHook ];
|
||||||
|
|
||||||
buildInputs = [ jre ];
|
buildInputs = [ jre gnome3.adwaita-icon-theme hicolor-icon-theme gtk3 ];
|
||||||
|
|
||||||
buildCommand = let
|
preFixup = with stdenv.lib; ''
|
||||||
pkg_path = "$out/${name}";
|
gappsWrapperArgs+=( \
|
||||||
bin_path = "$out/bin";
|
--prefix PATH : ${makeBinPath [ jre which ]} \
|
||||||
install_freedesktop_items = substituteAll {
|
--prefix LD_LIBRARY_PATH : ${makeLibraryPath [
|
||||||
inherit (stdenv) shell;
|
gtk3
|
||||||
isExecutable = true;
|
glib
|
||||||
src = ./install_freedesktop_items.sh;
|
libXtst
|
||||||
};
|
]} \
|
||||||
runtime_paths = lib.makeBinPath [
|
|
||||||
jre
|
|
||||||
#git mercurial subversion # the paths are requested in configuration
|
|
||||||
which
|
|
||||||
];
|
|
||||||
runtime_lib_paths = lib.makeLibraryPath [
|
|
||||||
gtk2 glib
|
|
||||||
libXtst
|
|
||||||
];
|
|
||||||
in ''
|
|
||||||
tar xvzf $src
|
|
||||||
mkdir -pv $out
|
|
||||||
mkdir -pv ${pkg_path}
|
|
||||||
# unpacking should have produced a dir named 'smartgit'
|
|
||||||
cp -a smartgit/* ${pkg_path}
|
|
||||||
# prevent using packaged jre
|
|
||||||
rm -r ${pkg_path}/jre
|
|
||||||
mkdir -pv ${bin_path}
|
|
||||||
jre=${jre.home}
|
|
||||||
makeWrapper ${pkg_path}/bin/smartgit.sh ${bin_path}/smartgit \
|
|
||||||
--prefix PATH : ${runtime_paths} \
|
|
||||||
--prefix LD_LIBRARY_PATH : ${runtime_lib_paths} \
|
|
||||||
--prefix JRE_HOME : ${jre} \
|
--prefix JRE_HOME : ${jre} \
|
||||||
--prefix JAVA_HOME : ${jre} \
|
--prefix JAVA_HOME : ${jre} \
|
||||||
--prefix SMARTGITHG_JAVA_HOME : ${jre}
|
--prefix SMARTGITHG_JAVA_HOME : ${jre} \
|
||||||
sed -i '/ --login/d' ${pkg_path}/bin/smartgit.sh
|
) \
|
||||||
patchShebangs $out
|
|
||||||
cp ${bin_path}/smartgit ${bin_path}/smartgithg
|
|
||||||
|
|
||||||
${install_freedesktop_items} "${pkg_path}/bin" "$out"
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
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 stdenv.lib; makeDesktopItem rec {
|
||||||
|
name = "smartgit";
|
||||||
|
exec = "smartgit";
|
||||||
|
comment = meta.description;
|
||||||
|
icon = "smartgit";
|
||||||
|
desktopName = "SmartGit";
|
||||||
|
categories = concatStringsSep ";" [
|
||||||
|
"Application"
|
||||||
|
"Development"
|
||||||
|
"RevisionControl"
|
||||||
|
];
|
||||||
|
mimeType = concatStringsSep ";" [
|
||||||
|
"x-scheme-handler/git"
|
||||||
|
"x-scheme-handler/smartgit"
|
||||||
|
"x-scheme-handler/sourcetree"
|
||||||
|
];
|
||||||
|
startupNotify = "true";
|
||||||
|
extraEntries = ''
|
||||||
|
Keywords=git
|
||||||
|
StartupWMClass=${name}
|
||||||
|
Version=1.0
|
||||||
|
Encoding=UTF-8
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "GUI for Git, Mercurial, Subversion";
|
description = "GUI for Git, Mercurial, Subversion";
|
||||||
homepage = http://www.syntevo.com/smartgit/;
|
homepage = http://www.syntevo.com/smartgit/;
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
#!@shell@
|
|
||||||
|
|
||||||
inBinDir=$1
|
|
||||||
out=$2
|
|
||||||
|
|
||||||
cat $inBinDir/add-menuitem.sh | \
|
|
||||||
sed -re 's#xdg-icon-resource[ ]+install[ ]+--size[ ]+([0-9]+)[ ]+("[^"]+")[ ]+([$0-9a-zA-Z_]+)#mkdir -p '${out}'/share/icons/hicolor/\1x\1/apps \&\& cp \2 '${out}'/share/icons/hicolor/\1x\1/apps/\3\.png #' | \
|
|
||||||
sed -re 's#xdg-desktop-menu[ ]+install[ ]+([$0-9a-zA-Z_]+)#mkdir -p '${out}'/share/applications \&\& cp \1 '${out}'/share/applications/#' | \
|
|
||||||
sed -re 's#Exec="[^"]+"#Exec=smartgit#' |
|
|
||||||
sed -re 's#SMARTGIT_BIN=.*#'SMARTGIT_BIN=${inBinDir}'#' \
|
|
||||||
| bash
|
|
Loading…
x
Reference in New Issue
Block a user