Greetings, I'm working on updating Hugs for the Debian GNU/Linux system, and have run into the following problem. With Debian, a package installs its binaries into a temporary directory (known as DESTDIR in Debian Makefiles) and then builds an archive. When the package is installed, it unpacks that archive into the real directory structure. Now I've altered parts of the hugs makefiles to use DESTDIR, so that they install into the correct subdirectories for later packing (and I've attached a patch for that), but I run into the following problem: the program ffihugs is expecting to use the prelude already installed on the system. That is fine when installing from upstream, but since Debian uses this temporary directory, the new Prelude is not installed at this point in the installation process, and so ffihugs dies like this: ---------- /bin/cp ../include/GreenCard.h /home/ijones/usr/src/hugs/hugs98-Nov2002/debian/tmp/hugs/usr/share/hugs98/include /bin/cp HsFFI.h /home/ijones/usr/src/hugs/hugs98-Nov2002/debian/tmp/hugs/usr/share/hugs98/include ./ffihugs -N +G -W +L"../lib/exts/Storable_aux.c" HugsStorable runhugs: Error occurred Reading file "/usr/share/hugs98/lib/Prelude.hs": ERROR "/usr/share/hugs98/lib/Prelude.hs" - Prelude does not define standard type "Int8" make[1]: *** [install_libexts_ffi] Error 1 make[1]: Leaving directory `/home/ijones/usr/src/hugs/hugs98-Nov2002/src' make: *** [debian/binary-arch.stamp] Error 2 debuild: fatal error at line 456: dpkg-buildpackage failed! ---------- Is there a way you or I can alter the build system so ffihugs looks at the right place at the right time? (It looks at $DESTDIR during installation and in the correct place afterward). peace, isaac
On Tue, Feb 04, 2003 at 11:09:46AM -0500, Isaac Jones wrote:
[...] Is there a way you or I can alter the build system so ffihugs looks at the right place at the right time? (It looks at $DESTDIR during installation and in the correct place afterward).
I'd suggest cd src && HUGSDIR=$(rootdir)/usr/share/hugs98 $(MAKE) DESTDIR=$(rootdir) install The environment variable HUGSDIR is used by hugs (and ffihugs) to find files. Also, an alternative to changing the makefiles might be hugsdir=/usr/share/hugs98 configure --prefix=$(rootdir)/usr/share/hugs98 BTW, Hugs will install object files under that directory (it doesn't separate share and lib properly, and that's not trivial to fix) so you probably want lib.
Thanks for the reply, I still seem to have this problem: during the installation section of the build, ffihugs is looking in /usr/share for the libraries it thinks it just installed (Actually, it just installed them in DESTDIR). Also, it fails with an error code of 1 without an error message, but strace tells the tale (see below).
I'd suggest
cd src && HUGSDIR=$(rootdir)/usr/share/hugs98 $(MAKE) DESTDIR=$(rootdir) install
I'm not sure I understand, why would we want to set DESTDIR here? Reading my mail again, I see that I may have been unclear. ffihugs assumes that the rest of Hugs has already been installed, and so looks in /usr/share/hugs98 for files that its interested in. However, at the point that ffihugs gets executed, Hugs has only been installed in DESTDIR, not in its final installation place. Any advice? peace, isaac ... stat64("Prelude.hs", 0xeffff4b8) = -1 ENOENT (No such file or directory) stat64("Prelude.lhs", 0xeffff4b8) = -1 ENOENT (No such file or directory) stat64("/usr/share/hugs98/libraries/Prelude.hs", 0xeffff4b8) = -1 ENOENT (No such file or directory) stat64("/usr/share/hugs98/libraries/Prelude.lhs", 0xeffff4b8) = -1 ENOENT (No such file or directory) stat64("/usr/share/hugs98/oldlib/Prelude.hs", 0xeffff4b8) = -1 ENOENT (No such file or directory) stat64("/usr/share/hugs98/oldlib/Prelude.lhs", 0xeffff4b8) = -1 ENOENT (No such file or directory) exit(1)
On Wed, Feb 12, 2003 at 10:04:23PM -0500, Isaac Jones wrote:
I still seem to have this problem: during the installation section of the build, ffihugs is looking in /usr/share for the libraries it thinks it just installed (Actually, it just installed them in DESTDIR).
The following steps work for me (running Debian testing), with no alteration to any of the distributed files: tar zxf hugs98-Nov2002.tar.gz cd hugs98-Nov2002 rootdir=`pwd`/debian/tmp/hugs cd src/unix ./configure --prefix=${rootdir}/usr --enable-ffi cd .. HUGSDIR=${rootdir}/usr/lib/hugs make CFLAGS+=-DHUGSDIR='\"/usr/lib/hugs\"' install Notes: - the --prefix gets things put where you want them. - the environment variable HUGSDIR tells ffihugs where to look for files during the make. - the CPP define HUGSDIR tells hugs, runhugs and ffihugs where to look for files (unless the environment variable is set when they run). - Hugs installs its libraries in ${prefix}/lib, because it mixes object files in with the modules (a bad idea, but not trivial to fix)
participants (2)
-
Isaac Jones -
Ross Paterson