atom, electron, vscode: split dependencies to atomEnv

fixes #14890
This commit is contained in:
Nikolay Amiantov 2016-04-22 13:51:11 +03:00 committed by Jakob Gillich
parent b2426adf1c
commit 6185f74531
6 changed files with 52 additions and 88 deletions

View File

@ -1,20 +1,6 @@
{ stdenv, fetchurl, lib, makeDesktopItem, makeWrapper, zlib, glib, alsaLib
, dbus, gtk, atk, pango, freetype, fontconfig, libgnome_keyring3, gdk_pixbuf
, gvfs, cairo, cups, expat, libgpgerror, nspr, gconf, nss, xorg, libcap, systemd
}:
{ stdenv, fetchurl, lib, makeWrapper, gvfs, atomEnv }:
let
atomPkgs = [
stdenv.cc.cc zlib glib dbus gtk atk pango freetype libgnome_keyring3
fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gconf nss
xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst
xorg.libXcomposite xorg.libXi xorg.libXfixes xorg.libXrandr
xorg.libXcursor libcap systemd
];
atomLib = lib.makeLibraryPath atomPkgs;
atomLib64 = lib.makeSearchPathOutputs "lib64" ["lib"] atomPkgs;
in stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
name = "atom-${version}";
version = "1.6.2";
@ -26,25 +12,23 @@ in stdenv.mkDerivation rec {
nativeBuildInputs = [ makeWrapper ];
phases = [ "installPhase" "fixupPhase" ];
installPhase = ''
mkdir -p $out
buildCommand = ''
mkdir -p $out/usr/
ar p $src data.tar.gz | tar -C $out -xz ./usr
substituteInPlace $out/usr/share/applications/atom.desktop \
--replace /usr/share/atom $out/bin
mv $out/usr/* $out/
rm -r $out/share/lintian
rm -r $out/usr/
wrapProgram $out/bin/atom \
--prefix "PATH" : "${gvfs}/bin"
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${atomEnv.libPath}:$out/share/atom" \
$out/share/atom/atom
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${atomEnv.libPath}" \
$out/share/atom/resources/app/apm/bin/node
wrapProgram $out/bin/atom \
--prefix "LD_LIBRARY_PATH" : "${atomLib}:${atomLib64}" \
--prefix "PATH" : "${gvfs}/bin"
wrapProgram $out/bin/apm \
--prefix "LD_LIBRARY_PATH" : "${atomLib}:${atomLib64}"
'';
meta = with stdenv.lib; {

View File

@ -0,0 +1,19 @@
{ stdenv, lib, zlib, glib, alsaLib, dbus, gtk, atk, pango, freetype, fontconfig
, libgnome_keyring3, gdk_pixbuf, gvfs, cairo, cups, expat, libgpgerror, nspr
, gconf, nss, xorg, libcap, systemd, libnotify
}:
let
packages = [
stdenv.cc.cc zlib glib dbus gtk atk pango freetype libgnome_keyring3
fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gconf nss
xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst
xorg.libXcomposite xorg.libXi xorg.libXfixes xorg.libXrandr
xorg.libXcursor libcap systemd libnotify
];
libPathNative = lib.makeLibraryPath packages;
libPath64 = lib.makeSearchPathOutputs "lib64" ["lib"] packages;
libPath = "${libPathNative}:${libPath64}";
in { inherit packages libPath; }

View File

@ -1,10 +1,6 @@
{ stdenv, callPackage, fetchurl, unzip
, ...
} @ args:
{ stdenv, lib, callPackage, fetchurl, unzip, atomEnv }:
let
atomEnv = callPackage ../../../development/tools/electron/env-atom.nix (args);
version = "0.10.10";
rev = "5b5f4db87c10345b9d5c8d0bed745bcad4533135";
sha256 = if stdenv.system == "i686-linux" then "1mmgq4fxi2h4hvz7yxgzzyvlznkb42qwr8i1g2b1akdlgnrvvpby"
@ -30,21 +26,16 @@ in
buildInputs = [ unzip ];
installPhase = ''
mkdir -p $out/bin
cp -r ./* $out/bin
${if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then ''
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
$out/bin/code
'' else ""}
mkdir -p $out/lib/vscode $out/bin
cp -r ./* $out/lib/vscode
ln -s $out/lib/vscode/code $out/bin
'';
postFixup = ''
${if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then ''
patchelf \
--set-rpath "${atomEnv}/lib:${atomEnv}/lib64:$out/bin:$(patchelf --print-rpath $out/bin/code)" \
$out/bin/code
'' else ""}
fixupPhase = lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") ''
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${atomEnv.libPath}:$out/lib/vscode" \
$out/lib/vscode/code
'';
meta = with stdenv.lib; {

View File

@ -1,10 +1,6 @@
{ stdenv, callPackage, fetchurl, unzip
, ...
} @ args:
{ stdenv, lib, callPackage, fetchurl, unzip, atomEnv }:
let
atomEnv = callPackage ./env-atom.nix (args);
in stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
name = "electron-${version}";
version = "0.36.2";
@ -14,23 +10,17 @@ in stdenv.mkDerivation rec {
name = "${name}.zip";
};
buildInputs = [ atomEnv unzip ];
buildInputs = [ unzip ];
phases = [ "installPhase" "fixupPhase" ];
buildCommand = ''
mkdir -p $out/lib/electron $out/bin
unzip -d $out/lib/electron $src
ln -s $out/lib/electron/electron $out/bin
unpackCmd = "unzip";
installPhase = ''
mkdir -p $out/bin
unzip -d $out/bin $src
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
$out/bin/electron
'';
postFixup = ''
patchelf \
--set-rpath "${atomEnv}/lib:${atomEnv}/lib64:$out/bin:$(patchelf --print-rpath $out/bin/electron)" \
$out/bin/electron
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${atomEnv.libPath}:$out/lib/electron" \
$out/lib/electron/electron
'';
meta = with stdenv.lib; {

View File

@ -1,17 +0,0 @@
{ stdenv, buildEnv, zlib, glib, alsaLib
, dbus, gtk, atk, pango, freetype, fontconfig, libgnome_keyring3, gdk_pixbuf
, cairo, cups, expat, libgpgerror, nspr, gconf, nss, xorg, libcap
, systemd, libnotify
, ...
}:
buildEnv {
name = "env-atom";
paths = [
stdenv.cc.cc zlib glib dbus gtk atk pango freetype libgnome_keyring3
fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gconf nss
xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst
xorg.libXcomposite xorg.libXi xorg.libXfixes xorg.libXrandr
xorg.libXcursor libcap systemd libnotify
];
}

View File

@ -5700,10 +5700,7 @@ in
astyle = callPackage ../development/tools/misc/astyle { };
electron = callPackage ../development/tools/electron {
gconf = pkgs.gnome.GConf;
};
electron = callPackage ../development/tools/electron { };
autobuild = callPackage ../development/tools/misc/autobuild { };
@ -11647,10 +11644,12 @@ in
artha = callPackage ../applications/misc/artha { };
atom = callPackage ../applications/editors/atom {
atomEnv = callPackage ../applications/editors/atom/env.nix {
gconf = gnome.GConf;
};
atom = callPackage ../applications/editors/atom { };
aseprite = callPackage ../applications/editors/aseprite {
giflib = giflib_4_1;
};
@ -14253,9 +14252,7 @@ in
vorbis-tools = callPackage ../applications/audio/vorbis-tools { };
vscode = callPackage ../applications/editors/vscode {
gconf = pkgs.gnome.GConf;
};
vscode = callPackage ../applications/editors/vscode { };
vue = callPackage ../applications/misc/vue { };