Skip to content

Commit

Permalink
rename contrib/build-osx as contrib/osx. Move QRReader submodule there.
Browse files Browse the repository at this point in the history
  • Loading branch information
ecdsa committed Nov 29, 2018
1 parent db89286 commit d7bf882
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
[submodule "contrib/deterministic-build/electrum-locale"]
path = contrib/deterministic-build/electrum-locale
url = https://github.com/spesmilo/electrum-locale
[submodule "contrib/CalinsQRReader"]
path = contrib/CalinsQRReader
[submodule "contrib/osx/CalinsQRReader"]
path = contrib/osx/CalinsQRReader
url = https://github.com/spesmilo/CalinsQRReader
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ This directory contains the python dependencies used by Electrum.
Mac OS X / macOS
--------

See `contrib/build-osx/`.
See `contrib/osx/`.

Windows
-------
Expand Down
4 changes: 2 additions & 2 deletions contrib/build-osx/README.md → contrib/osx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Before starting, make sure that the Xcode command line tools are installed (e.g.


cd electrum
./contrib/build-osx/make_osx
./contrib/osx/make_osx

This creates a folder named Electrum.app.

Expand All @@ -33,4 +33,4 @@ Copy the Electrum.app directory over and install the dependencies, e.g.:
Then you can just invoke `package.sh` with the path to the app:

cd electrum
./contrib/build-osx/package.sh ~/Electrum.app/
./contrib/osx/package.sh ~/Electrum.app/
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions contrib/build-osx/make_osx → contrib/osx/make_osx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ cp ./contrib/deterministic-build/electrum-icons/icons_rc.py ./electrum/gui/qt
info "Downloading libusb..."
curl https://homebrew.bintray.com/bottles/libusb-1.0.22.el_capitan.bottle.tar.gz | \
tar xz --directory $BUILDDIR
cp $BUILDDIR/libusb/1.0.22/lib/libusb-1.0.dylib contrib/build-osx
DoCodeSignMaybe "libusb" "contrib/build-osx/libusb-1.0.dylib" "$APP_SIGN" # If APP_SIGN is empty will be a noop
cp $BUILDDIR/libusb/1.0.22/lib/libusb-1.0.dylib contrib/osx
DoCodeSignMaybe "libusb" "contrib/osx/libusb-1.0.dylib" "$APP_SIGN" # If APP_SIGN is empty will be a noop

info "Building libsecp256k1"
brew install autoconf automake libtool
Expand All @@ -85,11 +85,11 @@ git clean -f -x -q
./configure --enable-module-recovery --enable-experimental --enable-module-ecdh --disable-jni
make
popd
cp $BUILDDIR/secp256k1/.libs/libsecp256k1.0.dylib contrib/build-osx
DoCodeSignMaybe "libsecp256k1" "contrib/build-osx/libsecp256k1.0.dylib" "$APP_SIGN" # If APP_SIGN is empty will be a noop
cp $BUILDDIR/secp256k1/.libs/libsecp256k1.0.dylib contrib/osx
DoCodeSignMaybe "libsecp256k1" "contrib/osx/libsecp256k1.0.dylib" "$APP_SIGN" # If APP_SIGN is empty will be a noop

info "Building CalinsQRReader..."
d=contrib/CalinsQRReader
d=contrib/osx/CalinsQRReader
pushd $d
rm -fr build
xcodebuild || fail "Could not build CalinsQRReader"
Expand Down Expand Up @@ -117,7 +117,7 @@ for d in ~/Library/Python/ ~/.pyenv .; do
done

info "Building binary"
pyinstaller --noconfirm --ascii --clean --name $VERSION contrib/build-osx/osx.spec || fail "Could not build binary"
pyinstaller --noconfirm --ascii --clean --name $VERSION contrib/osx/osx.spec || fail "Could not build binary"

info "Adding bitcoin URI types to Info.plist"
plutil -insert 'CFBundleURLTypes' \
Expand Down
6 changes: 3 additions & 3 deletions contrib/build-osx/osx.spec → contrib/osx/osx.spec
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ datas += collect_data_files('keepkeylib')
datas += collect_data_files('ckcc')

# Add the QR Scanner helper app
datas += [(electrum + "contrib/CalinsQRReader/build/Release/CalinsQRReader.app", "./contrib/CalinsQRReader/build/Release/CalinsQRReader.app")]
datas += [(electrum + "contrib/osx/CalinsQRReader/build/Release/CalinsQRReader.app", "./contrib/osx/CalinsQRReader/build/Release/CalinsQRReader.app")]

# Add libusb so Trezor and Safe-T mini will work
binaries = [(electrum + "contrib/build-osx/libusb-1.0.dylib", ".")]
binaries += [(electrum + "contrib/build-osx/libsecp256k1.0.dylib", ".")]
binaries = [(electrum + "contrib/osx/libusb-1.0.dylib", ".")]
binaries += [(electrum + "contrib/osx/libsecp256k1.0.dylib", ".")]

# Workaround for "Retro Look":
binaries += [b for b in collect_dynamic_libs('PyQt5') if 'macstyle' in b[0]]
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions electrum/qrscanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ def scan_barcode_osx(*args_ignored, **kwargs_ignored):
import subprocess
# NOTE: This code needs to be modified if the positions of this file changes with respect to the helper app!
# This assumes the built macOS .app bundle which ends up putting the helper app in
# .app/contrib/CalinsQRReader/build/Release/CalinsQRReader.app.
# .app/contrib/osx/CalinsQRReader/build/Release/CalinsQRReader.app.
root_ec_dir = os.path.abspath(os.path.dirname(__file__) + "/../")
prog = root_ec_dir + "/" + "contrib/CalinsQRReader/build/Release/CalinsQRReader.app/Contents/MacOS/CalinsQRReader"
prog = root_ec_dir + "/" + "contrib/osx/CalinsQRReader/build/Release/CalinsQRReader.app/Contents/MacOS/CalinsQRReader"
if not os.path.exists(prog):
raise RuntimeError("Cannot start QR scanner; helper app not found.")
data = ''
Expand Down

0 comments on commit d7bf882

Please sign in to comment.