nixpkgs/pkgs/applications/editors/lighttable/default.nix

66 lines
2.2 KiB
Nix
Raw Normal View History

2016-01-15 08:51:46 +00:00
{ stdenv, fetchurl, buildEnv, zlib, glib, alsaLib, makeDesktopItem
2014-07-16 22:10:08 +01:00
, dbus, gtk, atk, pango, freetype, fontconfig, libgnome_keyring3, gdk_pixbuf
, cairo, cups, expat, libgpgerror, nspr, gnome3, nss, xorg, libudev, libnotify
2014-07-16 22:10:08 +01:00
}:
let
libPath = stdenv.lib.makeLibraryPath [
stdenv.cc.cc zlib glib dbus gtk atk pango freetype libgnome_keyring3 nss
2014-07-16 22:10:08 +01:00
fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gnome3.gconf
xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst
2016-01-15 08:51:46 +00:00
xorg.libXcomposite xorg.libXi xorg.libXfixes libnotify xorg.libXrandr
xorg.libXcursor
];
desktopItem = makeDesktopItem {
name = "LightTable";
exec = "light";
comment = "LightTable";
desktopName = "LightTable";
genericName = "the next generation code editor";
};
2014-07-16 22:10:08 +01:00
in
stdenv.mkDerivation rec {
name = "lighttable-${version}";
2016-01-15 08:51:46 +00:00
version = "0.8.1";
2014-07-16 22:10:08 +01:00
2016-01-15 08:51:46 +00:00
src =
2014-07-16 22:10:08 +01:00
fetchurl {
name = "LightTableLinux64.tar.gz";
2016-01-15 08:51:46 +00:00
url = "https://github.com/LightTable/LightTable/releases/download/${version}/${name}-linux.tar.gz";
sha256 = "06fj725xfhf3fwrf7dya7ijmxq3v76kfmd4lr2067a92zhlwr5pv";
2014-07-16 22:10:08 +01:00
};
phases = [ "installPhase" ];
installPhase = ''
2016-01-15 08:51:46 +00:00
tar xf ${src}
mkdir -p $out/{bin,share/LightTable}
mv ./${name}-linux/* $out/share/LightTable
2014-07-16 22:10:08 +01:00
patchelf \
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
2016-01-15 08:51:46 +00:00
--set-rpath ${libPath}:${libPath}/lib64:$out/share/LightTable \
$out/share/LightTable/LightTable
mv $out/share/LightTable/light $out/bin/light
2014-07-16 22:10:08 +01:00
ln -sf ${libudev.out}/lib/libudev.so.1 $out/share/LightTable/libudev.so.0
2016-01-15 08:51:46 +00:00
substituteInPlace $out/bin/light \
--replace "/usr/lib/x86_64-linux-gnu" "${libudev.out}/lib" \
2016-01-15 08:51:46 +00:00
--replace "/lib/x86_64-linux-gnu" "$out/share/LightTable" \
--replace 'HERE=`dirname $(readlink -f $0)`' "HERE=$out/share/LightTable"
2014-07-16 22:10:08 +01:00
2016-01-15 08:51:46 +00:00
mkdir -p "$out"/share/applications
cp "${desktopItem}/share/applications/LightTable.desktop" "$out"/share/applications/
2014-07-16 22:10:08 +01:00
'';
meta = with stdenv.lib; {
description = "the next generation code editor";
homepage = http://www.lighttable.com/;
license = licenses.gpl3;
2016-01-15 08:51:46 +00:00
maintainers = [ maintainers.matejc ];
platforms = [ "x86_64-linux" ];
2014-07-16 22:10:08 +01:00
};
}