[macports-ports] 12/13: xcbuild: add new tool for xcode

Ryan Schmidt ryandesign at macports.org
Tue Jan 24 09:45:48 UTC 2017


> On Jan 23, 2017, at 18:08, Sean Farley <sean at macports.org> wrote:
> 
> Sean Farley (seanfarley) pushed a commit to branch master
> in repository macports-ports.
> 
> 
> https://github.com/macports/macports-ports/commit/ea02c6a2415087a43634f83653532c4aaf346a21
> 
> commit ea02c6a2415087a43634f83653532c4aaf346a21
> 
> Author: Sean Farley <sean at macports.org>
> AuthorDate: Mon Jan 23 16:04:28 2017 -0800
> 
> 
>     xcbuild: add new tool for xcode
> 
> ---
>  devel/xcbuild/Portfile | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 61 insertions(+)
> 
> 
> diff --git a/devel/xcbuild/Portfile b/devel/xcbuild/Portfile
> 
> new file mode 100644
> 
> index 0000000..958b72a
> 
> --- /dev/null
> 
> +++ b/devel/xcbuild/Portfile
> 
> @@ -0,0 +1,61 @@
> 
> +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=portfile:et:sw=4:ts=4:sts=4
> 
> +
> 
> +PortSystem          1.0
> 
> +PortGroup           cmake 1.0
> 
> +PortGroup           github 1.0
> 
> +
> 
> +github.setup        facebook xcbuild 0.1.1
> 
> +categories          devel
> 
> +platforms           darwin
> 
> +
> 
> +universal_variant   no
> 
> +license             BSD
> 
> +maintainers         sean openmaintainer
> 
> +
> 
> +description         xcbuild is an Xcode-compatible build tool with the goal of \
> 
> +                    providing faster builds, better documentation of the build \
> 
> +                    process and running on multiple platforms
> 
> +long_description    ${description}
> 
> +
> 
> +# Fetch from git instead of distfile because it needs submodules
> 
> +fetch.type          git
> 
> +
> 
> +depends_lib-append  port:libpng \
> 
> +                    port:pkgconfig \
> 
> +                    port:zlib \
> 
> +                    port:libxml2 \
> 
> +                    port:cmake \
> 
> +                    port:ninja
> 

Does xcbuild really use pkgconfig, cmake and ninja at runtime as well? Usually they're only build-time dependencies. The cmake portgroup already adds cmake as a build-time dependency.


> +post-fetch {
> 
> +    system -W "${worksrcpath}" "git submodule update --init"
> 
> +}
> 
> +
> 
> +# use_configure no
> 
> +
> 
> +configure {
> 
> +    system -W "${worksrcpath}" "${configure.cmd} -G Ninja ${configure.args} ${worksrcpath}"
> 
> +}
> 
> +
> 
> +build {
> 
> +    system -W "${worksrcpath}" "ninja"
> 
> +}
> 
> +
> 
> +destroot {
> 
> +    system -W "${worksrcpath}" "DESTDIR=${destroot} ninja install"
> 
> +}

It might be better to get support for ninja into the cmake portgroup, if ninja does really provide such great benefits, rather than override the standard phases. See https://trac.macports.org/ticket/47127 for that request.



> +post-destroot {
> 
> +    move {*}[glob ${destroot}/usr/local/usr/bin/*] ${destroot}${prefix}/bin
> 
> +    move {*}[glob ${destroot}/usr/local/usr/lib/*] ${destroot}${prefix}/lib
> 
> +    move ${destroot}/usr/local/Library/Xcode ${destroot}${prefix}/Library
> 
> +
> 
> +    # these files aren't needed on macos (they are built by the project for
> 
> +    # future work on linux)
> 
> +    delete ${destroot}${prefix}/bin/PlistBuddy
> 
> +    delete ${destroot}${prefix}/bin/lsbom
> 
> +    delete ${destroot}${prefix}/bin/plutil
> 
> +    delete ${destroot}${prefix}/bin/xcode-select
> 
> +    delete ${destroot}${prefix}/bin/xcodebuild
> 
> +    delete ${destroot}${prefix}/bin/xcrun
> 
> +}
> 
> 



More information about the macports-dev mailing list