From 09aefb51776ad5e4652ce5122175f889b167eef5 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 3 Jun 2016 16:36:26 -0400 Subject: [PATCH 1/3] build: Fix 'make deploy' for OSX Native OSX uses system tools rather than 3rd party dependencies. rsvg-convert is still required, though. --- Makefile.am | 9 ++++++++- configure.ac | 2 +- contrib/macdeploy/macdeployqtplus | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 76eba5190..6a8c1b761 100644 --- a/Makefile.am +++ b/Makefile.am @@ -111,9 +111,16 @@ 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 ced258e02..e068f2287 100644 --- a/configure.ac +++ b/configure.ac @@ -319,6 +319,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 @@ -352,7 +353,6 @@ case $host in AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool) AC_PATH_TOOL([OTOOL], [otool], otool) AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage) - AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert) AC_PATH_PROGS([IMAGEMAGICK_CONVERT], [convert],convert) AC_PATH_PROGS([TIFFCP], [tiffcp],tiffcp) diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index f8201e72c..6d43af421 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) @@ -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.") From b01667c77802f7eeda8b8c82d0c8358b601a9e16 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Fri, 23 Dec 2016 09:52:08 +0100 Subject: [PATCH 2/3] Mention RSVG dependency when creating the disk image on OSX --- configure.ac | 1 + doc/build-osx.md | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index e068f2287..74808cd33 100644 --- a/configure.ac +++ b/configure.ac @@ -353,6 +353,7 @@ case $host in AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool) AC_PATH_TOOL([OTOOL], [otool], otool) AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage) + AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert) AC_PATH_PROGS([IMAGEMAGICK_CONVERT], [convert],convert) AC_PATH_PROGS([TIFFCP], [tiffcp],tiffcp) diff --git a/doc/build-osx.md b/doc/build-osx.md index 63a7ee28c..5cdb3dab6 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 Bitcoin Core From 2fb98f6661887f125837653c8f5577dbd6c124c0 Mon Sep 17 00:00:00 2001 From: Don Patterson Date: Thu, 22 Dec 2016 08:02:15 -0800 Subject: [PATCH 3/3] Fix bug in dmg builder so that it actually reads in the configuration file --- contrib/macdeploy/macdeployqtplus | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index 6d43af421..73d4f159d 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -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: