2020-09-16 20:04:04 +00:00
|
|
|
{ lib, stdenv, pkgs, fetchurl, wrapGAppsHook, glib, gtk3, atomEnv }:
|
2014-06-07 10:45:33 +00:00
|
|
|
|
2018-05-22 07:40:00 +00:00
|
|
|
let
|
2018-10-24 09:30:28 +00:00
|
|
|
versions = {
|
|
|
|
atom = {
|
2022-06-15 11:44:05 +00:00
|
|
|
version = "1.60.0";
|
|
|
|
sha256 = "sha256-XHwCWQYrnUkR0lN7/Or/Uxb53hEWmIQKkNfNSX34kaY=";
|
2018-10-24 09:30:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
atom-beta = {
|
2022-06-15 11:44:05 +00:00
|
|
|
version = "1.61.0";
|
2018-12-13 08:07:56 +00:00
|
|
|
beta = 0;
|
2022-06-15 11:44:05 +00:00
|
|
|
sha256 = "sha256-viY/is7Nh3tlIkHhUBWtgMAjD6HDiC0pyJpUjsP5pRY=";
|
2021-02-24 21:36:49 +00:00
|
|
|
broken = true;
|
2018-10-24 09:30:28 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-02-24 21:36:49 +00:00
|
|
|
common = pname: {version, sha256, beta ? null, broken ? false}:
|
2021-01-15 13:21:58 +00:00
|
|
|
let fullVersion = version + lib.optionalString (beta != null) "-beta${toString beta}";
|
2018-08-01 09:30:10 +00:00
|
|
|
name = "${pname}-${fullVersion}";
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
inherit name;
|
|
|
|
version = fullVersion;
|
2018-05-22 07:40:00 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-08-01 09:30:10 +00:00
|
|
|
url = "https://github.com/atom/atom/releases/download/v${fullVersion}/atom-amd64.deb";
|
2018-05-22 07:40:00 +00:00
|
|
|
name = "${name}.deb";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2018-08-05 14:30:30 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapGAppsHook # Fix error: GLib-GIO-ERROR **: No GSettings schemas are installed on the system
|
2018-08-05 14:34:55 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2018-08-05 14:30:30 +00:00
|
|
|
gtk3 # Fix error: GLib-GIO-ERROR **: Settings schema 'org.gtk.Settings.FileChooser' is not installed
|
|
|
|
];
|
|
|
|
|
2020-07-22 04:13:14 +00:00
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
ar p $src data.tar.xz | tar xJ ./usr/
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out
|
|
|
|
mv usr/bin usr/share $out
|
|
|
|
rm -rf $out/share/lintian
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2018-08-05 14:30:30 +00:00
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(
|
2020-09-16 20:04:04 +00:00
|
|
|
# needed for gio executable to be able to delete files
|
|
|
|
--prefix "PATH" : "${glib.bin}/bin"
|
2018-08-05 14:30:30 +00:00
|
|
|
)
|
|
|
|
'';
|
2018-05-22 07:40:00 +00:00
|
|
|
|
2020-07-22 04:13:14 +00:00
|
|
|
postFixup = ''
|
2018-05-22 07:40:00 +00:00
|
|
|
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-10 22:08:08 +00:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2018-06-26 18:56:57 +00:00
|
|
|
$share/resources/app.asar.unpacked/node_modules/symbols-view/vendor/ctags-linux
|
2018-05-22 07:40:00 +00: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" {} \;
|
2020-07-22 04:13:14 +00:00
|
|
|
|
|
|
|
sed -i -e "s|Exec=.*$|Exec=$out/bin/${pname}|" $out/share/applications/${pname}.desktop
|
2018-05-22 07:40:00 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-05-22 07:40:00 +00:00
|
|
|
description = "A hackable text editor for the 21st Century";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://atom.io/";
|
2022-06-04 22:19:25 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2018-05-22 07:40:00 +00:00
|
|
|
license = licenses.mit;
|
2020-10-08 14:20:09 +00:00
|
|
|
maintainers = with maintainers; [ offline ysndr ];
|
2018-06-10 22:08:08 +00:00
|
|
|
platforms = platforms.x86_64;
|
2021-02-24 21:36:49 +00:00
|
|
|
inherit broken;
|
2018-05-22 07:40:00 +00:00
|
|
|
};
|
|
|
|
};
|
2021-01-15 13:21:58 +00:00
|
|
|
in lib.mapAttrs common versions
|