[72439] trunk/dports/devel/ld64

Rainer Müller raimue at macports.org
Fri Oct 15 03:33:28 PDT 2010


Hello Michael,

portindex fails on ld64 when llvm is not installed. You are trying to
execute a binary which is not present.

Failed to parse file devel/ld64/Portfile: couldn't execute
"/opt/local/bin/llvm-config": no such file or directory

I would recommend to move the exec inside a pre-configure {} phase. At
that point you can safely assume that llvm-config is present.

pre-configure {
  build.env OTHER_CFLAGS='[exec ${prefix}/bin/llvm-config --cflags]'
  destroot.env OTHER_CFLAGS='[exec ${prefix}/bin/llvm-config --cflags]'
}

Rainer

On 2010-10-15 10:01 , mfeiri at macports.org wrote:
> Revision: 72439
>           http://trac.macports.org/changeset/72439
> Author:   mfeiri at macports.org
> Date:     2010-10-15 01:01:11 -0700 (Fri, 15 Oct 2010)
> Log Message:
> -----------
> devel/ld64: update to 97.14 on darwin 10 and patch to work with llvm 2.8
> 
> Modified Paths:
> --------------
>     trunk/dports/devel/ld64/Portfile
> 
> Added Paths:
> -----------
>     trunk/dports/devel/ld64/files/patch-MATH-ld.cpp.diff
>     trunk/dports/devel/ld64/files/patch-MATH85-ld.cpp.diff
>     trunk/dports/devel/ld64/files/patch-lldb_private-libunwind.diff
> 
> Removed Paths:
> -------------
>     trunk/dports/devel/ld64/files/patch-ld64.xcodeproj_project.pbxproj.diff
>     trunk/dports/devel/ld64/files/patch-src_LTOreader.hpp.diff
> 
> Modified: trunk/dports/devel/ld64/Portfile
> ===================================================================
> --- trunk/dports/devel/ld64/Portfile	2010-10-15 04:56:34 UTC (rev 72438)
> +++ trunk/dports/devel/ld64/Portfile	2010-10-15 08:01:11 UTC (rev 72439)
> @@ -1,51 +1,119 @@
>  # $Id$
>  
>  PortSystem              1.0
> +PortGroup               xcode 1.0
>  
>  name                    ld64
> -version                 85.2.1
> +version                 97.14
>  categories              devel
> -platforms               darwin
>  maintainers             mfeiri
>  homepage                http://opensource.apple.com/source/ld64/
>  master_sites            http://opensource.apple.com/tarballs/ld64/
>  license                 Apple Public Source License (APSL), version 2.0
>  depends_build           path:include/llvm-c/lto.h:llvm
> -patchfiles              patch-src_LTOreader.hpp.diff \
> -                        patch-ld64.xcodeproj_project.pbxproj.diff
> -
> +universal_variant       no
>  description             ld64 is the new mach-o linker
>  long_description        ld64 combines several object files and libraries, \
>                          resolves references, and produces an ouput file.
>  
> -checksums               md5 6dac3ce6d3b495df9a3996cd5781c874 \
> +
> +if {${os.major} < 9} {
> +    pre-fetch {
> +        ui_error "${name} requires Mac OS X 10.5 or later."
> +        return -code error "incompatible Mac OS X version"
> +    }
> +}
> +
> +
> +platform darwin 9 {
> +
> +    version             85.2.1
> +    revision            1
> +    checksums           md5 6dac3ce6d3b495df9a3996cd5781c874 \
>                          sha1 31a7debf4c407c32b8bd1a51a4b4a7ae68dc8b85 \
>                          rmd160 42c80bd4ad6e9f96a757245e6a2b95084c009ff1
>  
> -post-patch {
> -   reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/src/LTOReader.hpp \
> -       ${worksrcpath}/ld64.xcodeproj/project.pbxproj
> +    patchfiles          patch-MATH85-ld.cpp.diff
> +    xcode.target        all ObjectDump machocheck
> +    xcode.destroot.path ${prefix}/bin
> +    build.env           OTHER_CFLAGS='[exec ${prefix}/bin/llvm-config --cflags]'
> +    destroot.env        OTHER_CFLAGS='[exec ${prefix}/bin/llvm-config --cflags]'
> +
> +    post-patch {
> +        reinplace "s|/usr/share/man/man1|${prefix}/share/man/man1|g" \
> +            ${worksrcpath}/ld64.xcodeproj/project.pbxproj
> +        reinplace "s|/Developer/usr/local|${prefix}|g" \
> +            ${worksrcpath}/ld64.xcodeproj/project.pbxproj
> +        reinplace "s|\$(RC_ProjectSourceVersion)|${version}|g" \
> +            ${worksrcpath}/ld64.xcodeproj/project.pbxproj
> +    }
>  }
>  
> -use_configure   no
> -build.target    
> -if {${os.major} > 9} {
> -    build.cmd   true
> -} else {
> -    build.cmd   xcodebuild
> +
> +platform darwin 10 {
> +
> +    svn.revision        115426
> +    svn.url             http://llvm.org/svn/llvm-project/lldb/trunk/source/Plugins/Process/Utility/libunwind
> +    master_sites-append http://opensource.apple.com/source/dyld/dyld-132.13/include/mach-o/dyld_priv.h?txt&dummy=:dyld \
> +                        http://opensource.apple.com/source/cctools/cctools-782/include/mach-o/arm/reloc.h?txt&dummy=:cctools
> +    distfiles-append    dyld_priv.h:dyld reloc.h:cctools
> +    extract.only        ${distname}${extract.suffix}
> +    checksums           ${distname}${extract.suffix} \
> +                        md5 ad469f37d670929f9b326f16d4373a73 \
> +                        sha1 a21da97f574a121ef29b8a1bfc7a7c74692a0152 \
> +                        rmd160 5116cc587a7761d06e1da93019362705510c3d7b \
> +                        dyld_priv.h \
> +                        md5 b956b96e6a566691109692e11b59f67f \
> +                        sha1 eb5daccff286a1154f29d0b3485218b198920f25 \
> +                        rmd160 278d8f891b5171adbbb3c4975c44f5887bd43375 \
> +                        reloc.h \
> +                        md5 6ce50950669d083aab458f196ec3a2fc \
> +                        sha1 87f0265f0f6abefd1e2cf12fe29242fb219fd71f \
> +                        rmd160 b9c6c4fcf7731a508b82dd09af81fa8b26caf3ef
> +
> +    patchfiles          patch-lldb_private-libunwind.diff patch-MATH-ld.cpp.diff
> +    xcode.target        all ObjectDump machocheck
> +    xcode.destroot.path ${prefix}/bin
> +    xcode.build.settings HEADER_SEARCH_PATHS=${workpath}/libunwind/include
> +    xcode.destroot.settings HEADER_SEARCH_PATHS=${workpath}/libunwind/include
> +    build.env           OTHER_CFLAGS='[exec ${prefix}/bin/llvm-config --cflags]'
> +    destroot.env        OTHER_CFLAGS='[exec ${prefix}/bin/llvm-config --cflags]'
> +
> +    post-extract {
> +        system "cd ${workpath} && ${svn.cmd} ${svn.pre_args} ${svn.method} ${svn.url}@${svn.revision}"
> +        file mkdir ${workpath}/libunwind/include/mach-o/arm
> +        file rename ${workpath}/libunwind/src ${workpath}/libunwind/include/libunwind
> +        file rename ${distpath}/dyld_priv.h ${workpath}/libunwind/include/mach-o/
> +        file rename ${distpath}/reloc.h ${workpath}/libunwind/include/mach-o/arm/
> +        reinplace "s|/usr/share/man/man1|${prefix}/share/man/man1|g" \
> +            ${worksrcpath}/ld64.xcodeproj/project.pbxproj
> +        reinplace "s|usr/share/man/man1|${prefix}/share/man/man1|g" \
> +            ${worksrcpath}/ld64.xcodeproj/project.pbxproj
> +        reinplace "s|/Developer/usr/local|${prefix}|g" \
> +            ${worksrcpath}/ld64.xcodeproj/project.pbxproj
> +        reinplace "s|/usr/local|${prefix}|g" \
> +            ${worksrcpath}/ld64.xcodeproj/project.pbxproj
> +        reinplace "s|\$(RC_ProjectSourceVersion)|${version}|g" \
> +            ${worksrcpath}/ld64.xcodeproj/project.pbxproj
> +        foreach f [glob ${workpath}/libunwind/include/libunwind/*.h*] {
> +            reinplace "s|lldb_private|libunwind|g" $f
> +        }
> +    }
> +
> +    post-destroot {
> +        file rename ${destroot}${prefix}/bin/libprunetrie.a ${destroot}${prefix}/lib/libprunetrie.a
> +    }
>  }
>  
> -destroot {
> -    if {${os.major} > 9} {
> +
> +if {${os.major} > 10} {
> +    distfiles
> +    build { }
> +    destroot {
>          file copy /usr/bin/ld ${destroot}${prefix}/bin
>          file copy /usr/bin/rebase ${destroot}${prefix}/bin
>          file copy /usr/share/man/man1/ld.1 ${destroot}${prefix}/share/man/man1
>          file copy /usr/share/man/man1/rebase.1 ${destroot}${prefix}/share/man/man1
> -    } else {
> -        file copy ${worksrcpath}/build/Release/ld ${destroot}${prefix}/bin
> -        file copy ${worksrcpath}/build/Release/rebase ${destroot}${prefix}/bin
> -        file copy ${worksrcpath}/doc/man/man1/ld.1 ${destroot}${prefix}/share/man/man1
> -        file copy ${worksrcpath}/doc/man/man1/rebase.1 ${destroot}${prefix}/share/man/man1
>      }
>  }
>  
> 
> Added: trunk/dports/devel/ld64/files/patch-MATH-ld.cpp.diff
> ===================================================================
> --- trunk/dports/devel/ld64/files/patch-MATH-ld.cpp.diff	                        (rev 0)
> +++ trunk/dports/devel/ld64/files/patch-MATH-ld.cpp.diff	2010-10-15 08:01:11 UTC (rev 72439)
> @@ -0,0 +1,13 @@
> +--- src/ld/ld.cpp	2010-01-26 20:07:02.000000000 +0100
> ++++ src/ld/ld.cpp	2010-10-12 22:56:13.000000000 +0200
> +@@ -21,10 +21,6 @@
> +  * @APPLE_LICENSE_HEADER_END@
> +  */
> +  
> +-// start temp HACK for cross builds
> +-extern "C" double log2 ( double );
> +-#define __MATH__
> +-// end temp HACK for cross builds
> + 
> + 
> + #include <stdlib.h>
> 
> Added: trunk/dports/devel/ld64/files/patch-MATH85-ld.cpp.diff
> ===================================================================
> --- trunk/dports/devel/ld64/files/patch-MATH85-ld.cpp.diff	                        (rev 0)
> +++ trunk/dports/devel/ld64/files/patch-MATH85-ld.cpp.diff	2010-10-15 08:01:11 UTC (rev 72439)
> @@ -0,0 +1,13 @@
> +--- src/ld.cpp	2010-01-26 20:07:02.000000000 +0100
> ++++ src/ld.cpp	2010-10-12 22:56:13.000000000 +0200
> +@@ -21,10 +21,6 @@
> +  * @APPLE_LICENSE_HEADER_END@
> +  */
> +  
> +-// start temp HACK for cross builds
> +-extern "C" double log2 ( double );
> +-#define __MATH__
> +-// end temp HACK for cross builds
> + 
> + 
> + #include <stdlib.h>
> 
> Deleted: trunk/dports/devel/ld64/files/patch-ld64.xcodeproj_project.pbxproj.diff
> ===================================================================
> --- trunk/dports/devel/ld64/files/patch-ld64.xcodeproj_project.pbxproj.diff	2010-10-15 04:56:34 UTC (rev 72438)
> +++ trunk/dports/devel/ld64/files/patch-ld64.xcodeproj_project.pbxproj.diff	2010-10-15 08:01:11 UTC (rev 72439)
> @@ -1,12 +0,0 @@
> ---- ld64.xcodeproj/project.pbxproj	2010-05-11 01:32:03.000000000 +0200
> -+++ ld64.xcodeproj/project.pbxproj	2010-05-16 22:54:39.000000000 +0200
> -@@ -350,7 +350,7 @@
> - 			);
> - 			runOnlyForDeploymentPostprocessing = 0;
> - 			shellPath = /bin/bash;
> --			shellScript = "if [ -f /Developer/usr/local/include/llvm-c/lto.h ]; then\n\techo \"#define LTO_SUPPORT 1\" > ${DERIVED_FILE_DIR}/configure.h\nelse\n\techo \"#undef LTO_SUPPORT\t\" > ${DERIVED_FILE_DIR}/configure.h\nfi\n";
> -+			shellScript = "if [ -f @@PREFIX@@/include/llvm-c/lto.h ]; then\n\techo \"#define LTO_SUPPORT 1\" > ${DERIVED_FILE_DIR}/configure.h\nelse\n\techo \"#undef LTO_SUPPORT\t\" > ${DERIVED_FILE_DIR}/configure.h\nfi\n";
> - 			showEnvVarsInLog = 0;
> - 		};
> - 		F96D5367094A2754008E9EE8 /* ShellScript */ = {
> -
> 
> Added: trunk/dports/devel/ld64/files/patch-lldb_private-libunwind.diff
> ===================================================================
> --- trunk/dports/devel/ld64/files/patch-lldb_private-libunwind.diff	                        (rev 0)
> +++ trunk/dports/devel/ld64/files/patch-lldb_private-libunwind.diff	2010-10-15 08:01:11 UTC (rev 72439)
> @@ -0,0 +1,36 @@
> +--- ../libunwind/include/libunwind.h	2010-07-09 22:39:50.000000000 +0200
> ++++ ../libunwind/include/libunwind.h	2010-08-20 22:29:08.000000000 +0200
> +@@ -25,7 +25,6 @@
> + #include <mach/mach_types.h>
> + #include <Availability.h>
> + 
> +-namespace lldb_private {
> + 
> + #pragma mark Error codes
> + 
> +@@ -502,7 +501,6 @@
> + };
> + 
> + 
> +-} // namespace lldb_private
> + 
> + 
> + #endif
> +--- ../libunwind/include/mach-o/compact_unwind_encoding.h	2010-06-08 18:52:24.000000000 +0200
> ++++ ../libunwind/include/mach-o/compact_unwind_encoding.h	2010-08-20 22:15:04.000000000 +0200
> +@@ -14,7 +14,6 @@
> + 
> + #include <stdint.h>
> + 
> +-namespace lldb_private {
> + 
> + // 
> + // Each final linked mach-o image has an optional __TEXT, __unwind_info section.
> +@@ -206,7 +205,6 @@
> +     UNWIND_X86_REG_EBP      = 6,
> + };
> + 
> +-}; // namespace lldb_private
> + 
> + #endif
> + 
> 
> Deleted: trunk/dports/devel/ld64/files/patch-src_LTOreader.hpp.diff
> ===================================================================
> --- trunk/dports/devel/ld64/files/patch-src_LTOreader.hpp.diff	2010-10-15 04:56:34 UTC (rev 72438)
> +++ trunk/dports/devel/ld64/files/patch-src_LTOreader.hpp.diff	2010-10-15 08:01:11 UTC (rev 72439)
> @@ -1,12 +0,0 @@
> ---- src/LTOReader.hpp	2008-07-11 03:15:14.000000000 +0200
> -+++ src/LTOReader.hpp	2010-05-16 22:56:59.000000000 +0200
> -@@ -36,7 +36,7 @@
> - #include "ObjectFile.h"
> - #include "Options.h"
> - 
> --#include "llvm-c/lto.h"
> -+#include "@@PREFIX@@/include/llvm-c/lto.h"
> - 
> - 
> - namespace lto {
> -
> 
> 
> 
> 
> _______________________________________________
> macports-changes mailing list
> macports-changes at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macports-changes



More information about the macports-dev mailing list