From 229340678482b215a3b049cb782ef4852fff208b Mon Sep 17 00:00:00 2001 From: out0fmemory Date: Thu, 25 May 2017 23:13:47 +0800 Subject: [PATCH] [fix: fix osx 'make deploy error', merged from bitcoin project in https://github.com/bitcoin/bitcoin/pull/9412/files] --- Makefile.am | 10 ++++++++-- configure.ac | 1 + contrib/macdeploy/macdeployqtplus | 6 +++--- doc/build-osx.md | 6 ++++++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index ceb726ff5..25eb3f1c6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -103,9 +103,15 @@ osx_volname: echo $(OSX_VOLNAME) >$@ if BUILD_DARWIN -$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) +$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) $(OSX_BACKGROUND_IMAGE) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 -volname $(OSX_VOLNAME) - +$(OSX_BACKGROUND_IMAGE).png: contrib/macdeploy/$(OSX_BACKGROUND_SVG) + sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 36 -p 36 -o $@ +$(OSX_BACKGROUND_IMAGE)@2x.png: contrib/macdeploy/$(OSX_BACKGROUND_SVG) + sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 72 -p 72 -o $@ +$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE).png $(OSX_BACKGROUND_IMAGE)@2x.png + tiffutil -cathidpicheck $^ -out $@ + deploydir: $(OSX_DMG) else APP_DIST_DIR=$(top_builddir)/dist diff --git a/configure.ac b/configure.ac index f699ad7f1..3cb27889b 100644 --- a/configure.ac +++ b/configure.ac @@ -324,6 +324,7 @@ case $host in fi fi + AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert) AC_CHECK_PROG([BREW],brew, brew) if test x$BREW = xbrew; then dnl These Homebrew packages may be keg-only, meaning that they won't be found diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index 86ae06bfc..6a6eaf3bf 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -791,7 +791,7 @@ if config.dmg is not None: except subprocess.CalledProcessError as e: sys.exit(e.returncode) - m = re.search("/Volumes/(.+$)", output) + m = re.search("/Volumes/(.+$)", output.decode()) disk_root = m.group(0) disk_name = m.group(1) @@ -852,7 +852,7 @@ if config.dmg is not None: "items_positions" : "\n ".join(items_positions) } if "window_bounds" in fancy: - params["window.bounds"] = ",".join([str(p) for p in fancy["window_bounds"]]) + params["window_bounds"] = ",".join([str(p) for p in fancy["window_bounds"]]) if "icon_size" in fancy: params["icon_size"] = str(fancy["icon_size"]) if bg_path is not None: @@ -868,7 +868,7 @@ if config.dmg is not None: print(s) p = subprocess.Popen(['osascript', '-'], stdin=subprocess.PIPE) - p.communicate(input=s) + p.communicate(input=s.encode('utf-8')) if p.returncode: print("Error running osascript.") diff --git a/doc/build-osx.md b/doc/build-osx.md index e23c2e9d2..21ae238c1 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -18,6 +18,10 @@ Dependencies brew install automake berkeley-db4 libtool boost --c++11 miniupnpc openssl pkg-config homebrew/versions/protobuf260 --c++11 qt5 libevent +In case you want to build the disk image with `make deploy` (.dmg / optional), you need RSVG + + brew install librsvg + NOTE: Building with Qt4 is still supported, however, could result in a broken UI. Building with Qt5 is recommended. Build Litecoin Core @@ -34,6 +38,8 @@ Build Litecoin Core You can disable the GUI build by passing `--without-gui` to configure. + In case you want to build the disk image with `make deploy` (.dmg / optional), by passing `--with-gui` to configure. + ./autogen.sh ./configure make