diff options
author | Peter Hoeg <peter@hoeg.com> | 2019-10-18 23:38:28 +0800 |
---|---|---|
committer | Peter Hoeg <peter@hoeg.com> | 2019-10-18 23:38:28 +0800 |
commit | 4487809902c684a97fb19a7b41158968027e4ec0 (patch) | |
tree | 675b399a90f20f37bf2dc5955a4d6c33c22f70f4 | |
parent | 1c40ee6fc44f7eb474c69ea070a43247a1a2c83c (diff) | |
download | nixpkgs-4487809902c684a97fb19a7b41158968027e4ec0.tar nixpkgs-4487809902c684a97fb19a7b41158968027e4ec0.tar.gz nixpkgs-4487809902c684a97fb19a7b41158968027e4ec0.tar.bz2 nixpkgs-4487809902c684a97fb19a7b41158968027e4ec0.tar.lz nixpkgs-4487809902c684a97fb19a7b41158968027e4ec0.tar.xz nixpkgs-4487809902c684a97fb19a7b41158968027e4ec0.tar.zst nixpkgs-4487809902c684a97fb19a7b41158968027e4ec0.zip |
emacsPackages.vterm: fix dynamic library and autoloaders
We need both the .so as well as the proper autoloaders that are generated when we build an emacs package, so we cannot use the normal stdenv.mkDerivation but have to inject the building of the libraries instead. Also, use the proper libvterm-neovim we have in nixpkgs instead of vendoring it.
-rw-r--r-- | pkgs/applications/editors/emacs-modes/melpa-packages.nix | 56 |
1 files changed, 13 insertions, 43 deletions
diff --git a/pkgs/applications/editors/emacs-modes/melpa-packages.nix b/pkgs/applications/editors/emacs-modes/melpa-packages.nix index 838e57343c4..39920b755f8 100644 --- a/pkgs/applications/editors/emacs-modes/melpa-packages.nix +++ b/pkgs/applications/editors/emacs-modes/melpa-packages.nix @@ -385,52 +385,22 @@ env NIXPKGS_ALLOW_BROKEN=1 nix-instantiate --show-trace ../../../../ -A emacsPac (attrs.nativeBuildInputs or []) ++ [ external.git ]; }); - vterm = let - emacsSources = pkgs.stdenv.mkDerivation { - name = self.emacs.name + "-sources"; - src = self.emacs.src; - - dontConfigure = true; - dontBuild = true; - doCheck = false; - fixupPhase = ":"; - - installPhase = '' - mkdir -p $out - cp -a * $out - ''; - - }; - - libvterm = pkgs.libvterm-neovim.overrideAttrs(old: rec { - pname = "libvterm-neovim"; - version = "2019-04-27"; - name = pname + "-" + version; - src = pkgs.fetchFromGitHub { - owner = "neovim"; - repo = "libvterm"; - rev = "89675ffdda615ffc3f29d1c47a933f4f44183364"; - sha256 = "0l9ixbj516vl41v78fi302ws655xawl7s94gmx1kb3fmfgamqisy"; - }; - }); - - in pkgs.stdenv.mkDerivation { - inherit (super.vterm) name version src; - - nativeBuildInputs = [ pkgs.cmake ]; - buildInputs = [ self.emacs libvterm ]; - + vterm = super.vterm.overrideAttrs(old: { + buildInputs = old.buildInputs ++ [ self.emacs pkgs.cmake pkgs.libvterm-neovim ]; cmakeFlags = [ - "-DEMACS_SOURCE=${emacsSources}" - "-DUSE_SYSTEM_LIBVTERM=True" + "-DEMACS_SOURCE=${self.emacs.src}" + "-DUSE_SYSTEM_LIBVTERM=ON" ]; - - installPhase = '' - install -d $out/share/emacs/site-lisp - install ../*.el $out/share/emacs/site-lisp - install ../*.so $out/share/emacs/site-lisp + # we need the proper out directory to exist, so we do this in the + # postInstall instead of postBuild + postInstall = '' + pushd source/build >/dev/null + make + install -m444 -t $out/share/emacs/site-lisp/elpa/vterm-** ../*.so + popd > /dev/null + rm -rf $out/share/emacs/site-lisp/elpa/vterm-**/{CMake*,build,*.c,*.h} ''; - }; + }); # Legacy alias emacs-libvterm = unstable.vterm; |