[80177] trunk/dports/lang/mercury

Ryan Schmidt ryandesign at macports.org
Wed Jul 6 00:21:00 PDT 2011


On Jul 6, 2011, at 01:51, jeremyhu at macports.org wrote:

> Revision: 80177
>          http://trac.macports.org/changeset/80177
> Author:   jeremyhu at macports.org
> Date:     2011-07-05 23:51:22 -0700 (Tue, 05 Jul 2011)
> Log Message:
> -----------
> mercury: Update version to 11.01 for x86_64 support, clang build fixes


> worksrcdir	${name}-${version}
> -post-extract	{ file rename \
> -			${workpath}/${name}-compiler-${version} \
> -			${workpath}/${name}-${version}
> -		}
> 
> -post-patch	{ reinplace \
> -			s|\$(INSTALL_ELISP_DIR)|${prefix}/lib/${name}/elisp| \
> -			${worksrcpath}/Mmakefile
> -		}
> +depends_lib \
> +    port:readline
> 
> -depends_lib	port:readline
> +post-extract {
> +    file rename ${workpath}/${name}-compiler-${version} ${workpath}/${name}-${version}
> +}

Why rename it in post-extract? Why not just use it with its existing name, by removing the worksrcdir definition a few lines above?


> -# Note that most of the building actually takes place in the
> -# destroot phase.  This is a consequence of the mercury build
> -# scheme.
> +# mercury's bootstrapping doesn't work with DESTDIR, so do it an ugly way...
> +set real_prefix ${prefix}
> +prefix ${destroot}${prefix}
> +destroot.destdir ""

Oh my that's ugly. I'm not even sure I really understand why this works. Is this just so that ./configure gets called with --prefix=${destroot}${prefix} instead of --prefix=${prefix}? If so, wouldn't that be the simpler thing to do, rather than redefining existing variables, which is sure to confuse other portfile readers, and MacPorts itself (see below)?


> -build		{
> -		  system "cd ${worksrcpath} && make INSTALL_PREFIX=${destroot}${prefix}"
> -		}
> +post-destroot {
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc/libmer_browser.dylib ${prefix}/lib/mercury/lib/hlc.gc/libmer_browser.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc/libmer_eventspec.dylib ${prefix}/lib/mercury/lib/hlc.gc/libmer_eventspec.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc/libmer_mdbcomp.dylib ${prefix}/lib/mercury/lib/hlc.gc/libmer_mdbcomp.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc/libmer_rt.dylib ${prefix}/lib/mercury/lib/hlc.gc/libmer_rt.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc/libmer_ssdb.dylib ${prefix}/lib/mercury/lib/hlc.gc/libmer_ssdb.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc/libmer_std.dylib ${prefix}/lib/mercury/lib/hlc.gc/libmer_std.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc/libmer_trace.dylib ${prefix}/lib/mercury/lib/hlc.gc/libmer_trace.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_browser.dylib ${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_browser.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_eventspec.dylib ${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_eventspec.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_mdbcomp.dylib ${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_mdbcomp.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_rt.dylib ${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_rt.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_ssdb.dylib ${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_ssdb.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_std.dylib ${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_std.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_trace.dylib ${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_trace.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.prof/libmer_browser.dylib ${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_browser.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.prof/libmer_eventspec.dylib ${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_eventspec.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.prof/libmer_mdbcomp.dylib ${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_mdbcomp.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.prof/libmer_rt.dylib ${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_rt.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.prof/libmer_ssdb.dylib ${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_ssdb.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.prof/libmer_std.dylib ${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_std.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.prof/libmer_trace.dylib ${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_trace.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_browser.dylib ${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_browser.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_eventspec.dylib ${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_eventspec.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_mdbcomp.dylib ${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_mdbcomp.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_rt.dylib ${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_rt.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_ssdb.dylib ${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_ssdb.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_std.dylib ${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_std.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_trace.dylib ${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_trace.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.par.gc/libmer_browser.dylib ${prefix}/lib/mercury/lib/hlc.par.gc/libmer_browser.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.par.gc/libmer_eventspec.dylib ${prefix}/lib/mercury/lib/hlc.par.gc/libmer_eventspec.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.par.gc/libmer_mdbcomp.dylib ${prefix}/lib/mercury/lib/hlc.par.gc/libmer_mdbcomp.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.par.gc/libmer_rt.dylib ${prefix}/lib/mercury/lib/hlc.par.gc/libmer_rt.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.par.gc/libmer_ssdb.dylib ${prefix}/lib/mercury/lib/hlc.par.gc/libmer_ssdb.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.par.gc/libmer_std.dylib ${prefix}/lib/mercury/lib/hlc.par.gc/libmer_std.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/hlc.par.gc/libmer_trace.dylib ${prefix}/lib/mercury/lib/hlc.par.gc/libmer_trace.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/libgc.dylib ${prefix}/lib/mercury/lib/libgc.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/libgc_prof.dylib ${prefix}/lib/mercury/lib/libgc_prof.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/libpar_gc.dylib ${prefix}/lib/mercury/lib/libpar_gc.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc/libmer_browser.dylib ${prefix}/lib/mercury/lib/none.gc/libmer_browser.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc/libmer_eventspec.dylib ${prefix}/lib/mercury/lib/none.gc/libmer_eventspec.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc/libmer_mdbcomp.dylib ${prefix}/lib/mercury/lib/none.gc/libmer_mdbcomp.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc/libmer_rt.dylib ${prefix}/lib/mercury/lib/none.gc/libmer_rt.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc/libmer_ssdb.dylib ${prefix}/lib/mercury/lib/none.gc/libmer_ssdb.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc/libmer_std.dylib ${prefix}/lib/mercury/lib/none.gc/libmer_std.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc/libmer_trace.dylib ${prefix}/lib/mercury/lib/none.gc/libmer_trace.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.debug/libmer_browser.dylib ${prefix}/lib/mercury/lib/none.gc.debug/libmer_browser.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.debug/libmer_eventspec.dylib ${prefix}/lib/mercury/lib/none.gc.debug/libmer_eventspec.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.debug/libmer_mdbcomp.dylib ${prefix}/lib/mercury/lib/none.gc.debug/libmer_mdbcomp.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.debug/libmer_rt.dylib ${prefix}/lib/mercury/lib/none.gc.debug/libmer_rt.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.debug/libmer_ssdb.dylib ${prefix}/lib/mercury/lib/none.gc.debug/libmer_ssdb.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.debug/libmer_std.dylib ${prefix}/lib/mercury/lib/none.gc.debug/libmer_std.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.debug/libmer_trace.dylib ${prefix}/lib/mercury/lib/none.gc.debug/libmer_trace.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.decldebug/libmer_browser.dylib ${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_browser.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.decldebug/libmer_eventspec.dylib ${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_eventspec.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.decldebug/libmer_mdbcomp.dylib ${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_mdbcomp.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.decldebug/libmer_rt.dylib ${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_rt.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.decldebug/libmer_ssdb.dylib ${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_ssdb.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.decldebug/libmer_std.dylib ${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_std.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.decldebug/libmer_trace.dylib ${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_trace.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.prof/libmer_browser.dylib ${prefix}/lib/mercury/lib/none.gc.prof/libmer_browser.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.prof/libmer_eventspec.dylib ${prefix}/lib/mercury/lib/none.gc.prof/libmer_eventspec.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.prof/libmer_mdbcomp.dylib ${prefix}/lib/mercury/lib/none.gc.prof/libmer_mdbcomp.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.prof/libmer_rt.dylib ${prefix}/lib/mercury/lib/none.gc.prof/libmer_rt.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.prof/libmer_ssdb.dylib ${prefix}/lib/mercury/lib/none.gc.prof/libmer_ssdb.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.prof/libmer_std.dylib ${prefix}/lib/mercury/lib/none.gc.prof/libmer_std.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.prof/libmer_trace.dylib ${prefix}/lib/mercury/lib/none.gc.prof/libmer_trace.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.profdeep/libmer_browser.dylib ${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_browser.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.profdeep/libmer_eventspec.dylib ${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_eventspec.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.profdeep/libmer_mdbcomp.dylib ${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_mdbcomp.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.profdeep/libmer_rt.dylib ${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_rt.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.profdeep/libmer_ssdb.dylib ${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_ssdb.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.profdeep/libmer_std.dylib ${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_std.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.gc.profdeep/libmer_trace.dylib ${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_trace.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.par.gc/libmer_browser.dylib ${prefix}/lib/mercury/lib/none.par.gc/libmer_browser.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.par.gc/libmer_eventspec.dylib ${prefix}/lib/mercury/lib/none.par.gc/libmer_eventspec.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.par.gc/libmer_mdbcomp.dylib ${prefix}/lib/mercury/lib/none.par.gc/libmer_mdbcomp.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.par.gc/libmer_rt.dylib ${prefix}/lib/mercury/lib/none.par.gc/libmer_rt.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.par.gc/libmer_ssdb.dylib ${prefix}/lib/mercury/lib/none.par.gc/libmer_ssdb.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.par.gc/libmer_std.dylib ${prefix}/lib/mercury/lib/none.par.gc/libmer_std.dylib"
> +    system "install_name_tool -id ${real_prefix}/lib/mercury/lib/none.par.gc/libmer_trace.dylib ${prefix}/lib/mercury/lib/none.par.gc/libmer_trace.dylib"

Oh my. Surely a foreach loop would be a shorter way to do this.


> -destroot	{
> -		  system "cd ${worksrcpath} && make INSTALL_PREFIX=${destroot}${prefix} \
> -			       MERCURY_COMPILER=${worksrcpath}/compiler/mercury_compile install"
> -		}
> +    file delete ${prefix}/var/macports/build
> +}

Which, because of your above changes in variable definitions, is actually deleting ${destroot}${prefix}/var/macports/build? Which was presumably also only created by MacPorts in the first place because of the above changes in variable definitions?






More information about the macports-dev mailing list