Hi; I'm trying to update the emacs-snapshot package to a more recent pretest of version 24.
At first I tried simply updating the URL of the tarball, but that
resulted in "impure path `/usr/lib64/crt1.o' used in link" when I
tested it with nix-build. I did some digging and found out that this
problem had been encountered earlier in the emacs23 package, and that
it had been fixed in r16591. That change added lines like this to builder.sh:
for i in src/s/*.h src/m/*.h; do
substituteInPlace $i \
--replace /usr/${glibclibdir}/crt1.o $libc/${glibclibdir}/crt1.o \
--replace /usr/${glibclibdir}/crti.o $libc/${glibclibdir}/crti.o \
--replace /usr/${glibclibdir}/crtn.o $libc/${glibclibdir}/crtn.o \
--replace /usr/lib/crt1.o $libc/${glibclibdir}/crt1.o \
--replace /usr/lib/crti.o $libc/${glibclibdir}/crti.o \
--replace /usr/lib/crtn.o $libc/${glibclibdir}/crtn.o
done
So I took the builder.sh from emacs23 and copied it over to emacs-snapshot.
However, the problem persists. I don't know enough about make or gcc
to diagnose further, though I suppose my guess would be that the list
of files substituted in the for loop needs to be expanded.
I've attached both my patch and the last few lines of output from the
nix-build invocation.
thanks!
Phil
>From 6fafb0ab44b94c25908c843e9eaba788890c8d57 Mon Sep 17 00:00:00 2001 From: Phil Hagelberg <[email protected]> Date: Tue, 10 Jan 2012 13:41:51 -0800 Subject: [PATCH] Update emacs-snapshot to latest trunk. --- .../applications/editors/emacs-snapshot/builder.sh | 21 ++++++++++++++++--- .../editors/emacs-snapshot/default.nix | 18 +++++++--------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/editors/emacs-snapshot/builder.sh b/pkgs/applications/editors/emacs-snapshot/builder.sh index 677311c..d04e7a4 100644 --- a/pkgs/applications/editors/emacs-snapshot/builder.sh +++ b/pkgs/applications/editors/emacs-snapshot/builder.sh @@ -1,16 +1,29 @@ source $stdenv/setup +# This hook is supposed to be run on Linux. It patches the proper locations of +# the crt{1,i,n}.o files into the build to ensure that Emacs is linked with +# *our* versions, not the ones found in the system, as it would do by default. +# On other platforms, this appears to be unnecessary. preConfigure() { + case "${system}" in + x86_64-linux) glibclibdir=lib64 ;; + i686-linux) glibclibdir=lib ;; + *) return; + esac + libc=$(cat ${NIX_GCC}/nix-support/orig-libc) echo "libc: $libc" for i in src/s/*.h src/m/*.h; do substituteInPlace $i \ - --replace /usr/lib/crt1.o $libc/lib/crt1.o \ - --replace /usr/lib/crti.o $libc/lib/crti.o \ - --replace /usr/lib/crtn.o $libc/lib/crtn.o + --replace /usr/${glibclibdir}/crt1.o $libc/${glibclibdir}/crt1.o \ + --replace /usr/${glibclibdir}/crti.o $libc/${glibclibdir}/crti.o \ + --replace /usr/${glibclibdir}/crtn.o $libc/${glibclibdir}/crtn.o \ + --replace /usr/lib/crt1.o $libc/${glibclibdir}/crt1.o \ + --replace /usr/lib/crti.o $libc/${glibclibdir}/crti.o \ + --replace /usr/lib/crtn.o $libc/${glibclibdir}/crtn.o done - + for i in Makefile.in ./src/Makefile.in ./lib-src/Makefile.in ./leim/Makefile.in; do substituteInPlace $i --replace /bin/pwd pwd done diff --git a/pkgs/applications/editors/emacs-snapshot/default.nix b/pkgs/applications/editors/emacs-snapshot/default.nix index d190a58..baa6b54 100644 --- a/pkgs/applications/editors/emacs-snapshot/default.nix +++ b/pkgs/applications/editors/emacs-snapshot/default.nix @@ -4,7 +4,7 @@ , xaw3dSupport ? false , gtkGUI ? false , xftSupport ? false -, stdenv, fetchcvs, ncurses, x11, libXaw ? null, libXpm ? null, Xaw3d ? null +, stdenv, fetchurl, ncurses, x11, libXaw ? null, libXpm ? null, Xaw3d ? null , pkgconfig ? null, gtk ? null, libXft ? null, dbus ? null , libpng, libjpeg, libungif, libtiff, texinfo , autoconf, automake @@ -17,17 +17,15 @@ assert xaw3dSupport -> Xaw3d != null; assert gtkGUI -> pkgconfig != null && gtk != null; assert xftSupport -> libXft != null && libpng != null; # libpng = probably a bug -let date = "2009-06-26"; in +let rev = "d833e64735d65990ee03e8c74f349f3650489b6a"; in stdenv.mkDerivation { - name = "emacs-snapshot-23-${date}"; + name = "emacs-snapshot-24-${rev}"; builder = ./builder.sh; - src = fetchcvs { - inherit date; - cvsRoot = ":pserver:[email protected]:/sources/emacs"; - module = "emacs"; - sha256 = "bf9b21a0634f45474a1ce91e6153ced69194f1e9c0acd6626a931198f4a5972f"; + src = fetchurl { + url = "http://git.savannah.gnu.org/cgit/emacs.git/snapshot/emacs-${rev}.tar.gz"; + sha256 = "1d2a5f28dirhij2frvk2n4wdb8lbnrjhf5wdzjgpck4avsp8icmw"; }; preConfigure = "autoreconf -vfi"; @@ -49,8 +47,8 @@ stdenv.mkDerivation { "; meta = { - description = "GNU Emacs with Unicode, GTK and Xft support (23.x alpha)"; - homepage = http://www.emacswiki.org/cgi-bin/wiki/XftGnuEmacs; + description = "GNU Emacs 24 pretest, the extensible, customizable text editor"; + homepage = http://www.gnu.org/software/emacs/; license = "GPLv3+"; maintainers = [ stdenv.lib.maintainers.ludo ]; platforms = stdenv.lib.platforms.linux; # GTK & co. are needed. -- 1.7.2.5
impure-crt1.log
Description: Binary data
_______________________________________________ nix-dev mailing list [email protected] http://lists.science.uu.nl/mailman/listinfo/nix-dev
