<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[147619] trunk/dports/finance/bitcoin</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/147619">147619</a></dd>
<dt>Author</dt> <dd>easieste@macports.org</dd>
<dt>Date</dt> <dd>2016-04-10 07:05:55 -0700 (Sun, 10 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Major reorganization of bitcoin port (alexreg)

GUI now builds correctly using OS X application bundle.

Parallel build working and enabled.

Daemon now runs system-wide using a dedicated 'bitcoin' user/group,
while the GUI runs as the invoking user.

Daemon uses system-wide config in ${prefix} and GUI uses user
configuration in &lt;file:~/Library/Application Support&gt;.

Added launchd support for daemon.

Added variant for enabling wallet, selected as default.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsfinancebitcoinPortfile">trunk/dports/finance/bitcoin/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportsfinancebitcoinfilesbitcoindlaunchdplist">trunk/dports/finance/bitcoin/files/bitcoind.launchd.plist</a></li>
<li><a href="#trunkdportsfinancebitcoinfilespatchissue7845diff">trunk/dports/finance/bitcoin/files/patch-issue7845.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsfinancebitcoinPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/finance/bitcoin/Portfile (147618 => 147619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/finance/bitcoin/Portfile        2016-04-10 11:39:32 UTC (rev 147618)
+++ trunk/dports/finance/bitcoin/Portfile        2016-04-10 14:05:55 UTC (rev 147619)
</span><span class="lines">@@ -1,91 +1,169 @@
</span><span class="cx"> # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
</span><span class="cx"> # $Id$
</span><span class="cx"> 
</span><del>-PortSystem          1.0
</del><ins>+PortSystem              1.0
</ins><span class="cx"> 
</span><del>-name                bitcoin
-categories          finance crypto
-version             0.12.0
-revision            1
-platforms           darwin
-license             MIT
-maintainers         easieste yopmail.com:sami.laine openmaintainer
-description         client user interface for a peer-to-peer digital currency
-long_description    Bitcoin is a peer-to-peer digital currency. By peer-to-peer,  \
-                    we mean that there is no central authority to issue \
-                    new Bitcoins or keep track of transactions. Instead, these \
-                    tasks are managed collectively by the Bitcoin protocol \
-                    operating through the nodes of the network.
</del><ins>+name                    bitcoin
+categories              finance crypto
+version                 0.12.0
+revision                2
+platforms               darwin
+license                 MIT
+maintainers             easieste yopmail.com:sami.laine openmaintainer
+description             server daemon and client user interface for a peer-to-peer digital currency
+long_description        Bitcoin is a peer-to-peer digital currency. By peer-to-peer,  \
+                        we mean that there is no central authority to issue \
+                        new Bitcoins or keep track of transactions. Instead, these \
+                        tasks are managed collectively by the Bitcoin protocol \
+                        operating through the nodes of the network.
</ins><span class="cx"> 
</span><del>-homepage            https://bitcoin.org/
-master_sites        ${homepage}bin/bitcoin-core-${version}/
</del><ins>+homepage                https://bitcoin.org/
+master_sites            ${homepage}bin/bitcoin-core-${version}/
</ins><span class="cx"> 
</span><del>-checksums           rmd160  aa6a5601ee4e778a2e52cb16b79e5a5e89ca92bb \
-                    sha256  0f1cda66c841a548a07cc37e80b0727354b1236d9f374c7d44362acdb85eb3e1
</del><ins>+checksums               rmd160  aa6a5601ee4e778a2e52cb16b79e5a5e89ca92bb \
+                        sha256  0f1cda66c841a548a07cc37e80b0727354b1236d9f374c7d44362acdb85eb3e1
</ins><span class="cx"> 
</span><del>-depends_build       port:pkgconfig \
-                    port:autoconf \
-                    port:automake \
-                    port:libtool
</del><ins>+patchfiles              patch-issue7845.diff
</ins><span class="cx"> 
</span><del>-depends_lib         port:boost \
-                    path:lib/libssl.dylib:openssl \
-                    port:db48 \
-                    port:libevent \
-                    port:miniupnpc \
-                    port:protobuf-cpp \
-                    port:zmq
</del><ins>+depends_build           port:pkgconfig \
+                        port:autoconf \
+                        port:automake \
+                        port:libtool
</ins><span class="cx"> 
</span><del>-use_parallel_build  no
</del><ins>+depends_lib             port:boost \
+                        path:lib/libssl.dylib:openssl \
+                        port:db48 \
+                        port:libevent \
+                        port:miniupnpc \
+                        port:protobuf-cpp \
+                        port:zmq
</ins><span class="cx"> 
</span><del>-configure.args      --disable-ccache \
-                    --disable-silent-rules
</del><ins>+use_parallel_build      yes
</ins><span class="cx"> 
</span><del>-# TODO: Restore GUI: needs to move to qt5, as it doesn't look like qt4
-# is going to get fixed.
-default_variants     +daemon
</del><ins>+configure.args          --disable-ccache \
+                        --disable-silent-rules
</ins><span class="cx"> 
</span><del>-variant gui description {NOT WORKING Build with qt5} {
-    configure.cmd-append    --with-gui=qt5
-    depends_lib-append      port:qt5
</del><ins>+configure.args-append   --with-daemon=no
+configure.args-append   --with-gui=no
+configure.args-append   --enable-wallet=no
+
+build.target            all
+
+test.run                yes
+test.target             check
+
+default_variants        +daemon +wallet
+
+set bitcoin_user        &quot;bitcoin&quot;
+set bitcoin_group       &quot;${bitcoin_user}&quot;
+set bitcoin_real_name   &quot;Bitcoin Core&quot;
+
+add_users               ${bitcoin_user} group=${bitcoin_group} realname=&quot;${bitcoin_real_name}&quot;
+
+set daemon_path         &quot;${prefix}/bin/bitcoind&quot;
+set daemon_working_dir  &quot;${prefix}/var/run/bitcoind/&quot;
+set daemon_conf_file    &quot;${prefix}/etc/bitcoin/bitcoin.conf&quot;
+set daemon_data_dir     &quot;${prefix}/var/lib/bitcoind/&quot;
+set daemon_pid_file     &quot;${prefix}/var/run/bitcoind/bitcoind.pid&quot;
+
+set gui_app_name        &quot;Bitcoin-Qt.app&quot;
+set gui_app_path        &quot;${applications_dir}/${gui_app_name}&quot;
+set gui_conf_dir        &quot;\$HOME/Library/Application Support/Bitcoin/&quot;
+set gui_conf_file       &quot;${gui_conf_dir}bitcoin.conf&quot;
+set gui_data_dir        &quot;${gui_conf_dir}&quot;
+set gui_pid_file        &quot;${gui_conf_dir}bitcoin.pid&quot;
+
+set launchd_label               &quot;org.macports.${name}&quot;
+set launchd_plist_path          &quot;${prefix}/etc/LaunchDaemons/${launchd_label}/${launchd_label}.plist&quot;
+set launchd_plist_symlink_path  &quot;/Library/LaunchDaemons/${launchd_label}.plist&quot;
+
+variant daemon description {Build and install the daemon} {
+    configure.args-replace  --with-daemon=no    --with-daemon=yes
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-variant daemon description {Build and install only the bitcoind daemon} {
-    configure.cmd-append    --with-gui=no
</del><ins>+variant gui description {Build the Qt5 GUI} {
+    depends_lib-append port:qt5
+    configure.args-replace --with-gui=no --with-gui=qt5
+    build.target-replace all appbundle
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-destroot {
-#    if {![variant_isset daemon]} {
-#        copy ${worksrcpath}/Bitcoin-Qt.app ${destroot}${applications_dir}
-#    }
-    xinstall -W ${worksrcpath}/src bitcoin-cli bitcoind ${destroot}${prefix}/bin
</del><ins>+variant wallet description {Build with support for wallet} {
+    configure.args-replace --enable-wallet=no --enable-wallet=yes
+}
</ins><span class="cx"> 
</span><del>-    set docdir ${prefix}/share/doc/${name}
-    xinstall -d ${destroot}${docdir}
-    xinstall -m 444 -W ${worksrcpath} {*}[glob ${worksrcpath}/doc/*.md] ${destroot}${docdir}
</del><ins>+post-destroot {
+    set config_args &quot;-conf=\&quot;${daemon_conf_file}\&quot; -datadir=\&quot;${daemon_data_dir}\&quot; -pid=\&quot;${daemon_pid_file}\&quot;&quot;
+
+    if {[variant_isset daemon]} {
+        if { [tbool startupitem.install] } {
+            # Install launchd plist for daemon
+            xinstall -d [file dirname &quot;${destroot}/${launchd_plist_path}&quot;]
+            xinstall -m 644 &quot;${filespath}/bitcoind.launchd.plist&quot; &quot;${destroot}/${launchd_plist_path}&quot;
+            reinplace -E &quot;
+                s|@@label@@|${launchd_label}|g;
+                s|@@user_name@@|${bitcoin_user}|g;
+                s|@@group_name@@|${bitcoin_group}|g;
+                s|@@program@@|\&quot;${daemon_path}\&quot; ${config_args}|g;
+                s|@@working_dir@@|${daemon_working_dir}|g;
+                &quot; \
+                &quot;${destroot}/${launchd_plist_path}&quot;
+        }
+    }
+
+    if {[variant_isset gui]} {
+        # Install GUI app
+        copy &quot;${worksrcpath}/${gui_app_name}&quot; &quot;${destroot}/${gui_app_path}&quot;
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-# TODO
-#
-## Automate creation of nonce RPC credentials
-## Add launchctl hooks for daemon
</del><ins>+post-activate {
+    if {[variant_isset daemon]} {
+        xinstall -d [file dirname &quot;${daemon_conf_file}&quot;]
+        xinstall -d -o ${bitcoin_user} -g ${bitcoin_group} &quot;${daemon_data_dir}&quot;
+        xinstall -d -o ${bitcoin_user} -g ${bitcoin_group} [file dirname &quot;${daemon_pid_file}&quot;]
</ins><span class="cx"> 
</span><ins>+        file mkdir -p [file dirname &quot;${launchd_plist_symlink_path}&quot;]
+        ln -sf &quot;${launchd_plist_path}&quot; &quot;${launchd_plist_symlink_path}&quot;
+    }
+}
+
+pre-deactivate {
+    if {[variant_isset daemon]} {
+        file delete &quot;${launchd_plist_symlink_path}&quot;
+    }
+}
+
</ins><span class="cx"> notes &quot;
</span><span class="cx"> 
</span><del>-1.  Sanity in scripting:
</del><ins>+1.  A launch daemon entry has been created for ${name}. It is disabled by default. To enable and load the daemon:
</ins><span class="cx"> 
</span><del>-    cmd$ ln -s \&quot;~/Library/Application Support/Bitcoin\&quot; ~/.bitcoin
</del><ins>+    cmd$ sudo launchctl load -w \&quot;${launchd_plist_symlink_path}\&quot;
</ins><span class="cx"> 
</span><del>-2.  View progress with:
</del><ins>+2.  Start the daemon manually in the background:
</ins><span class="cx"> 
</span><del>-    cmd$ tail -F ~/.bitcoin/debug.log
</del><ins>+    cmd$ ${daemon_path} -daemon
</ins><span class="cx"> 
</span><del>-3.  Edit ~/.bitcoin/bitcoin.conf with RPC credentials
</del><ins>+3.  Symlink the GUI configuration into your home directory:
</ins><span class="cx"> 
</span><del>-4.  Start in background via:
-    
-    cmd$ ${prefix}/sbin/bitcoind -daemon
</del><ins>+    cmd$ ln -s \&quot;${gui_data_dir}\&quot; ~/.bitcoin
</ins><span class="cx"> 
</span><ins>+4.  View the configuration:
+
+    # Daemon:
+    cmd$ less \&quot;${daemon_conf_file}\&quot;
+    # GUI:
+    cmd$ less \&quot;${gui_conf_file}\&quot;
+
+5.  View the log:
+
+    # Daemon:
+    cmd$ tail -F \&quot;${daemon_data_dir}debug.log\&quot;
+    # GUI:
+    cmd$ tail -F \&quot;${gui_data_dir}debug.log\&quot;
+
+6.  Edit \&quot;${daemon_data_dir}\&quot; and \&quot;${gui_conf_file}\&quot; to include the RPC credentials.
+    See https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md#running for more information.
+
</ins><span class="cx"> &quot;
</span><span class="cx"> 
</span><span class="cx"> livecheck.type      regex
</span></span></pre></div>
<a id="trunkdportsfinancebitcoinfilesbitcoindlaunchdplist"></a>
<div class="binary"><h4>Added: trunk/dports/finance/bitcoin/files/bitcoind.launchd.plist</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/dports/finance/bitcoin/files/bitcoind.launchd.plist
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkdportsfinancebitcoinfilespatchissue7845diff"></a>
<div class="addfile"><h4>Added: trunk/dports/finance/bitcoin/files/patch-issue7845.diff (0 => 147619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/finance/bitcoin/files/patch-issue7845.diff                                (rev 0)
+++ trunk/dports/finance/bitcoin/files/patch-issue7845.diff        2016-04-10 14:05:55 UTC (rev 147619)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+--- src/util.cpp        2016-04-10 01:01:33.000000000 +0100
++++ src/util.cpp        2016-04-10 01:01:51.000000000 +0100
+@@ -472,7 +472,6 @@
+ #ifdef MAC_OSX
+     // Mac
+     pathRet /= &quot;Library/Application Support&quot;;
+-    TryCreateDirectory(pathRet);
+     return pathRet / &quot;Bitcoin&quot;;
+ #else
+     // Unix
</ins></span></pre>
</div>
</div>

</body>
</html>