1 | # $Id: Portfile 79338 2011-06-09 19:51:57Z and.damore@macports.org $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | PortGroup github 1.0 |
---|
5 | name bitcoin |
---|
6 | categories finance crypto |
---|
7 | version 0.6.2.2 |
---|
8 | platforms darwin |
---|
9 | license MIT |
---|
10 | maintainers singingwolfboy openmaintainer |
---|
11 | description a peer-to-peer digital currency |
---|
12 | long_description \ |
---|
13 | Bitcoin is a peer-to-peer digital currency. Peer-to-peer (P2P) means that \ |
---|
14 | there is no central authority to issue new money or keep track of \ |
---|
15 | transactions. Instead, these tasks are managed collectively by the nodes \ |
---|
16 | of the network. |
---|
17 | |
---|
18 | homepage http://www.bitcoin.org/ |
---|
19 | github.setup ${name} ${name} v${version} |
---|
20 | checksums rmd160 c8ccbc325de2aa794dde48f28df5d175a68bf7f5 \ |
---|
21 | sha256 74231218e76b9f46392a050353debb039ae18bc3a36d93b7279505d8d46be7d2 |
---|
22 | |
---|
23 | depends_lib port:boost \ |
---|
24 | port:openssl \ |
---|
25 | port:db48 \ |
---|
26 | port:miniupnpc |
---|
27 | |
---|
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 | } |
---|
64 | } |
---|
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" |
---|
109 | } |
---|
110 | |
---|
111 | livecheck.type sourceforge |
---|