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
|
2014-09-18 20:51:19 +01:00
|
|
|
, cairo, cups, expat, libgpgerror, nspr, gconf, nss, xlibs, libcap
|
2014-06-07 11:45:33 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
atomEnv = buildEnv {
|
|
|
|
name = "env-atom";
|
|
|
|
paths = [
|
|
|
|
stdenv.gcc.gcc zlib glib dbus gtk atk pango freetype libgnome_keyring3
|
|
|
|
fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gconf nss
|
|
|
|
xlibs.libXrender xlibs.libX11 xlibs.libXext xlibs.libXdamage xlibs.libXtst
|
2014-09-18 20:51:19 +01:00
|
|
|
xlibs.libXcomposite xlibs.libXi xlibs.libXfixes xlibs.libXrandr
|
|
|
|
xlibs.libXcursor libcap
|
2014-06-07 11:45:33 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "atom-${version}";
|
2014-10-24 09:37:31 +01:00
|
|
|
version = "0.139.0";
|
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";
|
2014-10-24 09:37:31 +01:00
|
|
|
sha256 = "0732s4r9qx0sgsnz415z5r9685scly2084q80kz2xw0d2gfx04xr";
|
2014-09-18 20:51:19 +01:00
|
|
|
name = "${name}.deb";
|
2014-06-07 11:45:33 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ atomEnv makeWrapper ];
|
|
|
|
|
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
|
|
|
|
mv $out/usr/* $out/
|
|
|
|
rm -r $out/usr/
|
2014-06-07 11:45:33 +01:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
|
|
|
$out/share/atom/atom
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
|
|
|
$out/share/atom/resources/app/apm/node_modules/atom-package-manager/bin/node
|
2014-09-18 20:51:19 +01:00
|
|
|
wrapProgram $out/bin/atom \
|
2014-06-07 11:45:33 +01:00
|
|
|
--prefix "LD_LIBRARY_PATH" : "${atomEnv}/lib:${atomEnv}/lib64"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A hackable text editor for the 21st Century";
|
|
|
|
homepage = https://atom.io/;
|
|
|
|
license = [ licenses.mit ];
|
|
|
|
maintainers = [ maintainers.offline ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|