@@ -28,6 +28,16 @@ PYTESTOPTS = -vv # --capture=no --log-cli-level=INFO
2828
2929PY3TEST = $(PY3 ) -m pytest $(PYTESTOPTS )
3030
31+ # VirtualEnv: Build them in ~/src/python-slip39-1.2.3/
32+ LOCAL ?= ~/src/
33+
34+ GHUB_NAME = python-slip39
35+ GHUB_REPO =
[email protected] :pjkundert/
$(GHUB_NAME ) 36+ GHUB_BRCH = -b feature-dmg
37+ VENV_NAME = $(GHUB_NAME ) -$(VERSION )
38+ VENV_OPTS = # --copies # Doesn't help; still references some system libs.
39+
40+
3141.PHONY : all help test doctest analyze pylint build-check build install upload clean FORCE
3242
3343all : help
@@ -68,6 +78,9 @@ dist/slip39-$(VERSION)-py3-none-any.whl: build-check FORCE
6878 @ls -last dist
6979
7080# Install from wheel, including all optional extra dependencies
81+ install-dev :
82+ $(PY3 ) -m pip install --upgrade -r requirements-dev.txt
83+
7184install : dist/slip39-$(VERSION ) -py3-none-any.whl FORCE
7285 $(PY3 ) -m pip install --force-reinstall $< [gui,serial,json]
7386
@@ -405,7 +418,7 @@ dist/SLIP39.app: SLIP39.spec \
405418 sed -I " " -E " s/version=.*/version='$( VERSION) ',/" $<
406419 sed -I " " -E " s/'CFBundleVersion':.*/'CFBundleVersion':'$( VERSION) ',/" $<
407420 sed -I " " -E " s/codesign_identity=.*/codesign_identity='$( DEVID) ',/" $<
408- pyinstaller --noconfirm $<
421+ pyinstaller --noconfirm --windowed --onefile $<
409422 echo " Checking signature (pyinstaller signed)..." ; ./SLIP39.metadata/check-signature $@ || true
410423 codesign --verify $@
411424 # codesign --deep --force \
@@ -445,13 +458,14 @@ dist/SLIP39.app: SLIP39.spec \
445458
446459SLIP39.spec : SLIP39.py
447460 @echo " \n\n!!! Rebuilding $@ ; Must be manually edited..."
448- pyinstaller --noconfirm --windowed \
461+ pyinstaller --noconfirm --windowed --onefile \
449462 --codesign-identity " $( DEVID) " \
450463 --osx-bundle-identifier " $( BUNDLEID) " \
451464 --osx-entitlements-file ./SLIP39.metadata/entitlements.plist \
452465 --collect-data shamir_mnemonic \
453466 $<
454- false
467+ @echo " !!! Regenerated $@ : must be manually corrected!"
468+ false # Make the build fail if we've regenerated the .spec
455469
456470#
457471# macOS Icons
@@ -512,3 +526,23 @@ unit-%:
512526print-% :
513527 @echo $* = $($* )
514528 @echo $* \' s origin is $(origin $* )
529+
530+
531+ #
532+ # VirtualEnv build, install and activate
533+ #
534+
535+ venv : $(LOCAL ) /$(VENV_NAME )
536+ venv-activate : $(LOCAL ) /$(VENV_NAME ) -activate
537+
538+
539+ $(LOCAL ) /$(VENV_NAME ) :
540+ @echo; echo " *** Building $@ VirtualEnv..."
541+ @rm -rf $@ && $(PY3 ) -m venv $(VENV_OPTS ) $@ \
542+ && cd $@ && git clone $(GHUB_REPO ) $(GHUB_BRCH ) \
543+ && . ./bin/activate && make -C $(GHUB_NAME ) install-dev install
544+
545+ # Activate a given VirtualEnv
546+ $(LOCAL ) /$(VENV_NAME ) -activate : $(LOCAL ) /$(VENV_NAME )
547+ @echo; echo " *** Activating $@ VirtualEnv"
548+ . $< /bin/activate
0 commit comments