From 4214f503c93c80541a3f6ecabfb3d88b9ab58369 Mon Sep 17 00:00:00 2001 From: Doug Date: Mon, 6 Mar 2017 00:27:22 -0800 Subject: [PATCH] More OS X build fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OS X build still isn’t complete, probably due to a Makefile issue. --- Makefile.am | 10 +++++----- cppForSwig/cryptopp/Makefile.am | 3 ++- osxbuild/build-app.py | 21 +++++++++++++-------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Makefile.am b/Makefile.am index 7e82008a2..4fa9abdd5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ # Makefile for BitcoinArmory bitcoin wallet - SUBDIRS = cppForSwig +PREFIX = /usr EXTRA_DIST = *.py *.md LICENSE LICENSE-ATI LICENSE-MIT \ nginx_example.conf imgList.xml autogen.sh \ @@ -34,21 +34,21 @@ uninstall-old: rm -f $(DESTDIR)$(PREFIX)/bin/ArmoryDB install-exec-hook: uninstall-old - mkdir $(DESTDIR)$(PREXIX)/lib/armory - cp *.py *.so README.md $(DESTDIR)$(PREXIX)/lib/armory mkdir -p $(DESTDIR)$(PREFIX)/lib/armory/ui mkdir -p $(DESTDIR)$(PREFIX)/lib/armory/armoryengine + mkdir -p $(DESTDIR)$(PREFIX)/bin + mkdir -p $(DESTDIR)$(PREFIX)/share/applications + cp *.py *.so README.md $(DESTDIR)$(PREFIX)/lib/armory cp -r ui/* $(DESTDIR)$(PREFIX)/lib/armory/ui cp -r armoryengine/* $(DESTDIR)$(PREFIX)/lib/armory/armoryengine sed "s: /usr: $(PREFIX):g" < dpkgfiles/armory > $(DESTDIR)$(PREFIX)/bin/armory chmod +x $(DESTDIR)$(PREFIX)/bin/armory - mkdir -p $(DESTDIR)$(PREFIX)/share/applications sed "s:python /usr:python $(PREFIX):g" < dpkgfiles/armory.desktop > $(DESTDIR)$(PREFIX)/share/applications/armory.desktop sed "s:python /usr:python $(PREFIX):g" < dpkgfiles/armoryoffline.desktop > $(DESTDIR)$(PREFIX)/share/applications/armoryoffline.desktop sed "s:python /usr:python $(PREFIX):g" < dpkgfiles/armorytestnet.desktop > $(DESTDIR)$(PREFIX)/share/applications/armorytestnet.desktop uninstall-hook: uninstall-old - rm -rf $(DESTDIR)$(PREXIX)/lib/armory + rm -rf $(DESTDIR)$(PREFIX)/lib/armory rm -rf $(DESTDIR)$(PREFIX)/bin/armory rm -f $(DESTDIR)$(PREFIX)/share/applications/armory.* diff --git a/cppForSwig/cryptopp/Makefile.am b/cppForSwig/cryptopp/Makefile.am index ff3aa8cca..28341bd54 100644 --- a/cppForSwig/cryptopp/Makefile.am +++ b/cppForSwig/cryptopp/Makefile.am @@ -13,7 +13,8 @@ if IS_X86 if CRYPTOPP_HAVE_GCC if BUILD_DARWIN -AM_CXXFLAGS += -arch x86_64 +AM_CXXFLAGS += -arch x86_64 -std=c++11 -stdlib=libc++ +AM_LDFLAGS += -lc++ else AM_CXXFLAGS += -march=native endif diff --git a/osxbuild/build-app.py b/osxbuild/build-app.py index 68f6dcade..bb40de7ea 100755 --- a/osxbuild/build-app.py +++ b/osxbuild/build-app.py @@ -50,15 +50,20 @@ UNPACKDIR = path.join(WORKDIR, 'unpackandbuild') INSTALLDIR = path.join(WORKDIR, 'install') PYPREFIX = path.join(APPDIR, 'Contents/Frameworks/Python.framework/Versions/%s' % pyMajorVer) -PYSITEPKGS = path.join(PYPREFIX, 'lib/python%s/site-packages' % pyMajorVer) +PYLIBPREFIX = path.join(PYPREFIX, 'lib') +PYINCPREFIX = path.join(PYPREFIX, 'include/python%s' % pyMajorVer) +PYSITEPKGS = path.join(PYLIBPREFIX, 'python%s/site-packages' % pyMajorVer) MAKEFLAGS = '-j4' -CONFIGFLAGS = '' + +# Autotools needs some TLC to make Python happy. +CONFIGFLAGS = 'LIBS=\"-L%s\" PYTHON_LDFLAGS=\"-L%s\" PYTHON_CPPFLAGS=\"-I%s\" PYTHON_EXTRA_LIBS=\"-u _PyMac_Error %s/Python\"' % (PYLIBPREFIX, PYLIBPREFIX, PYINCPREFIX, PYPREFIX) QTBUILTFLAG = path.join(UNPACKDIR, 'qt/qt_install_success.txt') -pypathData = 'PYTHON_INCLUDE=%s/include/python%s/' % (PYPREFIX, pyMajorVer) -pypathData += '\nPYTHON_LIB=%s/lib/python%s/config/libpython%s.a' % (PYPREFIX, pyMajorVer, pyMajorVer) -pypathData += '\nPYTHON_LIB_DIR=%s/lib/python%s/config/' % (PYPREFIX, pyMajorVer) +pypathData = 'PYTHON_INCLUDE=%s' % PYINCPREFIX +pypathData += '\nPYTHON_LDFLAGS=%s' % PYLIBPREFIX +pypathData += '\nPYTHON_LIB=%s/python%s/config/libpython%s.a' % (PYLIBPREFIX, pyMajorVer, pyMajorVer) +pypathData += '\nPYTHON_LIB_DIR=%s/python%s/config/' % (PYLIBPREFIX, pyMajorVer) pypathData += '\nPYVER=python%s' % pyMajorVer # If no arguments specified, then do the minimal amount of work necessary @@ -418,7 +423,7 @@ def make_empty_app(): ######################################################## def compile_python(): - logprint('Installing python.') + logprint('Installing python') bldPath = unpack(tarfilesToDL['Python']) # ./configure - Force Python to link against a brew-ed version of OpenSSL @@ -456,7 +461,7 @@ def compile_python(): ######################################################## def compile_pip(): - logprint('Installing pip and setuptools.') + logprint('Installing pip and setuptools') pipexe = path.join(PYPREFIX, 'bin/pip') if path.exists(pipexe): logprint('Pip already installed') @@ -681,7 +686,7 @@ def compile_armory(): execAndWait('./autogen.sh', cwd='..') execAndWait('./configure %s' % CONFIGFLAGS, cwd='..') execAndWait('make all %s' % MAKEFLAGS, cwd='..') - execAndWait('make DESTDIR="%s" install' % pydir, cwd='..') + execAndWait('make DESTDIR="%s" install %s' % (pydir, MAKEFLAGS), cwd='..') copyfile('Armory-script.sh', armoryAppScript) copyfile('armoryd-script.sh', armorydAppScript) execAndWait('chmod +x "%s"' % armoryAppScript)