2014-06-07 11:45:33 +01:00
|
|
|
{ stdenv, fetchurl, buildEnv, makeDesktopItem, makeWrapper, zlib, glib, alsaLib
|
|
|
|
, dbus, gtk, atk, pango, freetype, fontconfig, libgnome_keyring3, gdk_pixbuf
|
2015-10-27 08:02:12 +00:00
|
|
|
, gvfs, cairo, cups, expat, libgpgerror, nspr, gconf, nss, xorg, libcap, systemd
|
2014-06-07 11:45:33 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
atomEnv = buildEnv {
|
|
|
|
name = "env-atom";
|
|
|
|
paths = [
|
2015-01-15 04:25:26 +00:00
|
|
|
stdenv.cc.cc zlib glib dbus gtk atk pango freetype libgnome_keyring3
|
2014-06-07 11:45:33 +01:00
|
|
|
fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gconf nss
|
2015-09-15 10:26:18 +01:00
|
|
|
xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst
|
|
|
|
xorg.libXcomposite xorg.libXi xorg.libXfixes xorg.libXrandr
|
|
|
|
xorg.libXcursor libcap systemd
|
2014-06-07 11:45:33 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "atom-${version}";
|
2016-02-09 14:26:11 +00:00
|
|
|
version = "1.4.3";
|
2014-06-07 11:45:33 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2014-09-18 20:51:19 +01:00
|
|
|
url = "https://github.com/atom/atom/releases/download/v${version}/atom-amd64.deb";
|
2016-02-09 14:26:11 +00:00
|
|
|
sha256 = "15ix5ww3ny5ylgmmxpkc32li6af2vc4a2p6aymx9c472fra0c41x";
|
2014-09-18 20:51:19 +01:00
|
|
|
name = "${name}.deb";
|
2014-06-07 11:45:33 +01:00
|
|
|
};
|
|
|
|
|
2015-10-27 08:02:12 +00:00
|
|
|
buildInputs = [ atomEnv gvfs makeWrapper ];
|
2014-06-07 11:45:33 +01:00
|
|
|
|
2014-09-18 20:51:19 +01:00
|
|
|
phases = [ "installPhase" "fixupPhase" ];
|
2014-06-07 11:45:33 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
2014-09-18 20:51:19 +01:00
|
|
|
mkdir -p $out
|
|
|
|
ar p $src data.tar.gz | tar -C $out -xz ./usr
|
2015-06-19 22:10:05 +01:00
|
|
|
substituteInPlace $out/usr/share/applications/atom.desktop \
|
|
|
|
--replace /usr/share/atom $out/bin
|
2014-09-18 20:51:19 +01:00
|
|
|
mv $out/usr/* $out/
|
2015-06-19 22:10:05 +01:00
|
|
|
rm -r $out/share/lintian
|
2014-09-18 20:51:19 +01:00
|
|
|
rm -r $out/usr/
|
2014-12-17 18:11:30 +00:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2014-06-07 11:45:33 +01:00
|
|
|
$out/share/atom/atom
|
2014-12-17 18:11:30 +00:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2015-03-12 16:41:41 +00:00
|
|
|
$out/share/atom/resources/app/apm/bin/node
|
2014-09-18 20:51:19 +01:00
|
|
|
wrapProgram $out/bin/atom \
|
2015-10-27 08:02:12 +00:00
|
|
|
--prefix "LD_LIBRARY_PATH" : "${atomEnv}/lib:${atomEnv}/lib64" \
|
|
|
|
--prefix "PATH" : "${gvfs}/bin"
|
2014-11-23 13:18:55 +00:00
|
|
|
wrapProgram $out/bin/apm \
|
|
|
|
--prefix "LD_LIBRARY_PATH" : "${atomEnv}/lib:${atomEnv}/lib64"
|
2014-06-07 11:45:33 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A hackable text editor for the 21st Century";
|
|
|
|
homepage = https://atom.io/;
|
2015-05-28 18:20:29 +01:00
|
|
|
license = licenses.mit;
|
2014-06-07 11:45:33 +01:00
|
|
|
maintainers = [ maintainers.offline ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|