[racket-dev] advice on the 6.x build system.

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sat Oct 18 11:16:36 EDT 2014

At Fri, 17 Oct 2014 17:56:51 +0200, David Bremner wrote:
> Matthew Flatt <mflatt at cs.utah.edu> writes:
> 
> >
> > Meanwhile, I haven't answered your original question. Can you remind me
> > of the specific steps that I'd need to follow to try the script that
> > you sent before?
> 
> With your indulgence, I'll just answer this part now. I have re-included
> the Makefile as an attachment, since make is fussy about whitespace.
> 
> Save the attached file to e.g. /tmp/test.mk
> 
> In a recent checkout of the release branch, 
> 
> % make -f /tmp/test.mk build-indep-stamp
> 
> the resulting build of racket will be in test-dest, in the top level
> directory of racket. For me, test-dest/usr/bin only has racket and raco
> in it.

The problem is that `make install` works with a configuration whose
paths are based on DESTDIR, but as its final act it rewrites
"config.rktd" and other files to strip away DESTDIR. That rewrite tells
the later use of `raco pkg install` to put binaries in the DESTDIRless
path (i.e., "/usr/bin"), and so on. It's a kind of bad luck that `raco
pkg install` runs at all, since it could depend on the DESTDIRless pass
in any number of ways, such as an embedded path in a shared library.

If you really want to go this way, I could extend the makefile to let
you supply a command that runs before the path-fixup step of `make
install`. Then, your "test.mk" would look more like this:

build-arch-stamp: ${base_build_dir}/Makefile
	$(MAKE) -C ${base_build_dir} 
	$(MAKE) -C ${base_build_dir} DESTDIR=${destdir} install \
          FINAL_PREP_CMD="cd $(CURDIR) \
                          && $(MAKE) RACKET="'"'"${PRERACKET}"'"'" \
                                     local-source-catalog \
                          && ${PRERACKET} -N raco -l- \
                                          pkg install ${raco_args} \
                                          main-distribution racket-lib"
	touch $@


Posted on the dev mailing list.