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

44 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, lib, makeWrapper, gvfs, atomEnv }:
stdenv.mkDerivation rec {
name = "atom-${version}";
2016-04-02 16:20:13 +02:00
version = "1.6.2";
src = fetchurl {
url = "https://github.com/atom/atom/releases/download/v${version}/atom-amd64.deb";
2016-04-02 16:20:13 +02:00
sha256 = "1kl2pc0smacn4lgk5wwlaiw03rm8b0763vaisgp843p35zzsbc9n";
name = "${name}.deb";
};
2016-04-13 17:30:38 +02:00
nativeBuildInputs = [ makeWrapper ];
buildCommand = ''
mkdir -p $out/usr/
ar p $src data.tar.gz | tar -C $out -xz ./usr
substituteInPlace $out/usr/share/applications/atom.desktop \
--replace /usr/share/atom $out/bin
mv $out/usr/* $out/
rm -r $out/share/lintian
rm -r $out/usr/
wrapProgram $out/bin/atom \
--prefix "PATH" : "${gvfs}/bin"
fixupPhase
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${atomEnv.libPath}:$out/share/atom" \
$out/share/atom/atom
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${atomEnv.libPath}" \
2015-03-12 17:41:41 +01:00
$out/share/atom/resources/app/apm/bin/node
'';
meta = with stdenv.lib; {
description = "A hackable text editor for the 21st Century";
homepage = https://atom.io/;
license = licenses.mit;
2016-02-15 20:58:46 +01:00
maintainers = [ maintainers.offline maintainers.nequissimus ];
platforms = [ "x86_64-linux" ];
};
}