From 275d6a31151514105b3db147a89ccc9c341c9ac4 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 6 Dec 2013 18:08:53 -0500 Subject: 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 533be6cffa..92881978fc 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": -- cgit v1.2.3 From 0f21d39ffad3425f4ffbe69513ac214434cef8f3 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Sun, 16 Mar 2014 16:12:52 -0400 Subject: 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 92881978fc..5c310df1fc 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. -- cgit v1.2.3 From b62bbb1ff00bdac1e0f95943b5c53638ef53ca0e Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 6 Dec 2013 18:11:03 -0500 Subject: 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 7ce5f683ee..1111575a51 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]) -- cgit v1.2.3 From c4a10dbb223028207cadfb17615d85a7e1be9c36 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 6 Dec 2013 18:12:19 -0500 Subject: 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 4f623f6c64..276e5ef44c 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 \ -- cgit v1.2.3 From 01e5327cfc4372158d7074fd8b277166bf271884 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 6 Dec 2013 18:13:25 -0500 Subject: 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 276e5ef44c..e26627f3e3 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 1111575a51..45cd023bb1 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 0000000000..b9a1e14864 Binary files /dev/null and b/contrib/macdeploy/DS_Store differ -- cgit v1.2.3