Unverified Commit e5f6200d authored by Pierre Bourdon's avatar Pierre Bourdon Committed by GitHub
Browse files

Merge pull request #258440 from SuperSandro2000/drop-atom

atom*: drop
parents 042d50a9 244be72e
Loading
Loading
Loading
Loading
+0 −96
Original line number Diff line number Diff line
{ lib, stdenv, pkgs, fetchurl, wrapGAppsHook, glib, gtk3, atomEnv }:

let
  versions = {
    atom = {
      version = "1.60.0";
      sha256 = "sha256-XHwCWQYrnUkR0lN7/Or/Uxb53hEWmIQKkNfNSX34kaY=";
    };

    atom-beta = {
      version = "1.61.0";
      beta = 0;
      sha256 = "sha256-viY/is7Nh3tlIkHhUBWtgMAjD6HDiC0pyJpUjsP5pRY=";
      broken = true;
    };
  };

  common = pname: {version, sha256, beta ? null, broken ? false}:
      let fullVersion = version + lib.optionalString (beta != null) "-beta${toString beta}";
      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
    ];

    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
    '';

    preFixup = ''
      gappsWrapperArgs+=(
        # needed for gio executable to be able to delete files
        --prefix "PATH" : "${glib.bin}/bin"
      )
    '';

    postFixup = ''
      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" {} \;

      sed -i -e "s|Exec=.*$|Exec=$out/bin/${pname}|" $out/share/applications/${pname}.desktop
    '';

    meta = with lib; {
      description = "A hackable text editor for the 21st Century";
      homepage = "https://atom.io/";
      sourceProvenance = with sourceTypes; [ binaryNativeCode ];
      license = licenses.mit;
      maintainers = with maintainers; [ offline ysndr ];
      platforms = platforms.x86_64;
      inherit broken;
    };
  };
in lib.mapAttrs common versions
+0 −23
Original line number Diff line number Diff line
{ stdenv, lib, zlib, glib, alsa-lib, dbus, gtk3, atk, pango, freetype, fontconfig
, gdk-pixbuf, cairo, cups, expat, libgpg-error, nspr
, nss, xorg, libcap, systemd, libnotify, libsecret, libuuid, at-spi2-atk
, at-spi2-core, libdbusmenu, libdrm, mesa
}:

let
  packages = [
    stdenv.cc.cc zlib glib dbus gtk3 atk pango freetype
    fontconfig gdk-pixbuf cairo cups expat libgpg-error alsa-lib nspr nss
    xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst
    xorg.libXcomposite xorg.libXi xorg.libXfixes xorg.libXrandr
    xorg.libXcursor xorg.libxkbfile xorg.libXScrnSaver libcap systemd libnotify
    xorg.libxcb libsecret libuuid at-spi2-atk at-spi2-core libdbusmenu
    libdrm
    mesa # required for libgbm
  ];

  libPathNative = lib.makeLibraryPath packages;
  libPath64 = lib.makeSearchPathOutput "lib" "lib64" packages;
  libPath = "${libPathNative}:${libPath64}";

in { inherit packages libPath; }
+38 −6
Original line number Diff line number Diff line
{ lib
, stdenv
, git
, runtimeShell
, fetchurl
, wrapGAppsHook
, alsa-lib
, at-spi2-atk
, cairo
, cups
, dbus
, expat
, gdk-pixbuf
, glib
, gtk3
, atomEnv
, mesa
, nss
, nspr
, xorg
, libdrm
, libsecret
, libxkbcommon
, hunspell
, pango
, systemd
, hunspellDicts
, useHunspell ? true
, languages ? [ "en_US" ]
, withNemoAction ? true
, makeDesktopItem
, copyDesktopItems
, makeWrapper
, asar
, python3
}:
@@ -32,13 +42,35 @@ let
    aarch64-linux.hash = "sha256-GdPnmhMZR3Y2WB2j98JEWomdKFZuTgxN8oga/tBwA4U=";
  }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");

  additionalLibs = lib.makeLibraryPath [
  newLibpath = lib.makeLibraryPath [
    alsa-lib
    at-spi2-atk
    cairo
    cups
    dbus
    expat
    gdk-pixbuf
    glib
    gtk3
    libsecret
    mesa
    nss
    nspr
    libdrm
    xorg.libX11
    xorg.libxcb
    xorg.libXcomposite
    xorg.libXdamage
    xorg.libXext
    xorg.libXfixes
    xorg.libXrandr
    xorg.libxshmfence
    libxkbcommon
    xorg.libxkbfile
    pango
    stdenv.cc.cc.lib
    systemd
  ];
  newLibpath = "${atomEnv.libPath}:${additionalLibs}";

  # Hunspell
  hunspellDirs = builtins.map (lang: "${hunspellDicts.${lang}}/share/hunspell") languages;
+2 −2
Original line number Diff line number Diff line
{ stdenv, lib, makeDesktopItem
, unzip, libsecret, libXScrnSaver, libxshmfence, buildPackages
, atomEnv, at-spi2-atk, autoPatchelfHook
, at-spi2-atk, autoPatchelfHook, alsa-lib, mesa, nss, nspr, xorg
, systemd, fontconfig, libdbusmenu, glib, buildFHSEnv, wayland
, libglvnd, libkrb5

@@ -67,7 +67,7 @@ let
    };

    buildInputs = [ libsecret libXScrnSaver libxshmfence ]
      ++ lib.optionals (!stdenv.isDarwin) ([ at-spi2-atk libkrb5 ] ++ atomEnv.packages);
      ++ lib.optionals (!stdenv.isDarwin) [ alsa-lib at-spi2-atk libkrb5 mesa nss nspr systemd xorg.libxkbfile ];

    runtimeDependencies = lib.optionals stdenv.isLinux [ (lib.getLib systemd) fontconfig.lib libdbusmenu wayland libsecret ];

+48 −24
Original line number Diff line number Diff line
@@ -4,21 +4,31 @@
, copyDesktopItems
, makeDesktopItem
, makeWrapper
, libuuid
, libunwind
, libxkbcommon
, icu
, openssl
, zlib
, curl
, at-spi2-core
, alsa-lib
, at-spi2-atk
, at-spi2-core
, cairo
, cups
, curl
, dbus
, expat
, gdk-pixbuf
, glib
, gnutar
, atomEnv
, libkrb5
, gtk3
, icu
, libdrm
, libunwind
, libuuid
, libxkbcommon
, mesa
, nspr
, nss
, openssl
, pango
, systemd
, xorg
, zlib
}:

# from justinwoo/azuredatastudio-nix
@@ -115,20 +125,34 @@ stdenv.mkDerivation rec {
  sqltoolsservicePath = "${targetPath}/resources/app/extensions/mssql/sqltoolsservice/Linux/4.7.1.6";

  rpath = lib.concatStringsSep ":" [
    atomEnv.libPath
    (
      lib.makeLibraryPath [
        libuuid
        at-spi2-core
    (lib.makeLibraryPath [
      alsa-lib
      at-spi2-atk
        stdenv.cc.cc.lib
        libkrb5
        libdrm
        libxkbcommon
      cairo
      cups
      dbus
      expat
      gdk-pixbuf
      glib
      gtk3
      mesa
      nss
      nspr
      libdrm
      xorg.libX11
      xorg.libxcb
      xorg.libXcomposite
      xorg.libXdamage
      xorg.libXext
      xorg.libXfixes
      xorg.libXrandr
      xorg.libxshmfence
      ]
    )
      libxkbcommon
      xorg.libxkbfile
      pango
      stdenv.cc.cc.lib
      systemd
    ])
    targetPath
    sqltoolsserviceRpath
  ];
Loading