1 { fetchurl, lib, stdenv, glib, xorg, cairo, gtk2, makeDesktopItem }:
3 libPath = lib.makeLibraryPath [ glib xorg.libX11 gtk2 cairo ];
6 stdenv.mkDerivation rec {
11 if stdenv.hostPlatform.system == "i686-linux" then
13 name = "sublimetext-${version}.tar.bz2";
15 "http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%20${version}.tar.bz2"
16 "https://download.sublimetext.com/Sublime%20Text%20${version}.tar.bz2"
18 sha256 = "026g5mppk28lzzzn9ibykcqkrd5msfmg0sc0z8w8jd7v3h28wcq7";
22 name = "sublimetext-${version}.tar.bz2";
24 "http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%20${version}.tar.bz2"
25 "https://download.sublimetext.com/Sublime%20Text%20${version}%20x64.tar.bz2"
27 sha256 = "115b71nbv9mv8cz6bkjwpbdf2ywnjc1zy2d3080f6ck4sqqfvfh1";
32 mv Sublime* $out/sublime
33 ln -s $out/sublime/sublime_text $out/bin/sublime
34 ln -s $out/sublime/sublime_text $out/bin/sublime2
38 --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
39 --set-rpath ${libPath}:${stdenv.cc.cc.lib}/lib${lib.optionalString stdenv.is64bit "64"} \
40 $out/sublime/sublime_text
42 mkdir -p $out/share/icons
44 for x in $(ls $out/sublime/Icon); do
45 mkdir -p $out/share/icons/hicolor/$x/apps
46 cp -v $out/sublime/Icon/$x/* $out/share/icons/hicolor/$x/apps
49 ln -sv "${desktopItem}/share/applications" $out/share
52 desktopItem = makeDesktopItem {
55 comment = meta.description;
56 desktopName = "Sublime Text";
57 genericName = "Text Editor";
58 categories = [ "TextEditor" "Development" ];
59 icon = "sublime_text";
63 description = "Sophisticated text editor for code, markup and prose";
64 license = lib.licenses.unfree;
65 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
66 platforms = [ "x86_64-linux" "i686-linux" ];