Revision: 148216 https://trac.macports.org/changeset/148216 Author: mcalhoun@macports.org Date: 2016-04-30 08:30:00 -0700 (Sat, 30 Apr 2016) Log Message: ----------- dmd: respect build_arch and allow universal build Modified Paths: -------------- trunk/dports/lang/dmd/Portfile Added Paths: ----------- trunk/dports/lang/dmd/files/ trunk/dports/lang/dmd/files/makefile_macports_install Modified: trunk/dports/lang/dmd/Portfile =================================================================== --- trunk/dports/lang/dmd/Portfile 2016-04-30 15:22:28 UTC (rev 148215) +++ trunk/dports/lang/dmd/Portfile 2016-04-30 15:30:00 UTC (rev 148216) @@ -3,12 +3,12 @@ PortSystem 1.0 PortGroup github 1.0 +PortGroup muniversal 1.0 github.setup D-Programming-Language dmd 2.069.2 v revision 1 categories lang platforms darwin -supported_archs noarch license {GPL-1 Artistic-1} Boost-1 Restrictive maintainers takeshi openmaintainer description dmd Digital Mars D compiler @@ -28,14 +28,15 @@ use_configure no -variant universal {} - depends_build-append port:dmd-bootstrap depends_skip_archcheck-append dmd-bootstrap - build.dir ${worksrcpath}/src +post-extract { + xinstall -m 0644 ${filespath}/makefile_macports_install ${build.dir} +} + # Use CFLAGS in the posix.make; some source needs special flags. # Command-line arguments wipe the CFLAGS in posix.mak and # extra flags cannot be added with +=. @@ -43,32 +44,26 @@ build.args -f posix.mak \ HOST_CC="${configure.cxx}" \ LDFLAGS="${configure.ldflags} -framework CoreServices" \ - MODEL_FLAG="[get_canonical_archflags]" \ ENVP="MACOSX_DEPLOYMENT_TARGET=${macosx_deployment_target}" \ HOST_DMD=${prefix}/libexec/dmd-bootstrap/bin/dmd -destroot { -# man - xinstall -m 644 -W ${worksrcpath}/docs/man/man1 \ - dmd.1 dumpobj.1 obj2asm.1 \ - ${destroot}${prefix}/share/man/man1 - xinstall -m 644 ${worksrcpath}/docs/man/man5/dmd.conf.5 \ - ${destroot}${prefix}/share/man/man5 -# bin - xinstall -m 755 -W ${destroot.dir} \ - dmd \ - ${destroot}${prefix}/bin -# samples - xinstall -d -m 755 ${destroot}${prefix}/share/${name}/samples - eval xinstall -m 644 [glob ${worksrcpath}/samples/*.d] ${destroot}${prefix}/share/${name}/samples -# conf - xinstall -d -m 755 ${destroot}${prefix}/etc/${name} - set conf [open ${destroot}${prefix}/etc/${name}/${name}.conf w] - puts $conf "\[Environment\] -DFLAGS=-I${prefix}/include/druntime/import -I${prefix}/include/phobos -L-L${prefix}/lib" - close $conf +if { ![variant_isset universal] } { + if { ${build_arch} eq "x86_64" || ${build_arch} eq "ppc64" } { + build.args-append MODEL=64 + } else { + build.args-append MODEL=32 + } +} else { + lappend merger_build_args(x86_64) MODEL=64 + lappend merger_build_args(i386) MODEL=32 + lappend merger_build_args(ppc64) MODEL=64 + lappend merger_build_args(ppc) MODEL=32 } +destroot.args \ + -f makefile_macports_install \ + PREFIX=${prefix} + notes { In order to have a complete dmd runtime environment consider installing the following ports: druntime phobos dmd-tools } Added: trunk/dports/lang/dmd/files/makefile_macports_install =================================================================== --- trunk/dports/lang/dmd/files/makefile_macports_install (rev 0) +++ trunk/dports/lang/dmd/files/makefile_macports_install 2016-04-30 15:30:00 UTC (rev 148216) @@ -0,0 +1,23 @@ +# -*- mode: makefile -*- + +INSTALL=/usr/bin/install + +install: +# man + for f in dmd.1 dumpobj.1 obj2asm.1; do \ + $(INSTALL) -m 644 ../docs/man/man1/$$f \ + $(DESTDIR)$(PREFIX)/share/man/man1; \ + done + $(INSTALL) -m 644 ../docs/man/man5/dmd.conf.5 \ + $(DESTDIR)$(PREFIX)/share/man/man5 +# bin + for f in dmd; do \ + $(INSTALL) -m 755 $$f $(DESTDIR)$(PREFIX)/bin; \ + done +# samples + $(INSTALL) -d -m 755 $(DESTDIR)$(PREFIX)/share/dmd/samples + $(INSTALL) -m 644 ../samples/*.d $(DESTDIR)$(PREFIX)/share/dmd/samples +# conf + $(INSTALL) -d -m 755 $(DESTDIR)$(PREFIX)/etc/dmd + echo "[Environment]" >> $(DESTDIR)$(PREFIX)/etc/dmd/dmd.conf + echo "DFLAGS=-I$(PREFIX)/include/druntime/import -I$(PREFIX)/include/phobos -L-L$(PREFIX)/lib" >> $(DESTDIR)$(PREFIX)/etc/dmd/dmd.conf
participants (1)
-
mcalhoun@macports.org