2021-01-15 13:21:58 +00:00
|
|
|
{ fetchurl, lib, stdenv, glib, xorg, cairo, gtk2, makeDesktopItem }:
|
2012-11-10 19:37:42 +00:00
|
|
|
let
|
2021-11-07 20:29:51 +00:00
|
|
|
libPath = lib.makeLibraryPath [ glib xorg.libX11 gtk2 cairo ];
|
2012-11-10 19:37:42 +00:00
|
|
|
in
|
2012-11-11 12:15:22 +00:00
|
|
|
|
2012-11-10 19:37:42 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-11-07 20:29:51 +00:00
|
|
|
pname = "sublimetext";
|
|
|
|
version = "2.0.2";
|
|
|
|
|
2018-05-03 05:58:11 +00:00
|
|
|
src =
|
2018-08-20 19:11:29 +00:00
|
|
|
if stdenv.hostPlatform.system == "i686-linux" then
|
2012-11-11 12:21:33 +00:00
|
|
|
fetchurl {
|
2021-11-07 20:29:51 +00:00
|
|
|
name = "sublimetext-${version}.tar.bz2";
|
2021-04-05 01:41:37 +00:00
|
|
|
urls = [
|
2021-11-07 20:29:51 +00:00
|
|
|
"http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%20${version}.tar.bz2"
|
|
|
|
"https://download.sublimetext.com/Sublime%20Text%20${version}.tar.bz2"
|
2018-12-13 16:16:52 +00:00
|
|
|
];
|
2013-09-02 18:26:25 +00:00
|
|
|
sha256 = "026g5mppk28lzzzn9ibykcqkrd5msfmg0sc0z8w8jd7v3h28wcq7";
|
2012-11-11 12:21:33 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
fetchurl {
|
2021-11-07 20:29:51 +00:00
|
|
|
name = "sublimetext-${version}.tar.bz2";
|
2021-04-05 01:41:37 +00:00
|
|
|
urls = [
|
2021-11-07 20:29:51 +00:00
|
|
|
"http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%20${version}.tar.bz2"
|
|
|
|
"https://download.sublimetext.com/Sublime%20Text%20${version}%20x64.tar.bz2"
|
2018-12-13 16:16:52 +00:00
|
|
|
];
|
2013-09-02 18:26:25 +00:00
|
|
|
sha256 = "115b71nbv9mv8cz6bkjwpbdf2ywnjc1zy2d3080f6ck4sqqfvfh1";
|
2012-11-11 12:21:33 +00:00
|
|
|
};
|
2012-11-10 19:37:42 +00:00
|
|
|
buildCommand = ''
|
|
|
|
tar xvf ${src}
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mv Sublime* $out/sublime
|
|
|
|
ln -s $out/sublime/sublime_text $out/bin/sublime
|
2014-01-25 20:45:08 +00:00
|
|
|
ln -s $out/sublime/sublime_text $out/bin/sublime2
|
2012-11-10 19:37:42 +00:00
|
|
|
|
|
|
|
echo ${libPath}
|
|
|
|
patchelf \
|
2014-12-17 18:11:30 +00:00
|
|
|
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2024-11-07 09:43:39 +00:00
|
|
|
--set-rpath ${libPath}:${lib.getLib stdenv.cc.cc}/lib${lib.optionalString stdenv.hostPlatform.is64bit "64"} \
|
2012-11-10 19:37:42 +00:00
|
|
|
$out/sublime/sublime_text
|
2016-05-25 23:24:50 +00: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 19:37:42 +00:00
|
|
|
'';
|
|
|
|
|
2016-05-25 23:24:50 +00:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "sublime2";
|
|
|
|
exec = "sublime2 %F";
|
|
|
|
comment = meta.description;
|
|
|
|
desktopName = "Sublime Text";
|
|
|
|
genericName = "Text Editor";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "TextEditor" "Development" ];
|
2016-05-25 23:24:50 +00:00
|
|
|
icon = "sublime_text";
|
|
|
|
};
|
|
|
|
|
2012-11-10 19:37:42 +00:00
|
|
|
meta = {
|
2013-10-06 09:49:53 +00:00
|
|
|
description = "Sophisticated text editor for code, markup and prose";
|
2021-01-15 13:21:58 +00:00
|
|
|
license = lib.licenses.unfree;
|
2022-06-04 22:19:25 +00:00
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
2018-05-03 05:58:11 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
2012-11-10 19:37:42 +00:00
|
|
|
};
|
|
|
|
}
|