2016-09-12 00:24:51 +03:00
|
|
|
{ fetchurl, stdenv, glib, xorg, cairo, gtk2, makeDesktopItem }:
|
2012-11-10 23:37:42 +04:00
|
|
|
let
|
2016-09-12 00:24:51 +03:00
|
|
|
libPath = stdenv.lib.makeLibraryPath [glib xorg.libX11 gtk2 cairo];
|
2012-11-10 23:37:42 +04:00
|
|
|
in
|
2012-11-11 16:15:22 +04:00
|
|
|
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
|
|
|
|
|
2012-11-10 23:37:42 +04:00
|
|
|
stdenv.mkDerivation rec {
|
2013-09-02 22:26:25 +04:00
|
|
|
name = "sublimetext-2.0.2";
|
2012-11-11 16:21:33 +04:00
|
|
|
src =
|
|
|
|
if stdenv.system == "i686-linux" then
|
|
|
|
fetchurl {
|
2013-09-02 22:26:25 +04:00
|
|
|
name = "sublimetext-2.0.2.tar.bz2";
|
|
|
|
url = http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.2.tar.bz2;
|
|
|
|
sha256 = "026g5mppk28lzzzn9ibykcqkrd5msfmg0sc0z8w8jd7v3h28wcq7";
|
2012-11-11 16:21:33 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
fetchurl {
|
2013-09-02 22:26:25 +04:00
|
|
|
name = "sublimetext-2.0.2.tar.bz2";
|
|
|
|
url = http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.2%20x64.tar.bz2;
|
|
|
|
sha256 = "115b71nbv9mv8cz6bkjwpbdf2ywnjc1zy2d3080f6ck4sqqfvfh1";
|
2012-11-11 16:21:33 +04:00
|
|
|
};
|
2012-11-10 23:37:42 +04:00
|
|
|
buildCommand = ''
|
|
|
|
tar xvf ${src}
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mv Sublime* $out/sublime
|
|
|
|
ln -s $out/sublime/sublime_text $out/bin/sublime
|
2014-01-26 00:45:08 +04:00
|
|
|
ln -s $out/sublime/sublime_text $out/bin/sublime2
|
2012-11-10 23:37:42 +04:00
|
|
|
|
|
|
|
echo ${libPath}
|
|
|
|
patchelf \
|
2014-12-17 21:11:30 +03:00
|
|
|
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2016-04-30 23:56:43 +03:00
|
|
|
--set-rpath ${libPath}:${stdenv.cc.cc.lib}/lib${stdenv.lib.optionalString stdenv.is64bit "64"} \
|
2012-11-10 23:37:42 +04:00
|
|
|
$out/sublime/sublime_text
|
2016-05-26 02:24:50 +03:00
|
|
|
|
|
|
|
mkdir -p $out/share/icons
|
|
|
|
|
|
|
|
for x in $(ls $out/sublime/Icon); do
|
|
|
|
mkdir -p $out/share/icons/hicolor/$x/apps
|
|
|
|
cp -v $out/sublime/Icon/$x/* $out/share/icons/hicolor/$x/apps
|
|
|
|
done
|
|
|
|
|
|
|
|
ln -sv "${desktopItem}/share/applications" $out/share
|
2012-11-10 23:37:42 +04:00
|
|
|
'';
|
|
|
|
|
2016-05-26 02:24:50 +03:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "sublime2";
|
|
|
|
exec = "sublime2 %F";
|
|
|
|
comment = meta.description;
|
|
|
|
desktopName = "Sublime Text";
|
|
|
|
genericName = "Text Editor";
|
|
|
|
categories = "TextEditor;Development;";
|
|
|
|
icon = "sublime_text";
|
|
|
|
};
|
|
|
|
|
2012-11-10 23:37:42 +04:00
|
|
|
meta = {
|
2013-10-06 13:49:53 +04:00
|
|
|
description = "Sophisticated text editor for code, markup and prose";
|
2014-06-19 08:19:00 +04:00
|
|
|
license = stdenv.lib.licenses.unfree;
|
2012-11-10 23:37:42 +04:00
|
|
|
};
|
|
|
|
}
|