diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/debian/bitcoin-qt.desktop | 5 | ||||
-rw-r--r-- | contrib/debian/bitcoin-qt.install | 1 | ||||
-rw-r--r-- | contrib/debian/bitcoin-qt.protocol | 11 | ||||
-rw-r--r-- | contrib/debian/changelog | 18 | ||||
-rw-r--r-- | contrib/debian/control | 3 | ||||
-rw-r--r-- | contrib/debian/copyright | 2 | ||||
-rw-r--r-- | contrib/debian/patches/1001_use_system_json-spirit.patch | 42 | ||||
-rwxr-xr-x | contrib/debian/rules | 2 | ||||
-rw-r--r-- | contrib/gitian-descriptors/deps-win32.yml | 71 | ||||
-rw-r--r-- | contrib/gitian-descriptors/gitian-win32.yml | 27 | ||||
-rw-r--r-- | contrib/gitian-descriptors/gitian.yml | 11 | ||||
-rwxr-xr-x | contrib/macdeploy/macdeployqtplus | 470 | ||||
-rw-r--r-- | contrib/macdeploy/notes.txt | 4 | ||||
-rw-r--r-- | contrib/miniupnpc/Portfile | 43 |
14 files changed, 584 insertions, 126 deletions
diff --git a/contrib/debian/bitcoin-qt.desktop b/contrib/debian/bitcoin-qt.desktop index d65cc35a3b..7cb00a2c8b 100644 --- a/contrib/debian/bitcoin-qt.desktop +++ b/contrib/debian/bitcoin-qt.desktop @@ -2,10 +2,11 @@ Encoding=UTF-8 Name=Bitcoin Comment=Bitcoin P2P Cryptocurrency +Comment[fr]=Bitcoin, monnaie virtuelle cryptographique pair à pair +Comment[tr]=Bitcoin, eşten eşe kriptografik sanal para birimi Exec=/usr/bin/bitcoin-qt Terminal=false Type=Application Icon=/usr/share/pixmaps/bitcoin80.xpm -#For when bitcoin (finally) properly handles bitcoin: URLs -#MimeType=x-scheme-handler/bitcoin; +MimeType=x-scheme-handler/bitcoin; Categories=Office; diff --git a/contrib/debian/bitcoin-qt.install b/contrib/debian/bitcoin-qt.install index 7ddc8c1d8f..6a566f515a 100644 --- a/contrib/debian/bitcoin-qt.install +++ b/contrib/debian/bitcoin-qt.install @@ -3,3 +3,4 @@ bitcoin-qt usr/lib/bitcoin share/pixmaps/bitcoin32.xpm usr/share/pixmaps share/pixmaps/bitcoin80.xpm usr/share/pixmaps debian/bitcoin-qt.desktop usr/share/applications +debian/bitcoin-qt.protocol usr/share/kde4/services/ diff --git a/contrib/debian/bitcoin-qt.protocol b/contrib/debian/bitcoin-qt.protocol new file mode 100644 index 0000000000..014588d536 --- /dev/null +++ b/contrib/debian/bitcoin-qt.protocol @@ -0,0 +1,11 @@ +[Protocol] +exec=bitcoin-qt '%u' +protocol=bitcoin +input=none +output=none +helper=true +listing= +reading=false +writing=false +makedir=false +deleting=false diff --git a/contrib/debian/changelog b/contrib/debian/changelog index 0720acc35c..db5e2682c6 100644 --- a/contrib/debian/changelog +++ b/contrib/debian/changelog @@ -1,23 +1,13 @@ -bitcoin (0.5.3-natty0) natty; urgency=low - - * New upstream release. - - -- Luke Dashjr <luke+bitcoin+deb@dashjr.org> Tue, 10 Jan 2012 15:57:00 -0500 - -bitcoin (0.5.2-natty1) natty; urgency=low +bitcoin (0.5.1-natty1) natty; urgency=low * Remove mentions on anonymity in package descriptions and manpage. These should never have been there, bitcoin isnt anonymous without a ton of work that virtually no users will ever be willing and capable of doing + * Add GNOME/KDE support for bitcoin-qt's bitcoin: URI support. + Thanks to luke-jr for the KDE .protocol file. - -- Matt Corallo <matt@bluematt.me> Sat, 7 Jan 2012 13:37:00 -0500 - -bitcoin (0.5.2-natty0) natty; urgency=low - - * New upstream release. - - -- Luke Dashjr <luke+bitcoin+deb@dashjr.org> Fri, 16 Dec 2011 17:57:00 -0500 + -- Matt Corallo <matt@bluematt.me> Fri, 23 Dec 2011 20:25:00 -0500 bitcoin (0.5.1-natty0) natty; urgency=low diff --git a/contrib/debian/control b/contrib/debian/control index 9d8764d6cb..d0a2d57c9e 100644 --- a/contrib/debian/control +++ b/contrib/debian/control @@ -15,7 +15,8 @@ Build-Depends: debhelper, libboost-thread-dev (>> 1.35) | libboost-thread1.35-dev, libboost-test-dev (>> 1.35) | libboost-test1.35-dev, qt4-qmake, - libqt4-dev + libqt4-dev, + libqrencode-dev Standards-Version: 3.9.2 Homepage: http://www.bitcoin.org/ Vcs-Git: git://github.com/bitcoin/bitcoin.git diff --git a/contrib/debian/copyright b/contrib/debian/copyright index fde33d3730..b99604913c 100644 --- a/contrib/debian/copyright +++ b/contrib/debian/copyright @@ -37,7 +37,7 @@ Files: src/qt/res/icons/address-book.png, src/qt/res/icons/export.png, src/qt/res/icons/history.png, src/qt/res/icons/key.png, src/qt/res/icons/lock_*.png, src/qt/res/icons/overview.png, src/qt/res/icons/receive.png, src/qt/res/icons/send.png, - src/qt/res/icons/synced.png + src/qt/res/icons/synced.png, src/qt/res/icons/filesave.png Copyright: David Vignoni (david@icon-king.com) ICON KING - www.icon-king.com License: LGPL diff --git a/contrib/debian/patches/1001_use_system_json-spirit.patch b/contrib/debian/patches/1001_use_system_json-spirit.patch index d471bded8f..307dfc8d49 100644 --- a/contrib/debian/patches/1001_use_system_json-spirit.patch +++ b/contrib/debian/patches/1001_use_system_json-spirit.patch @@ -3,8 +3,8 @@ Author: Jonas Smedegaard <dr@jones.dk> Last-Update: 2012-07-05 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp -@@ -12,9 +12,7 @@ - #include <boost/asio/ssl.hpp> +@@ -20,9 +20,7 @@ + #include <boost/filesystem/fstream.hpp> typedef boost::asio::ssl::stream<boost::asio::ip::tcp::socket> SSLStream; #endif -#include "json/json_spirit_reader_template.h" @@ -16,11 +16,41 @@ Last-Update: 2012-07-05 // precompiled in headers.h. The problem might be when the pch file goes over --- a/src/makefile.unix +++ b/src/makefile.unix -@@ -23,6 +23,7 @@ - -l boost_thread \ - -l db_cxx \ +@@ -29,6 +29,7 @@ LIBS += \ + -l boost_thread$(BOOST_LIB_SUFFIX) \ + -l db_cxx$(BDB_LIB_SUFFIX) \ -l ssl \ + -l json_spirit \ -l crypto - ifdef USE_UPNP + ifndef USE_UPNP +--- a/src/rpcdump.cpp ++++ b/src/rpcdump.cpp +@@ -15,9 +15,8 @@ + // typedef boost::asio::ssl::stream<boost::asio::ip::tcp::socket> SSLStream; + // #endif + // #include <boost/xpressive/xpressive_dynamic.hpp> +-#include "json/json_spirit_reader_template.h" +-#include "json/json_spirit_writer_template.h" +-#include "json/json_spirit_utils.h" ++ ++#include <json_spirit.h> + + #define printf OutputDebugStringF + +--- a/src/test/rpc_tests.cpp ++++ b/src/test/rpc_tests.cpp +@@ -1,11 +1,10 @@ + #include <boost/test/unit_test.hpp> + #include <boost/foreach.hpp> + ++#include <json_spirit.h> ++ + #include "base58.h" + #include "util.h" +-#include "json/json_spirit_reader_template.h" +-#include "json/json_spirit_writer_template.h" +-#include "json/json_spirit_utils.h" + + using namespace std; + using namespace json_spirit; diff --git a/contrib/debian/rules b/contrib/debian/rules index a1d65652e3..6d6f119b59 100755 --- a/contrib/debian/rules +++ b/contrib/debian/rules @@ -20,7 +20,7 @@ override_dh_auto_clean: cd src; $(MAKE) -f makefile.unix clean override_dh_auto_configure: - qmake bitcoin-qt.pro + qmake bitcoin-qt.pro USE_SSL=1 USE_QRCODE=1 override_dh_auto_test: cd src; $(MAKE) -f makefile.unix test_bitcoin diff --git a/contrib/gitian-descriptors/deps-win32.yml b/contrib/gitian-descriptors/deps-win32.yml new file mode 100644 index 0000000000..df1e3de358 --- /dev/null +++ b/contrib/gitian-descriptors/deps-win32.yml @@ -0,0 +1,71 @@ +--- +name: "bitcoin-deps" +suites: +- "lucid" +architectures: +- "i386" +packages: +- "mingw32" +- "git-core" +- "zip" +- "faketime" +- "wine" +reference_datetime: "2011-01-30 00:00:00" +remotes: [] +files: +- "openssl-1.0.1b.tar.gz" +- "db-4.8.30.NC.tar.gz" +- "miniupnpc-1.6.tar.gz" +- "zlib-1.2.6.tar.gz" +- "libpng-1.5.9.tar.gz" +- "qrencode-3.2.0.tar.bz2" +script: | + # + export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 + export FAKETIME=$REFERENCE_DATETIME + export TZ=UTC + # + tar xzf openssl-1.0.1b.tar.gz + cd openssl-1.0.1b + ./Configure --cross-compile-prefix=i586-mingw32msvc- mingw + make + cd .. + # + tar xzf db-4.8.30.NC.tar.gz + cd db-4.8.30.NC/build_unix + ../dist/configure --enable-mingw --enable-cxx --host=i586-mingw32msvc CFLAGS="-I/usr/i586-mingw32msvc/include" + make $MAKEOPTS + cd ../.. + # + tar xzf miniupnpc-1.6.tar.gz + cd miniupnpc-1.6 + sed 's/dllwrap -k --driver-name gcc/$(DLLWRAP) -k --driver-name $(CC)/' -i Makefile.mingw + sed 's|wingenminiupnpcstrings $< $@|./wingenminiupnpcstrings $< $@|' -i Makefile.mingw + make -f Makefile.mingw DLLWRAP=i586-mingw32msvc-dllwrap CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar + cd .. + mv miniupnpc-1.6 miniupnpc + # + tar xzf zlib-1.2.6.tar.gz + cd zlib-1.2.6 + make -f win32/Makefile.gcc PREFIX=i586-mingw32msvc- $MAKEOPTS + cd .. + # + tar xzf libpng-1.5.9.tar.gz + cd libpng-1.5.9 + ./configure -disable-shared CC=i586-mingw32msvc-cc AR=i586-mingw32msvc-ar STRIP=i586-mingw32msvc-strip RANLIB=i586-mingw32msvc-ranlib OBJDUMP=i586-mingw32msvc-objdump LD=i586-mingw32msvc-ld LDFLAGS="-L../zlib-1.2.6/" CFLAGS="-I../zlib-1.2.6/" + make $MAKEOPTS + cd .. + # + tar xjf qrencode-3.2.0.tar.bz2 + cd qrencode-3.2.0 + ./configure CC=i586-mingw32msvc-cc AR=i586-mingw32msvc-ar STRIP=i586-mingw32msvc-strip RANLIB=i586-mingw32msvc-ranlib OBJDUMP=i586-mingw32msvc-objdump LD=i586-mingw32msvc-ld png_LIBS="../libpng-1.5.9/.libs/libpng15.a ../zlib-1.2.6/libz.a" png_CFLAGS="-I../libpng-1.5.9" + make $MAKEOPTS + cd .. + # + zip -r $OUTDIR/bitcoin-deps-0.0.4.zip \ + $(ls qrencode-*/{qrencode.h,.libs/libqrencode.{,l}a} | sort) \ + $(ls db-*/build_unix/{libdb_cxx.a,db.h,db_cxx.h,libdb.a,.libs/libdb_cxx-?.?.a} | sort) \ + $(find openssl-* -name '*.a' -o -name '*.h' | sort) \ + $(find miniupnpc -name '*.h' -o -name 'libminiupnpc.a' | sort) + # Kill wine processes as gitian won't figure out we are done otherwise + killall wineserver services.exe explorer.exe winedevice.exe diff --git a/contrib/gitian-descriptors/gitian-win32.yml b/contrib/gitian-descriptors/gitian-win32.yml index f9c5214cbd..488cc95f64 100644 --- a/contrib/gitian-descriptors/gitian-win32.yml +++ b/contrib/gitian-descriptors/gitian-win32.yml @@ -10,7 +10,6 @@ packages: - "unzip" - "nsis" - "faketime" -- "wine" reference_datetime: "2011-01-30 00:00:00" remotes: - "url": "https://git.gitorious.org/+bitcoin-stable-developers/bitcoin/bitcoind-stable.git" @@ -18,9 +17,7 @@ remotes: files: - "qt-win32-4.7.4-gitian.zip" - "boost-win32-1.47.0-gitian.zip" -- "openssl-1.0.1b.tar.gz" -- "db-4.8.30.NC.tar.gz" -- "miniupnpc-1.6.tar.gz" +- "bitcoin-deps-0.0.4.zip" script: | # mkdir $HOME/qt @@ -42,25 +39,9 @@ script: | mv include/boost . cd .. # - tar xzf openssl-1.0.1b.tar.gz - cd openssl-1.0.1b - ./Configure --cross-compile-prefix=i586-mingw32msvc- mingw - make - cd .. + unzip bitcoin-deps-0.0.4.zip # - tar xzf db-4.8.30.NC.tar.gz - cd db-4.8.30.NC/build_unix - ../dist/configure --enable-mingw --enable-cxx --host=i586-mingw32msvc CFLAGS="-I/usr/i586-mingw32msvc/include" - make $MAKEOPTS - cd ../.. - # - tar xzf miniupnpc-1.6.tar.gz - cd miniupnpc-1.6 - sed 's/dllwrap -k --driver-name gcc/$(DLLWRAP) -k --driver-name $(CC)/' -i Makefile.mingw - sed 's|wingenminiupnpcstrings $< $@|./wingenminiupnpcstrings $< $@|' -i Makefile.mingw - make -f Makefile.mingw DLLWRAP=i586-mingw32msvc-dllwrap CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar - cd .. - mv miniupnpc-1.6 miniupnpc + find -type f | xargs touch --date="$REFERENCE_DATETIME" # cd bitcoin mkdir -p $OUTDIR/src @@ -71,7 +52,7 @@ script: | export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export FAKETIME=$REFERENCE_DATETIME export TZ=UTC - $HOME/qt/src/bin/qmake -spec unsupported/win32-g++-cross USE_SSL=1 MINIUPNPC_LIB_PATH=$HOME/build/miniupnpc MINIUPNPC_INCLUDE_PATH=$HOME/build/ BDB_LIB_PATH=$HOME/build/db-4.8.30.NC/build_unix BDB_INCLUDE_PATH=$HOME/build/db-4.8.30.NC/build_unix BOOST_LIB_PATH=$HOME/build/boost_1_47_0/stage/lib BOOST_INCLUDE_PATH=$HOME/build/boost_1_47_0 BOOST_LIB_SUFFIX=-mt-s BOOST_THREAD_LIB_SUFFIX=_win32-mt-s OPENSSL_LIB_PATH=$HOME/build/openssl-1.0.1b OPENSSL_INCLUDE_PATH=$HOME/build/openssl-1.0.1b/include INCLUDEPATH=$HOME/build DEFINES=BOOST_THREAD_USE_LIB BITCOIN_NEED_QT_PLUGINS=1 QMAKE_LRELEASE=lrelease QMAKE_CXXFLAGS=-frandom-seed=bitcoin QMAKE_LFLAGS=-frandom-seed=bitcoin + $HOME/qt/src/bin/qmake -spec unsupported/win32-g++-cross USE_SSL=1 MINIUPNPC_LIB_PATH=$HOME/build/miniupnpc MINIUPNPC_INCLUDE_PATH=$HOME/build/ BDB_LIB_PATH=$HOME/build/db-4.8.30.NC/build_unix BDB_INCLUDE_PATH=$HOME/build/db-4.8.30.NC/build_unix BOOST_LIB_PATH=$HOME/build/boost_1_47_0/stage/lib BOOST_INCLUDE_PATH=$HOME/build/boost_1_47_0 BOOST_LIB_SUFFIX=-mt-s BOOST_THREAD_LIB_SUFFIX=_win32-mt-s OPENSSL_LIB_PATH=$HOME/build/openssl-1.0.1b OPENSSL_INCLUDE_PATH=$HOME/build/openssl-1.0.1b/include QRENCODE_LIB_PATH=$HOME/build/qrencode-3.2.0/.libs QRENCODE_INCLUDE_PATH=$HOME/build/qrencode-3.2.0 USE_QRCODE=1 INCLUDEPATH=$HOME/build DEFINES=BOOST_THREAD_USE_LIB BITCOIN_NEED_QT_PLUGINS=1 QMAKE_LRELEASE=lrelease QMAKE_CXXFLAGS=-frandom-seed=bitcoin QMAKE_LFLAGS=-frandom-seed=bitcoin make $MAKEOPTS cp release/bitcoin-qt.exe $OUTDIR/ # diff --git a/contrib/gitian-descriptors/gitian.yml b/contrib/gitian-descriptors/gitian.yml index 11ee4dc580..52056b381d 100644 --- a/contrib/gitian-descriptors/gitian.yml +++ b/contrib/gitian-descriptors/gitian.yml @@ -16,12 +16,15 @@ packages: - "libssl-dev" - "git-core" - "unzip" +- "pkg-config" +- "libpng12-dev" reference_datetime: "2011-01-30 00:00:00" remotes: - "url": "https://git.gitorious.org/+bitcoin-stable-developers/bitcoin/bitcoind-stable.git" "dir": "bitcoin" files: - "miniupnpc-1.6.tar.gz" +- "qrencode-3.2.0.tar.bz2" script: | INSTDIR="$HOME/install" export LIBRARY_PATH="$INSTDIR/lib" @@ -31,6 +34,12 @@ script: | INSTALLPREFIX=$INSTDIR make $MAKEOPTS install cd .. # + tar xjf qrencode-3.2.0.tar.bz2 + cd qrencode-3.2.0 + ./configure --prefix=$INSTDIR --enable-static --disable-shared + make $MAKEOPTS install + cd .. + # cd bitcoin mkdir -p $OUTDIR/src cp -a . $OUTDIR/src @@ -43,6 +52,6 @@ script: | mkdir -p $OUTDIR/bin/$GBUILD_BITS install -s bitcoind $OUTDIR/bin/$GBUILD_BITS cd .. - qmake INCLUDEPATH="$INSTDIR/include" LIBS="-L$INSTDIR/lib" RELEASE=1 USE_SSL=1 + qmake INCLUDEPATH="$INSTDIR/include" LIBS="-L$INSTDIR/lib" RELEASE=1 USE_SSL=1 USE_QRCODE=1 make $MAKEOPTS install bitcoin-qt $OUTDIR/bin/$GBUILD_BITS diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index a43e7102a8..e159f9bbc3 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -17,16 +17,405 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # -import subprocess, sys, re, os, shutil, os.path +import subprocess, sys, re, os, shutil, stat, os.path from time import sleep from argparse import ArgumentParser +# This is ported from the original macdeployqt with modifications + +class FrameworkInfo(object): + def __init__(self): + self.frameworkDirectory = "" + self.frameworkName = "" + self.frameworkPath = "" + self.binaryDirectory = "" + self.binaryName = "" + self.binaryPath = "" + self.version = "" + self.installName = "" + self.deployedInstallName = "" + self.sourceFilePath = "" + self.destinationDirectory = "" + self.sourceResourcesDirectory = "" + self.destinationResourcesDirectory = "" + + def __eq__(self, other): + if self.__class__ == other.__class__: + return self.__dict__ == other.__dict__ + else: + return False + + def __str__(self): + return """ Framework name: %s + Framework directory: %s + Framework path: %s + Binary name: %s + Binary directory: %s + Binary path: %s + Version: %s + Install name: %s + Deployed install name: %s + Source file Path: %s + Deployed Directory (relative to bundle): %s +""" % (self.frameworkName, + self.frameworkDirectory, + self.frameworkPath, + self.binaryName, + self.binaryDirectory, + self.binaryPath, + self.version, + self.installName, + self.deployedInstallName, + self.sourceFilePath, + self.destinationDirectory) + + def isDylib(self): + return self.frameworkName.endswith(".dylib") + + def isQtFramework(self): + if self.isDylib(): + return self.frameworkName.startswith("libQt") + else: + return self.frameworkName.startswith("Qt") + + reOLine = re.compile(r'^(.+) \(compatibility version [0-9.]+, current version [0-9.]+\)$') + bundleFrameworkDirectory = "Contents/Frameworks" + bundleBinaryDirectory = "Contents/MacOS" + + @classmethod + def fromOtoolLibraryLine(cls, line): + # Note: line must be trimmed + if line == "": + return None + + # Don't deploy system libraries (exception for libQtuitools and libQtlucene). + if line.startswith("/System/Library/") or line.startswith("@executable_path") or (line.startswith("/usr/lib/") and "libQt" not in line): + return None + + m = cls.reOLine.match(line) + if m is None: + raise RuntimeError("otool line could not be parsed: " + line) + + path = m.group(1) + + info = cls() + info.sourceFilePath = path + info.installName = path + + if path.endswith(".dylib"): + dirname, filename = os.path.split(path) + info.frameworkName = filename + info.frameworkDirectory = dirname + info.frameworkPath = path + + info.binaryDirectory = dirname + info.binaryName = filename + info.binaryPath = path + info.version = "-" + + info.installName = path + info.deployedInstallName = "@executable_path/../Frameworks/" + info.binaryName + info.sourceFilePath = path + info.destinationDirectory = cls.bundleFrameworkDirectory + else: + parts = path.split("/") + i = 0 + # Search for the .framework directory + for part in parts: + if part.endswith(".framework"): + break + i += 1 + if i == len(parts): + raise RuntimeError("Could not find .framework or .dylib in otool line: " + line) + + info.frameworkName = parts[i] + info.frameworkDirectory = "/".join(parts[:i]) + info.frameworkPath = os.path.join(info.frameworkDirectory, info.frameworkName) + + info.binaryName = parts[i+3] + info.binaryDirectory = "/".join(parts[i+1:i+3]) + info.binaryPath = os.path.join(info.binaryDirectory, info.binaryName) + info.version = parts[i+2] + + info.deployedInstallName = "@executable_path/../Frameworks/" + os.path.join(info.frameworkName, info.binaryPath) + info.destinationDirectory = os.path.join(cls.bundleFrameworkDirectory, info.frameworkName, info.binaryDirectory) + + info.sourceResourcesDirectory = os.path.join(info.frameworkPath, "Resources") + info.destinationResourcesDirectory = os.path.join(cls.bundleFrameworkDirectory, info.frameworkName, "Resources") + + return info + +class ApplicationBundleInfo(object): + def __init__(self, path): + self.path = path + appName = os.path.splitext(os.path.basename(path))[0] + self.binaryPath = os.path.join(path, "Contents", "MacOS", appName) + if not os.path.exists(self.binaryPath): + raise RuntimeError("Could not find bundle binary for " + path) + self.resourcesPath = os.path.join(path, "Contents", "Resources") + self.pluginPath = os.path.join(path, "Contents", "PlugIns") + +class DeploymentInfo(object): + def __init__(self): + self.qtPath = None + self.pluginPath = None + self.deployedFrameworks = [] + + def detectQtPath(self, frameworkDirectory): + parentDir = os.path.dirname(frameworkDirectory) + if os.path.exists(os.path.join(parentDir, "translations")): + # Classic layout, e.g. "/usr/local/Trolltech/Qt-4.x.x" + self.qtPath = parentDir + elif os.path.exists(os.path.join(parentDir, "share", "qt4", "translations")): + # MacPorts layout, e.g. "/opt/local/share/qt4" + self.qtPath = os.path.join(parentDir, "share", "qt4") + + if self.qtPath is not None: + pluginPath = os.path.join(self.qtPath, "plugins") + if os.path.exists(pluginPath): + self.pluginPath = pluginPath + + def usesFramework(self, name): + nameDot = "%s." % name + libNameDot = "lib%s." % name + for framework in self.deployedFrameworks: + if framework.endswith(".framework"): + if framework.startswith(nameDot): + return True + elif framework.endswith(".dylib"): + if framework.startswith(libNameDot): + return True + return False + +def getFrameworks(binaryPath, verbose): + if verbose >= 3: + print "Inspecting with otool: " + binaryPath + otool = subprocess.Popen(["otool", "-L", binaryPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + o_stdout, o_stderr = otool.communicate() + if otool.returncode != 0: + if verbose >= 1: + sys.stderr.write(o_stderr) + sys.stderr.flush() + raise RuntimeError("otool failed with return code %d" % otool.returncode) + + otoolLines = o_stdout.split("\n") + otoolLines.pop(0) # First line is the inspected binary + if ".framework" in binaryPath or binaryPath.endswith(".dylib"): + otoolLines.pop(0) # Frameworks and dylibs list themselves as a dependency. + + libraries = [] + for line in otoolLines: + info = FrameworkInfo.fromOtoolLibraryLine(line.strip()) + if info is not None: + if verbose >= 3: + print "Found framework:" + print info + libraries.append(info) + + return libraries + +def runInstallNameTool(action, *args): + subprocess.check_call(["install_name_tool", "-"+action] + list(args)) + +def changeInstallName(oldName, newName, binaryPath, verbose): + if verbose >= 3: + print "Using install_name_tool:" + print " in", binaryPath + print " change reference", oldName + print " to", newName + runInstallNameTool("change", oldName, newName, binaryPath) + +def changeIdentification(id, binaryPath, verbose): + if verbose >= 3: + print "Using install_name_tool:" + print " change identification in", binaryPath + print " to", id + runInstallNameTool("id", id, binaryPath) + +def runStrip(binaryPath, verbose): + if verbose >= 3: + print "Using strip:" + print " stripped", binaryPath + subprocess.check_call(["strip", "-x", binaryPath]) + +def copyFramework(framework, path, verbose): + fromPath = framework.sourceFilePath + toDir = os.path.join(path, framework.destinationDirectory) + toPath = os.path.join(toDir, framework.binaryName) + + if not os.path.exists(fromPath): + raise RuntimeError("No file at " + fromPath) + + if os.path.exists(toPath): + return None # Already there + + if not os.path.exists(toDir): + os.makedirs(toDir) + + shutil.copy2(fromPath, toPath) + if verbose >= 3: + print "Copied:", fromPath + print " to:", toPath + + permissions = os.stat(toPath) + if not permissions.st_mode & stat.S_IWRITE: + os.chmod(toPath, permissions.st_mode | stat.S_IWRITE) + + if not framework.isDylib(): # Copy resources for real frameworks + fromResourcesDir = framework.sourceResourcesDirectory + if os.path.exists(fromResourcesDir): + toResourcesDir = os.path.join(path, framework.destinationResourcesDirectory) + shutil.copytree(fromResourcesDir, toResourcesDir) + if verbose >= 3: + print "Copied resources:", fromResourcesDir + print " to:", toResourcesDir + elif framework.frameworkName.startswith("libQtGui"): # Copy qt_menu.nib (applies to non-framework layout) + qtMenuNibSourcePath = os.path.join(framework.frameworkDirectory, "Resources", "qt_menu.nib") + qtMenuNibDestinationPath = os.path.join(path, "Contents", "Resources", "qt_menu.nib") + if os.path.exists(qtMenuNibSourcePath) and not os.path.exists(qtMenuNibDestinationPath): + shutil.copytree(qtMenuNibSourcePath, qtMenuNibDestinationPath) + if verbose >= 3: + print "Copied for libQtGui:", qtMenuNibSourcePath + print " to:", qtMenuNibDestinationPath + + return toPath + +def deployFrameworks(frameworks, bundlePath, binaryPath, strip, verbose, deploymentInfo=None): + if deploymentInfo is None: + deploymentInfo = DeploymentInfo() + + while len(frameworks) > 0: + framework = frameworks.pop(0) + deploymentInfo.deployedFrameworks.append(framework.frameworkName) + + if verbose >= 2: + print "Processing", framework.frameworkName, "..." + + # Get the Qt path from one of the Qt frameworks + if deploymentInfo.qtPath is None and framework.isQtFramework(): + deploymentInfo.detectQtPath(framework.frameworkDirectory) + + if framework.installName.startswith("@executable_path"): + if verbose >= 2: + print framework.frameworkName, "already deployed, skipping." + continue + + # install_name_tool the new id into the binary + changeInstallName(framework.installName, framework.deployedInstallName, binaryPath, verbose) + + # Copy farmework to app bundle. + deployedBinaryPath = copyFramework(framework, bundlePath, verbose) + # Skip the rest if already was deployed. + if deployedBinaryPath is None: + continue + + if strip: + runStrip(deployedBinaryPath, verbose) + + # install_name_tool it a new id. + changeIdentification(framework.deployedInstallName, deployedBinaryPath, verbose) + # Check for framework dependencies + dependencies = getFrameworks(deployedBinaryPath, verbose) + + for dependency in dependencies: + changeInstallName(dependency.installName, dependency.deployedInstallName, deployedBinaryPath, verbose) + + # Deploy framework if necessary. + if dependency.frameworkName not in deploymentInfo.deployedFrameworks and dependency not in frameworks: + frameworks.append(dependency) + + return deploymentInfo + +def deployFrameworksForAppBundle(applicationBundle, strip, verbose): + frameworks = getFrameworks(applicationBundle.binaryPath, verbose) + if len(frameworks) == 0 and verbose >= 1: + print "Warning: Could not find any external frameworks to deploy in %s." % (applicationBundle.path) + return DeploymentInfo() + else: + return deployFrameworks(frameworks, applicationBundle.path, applicationBundle.binaryPath, strip, verbose) + +def deployPlugins(appBundleInfo, deploymentInfo, strip, verbose): + # Lookup available plugins, exclude unneeded + plugins = [] + for dirpath, dirnames, filenames in os.walk(deploymentInfo.pluginPath): + pluginDirectory = os.path.relpath(dirpath, deploymentInfo.pluginPath) + if pluginDirectory == "designer": + # Skip designer plugins + continue + elif pluginDirectory == "phonon": + # Deploy the phonon plugins only if phonon is in use + if not deploymentInfo.usesFramework("phonon"): + continue + elif pluginDirectory == "sqldrivers": + # Deploy the sql plugins only if QtSql is in use + if not deploymentInfo.usesFramework("QtSql"): + continue + elif pluginDirectory == "script": + # Deploy the script plugins only if QtScript is in use + if not deploymentInfo.usesFramework("QtScript"): + continue + elif pluginDirectory == "qmltooling": + # Deploy the qml plugins only if QtDeclarative is in use + if not deploymentInfo.usesFramework("QtDeclarative"): + continue + elif pluginDirectory == "bearer": + # Deploy the bearer plugins only if QtNetwork is in use + if not deploymentInfo.usesFramework("QtNetwork"): + continue + + for pluginName in filenames: + pluginPath = os.path.join(pluginDirectory, pluginName) + if pluginName.endswith("_debug.dylib"): + # Skip debug plugins + continue + elif pluginPath == "imageformats/libqsvg.dylib" or pluginPath == "iconengines/libqsvgicon.dylib": + # Deploy the svg plugins only if QtSvg is in use + if not deploymentInfo.usesFramework("QtSvg"): + continue + elif pluginPath == "accessible/libqtaccessiblecompatwidgets.dylib": + # Deploy accessibility for Qt3Support only if the Qt3Support is in use + if not deploymentInfo.usesFramework("Qt3Support"): + continue + elif pluginPath == "graphicssystems/libqglgraphicssystem.dylib": + # Deploy the opengl graphicssystem plugin only if QtOpenGL is in use + if not deploymentInfo.usesFramework("QtOpenGL"): + continue + + plugins.append((pluginDirectory, pluginName)) + + for pluginDirectory, pluginName in plugins: + if verbose >= 2: + print "Processing plugin", os.path.join(pluginDirectory, pluginName), "..." + + sourcePath = os.path.join(deploymentInfo.pluginPath, pluginDirectory, pluginName) + destinationDirectory = os.path.join(appBundleInfo.pluginPath, pluginDirectory) + if not os.path.exists(destinationDirectory): + os.makedirs(destinationDirectory) + + destinationPath = os.path.join(destinationDirectory, pluginName) + shutil.copy2(sourcePath, destinationPath) + if verbose >= 3: + print "Copied:", sourcePath + print " to:", destinationPath + + if strip: + runStrip(destinationPath, verbose) + + dependencies = getFrameworks(destinationPath, verbose) + + for dependency in dependencies: + changeInstallName(dependency.installName, dependency.deployedInstallName, destinationPath, verbose) + + # Deploy framework if necessary. + if dependency.frameworkName not in deploymentInfo.deployedFrameworks: + deployFrameworks([dependency], appBundleInfo.path, destinationPath, strip, verbose, deploymentInfo) + qt_conf="""[Paths] translations=Resources plugins=PlugIns """ -ap = ArgumentParser(description="""Front-end to macdeployqt with some additional functions. +ap = ArgumentParser(description="""Improved version of macdeployqt. Outputs a ready-to-deploy app in a folder "dist" and optionally wraps it in a .dmg file. Note, that the "dist" folder will be deleted before deploying on each run. @@ -69,22 +458,6 @@ for p in config.add_resources: # ------------------------------------------------ -if len(config.add_qt_tr) == 0: - add_qt_tr = [] -else: - qt_tr_dir = os.path.join(os.getenv("QTDIR", ""), "translations") - add_qt_tr = ["qt_%s.qm" % lng for lng in config.add_qt_tr[0].split(",")] - for lng_file in add_qt_tr: - p = os.path.join(qt_tr_dir, lng_file) - if verbose >= 3: - print "Checking for \"%s\"..." % p - if not os.path.exists(p): - if verbose >= 1: - sys.stderr.write("Error: Could not find Qt translation file \"%s\"\n" % (lng_file)) - sys.exit(1) - -# ------------------------------------------------ - if len(config.fancy) == 1: if verbose >= 3: print "Fancy: Importing plistlib..." @@ -160,7 +533,6 @@ if os.path.exists("dist"): # ------------------------------------------------ target = os.path.join("dist", app_bundle) -target_res = os.path.join(target, "Contents", "Resources") if verbose >= 2: print "+ Copying source bundle +" @@ -170,27 +542,61 @@ if verbose >= 3: os.mkdir("dist") shutil.copytree(app_bundle, target) -# ------------------------------------------------ +applicationBundle = ApplicationBundleInfo(target) -macdeployqt_args = ["macdeployqt", target, "-verbose=%d" % verbose] -if not config.plugins: - macdeployqt_args.append("-no-plugins") -if not config.strip: - macdeployqt_args.append("-no-strip") +# ------------------------------------------------ if verbose >= 2: - print "+ Running macdeployqt +" + print "+ Deploying frameworks +" -ret = subprocess.call(macdeployqt_args) -if ret != 0: +try: + deploymentInfo = deployFrameworksForAppBundle(applicationBundle, config.strip, verbose) + if deploymentInfo.qtPath is None: + deploymentInfo.qtPath = os.getenv("QTDIR", None) + if deploymentInfo.qtPath is None: + if verbose >= 1: + sys.stderr.write("Warning: Could not detect Qt's path, skipping plugin deployment!\n") + config.plugins = False +except RuntimeError as e: + if verbose >= 1: + sys.stderr.write("Error: %s\n" % str(e)) sys.exit(ret) # ------------------------------------------------ +if config.plugins: + if verbose >= 2: + print "+ Deploying plugins +" + + try: + deployPlugins(applicationBundle, deploymentInfo, config.strip, verbose) + except RuntimeError as e: + if verbose >= 1: + sys.stderr.write("Error: %s\n" % str(e)) + sys.exit(ret) + +# ------------------------------------------------ + +if len(config.add_qt_tr) == 0: + add_qt_tr = [] +else: + qt_tr_dir = os.path.join(deploymentInfo.qtPath, "translations") + add_qt_tr = ["qt_%s.qm" % lng for lng in config.add_qt_tr[0].split(",")] + for lng_file in add_qt_tr: + p = os.path.join(qt_tr_dir, lng_file) + if verbose >= 3: + print "Checking for \"%s\"..." % p + if not os.path.exists(p): + if verbose >= 1: + sys.stderr.write("Error: Could not find Qt translation file \"%s\"\n" % (lng_file)) + sys.exit(1) + +# ------------------------------------------------ + if verbose >= 2: print "+ Installing qt.conf +" -f = open(os.path.join(target_res, "qt.conf"), "wb") +f = open(os.path.join(applicationBundle.resourcesPath, "qt.conf"), "wb") f.write(qt_conf) f.close() @@ -201,8 +607,8 @@ if len(add_qt_tr) > 0 and verbose >= 2: for lng_file in add_qt_tr: if verbose >= 3: - print os.path.join(qt_tr_dir, lng_file), "->", os.path.join(target_res, lng_file) - shutil.copy2(os.path.join(qt_tr_dir, lng_file), os.path.join(target_res, lng_file)) + print os.path.join(qt_tr_dir, lng_file), "->", os.path.join(applicationBundle.resourcesPath, lng_file) + shutil.copy2(os.path.join(qt_tr_dir, lng_file), os.path.join(applicationBundle.resourcesPath, lng_file)) # ------------------------------------------------ @@ -210,7 +616,7 @@ if len(config.add_resources) > 0 and verbose >= 2: print "+ Adding additional resources +" for p in config.add_resources: - t = os.path.join(target_res, os.path.basename(p)) + t = os.path.join(applicationBundle.resourcesPath, os.path.basename(p)) if verbose >= 3: print p, "->", t if os.path.isdir(p): diff --git a/contrib/macdeploy/notes.txt b/contrib/macdeploy/notes.txt index 0654ff7169..a3f0b5447d 100644 --- a/contrib/macdeploy/notes.txt +++ b/contrib/macdeploy/notes.txt @@ -6,7 +6,7 @@ You will need the appscript package for the fancy disk image creation to work. Install it by invoking "sudo easy_install appscript". Ths script should be invoked in the target directory like this: -$source_dir/contrib/macdeploy/macdeployqtplus Bitcoin-Qt.app -add-qt-tr de,es,ru -dmg -fancy $source_dir/contrib/macdeploy/fancy.plist +$source_dir/contrib/macdeploy/macdeployqtplus Bitcoin-Qt.app -add-qt-tr da,de,es,hu,ru,uk,zh_CN,zh_TW -dmg -fancy $source_dir/contrib/macdeploy/fancy.plist -verbose 2 During the process, the disk image window will pop up briefly where the fancy settings are applied. This is normal, please do not interfere. @@ -19,7 +19,7 @@ Fill in the following. Enable custom process step: [x] Command: %{sourceDir}/contrib/macdeploy/macdeployqtplus Working directory: %{buildDir} -Command arguments: Bitcoin-Qt.app -add-qt-tr de,ru -dmg -fancy %{sourceDir}/contrib/macdeploy/fancy.plist +Command arguments: Bitcoin-Qt.app -add-qt-tr da,de,es,hu,ru,uk,zh_CN,zh_TW -dmg -fancy %{sourceDir}/contrib/macdeploy/fancy.plist -verbose 2 After that you can start the deployment process through the menu with Build -> Deploy Project "bitcoin-qt" diff --git a/contrib/miniupnpc/Portfile b/contrib/miniupnpc/Portfile deleted file mode 100644 index 133aee532c..0000000000 --- a/contrib/miniupnpc/Portfile +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4 -# $Id$ - -PortSystem 1.0 - -name miniupnpc -epoch 2 -version 1.6 -revision 2 -categories net -platforms darwin -license BSD -maintainers singingwolfboy openmaintainer -description Lightweight client for UPnP protocol -long_description \ - ${description} - -homepage http://miniupnp.free.fr/ -master_sites http://miniupnp.free.fr/files/download.php?file=${distname}${extract.suffix}&dummy= -checksums md5 88055f2d4a061cfd4cfe25a9eae22f67 \ - sha1 ef8f2edb17f2e7c5b8dc67ee80a65c199d823e0a \ - rmd160 d86b75b331a3fb5525c71708548f311977c0598f - -use_configure no - -variant universal {} -if {[variant_isset universal]} { - set archflags ${configure.universal_cflags} -} else { - set archflags ${configure.cc_archflags} -} - -build.args-append CC="${configure.cc} ${archflags}" - -post-patch { - reinplace "s|-Wl,-install_name,|-Wl,-install_name,${prefix}/lib/|" ${worksrcpath}/Makefile -} - -destroot.destdir PREFIX=${prefix} INSTALLPREFIX=${destroot}${prefix} - -livecheck.type regex -livecheck.url http://miniupnp.free.fr/files/ -livecheck.regex ${name}-(\\d+(\\.\\d{1,4})+)${extract.suffix} |