@@ -19,8 +19,8 @@ BUNDLEID ?= ca.kundert.perry.SLIP39
1919APIISSUER ?= 5f3b4519-83ae-4e01-8d31-f7db26f68290
2020APIKEY ?= 5H98J7LKPC
2121
22- # PY[3] is the target Python interpreter. It must have pytest installed .
23- PY3 ?= $(shell which python3 2 >/dev/null && echo python3 || echo python )
22+ # PY[3] is the target Python interpreter; require 3.9+. Detect if it is named python3 or python .
23+ PY3 ?= $(shell python3 --version >/dev/null 2>&1 && echo python3 || echo python )
2424
2525VERSION = $(shell $(PY3 ) -c 'exec(open("slip39/version.py") .read()); print( __version__ )')
2626
@@ -29,8 +29,8 @@ PYTESTOPTS = -vv # --capture=no --log-cli-level=INFO
2929
3030PY3TEST = $(PY3 ) -m pytest $(PYTESTOPTS )
3131
32- # VirtualEnv: Build them in ~/src/python-slip39-1.2.3/
33- LOCAL ?= ~/src/
32+ # VirtualEnv: Build them in eg. ~/src/python-slip39-1.2.3/
33+ VENV_LOCAL ?= ~/src/
3434
3535GHUB_NAME = python-slip39
3636GHUB_REPO =
[email protected] :pjkundert/
$(GHUB_NAME ) @@ -72,18 +72,36 @@ build-check:
7272 || ( echo " \n*** Missing Python modules; run:\n\n $( PY3) -m pip install --upgrade pip setuptools wheel build\n" \
7373 && false )
7474
75+ deps : deps-txt
76+
7577build : clean wheel app
7678
7779
80+ #
81+ # org-mode products.
82+ #
83+ # deps-txt: All of the .txt files needed to build
84+ #
85+ % .txt : % .org
86+ emacs $< --batch -f org-ascii-export-to-ascii --kill
87+
88+ GUI_TXT = $(patsubst % .org,% .txt,$(wildcard slip39/gui/* .org) )
89+
90+ deps-txt : $(GUI_TXT ) slip39/gui/SLIP-39.txt
91+
92+ slip39/gui/SLIP-39.txt :
93+ toilet --font ascii12 SLIP-39 > $@
94+ @echo " Safe & Effective (tm) Crypto Wallet Backup and Recovery" >> $@
95+
7896#
7997# VirtualEnv build, install and activate
8098#
8199
82- venv : $(LOCAL ) /$(VENV_NAME )
83- venv-activate : $(LOCAL ) /$(VENV_NAME ) -activate
100+ venv : $(VENV_LOCAL ) /$(VENV_NAME )
101+ venv-activate : $(VENV_LOCAL ) /$(VENV_NAME ) -activate
84102
85103
86- $(LOCAL ) /$(VENV_NAME ) :
104+ $(VENV_LOCAL ) /$(VENV_NAME ) :
87105 @echo; echo " *** Building $@ VirtualEnv..."
88106 @rm -rf $@ && $(PY3 ) -m venv $(VENV_OPTS ) $@ \
89107 && cd $@ && git clone $(GHUB_REPO ) $(GHUB_BRCH ) \
@@ -92,7 +110,7 @@ $(LOCAL)/$(VENV_NAME):
92110# Activate a given VirtualEnv, and go to its python-slip39 installation
93111# o Creates a custom venv-activate.sh script in the venv, and uses it start
94112# start a sub-shell in that venv, with a CWD in the contained python-slip39 installation
95- $(LOCAL ) /$(VENV_NAME ) -activate : $(LOCAL ) /$(VENV_NAME )
113+ $(VENV_LOCAL ) /$(VENV_NAME ) -activate : $(VENV_LOCAL ) /$(VENV_NAME )
96114 @echo; echo " *** Activating $@ VirtualEnv"
97115 @[ -s $< /venv-activate.sh ] || ( \
98116 echo " PS1='[\u@\h \W)]\\ $$ '" ; \
@@ -106,7 +124,7 @@ $(LOCAL)/$(VENV_NAME)-activate: $(LOCAL)/$(VENV_NAME)
106124
107125wheel : dist/slip39-$(VERSION ) -py3-none-any.whl
108126
109- dist/slip39-$(VERSION ) -py3-none-any.whl : build-check FORCE
127+ dist/slip39-$(VERSION ) -py3-none-any.whl : build-check deps FORCE
110128 $(PY3 ) -m build
111129 @ls -last dist
112130
@@ -142,7 +160,7 @@ app-pkg-upload: dist/SLIP-39-$(VERSION).pkg.upload-package
142160#
143161# Build the windows .msi installer
144162#
145- dist/slip39-$(VERSION ) -win64.msi :
163+ dist/slip39-$(VERSION ) -win64.msi : deps
146164 $(PY3 ) setup.py bdist_msi
147165
148166#
@@ -453,7 +471,8 @@ dist/SLIP-39.app-checkids: SLIP-39.spec
453471# - Find each dependent key, and look at its SHA fingerprint, and then see if you have
454472# that one in your System keychain, downloading all the named keys from apple 'til
455473# you find the one with the matching fingerprint. Grr... Repeat 'til check-signature works.
456- dist/SLIP-39.app : SLIP-39-macOS.spec \
474+ dist/SLIP-39.app : deps \
475+ SLIP-39-macOS.spec \
457476 SLIP-39.metadata/entitlements.plist \
458477 images/SLIP-39.icns
459478 @echo " \n\n*** Rebuilding $@ , version $( VERSION) ..."
@@ -529,6 +548,7 @@ SLIP-39-win32.spec: SLIP-39.py
529548 @echo " !!! Regenerated $@ : must be manually corrected!"
530549 false # Make the build fail if we've regenerated the .spec
531550
551+
532552#
533553# macOS Icons
534554#
0 commit comments