nixpkgs/pkgs/applications/editors/atom/default.nix
Gauthier POGAM--LE MONTAGNER 869bc1c07e atom: 1.14.3 -> 1.14.4
2017-03-02 13:44:47 +01:00

48 lines
1.7 KiB
Nix

{ stdenv, fetchurl, lib, makeWrapper, gvfs, atomEnv, libXScrnSaver, libxkbfile }:
stdenv.mkDerivation rec {
name = "atom-${version}";
version = "1.14.4";
src = fetchurl {
url = "https://github.com/atom/atom/releases/download/v${version}/atom-amd64.deb";
sha256 = "0b1dbhpphbsjkizii6l5cxr2pqk6bjix0amc2avk3p7ys710zazv";
name = "${name}.deb";
};
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" \
--prefix LD_PRELOAD : ${stdenv.lib.makeLibraryPath [ libXScrnSaver ]}/libXss.so.1 \
--prefix LD_PRELOAD : ${stdenv.lib.makeLibraryPath [ libxkbfile ]}/libxkbfile.so.1
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}" \
$out/share/atom/resources/app/apm/bin/node
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
$out/share/atom/resources/app.asar.unpacked/node_modules/symbols-view/vendor/ctags-linux
'';
meta = with stdenv.lib; {
description = "A hackable text editor for the 21st Century";
homepage = https://atom.io/;
license = licenses.mit;
maintainers = [ maintainers.offline maintainers.nequissimus ];
platforms = [ "x86_64-linux" ];
};
}