From 2df151e3251867259ad626f4a67baa0865fa3177 Mon Sep 17 00:00:00 2001 From: Job Evers Date: Fri, 29 Jul 2016 09:05:42 -0500 Subject: [PATCH] add windows build to travis Compiles lbrycrdd using mingw to produce a windows executable --- .travis.yml | 29 +++++++++++++++++++++++++---- depends/Makefile | 1 + packaging/build_windows.sh | 18 ++++++++++++++++++ packaging/remove_consensus.patch | 23 +++++++++++++++++++++++ share/setup.nsi.in | 4 ++-- src/Makefile.am | 2 +- 6 files changed, 70 insertions(+), 7 deletions(-) create mode 100755 packaging/build_windows.sh create mode 100644 packaging/remove_consensus.patch diff --git a/.travis.yml b/.travis.yml index 0974c9d3d..1cc3c7dee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,14 +4,23 @@ matrix: sudo: required dist: trusty language: c + env: TARGET=linux + - os: linux + sudo: required + dist: trusty + language: c + env: TARGET=windows - os: osx language: c osx_image: xcode7.3 + env: TARGET=osx cache: + apt: true ccache: true directories: - build + - depends/built before_install: - date +%s > "${TRAVIS_BUILD_DIR}/start_time" @@ -20,8 +29,12 @@ before_install: install: true script: - - ./reproducible_build.sh -t -o -c - - zip -j "lbrycrd-${TRAVIS_OS_NAME}.zip" src/lbrycrdd src/lbrycrd-cli src/lbrycrd-tx + - if [[ "${TARGET}" == "osx" ]]; then ./reproducible_build.sh -t -o -c; fi + - if [[ "${TARGET}" == "linux" ]]; then ./reproducible_build.sh -t -o -c; fi + - if [[ "${TARGET}" == "windows" ]]; then ./packaging/build_windows.sh; fi + - if [[ "${TARGET}" == "osx" ]]; then zip -j "lbrycrd-${TARGET}.zip" src/lbrycrdd src/lbrycrd-cli src/lbrycrd-tx; fi + - if [[ "${TARGET}" == "linux" ]]; then zip -j "lbrycrd-${TARGET}.zip" src/lbrycrdd src/lbrycrd-cli src/lbrycrd-tx; fi + - if [[ "${TARGET}" == "windows" ]]; then zip -j "lbrycrd-${TARGET}.zip" src/lbrycrdd.exe src/lbrycrd-cli.exe src/lbrycrd-tx.exe; fi before_cache: - ls -lh build @@ -33,7 +46,7 @@ deploy: skip_cleanup: true on: tags: true - condition: "$TRAVIS_OS_NAME = linux" + condition: "$TARGET = linux" api_key: secure: "ibN+PQg84f0tgJLV3KaHjkHmgFNOPqBLIrSU42moen22xxT2VIn0j7DkFaLLts1fs/+/gxmrvhOQ0vUFJqmflZ3kCeyedP/CVgZz7D7HRVK0cYUMJ2F9VWMZAFIX6A67OUlypqZqzKAKrZHx3HXky6Z8NBU23JgWqDm8PcrbbgMLvB2lvWVASjJVKreaL9BOxFOOOrAj6xAIm9ogTOnFVI/AhufNOKOTZaiprcbqMngwHeaILbwEJVqv5P2YUurC6Sq+QaH26tX00DtsYOW+n8AA3Fe48+L6rqa6Q8ru+dhPuR/Apr2+DTZ+npzY8leV3A7mYUeLo4JLaEH6n1TLVt65cX7nuesS7KsSKBSxs7q7bsqeapDcMskZz5JR4EK4S96CuHZEnn6+efpH8IrxWpbeO3EibJfyT8tMJKw7Zym5mPr+sz6xSlVMoBVcCm+7z9e7Zcqukdvdy8jM7sGP9qusqEhpojh0o+gPgr9p13SfR+6OCpj9gwxPCnZO8RBfh1cbz9vFSVlDyUYcpI2CCCpPazA1glTsEDk+VtznnUMmWksXWfxBFV81jQB2SnoZKlnsiEuNMwhiMCMEkRFo74+AsUr2UjmKJ5KC8ACwsn475PoLZBh2J6fyXBHMdbrGfK+Zt5K2IHRRtDaZVT4eHqYzxh8KhalsuBNxCo3FygI=" - provider: releases @@ -41,7 +54,15 @@ deploy: skip_cleanup: true on: tags: true - condition: "$TRAVIS_OS_NAME = osx" + condition: "$TARGET = osx" + api_key: + secure: "ibN+PQg84f0tgJLV3KaHjkHmgFNOPqBLIrSU42moen22xxT2VIn0j7DkFaLLts1fs/+/gxmrvhOQ0vUFJqmflZ3kCeyedP/CVgZz7D7HRVK0cYUMJ2F9VWMZAFIX6A67OUlypqZqzKAKrZHx3HXky6Z8NBU23JgWqDm8PcrbbgMLvB2lvWVASjJVKreaL9BOxFOOOrAj6xAIm9ogTOnFVI/AhufNOKOTZaiprcbqMngwHeaILbwEJVqv5P2YUurC6Sq+QaH26tX00DtsYOW+n8AA3Fe48+L6rqa6Q8ru+dhPuR/Apr2+DTZ+npzY8leV3A7mYUeLo4JLaEH6n1TLVt65cX7nuesS7KsSKBSxs7q7bsqeapDcMskZz5JR4EK4S96CuHZEnn6+efpH8IrxWpbeO3EibJfyT8tMJKw7Zym5mPr+sz6xSlVMoBVcCm+7z9e7Zcqukdvdy8jM7sGP9qusqEhpojh0o+gPgr9p13SfR+6OCpj9gwxPCnZO8RBfh1cbz9vFSVlDyUYcpI2CCCpPazA1glTsEDk+VtznnUMmWksXWfxBFV81jQB2SnoZKlnsiEuNMwhiMCMEkRFo74+AsUr2UjmKJ5KC8ACwsn475PoLZBh2J6fyXBHMdbrGfK+Zt5K2IHRRtDaZVT4eHqYzxh8KhalsuBNxCo3FygI=" + - provider: releases + file: lbrycrd-windows.zip + skip_cleanup: true + on: + tags: true + condition: "$TARGET = windows" api_key: secure: "ibN+PQg84f0tgJLV3KaHjkHmgFNOPqBLIrSU42moen22xxT2VIn0j7DkFaLLts1fs/+/gxmrvhOQ0vUFJqmflZ3kCeyedP/CVgZz7D7HRVK0cYUMJ2F9VWMZAFIX6A67OUlypqZqzKAKrZHx3HXky6Z8NBU23JgWqDm8PcrbbgMLvB2lvWVASjJVKreaL9BOxFOOOrAj6xAIm9ogTOnFVI/AhufNOKOTZaiprcbqMngwHeaILbwEJVqv5P2YUurC6Sq+QaH26tX00DtsYOW+n8AA3Fe48+L6rqa6Q8ru+dhPuR/Apr2+DTZ+npzY8leV3A7mYUeLo4JLaEH6n1TLVt65cX7nuesS7KsSKBSxs7q7bsqeapDcMskZz5JR4EK4S96CuHZEnn6+efpH8IrxWpbeO3EibJfyT8tMJKw7Zym5mPr+sz6xSlVMoBVcCm+7z9e7Zcqukdvdy8jM7sGP9qusqEhpojh0o+gPgr9p13SfR+6OCpj9gwxPCnZO8RBfh1cbz9vFSVlDyUYcpI2CCCpPazA1glTsEDk+VtznnUMmWksXWfxBFV81jQB2SnoZKlnsiEuNMwhiMCMEkRFo74+AsUr2UjmKJ5KC8ACwsn475PoLZBh2J6fyXBHMdbrGfK+Zt5K2IHRRtDaZVT4eHqYzxh8KhalsuBNxCo3FygI=" diff --git a/depends/Makefile b/depends/Makefile index 3ddfc85a4..cd81fccf8 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -95,6 +95,7 @@ wallet_packages_$(NO_WALLET) = $(wallet_packages) upnp_packages_$(NO_UPNP) = $(upnp_packages) packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_) +$(info $$packages is [${packages}]) native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) $(qt_native_packages_) all_packages = $(packages) $(native_packages) diff --git a/packaging/build_windows.sh b/packaging/build_windows.sh new file mode 100755 index 000000000..29a655128 --- /dev/null +++ b/packaging/build_windows.sh @@ -0,0 +1,18 @@ +#! /bin/bash + +set -euo pipefail + +sudo apt-get update +sudo apt-get install -y --no-install-recommends \ + g++-mingw-w64-i686 mingw-w64-i686-dev g++-mingw-w64-x86-64 \ + mingw-w64-x86-64-dev build-essential libtool autotools-dev automake pkg-config \ + libssl-dev libevent-dev bsdmainutils curl ca-certificates + +cd depends +make HOST=i686-w64-mingw32 NO_QT=1 +cd .. +patch -p1 < packaging/remove_consensus.patch +./autogen.sh +./configure --prefix=`pwd`/depends/i686-w64-mingw32 --without-gui +make + diff --git a/packaging/remove_consensus.patch b/packaging/remove_consensus.patch new file mode 100644 index 000000000..aa16a5d9e --- /dev/null +++ b/packaging/remove_consensus.patch @@ -0,0 +1,23 @@ +diff --git a/src/Makefile.am b/src/Makefile.am +index a9f0a94..d71bfeb 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -64,12 +64,12 @@ if ENABLE_ZMQ + EXTRA_LIBRARIES += libbitcoin_zmq.a + endif + +-if BUILD_BITCOIN_LIBS +-lib_LTLIBRARIES = libbitcoinconsensus.la +-LIBBITCOINCONSENSUS=libbitcoinconsensus.la +-else +-LIBBITCOINCONSENSUS= +-endif ++# if BUILD_BITCOIN_LIBS ++# lib_LTLIBRARIES = libbitcoinconsensus.la ++# LIBBITCOINCONSENSUS=libbitcoinconsensus.la ++# else ++# LIBBITCOINCONSENSUS= ++# endif + + bin_PROGRAMS = + TESTS = diff --git a/share/setup.nsi.in b/share/setup.nsi.in index c062f96a3..e71fa25d2 100644 --- a/share/setup.nsi.in +++ b/share/setup.nsi.in @@ -50,9 +50,9 @@ Var StartMenuGroup # Installer attributes OutFile @abs_top_srcdir@/@PACKAGE_TARNAME@-${VERSION}-win@WINDOWS_BITS@-setup.exe !if "@WINDOWS_BITS@" == "64" -InstallDir $PROGRAMFILES64\Bitcoin +InstallDir $PROGRAMFILES64\Lbrycrd !else -InstallDir $PROGRAMFILES\Bitcoin +InstallDir $PROGRAMFILES\Lbrycrd !endif CRCCheck on XPStyle on diff --git a/src/Makefile.am b/src/Makefile.am index 4c83bb8ba..a9f0a949c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -357,7 +357,7 @@ lbrycrdd_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) lbrycrdd_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) if TARGET_WINDOWS -lbrycrdd_SOURCES += lbrycrdd-res.rc +lbrycrdd_SOURCES += bitcoin-cli-res.rc endif lbrycrdd_LDADD = \