2016-11-10 00:54:13 +00:00
|
|
|
{ stdenv, fetchurl, lib, makeWrapper, gvfs, atomEnv, libXScrnSaver, libxkbfile }:
|
2014-06-07 11:45:33 +01:00
|
|
|
|
2016-04-22 11:51:11 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2014-06-07 11:45:33 +01:00
|
|
|
name = "atom-${version}";
|
2016-11-11 02:05:55 +00:00
|
|
|
version = "1.12.1";
|
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-11-11 02:05:55 +00:00
|
|
|
sha256 = "0v7qlqkpq5zymn0ww35ywkh0vzm2mfpah18nqrc0rx0kvxr0xzqj";
|
2014-09-18 20:51:19 +01:00
|
|
|
name = "${name}.deb";
|
2014-06-07 11:45:33 +01:00
|
|
|
};
|
|
|
|
|
2016-04-13 16:30:38 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2014-06-07 11:45:33 +01:00
|
|
|
|
2016-04-22 11:51:11 +01:00
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/usr/
|
2014-09-18 20:51:19 +01:00
|
|
|
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/
|
2016-04-22 11:51:11 +01:00
|
|
|
wrapProgram $out/bin/atom \
|
2016-11-10 00:54:13 +00:00
|
|
|
--prefix "PATH" : "${gvfs}/bin" \
|
|
|
|
--prefix LD_PRELOAD : ${stdenv.lib.makeLibraryPath [ libXScrnSaver ]}/libXss.so.1 \
|
|
|
|
--prefix LD_PRELOAD : ${stdenv.lib.makeLibraryPath [ libxkbfile ]}/libxkbfile.so.1
|
2016-04-22 11:51:11 +01:00
|
|
|
|
2016-04-22 15:44:30 +01:00
|
|
|
fixupPhase
|
|
|
|
|
2014-12-17 18:11:30 +00:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2016-04-22 11:51:11 +01:00
|
|
|
--set-rpath "${atomEnv.libPath}:$out/share/atom" \
|
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)" \
|
2016-04-22 11:51:11 +01:00
|
|
|
--set-rpath "${atomEnv.libPath}" \
|
2015-03-12 16:41:41 +00:00
|
|
|
$out/share/atom/resources/app/apm/bin/node
|
2016-05-30 03:12:26 +01:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
$out/share/atom/resources/app.asar.unpacked/node_modules/symbols-view/vendor/ctags-linux
|
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;
|
2016-02-15 19:58:46 +00:00
|
|
|
maintainers = [ maintainers.offline maintainers.nequissimus ];
|
2014-06-07 11:45:33 +01:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|