source: trunk/dports/lang/phobos/Portfile

Last change on this file was 148693, checked in by mcalhoun@…, 18 months ago

dmd ecosystem: version update 2.069.2->2.071.0 (fixes #51340)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 148693 2016-05-15 08:39:30Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           github 1.0
6PortGroup           muniversal 1.0
7PortGroup           active_variants 1.1
8
9github.setup        dlang phobos 2.071.0 v
10categories          lang
11platforms           darwin
12license             Boost-1
13maintainers         takeshi openmaintainer
14description         Runtime library for the D programming language
15long_description \
16    Phobos is the standard runtime library that comes with the D language compiler.
17homepage            http://dlang.org/
18
19checksums           rmd160  a992eef87c674b6143cda1038a28053ff21dd9f8 \
20                    sha256  b645de03dacaa192ccacffb2f8cc18ee419bf93084eb07c609feba8a0014153a
21
22depends_lib         port:druntime
23
24patchfiles          patch-gzlib.c.diff \
25                    patch-posix.diff
26
27use_configure       no
28
29post-extract {
30    xinstall -m 0644 ${filespath}/makefile_macports_install ${build.dir}
31}
32
33post-patch {
34    reinplace "s|__MACPORTS_CFLAGS__|${configure.cflags}|g" \
35        ${worksrcpath}/posix.mak
36}
37
38pre-configure {
39    # dmd compiler can not handle universal files, so create thin versions of archive files from libdruntime.a
40    if { ![variant_isset universal] } {
41        set all_archs ${build_arch}
42    } else {
43        set all_archs ${universal_archs}
44    }
45    foreach arch ${all_archs} {
46        file mkdir ${workpath}/druntime/${arch}
47    }
48    if {[active_variants port:druntime universal ""]} {
49        # libdruntime.a is universal, so create a thin version
50        foreach arch ${all_archs} {
51            system \
52                -W ${workpath}/druntime/${arch} \
53                "/usr/bin/lipo -thin ${arch} ${prefix}/lib/libdruntime.a -output libdruntime.a"
54        }
55    } else {
56        # libdruntime.a is NOT universal, so just copy it
57        foreach arch ${all_archs} {
58            file copy ${prefix}/lib/libdruntime.a ${workpath}/druntime/${arch}/libdruntime.a
59        }
60    }
61}
62
63pre-build {
64    file mkdir ${workpath}/dmd
65    system "echo ${version} > ${workpath}/dmd/VERSION"
66}
67build.args          -f posix.mak \
68                    DRUNTIME_PATH=${prefix}/include/druntime \
69                    CC=${configure.cc} \
70                    DMD=${prefix}/bin/dmd
71build.target        ""
72
73if { ![variant_isset universal] } {
74    if { ${build_arch} eq "x86_64" || ${build_arch} eq "ppc64" } {
75        build.args-append MODEL=64 DRUNTIME=${workpath}/druntime/${build_arch}/libdruntime.a
76    } else {
77        build.args-append MODEL=32 DRUNTIME=${workpath}/druntime/${build_arch}/libdruntime.a
78    }
79} else {
80    lappend merger_build_args(x86_64) MODEL=64 DRUNTIME=${workpath}/druntime/x86_64/libdruntime.a
81    lappend merger_build_args(i386)   MODEL=32 DRUNTIME=${workpath}/druntime/i386/libdruntime.a
82    lappend merger_build_args(ppc64)  MODEL=64 DRUNTIME=${workpath}/druntime/ppc64/libdruntime.a
83    lappend merger_build_args(ppc)    MODEL=32 DRUNTIME=${workpath}/druntime/ppc/libdruntime.a
84}
85
86destroot.args \
87    -f makefile_macports_install \
88    PREFIX=${prefix}
89
90livecheck.regex     archive/[join ${github.tag_prefix} ""](\[^"-\]+)${extract.suffix}
Note: See TracBrowser for help on using the repository browser.