2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, pkgs, fetchurl, wrapGAppsHook, glib, gtk3, atomEnv }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
versions = {
|
|
|
|
atom = {
|
2021-10-04 12:37:57 +00:00
|
|
|
version = "1.58.0";
|
|
|
|
sha256 = "sha256-QxDhr4gwlS9O/lk0nfqsw5sFiPckSTFL15XtRpQh0tU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
atom-beta = {
|
2021-10-04 12:37:57 +00:00
|
|
|
version = "1.59.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
beta = 0;
|
2021-10-04 12:37:57 +00:00
|
|
|
sha256 = "sha256-s1XHR2e4JPywdLiIcjTqMRILARDthHxBeTQOCIkhmXE=";
|
2021-03-09 03:18:52 +00:00
|
|
|
broken = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
common = pname: {version, sha256, beta ? null, broken ? false}:
|
2021-01-17 00:15:33 +00:00
|
|
|
let fullVersion = version + lib.optionalString (beta != null) "-beta${toString beta}";
|
2020-04-24 23:36:52 +00:00
|
|
|
name = "${pname}-${fullVersion}";
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
inherit name;
|
|
|
|
version = fullVersion;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/atom/atom/releases/download/v${fullVersion}/atom-amd64.deb";
|
|
|
|
name = "${name}.deb";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapGAppsHook # Fix error: GLib-GIO-ERROR **: No GSettings schemas are installed on the system
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gtk3 # Fix error: GLib-GIO-ERROR **: Settings schema 'org.gtk.Settings.FileChooser' is not installed
|
|
|
|
];
|
|
|
|
|
2020-08-20 17:08:02 +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
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(
|
2021-02-05 17:12:51 +00:00
|
|
|
# needed for gio executable to be able to delete files
|
|
|
|
--prefix "PATH" : "${glib.bin}/bin"
|
2020-04-24 23:36:52 +00:00
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
postFixup = ''
|
2020-04-24 23:36:52 +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
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
$share/resources/app.asar.unpacked/node_modules/symbols-view/vendor/ctags-linux
|
|
|
|
|
|
|
|
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-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
sed -i -e "s|Exec=.*$|Exec=$out/bin/${pname}|" $out/share/applications/${pname}.desktop
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A hackable text editor for the 21st Century";
|
|
|
|
homepage = "https://atom.io/";
|
|
|
|
license = licenses.mit;
|
2020-10-11 12:50:04 +00:00
|
|
|
maintainers = with maintainers; [ offline ysndr ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.x86_64;
|
2021-03-09 03:18:52 +00:00
|
|
|
inherit broken;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
2021-01-17 00:15:33 +00:00
|
|
|
in lib.mapAttrs common versions
|