sublime-merge: remove GTK 2 support

Sublime Merge does not support GTK 2 from build 1092 so we do not need this anymore.

Also brings the expression in sync with Sublime Text.
This commit is contained in:
Jan Tojnar 2019-06-18 22:53:04 +02:00
parent a3667ee6be
commit 9819cc2ca6
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4

View File

@ -1,12 +1,10 @@
{ buildVersion, sha256, dev ? false }:
{ fetchurl, stdenv, xorg, glib, glibcLocales, gtk2, gtk3, cairo, pango, libredirect, makeWrapper, wrapGAppsHook
, pkexecPath ? "/run/wrappers/bin/pkexec", gksuSupport ? false, gksu
{ fetchurl, stdenv, xorg, glib, glibcLocales, gtk3, cairo, pango, libredirect, makeWrapper, wrapGAppsHook
, pkexecPath ? "/run/wrappers/bin/pkexec"
, writeScript, common-updater-scripts, curl, gnugrep
}:
assert gksuSupport -> gksu != null;
let
pname = "sublime-merge";
packageAttribute = "sublime-merge${stdenv.lib.optionalString dev "-dev"}";
@ -17,13 +15,11 @@ let
downloadArchiveType = "tar.xz";
versionUrl = "https://www.sublimemerge.com/${if dev then "dev" else "download"}";
versionFile = "pkgs/applications/version-management/sublime-merge/default.nix";
usesGtk2 = false;
archSha256 = sha256;
arch = "x64";
libPath = stdenv.lib.makeLibraryPath [ xorg.libX11 glib (if usesGtk2 then gtk2 else gtk3) cairo pango ];
redirects = [ "/usr/bin/pkexec=${pkexecPath}" ]
++ stdenv.lib.optional gksuSupport "/usr/bin/gksudo=${gksu}/bin/gksudo";
libPath = stdenv.lib.makeLibraryPath [ xorg.libX11 glib gtk3 cairo pango ];
redirects = [ "/usr/bin/pkexec=${pkexecPath}" ];
in let
binaryPackage = stdenv.mkDerivation {
pname = "${pname}-bin";
@ -37,8 +33,8 @@ in let
dontStrip = true;
dontPatchELF = true;
buildInputs = stdenv.lib.optionals (!usesGtk2) [ glib gtk3 ]; # for GSETTINGS_SCHEMAS_PATH
nativeBuildInputs = [ makeWrapper ] ++ stdenv.lib.optional (!usesGtk2) wrapGAppsHook;
buildInputs = [ glib gtk3 ]; # for GSETTINGS_SCHEMAS_PATH
nativeBuildInputs = [ makeWrapper wrapGAppsHook ];
buildPhase = ''
runHook preBuild
@ -50,7 +46,7 @@ in let
$binary
done
# Rewrite pkexec|gksudo argument. Note that we can't delete bytes in binary.
# Rewrite pkexec argument. Note that we cannot delete bytes in binary.
sed -i -e 's,/bin/cp\x00,cp\x00\x00\x00\x00\x00\x00,g' ${primaryBinary}
runHook postBuild
@ -72,7 +68,7 @@ in let
--set LD_PRELOAD "${libredirect}/lib/libredirect.so" \
--set NIX_REDIRECTS ${builtins.concatStringsSep ":" redirects} \
--set LOCALE_ARCHIVE "${glibcLocales.out}/lib/locale/locale-archive" \
${stdenv.lib.optionalString (!usesGtk2) ''"''${gappsWrapperArgs[@]}"''}
"''${gappsWrapperArgs[@]}"
'';
};
in stdenv.mkDerivation (rec {