nixpkgs-suyu/pkgs/applications/editors/sublime/default.nix

40 lines
1.3 KiB
Nix
Raw Normal View History

2012-11-10 20:37:42 +01:00
{ fetchurl, stdenv, glib, xlibs, cairo, gtk}:
let
libPath = stdenv.lib.makeLibraryPath [glib xlibs.libX11 gtk cairo];
in
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
2012-11-10 20:37:42 +01:00
stdenv.mkDerivation rec {
name = "sublimetext-2.0.1";
src =
if stdenv.system == "i686-linux" then
fetchurl {
name = "sublimetext-2.0.1.tar.bz2";
url = http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1.tar.bz2;
sha256 = "1x6vmlfn5mdbf23nyfr7dhhi6y60lnpcmqj59svl3bzvayijsxaf";
}
else
fetchurl {
name = "sublimetext-2.0.1.tar.bz2";
url = http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1%20x64.tar.bz2;
sha256 = "0174dnp9zika5as25mcls5y0qzhh8mnc5ajxsxz7qjrk4lrzk3c5";
};
2012-11-10 20:37:42 +01:00
buildCommand = ''
tar xvf ${src}
mkdir -p $out/bin
mv Sublime* $out/sublime
ln -s $out/sublime/sublime_text $out/bin/sublime
echo ${libPath}
patchelf \
--interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
2012-11-11 13:23:15 +01:00
--set-rpath ${libPath}:${stdenv.gcc.gcc}/lib${stdenv.lib.optionalString stdenv.is64bit "64"} \
2012-11-10 20:37:42 +01:00
$out/sublime/sublime_text
'';
meta = {
description = "Sublime Text is a sophisticated text editor for code, markup and prose.";
license = "unfree";
2012-11-10 20:37:42 +01:00
};
}