source: trunk/dports/finance/bitcoin/Portfile

Last change on this file was 147864, checked in by easieste@…, 19 months ago

finance/bitcoin: enable use of QR codes with QT client

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.9 KB
Line 
1# -*- 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
2# $Id: Portfile 147864 2016-04-19 05:23:35Z ryandesign@macports.org $
3
4PortSystem              1.0
5
6name                    bitcoin
7categories              finance crypto
8version                 0.12.1
9revision                3
10platforms               darwin
11license                 MIT
12maintainers             easieste yopmail.com:sami.laine openmaintainer
13description             server daemon and client user interface for a peer-to-peer digital currency
14long_description        Bitcoin is a peer-to-peer digital currency. By peer-to-peer,  \
15                        we mean that there is no central authority to issue \
16                        new Bitcoins or keep track of transactions. Instead, these \
17                        tasks are managed collectively by the Bitcoin protocol \
18                        operating through the nodes of the network.
19
20homepage                https://bitcoin.org/
21master_sites            ${homepage}bin/bitcoin-core-${version}/
22
23checksums               rmd160  95d5c0b79969d28d23b3330bb2fb5d4c94fe8919 \
24                        sha256  08fc3b6c05c39fb975bba1f6dd49992df46511790ce8dc67398208af9565e199
25
26patchfiles              patch-issue7845.diff
27
28depends_build           port:pkgconfig \
29                        port:autoconf \
30                        port:automake \
31                        port:libtool
32
33depends_lib             port:boost \
34                        path:lib/libssl.dylib:openssl \
35                        port:db48 \
36                        port:libevent \
37                        port:miniupnpc \
38                        port:protobuf-cpp \
39                        port:zmq
40
41use_parallel_build      yes
42
43configure.args          --disable-ccache \
44                        --disable-silent-rules
45
46configure.args-append   --with-daemon=no
47configure.args-append   --with-gui=no
48configure.args-append   --enable-wallet=no
49
50build.target            all
51
52test.run                yes
53test.target             check
54
55default_variants        +daemon +wallet
56
57set bitcoin_user        "bitcoin"
58set bitcoin_group       "${bitcoin_user}"
59set bitcoin_real_name   "Bitcoin Core"
60
61add_users               ${bitcoin_user} group=${bitcoin_group} realname="${bitcoin_real_name}"
62
63set daemon_path         "${prefix}/bin/bitcoind"
64set daemon_working_dir  "${prefix}/var/run/bitcoind/"
65set daemon_conf_file    "${prefix}/etc/bitcoin/bitcoin.conf"
66set daemon_data_dir     "${prefix}/var/lib/bitcoind/"
67set daemon_pid_file     "${prefix}/var/run/bitcoind/bitcoind.pid"
68
69set gui_app_name        "Bitcoin-Qt.app"
70set gui_app_path        "${applications_dir}/${gui_app_name}"
71set gui_conf_dir        "\$HOME/Library/Application Support/Bitcoin/"
72set gui_conf_file       "${gui_conf_dir}bitcoin.conf"
73set gui_data_dir        "${gui_conf_dir}"
74set gui_pid_file        "${gui_conf_dir}bitcoin.pid"
75
76set launchd_label               "org.macports.${name}"
77set launchd_plist_path          "${prefix}/etc/LaunchDaemons/${launchd_label}/${launchd_label}.plist"
78set launchd_plist_symlink_path  "/Library/LaunchDaemons/${launchd_label}.plist"
79
80variant daemon description {Build and install the daemon} {
81    configure.args-replace  --with-daemon=no    --with-daemon=yes
82}
83
84variant gui description {Build the Qt5 GUI} {
85    configure.args-replace --with-gui=no --with-gui=qt5
86    depends_lib-append port:qt5 port:qrencode
87    configure.args-append --with-qrencode
88    build.target-replace all appbundle
89}
90
91variant wallet description {Build with support for wallet} {
92    configure.args-replace --enable-wallet=no --enable-wallet=yes
93}
94
95post-destroot {
96    set config_args "-conf=\"${daemon_conf_file}\" -datadir=\"${daemon_data_dir}\" -pid=\"${daemon_pid_file}\""
97
98    if {[variant_isset daemon]} {
99        if { [tbool startupitem.install] } {
100            # Install launchd plist for daemon
101            xinstall -d [file dirname "${destroot}/${launchd_plist_path}"]
102            xinstall -m 644 "${filespath}/bitcoind.launchd.plist" "${destroot}/${launchd_plist_path}"
103            reinplace -E "
104                s|@@label@@|${launchd_label}|g;
105                s|@@user_name@@|${bitcoin_user}|g;
106                s|@@group_name@@|${bitcoin_group}|g;
107                s|@@program@@|\"${daemon_path}\" ${config_args}|g;
108                s|@@working_dir@@|${daemon_working_dir}|g;
109                " \
110                "${destroot}/${launchd_plist_path}"
111        }
112    }
113
114    if {[variant_isset gui]} {
115        # Install GUI app
116        copy "${worksrcpath}/${gui_app_name}" "${destroot}/${gui_app_path}"
117    }
118}
119
120post-activate {
121    if {[variant_isset daemon]} {
122        xinstall -d [file dirname "${daemon_conf_file}"]
123        xinstall -d -o ${bitcoin_user} -g ${bitcoin_group} "${daemon_data_dir}"
124        xinstall -d -o ${bitcoin_user} -g ${bitcoin_group} [file dirname "${daemon_pid_file}"]
125
126        file mkdir -p [file dirname "${launchd_plist_symlink_path}"]
127        ln -sf "${launchd_plist_path}" "${launchd_plist_symlink_path}"
128    }
129}
130
131pre-deactivate {
132    if {[variant_isset daemon]} {
133        file delete "${launchd_plist_symlink_path}"
134    }
135}
136
137notes "
138
1391.  A launch daemon entry has been created for ${name}. It is disabled by default. To enable and load the daemon:
140
141    cmd$ sudo launchctl load -w \"${launchd_plist_symlink_path}\"
142
1432.  Start the daemon manually in the background:
144
145    cmd$ ${daemon_path} -daemon
146
1473.  Symlink the GUI configuration into your home directory:
148
149    cmd$ ln -s \"${gui_data_dir}\" ~/.bitcoin
150
1514.  View the configuration:
152
153    # Daemon:
154    cmd$ less \"${daemon_conf_file}\"
155    # GUI:
156    cmd$ less \"${gui_conf_file}\"
157
1585.  View the log:
159
160    # Daemon:
161    cmd$ tail -F \"${daemon_data_dir}debug.log\"
162    # GUI:
163    cmd$ tail -F \"${gui_data_dir}debug.log\"
164
1656.  Edit \"${daemon_data_dir}\" and \"${gui_conf_file}\" to include the RPC credentials.
166    See https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md#running for more information.
167
168"
169
170livecheck.type      regex
171livecheck.url       ${homepage}bin/
172livecheck.regex     ${name}-core-(\[0-9.\]+)/
Note: See TracBrowser for help on using the repository browser.