Ticket #51109: Portfile-bitcoin.diff
File Portfile-bitcoin.diff, 6.6 KB (added by neverpanic (Clemens Lang), 9 years ago) |
---|
-
Portfile
old new 6 6 name bitcoin 7 7 categories finance crypto 8 8 version 0.12.0 9 revision 19 revision 2 10 10 platforms darwin 11 11 license MIT 12 12 maintainers easieste yopmail.com:sami.laine openmaintainer 13 description client user interface for a peer-to-peer digital currency13 description server daemon and client user interface for a peer-to-peer digital currency 14 14 long_description Bitcoin is a peer-to-peer digital currency. By peer-to-peer, \ 15 15 we mean that there is no central authority to issue \ 16 16 new Bitcoins or keep track of transactions. Instead, these \ … … 23 23 checksums rmd160 aa6a5601ee4e778a2e52cb16b79e5a5e89ca92bb \ 24 24 sha256 0f1cda66c841a548a07cc37e80b0727354b1236d9f374c7d44362acdb85eb3e1 25 25 26 patchfiles patch-issue7845.diff 27 26 28 depends_build port:pkgconfig \ 27 29 port:autoconf \ 28 30 port:automake \ … … 36 38 port:protobuf-cpp \ 37 39 port:zmq 38 40 39 use_parallel_build no41 use_parallel_build yes 40 42 41 43 configure.args --disable-ccache \ 42 44 --disable-silent-rules 43 45 44 # TODO: Restore GUI: needs to move to qt5, as it doesn't look like qt4 45 # is going to get fixed. 46 default_variants +daemon 46 configure.args-append --with-daemon=no 47 configure.args-append --with-gui=no 48 configure.args-append --enable-wallet=no 49 50 build.target all 51 52 test.run yes 53 test.target check 54 55 default_variants +daemon +wallet 56 57 set bitcoin_user "bitcoin" 58 set bitcoin_group "${bitcoin_user}" 59 set bitcoin_real_name "Bitcoin Core" 60 61 add_users ${bitcoin_user} group=${bitcoin_group} realname="${bitcoin_real_name}" 62 63 set daemon_path "${prefix}/bin/bitcoind" 64 set daemon_working_dir "${prefix}/var/run/bitcoind/" 65 set daemon_conf_file "${prefix}/etc/bitcoin/bitcoin.conf" 66 set daemon_data_dir "${prefix}/var/lib/bitcoind/" 67 set daemon_pid_file "${prefix}/var/run/bitcoind/bitcoind.pid" 68 69 set gui_app_name "Bitcoin-Qt.app" 70 set gui_app_path "${applications_dir}/${gui_app_name}" 71 set gui_conf_dir "\$HOME/Library/Application Support/Bitcoin/" 72 set gui_conf_file "${gui_conf_dir}bitcoin.conf" 73 set gui_data_dir "${gui_conf_dir}" 74 set gui_pid_file "${gui_conf_dir}bitcoin.pid" 75 76 set launchd_label "org.macports.${name}" 77 set launchd_plist_path "${prefix}/etc/LaunchDaemons/${launchd_label}/${launchd_label}.plist" 78 set launchd_plist_symlink_path "/Library/LaunchDaemons/${launchd_label}.plist" 79 80 variant daemon description {Build and install the daemon} { 81 configure.args-replace --with-daemon=no --with-daemon=yes 82 } 47 83 48 variant gui description {NOT WORKING Build with qt5} { 49 configure.cmd-append --with-gui=qt5 84 variant gui description {Build the Qt5 GUI} { 50 85 depends_lib-append port:qt5 86 configure.args-replace --with-gui=no --with-gui=qt5 87 build.target-replace all appbundle 51 88 } 52 89 53 variant daemon description {Build and install only the bitcoind daemon} {54 configure. cmd-append --with-gui=no90 variant wallet description {Build with support for wallet} { 91 configure.args-replace --enable-wallet=no --enable-wallet=yes 55 92 } 56 93 57 destroot { 58 # if {![variant_isset daemon]} { 59 # copy ${worksrcpath}/Bitcoin-Qt.app ${destroot}${applications_dir} 60 # } 61 xinstall -W ${worksrcpath}/src bitcoin-cli bitcoind ${destroot}${prefix}/bin 94 post-destroot { 95 set config_args "-conf=\"${daemon_conf_file}\" -datadir=\"${daemon_data_dir}\" -pid=\"${daemon_pid_file}\"" 96 97 if {[variant_isset daemon]} { 98 if { [tbool startupitem.install] } { 99 # Install launchd plist for daemon 100 xinstall -d [file dirname "${destroot}/${launchd_plist_path}"] 101 xinstall -m 644 "${filespath}/bitcoind.launchd.plist" "${destroot}/${launchd_plist_path}" 102 reinplace -E " 103 s|@@label@@|${launchd_label}|g; 104 s|@@user_name@@|${bitcoin_user}|g; 105 s|@@group_name@@|${bitcoin_group}|g; 106 s|@@program@@|\"${daemon_path}\" ${config_args}|g; 107 s|@@working_dir@@|${daemon_working_dir}|g; 108 " \ 109 "${destroot}/${launchd_plist_path}" 110 } 111 } 112 113 if {[variant_isset gui]} { 114 # Install GUI app 115 copy "${worksrcpath}/${gui_app_name}" "${destroot}/${gui_app_path}" 116 } 117 } 62 118 63 set docdir ${prefix}/share/doc/${name} 64 xinstall -d ${destroot}${docdir} 65 xinstall -m 444 -W ${worksrcpath} {*}[glob ${worksrcpath}/doc/*.md] ${destroot}${docdir} 119 post-activate { 120 if {[variant_isset daemon]} { 121 xinstall -d [file dirname "${daemon_conf_file}"] 122 xinstall -d -o ${bitcoin_user} -g ${bitcoin_group} "${daemon_data_dir}" 123 xinstall -d -o ${bitcoin_user} -g ${bitcoin_group} [file dirname "${daemon_pid_file}"] 124 125 file mkdir -p [file dirname "${launchd_plist_symlink_path}"] 126 ln -sf "${launchd_plist_path}" "${launchd_plist_symlink_path}" 127 } 66 128 } 67 129 68 # TODO 69 # 70 ## Automate creation of nonce RPC credentials 71 ## Add launchctl hooks for daemon 130 pre-deactivate { 131 if {[variant_isset daemon]} { 132 file delete "${launchd_plist_symlink_path}" 133 } 134 } 72 135 73 136 notes " 74 137 75 1. Sanity in scripting: 138 1. A launch daemon entry has been created for ${name}. It is disabled by default. To enable and load the daemon: 139 140 cmd$ sudo launchctl load -w \"${launchd_plist_symlink_path}\" 141 142 2. Start the daemon manually in the background: 143 144 cmd$ ${daemon_path} -daemon 145 146 3. Symlink the GUI configuration into your home directory: 76 147 77 cmd$ ln -s \" ~/Library/Application Support/Bitcoin\" ~/.bitcoin148 cmd$ ln -s \"${gui_data_dir}\" ~/.bitcoin 78 149 79 2. View progress with:150 4. View the configuration: 80 151 81 cmd$ tail -F ~/.bitcoin/debug.log 152 # Daemon: 153 cmd$ less \"${daemon_conf_file}\" 154 # GUI: 155 cmd$ less \"${gui_conf_file}\" 82 156 83 3. Edit ~/.bitcoin/bitcoin.conf with RPC credentials 157 5. View the log: 84 158 85 4. Start in background via: 159 # Daemon: 160 cmd$ tail -F \"${daemon_data_dir}debug.log\" 161 # GUI: 162 cmd$ tail -F \"${gui_data_dir}debug.log\" 86 163 87 cmd$ ${prefix}/sbin/bitcoind -daemon 164 6. Edit \"${daemon_conf_file}\" and \"${gui_conf_file}\" to include the RPC credentials. 165 See https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md#running for more information. 88 166 89 167 " 90 168