Skip to content

Commit 374ff1a

Browse files
committed
merge share upstream with btc
1 parent ef52d4d commit 374ff1a

File tree

7 files changed

+93
-27
lines changed

7 files changed

+93
-27
lines changed

share/genbuild.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/bin/sh
2+
# Copyright (c) 2012-2016 The Syscoin Core developers
3+
# Distributed under the MIT software license, see the accompanying
4+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5+
26
if [ $# -gt 1 ]; then
3-
cd "$2"
7+
cd "$2" || exit 1
48
fi
59
if [ $# -gt 0 ]; then
610
FILE="$1"
@@ -13,10 +17,13 @@ else
1317
exit 1
1418
fi
1519

20+
git_check_in_repo() {
21+
! { git status --porcelain -uall --ignored "$@" 2>/dev/null || echo '??'; } | grep -q '?'
22+
}
23+
1624
DESC=""
1725
SUFFIX=""
18-
LAST_COMMIT_DATE=""
19-
if [ -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then
26+
if [ "${SYSCOIN_GENBUILD_NO_GIT}" != "1" -a -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ] && git_check_in_repo share/genbuild.sh; then
2027
# clean 'dirty' status of touched files that haven't been modified
2128
git diff >/dev/null 2>/dev/null
2229

@@ -29,9 +36,6 @@ if [ -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/
2936
# otherwise generate suffix from git, i.e. string like "59887e8-dirty"
3037
SUFFIX=$(git rev-parse --short HEAD)
3138
git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-dirty"
32-
33-
# get a string like "2012-04-10 16:27:19 +0200"
34-
LAST_COMMIT_DATE="$(git log -n 1 --format="%ci")"
3539
fi
3640

3741
if [ -n "$DESC" ]; then
@@ -45,7 +49,4 @@ fi
4549
# only update build.h if necessary
4650
if [ "$INFO" != "$NEWINFO" ]; then
4751
echo "$NEWINFO" >"$FILE"
48-
if [ -n "$LAST_COMMIT_DATE" ]; then
49-
echo "#define BUILD_DATE \"$LAST_COMMIT_DATE\"" >> "$FILE"
50-
fi
5152
fi

share/qt/Info.plist.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<plist version="0.9">
44
<dict>
55
<key>LSMinimumSystemVersion</key>
6-
<string>10.7.0</string>
6+
<string>10.8.0</string>
77

88
<key>LSArchitecturePriority</key>
99
<array>
@@ -17,7 +17,7 @@
1717
<string>APPL</string>
1818

1919
<key>CFBundleGetInfoString</key>
20-
<string>@CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@, Copyright © 2009-@COPYRIGHT_YEAR@ The Syscoin Core developers, 2014-@COPYRIGHT_YEAR@ The Syscoin Core developers</string>
20+
<string>@CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@, Copyright © 2009-@COPYRIGHT_YEAR@ @COPYRIGHT_HOLDERS_FINAL@</string>
2121

2222
<key>CFBundleShortVersionString</key>
2323
<string>@CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@</string>
@@ -38,7 +38,7 @@
3838
<true/>
3939

4040
<key>CFBundleIdentifier</key>
41-
<string>org.syscoin.Syscoin-Qt</string>
41+
<string>org.syscoinfoundation.Syscoin-Qt</string>
4242

4343
<key>CFBundleURLTypes</key>
4444
<array>
@@ -71,7 +71,7 @@
7171
<string>application/x-syscoin-payment-request</string>
7272
<key>public.filename-extension</key>
7373
<array>
74-
<string>syscoinmentrequest</string>
74+
<string>syscoinpaymentrequest</string>
7575
</array>
7676
</dict>
7777
</dict>

share/qt/extract_strings_qt.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python3
2+
# Copyright (c) 2012-2017 The Syscoin Core developers
3+
# Distributed under the MIT software license, see the accompanying
4+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
25
'''
3-
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
6+
Extract _("...") strings for translation and convert to Qt stringdefs so that
47
they can be picked up by Qt linguist.
58
'''
69
from subprocess import Popen, PIPE
7-
import glob
810
import operator
911
import os
1012
import sys
@@ -52,24 +54,32 @@ def parse_po(text):
5254

5355
# xgettext -n --keyword=_ $FILES
5456
XGETTEXT=os.getenv('XGETTEXT', 'xgettext')
57+
if not XGETTEXT:
58+
print('Cannot extract strings: xgettext utility is not installed or not configured.',file=sys.stderr)
59+
print('Please install package "gettext" and re-run \'./configure\'.',file=sys.stderr)
60+
sys.exit(1)
5561
child = Popen([XGETTEXT,'--output=-','-n','--keyword=_'] + files, stdout=PIPE)
5662
(out, err) = child.communicate()
5763

58-
messages = parse_po(out)
64+
messages = parse_po(out.decode('utf-8'))
5965

6066
f = open(OUT_CPP, 'w')
6167
f.write("""
6268
6369
#include <QtGlobal>
6470
65-
// Automatically generated by extract_strings.py
71+
// Automatically generated by extract_strings_qt.py
6672
#ifdef __GNUC__
6773
#define UNUSED __attribute__((unused))
6874
#else
6975
#define UNUSED
7076
#endif
7177
""")
7278
f.write('static const char UNUSED *syscoin_strings[] = {\n')
79+
f.write('QT_TRANSLATE_NOOP("syscoin-core", "%s"),\n' % (os.getenv('PACKAGE_NAME'),))
80+
f.write('QT_TRANSLATE_NOOP("syscoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS'),))
81+
if os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION') != os.getenv('PACKAGE_NAME'):
82+
f.write('QT_TRANSLATE_NOOP("syscoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION'),))
7383
messages.sort(key=operator.itemgetter(0))
7484
for (msgid, msgstr) in messages:
7585
if msgid != EMPTY:

share/rpcauth/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
RPC Tools
2+
---------------------
3+
4+
### [RPCAuth](/share/rpcauth) ###
5+
6+
Create login credentials for a JSON-RPC user.
7+
8+
Usage:
9+
10+
./rpcauth.py <username>
11+
12+
in which case the script will generate a password. To specify a custom password do:
13+
14+
./rpcauth.py <username> <password>

share/rpcauth/rpcauth.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env python3
2+
# Copyright (c) 2015-2017 The Syscoin Core developers
3+
# Distributed under the MIT software license, see the accompanying
4+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5+
6+
import sys
7+
import os
8+
from random import SystemRandom
9+
import base64
10+
import hmac
11+
12+
def generate_salt():
13+
# This uses os.urandom() underneath
14+
cryptogen = SystemRandom()
15+
16+
# Create 16 byte hex salt
17+
salt_sequence = [cryptogen.randrange(256) for _ in range(16)]
18+
return ''.join([format(r, 'x') for r in salt_sequence])
19+
20+
def generate_password():
21+
"""Create 32 byte b64 password"""
22+
return base64.urlsafe_b64encode(os.urandom(32)).decode('utf-8')
23+
24+
def password_to_hmac(salt, password):
25+
m = hmac.new(bytearray(salt, 'utf-8'), bytearray(password, 'utf-8'), 'SHA256')
26+
return m.hexdigest()
27+
28+
def main():
29+
if len(sys.argv) < 2:
30+
sys.stderr.write('Please include username (and an optional password, will generate one if not provided) as an argument.\n')
31+
sys.exit(0)
32+
33+
username = sys.argv[1]
34+
35+
salt = generate_salt()
36+
if len(sys.argv) > 2:
37+
password = sys.argv[2]
38+
else:
39+
password = generate_password()
40+
password_hmac = password_to_hmac(salt, password)
41+
42+
print('String to be appended to syscoin.conf:')
43+
print('rpcauth={0}:{1}${2}'.format(username, salt, password_hmac))
44+
print('Your password:\n{0}'.format(password))
45+
46+
if __name__ == '__main__':
47+
main()

share/rpcuser/rpcuser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python2
2-
# Copyright (c) 2015 The Bitcoin Core developers
2+
# Copyright (c) 2015 The Syscoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

share/setup.nsi.in

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ SetCompressor /SOLID lzma
2020
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
2121
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
2222
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "@PACKAGE_NAME@"
23-
!define MUI_FINISHPAGE_RUN $INSTDIR\@SYSCOIN_GUI_NAME@@EXEEXT@
23+
!define MUI_FINISHPAGE_RUN "$WINDIR\explorer.exe"
24+
!define MUI_FINISHPAGE_RUN_PARAMETERS $INSTDIR\@SYSCOIN_GUI_NAME@@EXEEXT@
2425
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
2526
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "@abs_top_srcdir@/share/pixmaps/nsis-wizard.bmp"
2627
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
@@ -107,10 +108,6 @@ Section -post SEC0001
107108
WriteRegStr HKCR "@PACKAGE_TARNAME@" "" "URL:Syscoin"
108109
WriteRegStr HKCR "@PACKAGE_TARNAME@\DefaultIcon" "" $INSTDIR\@SYSCOIN_GUI_NAME@@EXEEXT@
109110
WriteRegStr HKCR "@PACKAGE_TARNAME@\shell\open\command" "" '"$INSTDIR\@SYSCOIN_GUI_NAME@@EXEEXT@" "%1"'
110-
111-
# Delete old key (before we switched to PACKAGE_TARNAME, which is set to 'syscoincore' now, we had 'syscoin' hardcoded)
112-
# TODO remove this line sometime later
113-
DeleteRegKey HKCR "syscoin"
114111
SectionEnd
115112

116113
# Macro for selecting uninstaller sections
@@ -150,9 +147,6 @@ Section -un.post UNSEC0001
150147
DeleteRegKey /IfEmpty HKCU "${REGKEY}\Components"
151148
DeleteRegKey /IfEmpty HKCU "${REGKEY}"
152149
DeleteRegKey HKCR "@PACKAGE_TARNAME@"
153-
# Delete old key (before we switched to PACKAGE_TARNAME, which is set to 'syscoincore' now, we had 'syscoin' hardcoded)
154-
# TODO remove this line sometime later
155-
DeleteRegKey HKCR "syscoin"
156150
RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
157151
RmDir /REBOOTOK $INSTDIR
158152
Push $R0

0 commit comments

Comments
 (0)