31 | | supported_archs x86_64 |
32 | | universal_variant no |
33 | | worksrcdir ${name}-${version}/src |
34 | | set makefile ${worksrcpath}/makefile.osx |
35 | | configure { |
36 | | reinplace "s|^DEPSDIR=.*$|DEPSDIR=${prefix}|" ${makefile} |
37 | | reinplace "s|-I\"\$\(DEPSDIR\)\/include\"|-I${prefix}/include -I${prefix}/include/db48|" ${makefile} |
38 | | reinplace "s|lib/libdb_cxx-4.8.a|lib/db48/libdb_cxx-4.8.dylib|" ${makefile} |
39 | | reinplace "s|lib/libboost_thread.a|lib/libboost_thread-mt.dylib|" ${makefile} |
40 | | reinplace "s|\\\.a|.dylib|" ${makefile} |
41 | | reinplace "s|/miniupnpc/|/lib/|" ${makefile} |
42 | | |
43 | | # The QuickTime framework isn't actually needed, and it doesn't exist for |
44 | | # x86_64, but wx-config --libs spits it out anyway, so we'll filter it out |
45 | | # with sed. |
46 | | reinplace "s|wx-config --libs --static|wx-config --libs \\\| sed -e \"s/-framework QuickTime//\"|g" ${makefile} |
47 | | |
48 | | # Building with i386 support seems to make everything explode, so we'll |
49 | | # remove it. |
50 | | reinplace "s|-arch i386||" ${makefile} |
| 28 | supported_archs i386 x86_64 |
| 29 | |
| 30 | default_variants +qt4 |
| 31 | |
| 32 | variant no_gui conflicts qt4 description "Build bitcoin without a GUI" { |
| 33 | global makefile |
| 34 | set makefile makefile.osx |
| 35 | |
| 36 | post-patch { |
| 37 | # get correct compilers and flags |
| 38 | # -Wformat is needed for -Wformat-security |
| 39 | reinplace "s|^CXX=.*$|CXX=${configure.cxx}|" src/${makefile} |
| 40 | reinplace "s|^DEPSDIR=.*$|DEPSDIR=${prefix}|" src/${makefile} |
| 41 | reinplace "s|^CFLAGS = -m.*$|CFLAGS = ${configure.cxxflags} -Wformat|" src/${makefile} |
| 42 | reinplace "s|^CFLAGS = -g.*$|CFLAGS = -g ${configure.cxxflags} -Wformat|" src/${makefile} |
| 43 | reinplace "s|-arch i386|${configure.cxx_archflags}|" src/${makefile} |
| 44 | } |
| 45 | |
| 46 | use_configure no |
| 47 | |
| 48 | build.cmd cd src && ${build.cmd} |
| 49 | build.args -w -f ${makefile} "RELEASE=1" "USE_UPNP=1" "USE_SSL=1" |
| 50 | |
| 51 | test.run yes |
| 52 | # Why won't port recognise build.args here? |
| 53 | test.cmd ${build.cmd} -w -f ${makefile} "RELEASE=1" "USE_UPNP=1" "USE_SSL=1" test_bitcoin && ./test_bitcoin |
| 54 | |
| 55 | destroot { |
| 56 | xinstall -m 755 -W ${worksrcpath}/src \ |
| 57 | bitcoind ${destroot}${prefix}/bin |
| 58 | |
| 59 | set docdir ${destroot}${prefix}/share/doc/${name} |
| 60 | xinstall -d ${docdir} |
| 61 | eval xinstall -m 644 [glob ${worksrcpath}/doc/*] \ |
| 62 | ${destroot}${prefix}/share/doc/${name} |
| 63 | } |
52 | | build.args -f ${makefile} |
53 | | build.target-append bitcoind |
54 | | destroot { |
55 | | xinstall -m 755 -W ${worksrcpath} \ |
56 | | bitcoin bitcoind ${destroot}${prefix}/bin |
57 | | |
58 | | set docdir ${destroot}${prefix}/share/doc/${name} |
59 | | xinstall -d ${docdir} |
60 | | xinstall -m 444 -W ${worksrcpath}/.. readme.txt license.txt ${docdir} |
61 | | |
62 | | file copy ${worksrcpath}/../Bitcoin.app ${destroot}${applications_dir}/ |
| 65 | |
| 66 | variant qt4 conflicts no_gui description "Build the Qt4 GUI front-end for bitcoin" { |
| 67 | PortGroup qt4 1.0 |
| 68 | |
| 69 | global makefile |
| 70 | set makefile bitcoin-qt.pro |
| 71 | |
| 72 | if {${configure.compiler} == "clang"} { |
| 73 | # Clang gives 2 errors. Mac dock icon handler has work-around. |
| 74 | # QtIPCServer is completely disabled: ipcInit() was disabled for Mac |
| 75 | # anyway, there is a TODO comment. The compile error has actually to do |
| 76 | # with Boost. An update to Boost may make this work in the future. |
| 77 | patchfiles-append patch-clang-src_qt_macdockiconhandler_mm.diff \ |
| 78 | patch-clang-src_qt_qtipcserver_cpp.diff |
| 79 | } |
| 80 | |
| 81 | post-patch { |
| 82 | # Use correct compilers and flags |
| 83 | reinplace "s|macx:QMAKE_CXXFLAGS += .*||g" ${makefile} |
| 84 | reinplace "s|-fstack-protector|-fstack-protector-all -D_FORTIFY_SOURCE=2|g" ${makefile} |
| 85 | reinplace "s|CONFIG += no_include_pwd|CONFIG += no_include_pwd \ |
| 86 | \\\nQMAKE_CC = ${configure.cc} \ |
| 87 | \\\nQMAKE_CXX = ${configure.cxx} \ |
| 88 | \\\nQMAKE_LINK = ${configure.cxx} \ |
| 89 | \\\nQMAKE_CFLAGS_RELEASE = ${configure.cflags} \ |
| 90 | \\\nQMAKE_CXXFLAGS_RELEASE = ${configure.cxxflags}|" ${makefile} |
| 91 | reinplace "s|macx:TARGET = \"Bitcoin-Qt\"|macx:TARGET = \"Bitcoin\"|" ${makefile} |
| 92 | } |
| 93 | |
| 94 | configure.cmd ${qt_qmake_cmd} |
| 95 | # remove --prefix |
| 96 | configure.pre_args {} |
| 97 | configure.args "USE_UPNP=1" "USE_SSL=1" "FIRST_CLASS_MESSAGING=1" "RELEASE=1" ${makefile} |
| 98 | |
| 99 | test.run no |
| 100 | |
| 101 | destroot { |
| 102 | file copy ${worksrcpath}/Bitcoin.app ${destroot}${applications_dir}/ |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | variant qrcode requires qt4 description "Include ability to save transactions as QR codes" { |
| 107 | depends_lib-append port:qrencode |
| 108 | configure.args-append "USE_QRCODE=1" |