diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix index 4a729ba3da3f..e10be4ab22d6 100644 --- a/pkgs/applications/editors/emacs/default.nix +++ b/pkgs/applications/editors/emacs/default.nix @@ -6,6 +6,7 @@ , withGTK2 ? true, gtk2 ? null , withGTK3 ? false, gtk3 ? null , withXwidgets ? false, webkitgtk24x ? null, wrapGAppsHook ? null, glib_networking ? null +, withCsrc ? true , srcRepo ? false, autoconf ? null, automake ? null, texinfo ? null }: @@ -31,7 +32,8 @@ stdenv.mkDerivation rec { sha256 = "0cwgyiyymnx4xdg99dm2drfxcyhy2jmyf0rkr9fwj9mwwf77kwhr"; }; - patches = lib.optional stdenv.isDarwin ./at-fdcwd.patch; + patches = lib.optional stdenv.isDarwin ./at-fdcwd.patch + ++ lib.optional withCsrc ./install-C-src.patch; nativeBuildInputs = [ pkgconfig ] ++ lib.optionals srcRepo [ autoconf automake texinfo ]; diff --git a/pkgs/applications/editors/emacs/install-C-src.patch b/pkgs/applications/editors/emacs/install-C-src.patch new file mode 100644 index 000000000000..eb980d3e0789 --- /dev/null +++ b/pkgs/applications/editors/emacs/install-C-src.patch @@ -0,0 +1,33 @@ +diff --git a/Makefile.in b/Makefile.in +index 7aac403..c21a396 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -563,7 +563,7 @@ set_installuser= + ## work correctly, and therefore no idea when tar can be replaced. + ## See also these comments from 2004 about cp -r working fine: + ## http://lists.gnu.org/archive/html/autoconf-patches/2004-11/msg00005.html +-install-arch-indep: lisp install-info install-man ${INSTALL_ARCH_INDEP_EXTRA} ++install-arch-indep: lisp install-info install-man ${INSTALL_ARCH_INDEP_EXTRA} tags + -set ${COPYDESTS} ; \ + unset CDPATH; \ + $(set_installuser); \ +@@ -617,6 +617,19 @@ install-arch-indep: + done; \ + ${GZIP_PROG} -9n "../etc/publicsuffix.txt"; \ + } ++ for d in src lwlib ; do \ ++ srcdir="$(DESTDIR)${datadir}/emacs/${version}/$$d" ; \ ++ mkdir -p $$srcdir ; \ ++ find $$d -name "*.[chm]" -exec cp {} $$srcdir \; ; \ ++ done ++ for d in src lisp lwlib ; do \ ++ srcdir="$(DESTDIR)${datadir}/emacs/${version}/$$d" ; \ ++ cp $$d/TAGS $$srcdir ; \ ++ echo '((nil . ((tags-file-name . "TAGS"))))' > $$srcdir/.dir-locals.el ; \ ++ done ++ mkdir -p "$(DESTDIR)${datadir}/emacs/${version}/site-lisp" ++ echo "(setq find-function-C-source-directory \"$(DESTDIR)${datadir}/emacs/${version}/src\")" \ ++ > "$(DESTDIR)${datadir}/emacs/${version}/site-lisp/site-start.el" + -chmod -R a+r "$(DESTDIR)${datadir}/emacs/${version}" ${COPYDESTS} + + ## The above chmods are needed because "umask 022; tar ..." is not