@@ -13,7 +13,8 @@ SHELL = /bin/bash
1313
1414# Change to your own Apple Developer ID, if you want to code-sign the resultant .app
1515
16- ALL = gui,serial,wallet,invoice
16+ MIN = gui,wallet
17+ ALL = gui,wallet,serial,invoice
1718
1819APPLEID ?= perry@kundert.ca
1920TEAMID ?= ZD8TVTCXDS
@@ -90,7 +91,7 @@ VENV_OPTS = --system-site-packages --copies # make available references some sys
9091all : help
9192
9293help :
93- @echo " GNUmakefile for cpppo . Targets:"
94+ @echo " GNUmakefile for python-slip39 . Targets:"
9495 @echo " help This help"
9596 @echo " test Run unit tests under Python3"
9697 @echo " clean Remove build artifacts"
@@ -99,7 +100,17 @@ help:
99100 @echo " upload Upload new version to pypi (package maintainer only)"
100101 @echo " app Build the macOS SLIP-39.app"
101102 @echo " installer Build the .dmg, .msi, as appropriate for PLATFORM"
102- @echo " print-PLATFORM prints the detected PLATFORM"
103+ @echo
104+ @echo " nix-venv Create and/or start Nix-supplied Python virtual env"
105+ @echo " nix-venv-test Run the 'make test' target within the Nix Python venv"
106+ @echo " TARGET=py313 make nix-venv... Use a Python 3.13 Nix environment for the remaining targets"
107+ @echo " PATH=/usr/local/bin:$PATH make venv... Use an installed Python environment for the remaining targets"
108+
109+
110+ # Installs ALL optional Python requirements for testing
111+ .PHONY : deps-test
112+ deps-test : install-all \
113+ slip39/payments_test/slip-39-app.crypto-license
103114
104115test : deps-test
105116 $(PYTEST ) $(PYTEST_OPTS )
@@ -143,7 +154,11 @@ clean:
143154
144155nix-% :
145156 @if [ -r flake.nix ]; then \
146- nix develop $(NIX_OPTS ) --command make $* ; \
157+ if [ -n " $( TARGET) " ]; then \
158+ nix develop .# $(TARGET) $(NIX_OPTS) --command make $*; \
159+ else \
160+ nix develop $(NIX_OPTS ) --command make $* ; \
161+ fi ; \
147162 else \
148163 nix-shell $(NIX_OPTS) --run "make $*"; \
149164 fi
@@ -158,7 +173,6 @@ print-%:
158173 @echo $* \' s origin is $(origin $* )
159174
160175
161-
162176#
163177# org-mode products.
164178#
@@ -365,9 +379,6 @@ $(PAY-TEST-LIC): GRANTS="{\"crypto-licensing-server\": {\
365379}}"
366380
367381
368- .PHONY : deps-test
369- deps-test : slip39/payments_test/slip-39-app.crypto-license
370-
371382# Try to copy the generated slip-39-app.crypto-license, if it exists, but no worries if it doesn't
372383slip39/payments_test/slip-39-app.crypto-license : FORCE
373384 cp $(SLIP-39-LIC ) $@ 2> /dev/null || echo " Missing $( SLIP-39-LIC) ; ignoring..."
@@ -415,6 +426,7 @@ venv: $(VENV)
415426 @echo; echo " *** Activating $< VirtualEnv for Interactive $( SHELL) "
416427 @bash --init-file $< /bin/activate -i
417428
429+ # Installs the MIN optional Python requirements to support GUI, paper wallets
418430$(VENV ) :
419431 @[[ " $( PYTHON_V) " =~ " ^venv" ]] && ( echo -e " \n\n!!! $@ Cannot start a venv within a venv" ; false ) || true
420432 @echo; echo " *** Building $@ VirtualEnv..."
@@ -431,6 +443,9 @@ $(WHEEL): install-dev FORCE
431443
432444# Install from wheel, including all optional extra dependencies (except dev). Always use the venv (or global)
433445install : $(WHEEL ) FORCE
446+ $(PYTHON ) -m pip install --no-user --force-reinstall $< [$( MIN) ]
447+
448+ install-all :
434449 $(PYTHON ) -m pip install --no-user --force-reinstall $< [$( ALL) ]
435450
436451install-% : # ...-dev, -tests, -gui, -serial, -wallet, -invoice
@@ -909,6 +924,7 @@ app-assess: dist/SLIP-39.app
909924#
910925#
911926# The --onefile approach is incompatible with macOS Apps; use --onedir
927+ # Ensures various Python packages using shared libraries are made available
912928SLIP-39-macOS.spec : SLIP-39.py
913929 @echo -e " \n\n!!! Rebuilding $@ ; Must be manually edited..."
914930 pyinstaller --noconfirm --windowed --onedir \
@@ -917,6 +933,13 @@ SLIP-39-macOS.spec: SLIP-39.py
917933 --collect-data shamir_mnemonic \
918934 --collect-all tzdata \
919935 --collect-all zoneinfo \
936+ --collect-all pycryptodome \
937+ --collect-all eth_account \
938+ --hidden-import Crypto \
939+ --hidden-import Crypto.Cipher \
940+ --hidden-import Crypto.Protocol \
941+ --hidden-import Crypto.Protocol.KDF \
942+ --hidden-import Crypto.Hash \
920943 --hidden-import slip39 \
921944 --collect-data slip39 \
922945 --osx-entitlements-file SLIP-39.metadata/entitlements.plist \
0 commit comments