2018-08-05 16:34:55 +02:00
|
|
|
{ stdenv, pkgs, fetchurl, makeWrapper, wrapGAppsHook, gvfs, gtk3, atomEnv }:
|
2014-06-07 12:45:33 +02:00
|
|
|
|
2018-05-22 09:40:00 +02:00
|
|
|
let
|
2018-10-24 11:30:28 +02:00
|
|
|
versions = {
|
|
|
|
atom = {
|
2018-11-01 20:09:24 +01:00
|
|
|
version = "1.32.1";
|
|
|
|
sha256 = "1x22jbhvagqw9mvq0v7z4z09qp727vl0rkyvaxn98xnj9gvcfkq9";
|
2018-10-24 11:30:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
atom-beta = {
|
2018-10-24 11:33:20 +02:00
|
|
|
version = "1.33.0";
|
2018-11-01 20:09:24 +01:00
|
|
|
beta = 1;
|
|
|
|
sha256 = "0sf98apmb57msgr5p1xly0mffzn2s808nsfsmbisk4qqmm9fv2m3";
|
2018-10-24 11:30:28 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-08-01 11:30:10 +02:00
|
|
|
common = pname: {version, sha256, beta ? null}:
|
|
|
|
let fullVersion = version + stdenv.lib.optionalString (beta != null) "-beta${toString beta}";
|
|
|
|
name = "${pname}-${fullVersion}";
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
inherit name;
|
|
|
|
version = fullVersion;
|
2018-05-22 09:40:00 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-08-01 11:30:10 +02:00
|
|
|
url = "https://github.com/atom/atom/releases/download/v${fullVersion}/atom-amd64.deb";
|
2018-05-22 09:40:00 +02:00
|
|
|
name = "${name}.deb";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2018-08-05 16:30:30 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapGAppsHook # Fix error: GLib-GIO-ERROR **: No GSettings schemas are installed on the system
|
2018-08-05 16:34:55 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2018-08-05 16:30:30 +02:00
|
|
|
gtk3 # Fix error: GLib-GIO-ERROR **: Settings schema 'org.gtk.Settings.FileChooser' is not installed
|
|
|
|
];
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(
|
|
|
|
--prefix "PATH" : "${gvfs}/bin" \
|
|
|
|
)
|
|
|
|
'';
|
2018-05-22 09:40:00 +02:00
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/usr/
|
|
|
|
ar p $src data.tar.xz | tar -C $out -xJ ./usr
|
|
|
|
substituteInPlace $out/usr/share/applications/${pname}.desktop \
|
|
|
|
--replace /usr/share/${pname} $out/bin
|
|
|
|
mv $out/usr/* $out/
|
|
|
|
rm -r $out/share/lintian
|
|
|
|
rm -r $out/usr/
|
2018-06-29 15:10:17 +02:00
|
|
|
sed -i "s/${pname})/.${pname}-wrapped)/" $out/bin/${pname}
|
2018-05-22 09:40:00 +02:00
|
|
|
|
|
|
|
fixupPhase
|
|
|
|
|
|
|
|
share=$out/share/${pname}
|
|
|
|
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath "${atomEnv.libPath}:$share" \
|
|
|
|
$share/atom
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath "${atomEnv.libPath}" \
|
|
|
|
$share/resources/app/apm/bin/node
|
2018-06-11 00:08:08 +02:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2018-06-26 20:56:57 +02:00
|
|
|
$share/resources/app.asar.unpacked/node_modules/symbols-view/vendor/ctags-linux
|
2018-05-22 09:40:00 +02:00
|
|
|
|
|
|
|
dugite=$share/resources/app.asar.unpacked/node_modules/dugite
|
|
|
|
rm -f $dugite/git/bin/git
|
|
|
|
ln -s ${pkgs.git}/bin/git $dugite/git/bin/git
|
|
|
|
rm -f $dugite/git/libexec/git-core/git
|
|
|
|
ln -s ${pkgs.git}/bin/git $dugite/git/libexec/git-core/git
|
|
|
|
|
|
|
|
find $share -name "*.node" -exec patchelf --set-rpath "${atomEnv.libPath}:$share" {} \;
|
|
|
|
|
|
|
|
paxmark m $share/atom
|
|
|
|
paxmark m $share/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;
|
|
|
|
maintainers = with maintainers; [ offline nequissimus synthetica ysndr ];
|
2018-06-11 00:08:08 +02:00
|
|
|
platforms = platforms.x86_64;
|
2018-05-22 09:40:00 +02:00
|
|
|
};
|
|
|
|
};
|
2018-10-24 11:30:28 +02:00
|
|
|
in stdenv.lib.mapAttrs common versions
|