aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2020-07-09 14:54:55 +0300
committerEfraim Flashner <efraim@flashner.co.il>2020-07-09 17:00:26 +0300
commitd7b0db6e4e9ca9cd32765fc6bdd3f9933f097d61 (patch)
tree4acec975eabbbb51745fda355c982047c1d89cce
parent5eb7531bede1fbc0818086cf495eaf31e6d9d85f (diff)
downloadguix-d7b0db6e4e9ca9cd32765fc6bdd3f9933f097d61.tar.gz
guix-d7b0db6e4e9ca9cd32765fc6bdd3f9933f097d61.zip
gnu: rust-wincolor-1.0: Update to 1.0.3.
* gnu/packages/crates-io.scm (rust-wincolor-1.0): Update to 1.0.3.
-rw-r--r--gnu/packages/crates-io.scm4
1 files changed, 2 insertions, 2 deletions
diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index e910674517..d881daa925 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -28611,7 +28611,7 @@ x86_64-pc-windows-gnu target. Please don't use this crate directly, depend on
(define-public rust-wincolor-1.0
(package
(name "rust-wincolor")
- (version "1.0.2")
+ (version "1.0.3")
(source
(origin
(method url-fetch)
@@ -28619,7 +28619,7 @@ x86_64-pc-windows-gnu target. Please don't use this crate directly, depend on
(file-name (string-append name "-" version ".crate"))
(sha256
(base32
- "1agaf3hcav113i86912ajnw6jxcy4rvkrgyf8gdj8kc031mh3xcn"))))
+ "017x33ljndwc76cp5z9llgndn0nh7v8jcjaykbizkawmwy9n3pyp"))))
(build-system cargo-build-system)
(arguments
`(#:cargo-inputs
ch \
%D%/packages/patches/python-seaborn-kde-test.patch \
+ %D%/packages/patches/python-trezor-agent-fix-argv0.patch \
%D%/packages/patches/python2-subprocess32-disable-input-test.patch \
%D%/packages/patches/python-unittest2-python3-compat.patch \
%D%/packages/patches/python-unittest2-remove-argparse.patch \
diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index 00e3b7a5af..f4978a444b 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -844,7 +844,8 @@ the Monero GUI client.")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "0q99vbfd3h85s8rnjipnmldixabqmmlk5w9karv6f0rhyi54f4zv"))))
+ (base32 "0q99vbfd3h85s8rnjipnmldixabqmmlk5w9karv6f0rhyi54f4zv"))
+ (patches (search-patches "python-trezor-agent-fix-argv0.patch"))))
(build-system python-build-system)
(arguments
`(#:phases
@@ -1091,7 +1092,15 @@ the KeepKey Hardware Wallet.")
(add-after 'wrap 'fixup-agent-py
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")))
- ;; overwrite the wrapper with the real thing.
+ ;; The wrap phase also wraps trezor_agent.py (besides the
+ ;; public facing executable called trezor-agent). We need to
+ ;; undo that wrapping. The reason this is needed is that the
+ ;; python easy install generates a toplevel script (?) that
+ ;; messes with argv[0] and then re-opens the python
+ ;; module. This fails when the wrapped file is actually a shell
+ ;; script, not a python file.
+ (delete-file (string-append out "/bin/.trezor_agent.py-real"))
+ ;; Overwrite the wrapped one with the real thing.
(install-file "./trezor_agent.py"
(string-append out "/bin"))
#t))))))
diff --git a/gnu/packages/patches/python-trezor-agent-fix-argv0.patch b/gnu/packages/patches/python-trezor-agent-fix-argv0.patch
new file mode 100644
index 0000000000..9462067cd5
--- /dev/null
+++ b/gnu/packages/patches/python-trezor-agent-fix-argv0.patch
@@ -0,0 +1,27 @@
+diff --git a/libagent/gpg/__init__.py b/libagent/gpg/__init__.py
+index 3711bc8..67085de 100644
+--- a/libagent/gpg/__init__.py
++++ b/libagent/gpg/__init__.py
+@@ -122,15 +122,19 @@ def run_init(device_type, args):
+ verify_gpg_version()
+
+ # Prepare new GPG home directory for hardware-based identity
+- device_name = os.path.basename(sys.argv[0]).rsplit('-', 1)[0]
+- log.info('device name: %s', device_name)
++ exe_name = os.path.basename(sys.argv[0])
++ # drop the Guix wrapper's dot prefix from the name
++ if exe_name[0] == '.' and exe_name.endswith('-real'):
++ exe_name = exe_name[1:-5:]
++ device_name = exe_name.rsplit('-', 1)[0]
++ log.info('exe name: %s, device name: %s', exe_name, device_name)
+ homedir = args.homedir
+ if not homedir:
+ homedir = os.path.expanduser('~/.gnupg/{}'.format(device_name))
+
+ log.info('GPG home directory: %s', homedir)
+
+- if os.path.exists(homedir):
++ if os.path.exists(homedir) and not args.subkey:
+ log.error('GPG home directory %s exists, '
+ 'remove it manually if required', homedir)
+ sys.exit(1)