From 275d6a31151514105b3db147a89ccc9c341c9ac4 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 6 Dec 2013 18:08:53 -0500 Subject: [PATCH 1/5] build: allow correct tools to be used for dmg creation. These come from the enironment, which will be properly setup by Make with the paths gleaned from configure. Also don't crash if plugins are static. --- contrib/macdeploy/macdeployqtplus | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index 533be6cff..92881978f 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -196,7 +196,8 @@ class DeploymentInfo(object): def getFrameworks(binaryPath, verbose): if verbose >= 3: print "Inspecting with otool: " + binaryPath - otool = subprocess.Popen(["otool", "-L", binaryPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + otoolbin=os.getenv("OTOOL", "otool") + otool = subprocess.Popen([otoolbin, "-L", binaryPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE) o_stdout, o_stderr = otool.communicate() if otool.returncode != 0: if verbose >= 1: @@ -221,7 +222,8 @@ def getFrameworks(binaryPath, verbose): return libraries def runInstallNameTool(action, *args): - subprocess.check_call(["install_name_tool", "-"+action] + list(args)) + installnametoolbin=os.getenv("INSTALLNAMETOOL", "install_name_tool") + subprocess.check_call([installnametoolbin, "-"+action] + list(args)) def changeInstallName(oldName, newName, binaryPath, verbose): if verbose >= 3: @@ -239,10 +241,11 @@ def changeIdentification(id, binaryPath, verbose): runInstallNameTool("id", id, binaryPath) def runStrip(binaryPath, verbose): + stripbin=os.getenv("STRIP", "strip") if verbose >= 3: print "Using strip:" print " stripped", binaryPath - subprocess.check_call(["strip", "-x", binaryPath]) + subprocess.check_call([stripbin, "-x", binaryPath]) def copyFramework(framework, path, verbose): if framework.sourceFilePath.startswith("Qt"): @@ -347,6 +350,8 @@ def deployFrameworksForAppBundle(applicationBundle, strip, verbose): def deployPlugins(appBundleInfo, deploymentInfo, strip, verbose): # Lookup available plugins, exclude unneeded plugins = [] + if deploymentInfo.pluginPath is None: + return for dirpath, dirnames, filenames in os.walk(deploymentInfo.pluginPath): pluginDirectory = os.path.relpath(dirpath, deploymentInfo.pluginPath) if pluginDirectory == "designer": From 0f21d39ffad3425f4ffbe69513ac214434cef8f3 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Sun, 16 Mar 2014 16:12:52 -0400 Subject: [PATCH 2/5] build: fix qt.conf case-sensitivity in the deployed dmg For qt5.2 on osx, the qcocoa plugin is mandatory. However, it fails to load when qt.conf specifies the "plugin" path instead of the expected "Plugin". This is in line with the documentation: https://qt-project.org/doc/qt-5.0/qtdoc/qt-conf.html I'm not sure how the plugins were loading before, unless the case-sensitivity for OSX is new. --- contrib/macdeploy/macdeployqtplus | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index 92881978f..5c310df1f 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -426,8 +426,8 @@ def deployPlugins(appBundleInfo, deploymentInfo, strip, verbose): deployFrameworks([dependency], appBundleInfo.path, destinationPath, strip, verbose, deploymentInfo) qt_conf="""[Paths] -translations=Resources -plugins=PlugIns +Translations=Resources +Plugins=PlugIns """ ap = ArgumentParser(description="""Improved version of macdeployqt. From b62bbb1ff00bdac1e0f95943b5c53638ef53ca0e Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 6 Dec 2013 18:11:03 -0500 Subject: [PATCH 3/5] build: if cross-compiling for an apple host, locate some additional tools This should be safe to do for native builds too, but for now it's specific to cross-builds to avoid possible regressions. --- configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/configure.ac b/configure.ac index 7ce5f683e..1111575a5 100644 --- a/configure.ac +++ b/configure.ac @@ -222,6 +222,7 @@ case $host in TARGET_OS=darwin LEVELDB_TARGET_FLAGS="TARGET_OS=Darwin" if test x$cross_compiling != xyes; then + BUILD_OS=darwin AC_CHECK_PROG([PORT],port, port) if test x$PORT = xport; then dnl add default macports paths @@ -238,6 +239,17 @@ case $host in CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include" LIBS="$LIBS -L$bdb_prefix/lib" fi + else + case $build_os in + *darwin*) + BUILD_OS=darwin + ;; + *) + AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool) + AC_PATH_TOOL([OTOOL], [otool], otool) + AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage) + ;; + esac fi CPPFLAGS="$CPPFLAGS -DMAC_OSX" @@ -671,6 +683,7 @@ if test "x$use_tests$build_bitcoind$use_qt" = "xnonono"; then fi AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin]) +AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin]) AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows]) AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet == xyes]) AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes]) From c4a10dbb223028207cadfb17615d85a7e1be9c36 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 6 Dec 2013 18:12:19 -0500 Subject: [PATCH 4/5] build: ensure the correct strip is used for osx/win32 --- Makefile.am | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4f623f6c6..276e5ef44 100644 --- a/Makefile.am +++ b/Makefile.am @@ -45,9 +45,9 @@ distcleancheck: $(BITCOIN_WIN_INSTALLER): $(BITCOIND_BIN) $(BITCOIN_QT_BIN) $(BITCOIN_CLI_BIN) $(MKDIR_P) $(top_builddir)/release - $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release - $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release - $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release + STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release + STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release + STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release @test -f $(MAKENSIS) && $(MAKENSIS) $(top_builddir)/share/setup.nsi || \ echo error: could not build $@ @@ -72,7 +72,7 @@ $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS) $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN) $(MKDIR_P) $(@D) - $(INSTALL_STRIP_PROGRAM) $< $@ + STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $< $@ OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \ $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \ From 01e5327cfc4372158d7074fd8b277166bf271884 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 6 Dec 2013 18:13:25 -0500 Subject: [PATCH 5/5] build: hook up "make deploy" for cross osx builds --- Makefile.am | 16 ++++++++++++++-- configure.ac | 1 + contrib/macdeploy/DS_Store | Bin 0 -> 15364 bytes 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 contrib/macdeploy/DS_Store diff --git a/Makefile.am b/Makefile.am index 276e5ef44..e26627f3e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,7 @@ OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns OSX_PLIST=$(top_srcdir)/share/qt/Info.plist #not installed +OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md) @@ -24,7 +25,8 @@ WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \ $(top_srcdir)/doc/README_windows.txt OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \ - $(top_srcdir)/contrib/macdeploy/background.png + $(top_srcdir)/contrib/macdeploy/background.png \ + $(top_srcdir)/contrib/macdeploy/DS_Store COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \ leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \ @@ -78,9 +80,19 @@ OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lp $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \ $(OSX_APP)/Contents/MacOS/Bitcoin-Qt +if BUILD_DARWIN $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) - $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr da,de,es,hu,ru,uk,zh_CN,zh_TW -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 + $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 +else +$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) + INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2 + $(MKDIR_P) dist/.background + $(INSTALL) contrib/macdeploy/background.png dist/.background + $(INSTALL) contrib/macdeploy/DS_Store dist/.DS_Store + cd dist; $(LN_S) /Applications Applications + $(GENISOIMAGE) -no-cache-inodes -l -probe -V "Bitcoin-Qt" -no-pad -r -apple -o $@ dist +endif if TARGET_DARWIN appbundle: $(OSX_APP_BUILT) diff --git a/configure.ac b/configure.ac index 1111575a5..45cd023bb 100644 --- a/configure.ac +++ b/configure.ac @@ -121,6 +121,7 @@ AC_PROG_CPP AC_PROG_CXXCPP AC_PROG_INSTALL AC_PROG_OBJC +AC_PROG_LN_S m4_ifdef([AC_PROG_OBJCXX],[AC_PROG_OBJCXX]) AC_PROG_MKDIR_P AC_PROG_SED diff --git a/contrib/macdeploy/DS_Store b/contrib/macdeploy/DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b9a1e1486405136607eedf433af8d469ef7059b8 GIT binary patch literal 15364 zcmeHMU2Ggz6+Yu^8ar|9^-n_RUq*GQ3V3(NJKi7LNZG9IU`wr>){bk_lrTFpyB>Kx zvzZ;+2_e)VBwou~9}vwOs48kz0STfYORZE@f`})?Lsbw$6d@!k0TK_C@|~GGyK6gu ziV#BK9_h~c?%%oheD}_|cXo+LDQ{Y1L@E(=Be72Q;&BJzdQJzVOO*6LE9g&N1?c5U zqwX|=1FdC&WI!??8ITM}1|$Rj3k=}QX6Zf_Y59~4NCqSWEe1F~s7S0!LhnR63>|oc zp8(Ja6o&$wWB{!ST@rdH(x`zbQCH}wt0F!zl&Cw(Rne{_^iHIs?xcv14@Hcuh%Xc+ z93A%6usJEENXw^WKr(QUf#};kUD<9nD)r9qcTM}5(sd|t_?{!(klu?=Ij-exm%UBb zYCgTV=4~%JmR&LYXF?np!Dh2;_+ia?BUnRCh?hLC4t!Cxe#)_ewM)rU*RExAxluJ+ z(65iG*9rw~R2|m~*RS_LlDpj}9!h^|Zprw<^)EiV6U|u>?>!yg=fjtgS19e6Tf%|F zH=`dQH0>A3{@8_{qsMxW_w^?S28V`EoczeCkKQ|Q{{s(RN)A;FbG_!XSJPhI^UL*3 z`%<#M3IFCz&pq$kTaLZG;s7r?pSM>6`%1vzQgU!#&nIo`v+bg#s|~anZWn~sKkeJL z`*h8Btc7Z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