Sublime dev (#38383)

* Package sublime-dev build.

* sublime3-dev: Init at 3160

* Sublime3: Refactor to share derivation between sublime-text 3 dev and stable

* Sublime3: Refactor as a fuction to avoid duplicating parameters

* Sublime3: Remove unnecessary rec

https://github.com/NixOS/nixpkgs/pull/38383#discussion_r178898901

* sublime3-dev: 3160 -> 3161
This commit is contained in:
Guillaume Massé 2018-04-06 18:31:10 +02:00 committed by zimbatm
parent 0af5b254ab
commit 15a2dca15c
4 changed files with 47 additions and 21 deletions

View File

@ -1,33 +1,39 @@
{buildVersion, x32sha256, x64sha256}:
{ fetchurl, stdenv, glib, xorg, cairo, gtk2, pango, makeWrapper, openssl, bzip2,
pkexecPath ? "/run/wrappers/bin/pkexec", libredirect,
gksuSupport ? false, gksu, unzip, zip, bash }:
gksuSupport ? false, gksu, unzip, zip, bash}:
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
assert gksuSupport -> gksu != null;
let
build = "3143";
libPath = stdenv.lib.makeLibraryPath [glib xorg.libX11 gtk2 cairo pango];
redirects = [ "/usr/bin/pkexec=${pkexecPath}" ]
++ stdenv.lib.optional gksuSupport "/usr/bin/gksudo=${gksu}/bin/gksudo";
in let
archSha256 =
if stdenv.system == "i686-linux" then
x32sha256
else
x64sha256;
arch =
if stdenv.system == "i686-linux" then
"x32"
else
"x64";
# package with just the binaries
sublime = stdenv.mkDerivation {
name = "sublimetext3-${build}-bin";
name = "sublimetext3-${buildVersion}-bin";
src =
if stdenv.system == "i686-linux" then
fetchurl {
name = "sublimetext-${build}.tar.bz2";
url = "https://download.sublimetext.com/sublime_text_3_build_${build}_x32.tar.bz2";
sha256 = "0dgpx4wij2m77f478p746qadavab172166bghxmj7fb61nvw9v5i";
}
else
fetchurl {
name = "sublimetext-${build}.tar.bz2";
url = "https://download.sublimetext.com/sublime_text_3_build_${build}_x64.tar.bz2";
sha256 = "06b554d2cvpxc976rvh89ix3kqc7klnngvk070xrs8wbyb221qcw";
};
fetchurl {
name = "sublimetext-${buildVersion}.tar.bz2";
url = "https://download.sublimetext.com/sublime_text_3_build_${buildVersion}_${arch}.tar.bz2";
sha256 = archSha256;
};
dontStrip = true;
dontPatchELF = true;
@ -80,8 +86,8 @@ in let
wrapProgram $out/plugin_host --prefix LD_PRELOAD : ${stdenv.cc.cc.lib}/lib${stdenv.lib.optionalString stdenv.is64bit "64"}/libgcc_s.so.1:${openssl.out}/lib/libssl.so:${bzip2.out}/lib/libbz2.so
'';
};
in stdenv.mkDerivation {
name = "sublimetext3-${build}";
in stdenv.mkDerivation (rec {
name = "sublimetext3-${buildVersion}";
phases = [ "installPhase" ];
@ -110,4 +116,4 @@ in stdenv.mkDerivation {
license = licenses.unfree;
platforms = platforms.linux;
};
}
})

View File

@ -0,0 +1,18 @@
{ callPackage }:
let
common = opts: callPackage (import ./common.nix opts);
in
rec {
sublime3-dev = common {
buildVersion = "3161";
x32sha256 = "0qrm2qmfsj71lr83c8zas2n3xk8hk9k4w8ygnasjhggmyjm3wy0q";
x64sha256 = "0cgadylm68s2jly10r038q1fvmbzmpc2nvqy86vlyq9avgqbm5pc";
} {};
sublime3 = common {
buildVersion = "3143";
x32sha256 = "0dgpx4wij2m77f478p746qadavab172166bghxmj7fb61nvw9v5i";
x64sha256 = "06b554d2cvpxc976rvh89ix3kqc7klnngvk070xrs8wbyb221qcw";
} {};
}

View File

@ -17824,9 +17824,11 @@ with pkgs;
inherit sbcl lispPackages;
};
sublime = callPackage ../applications/editors/sublime { };
sublime3Packages = recurseIntoAttrs (callPackage ../applications/editors/sublime/3/packages.nix { });
sublime3 = lowPrio (callPackage ../applications/editors/sublime3 { });
sublime3 = sublime3Packages.sublime3;
sublime3-dev = sublime3Packages.sublime3-dev;
inherit (callPackages ../applications/version-management/subversion/default.nix {
bdbSupport = true;