From 50d44a3992385d342997a71f2530f74e4d57f93d Mon Sep 17 00:00:00 2001 From: James Duley Date: Wed, 25 Nov 2015 10:24:17 +0000 Subject: [PATCH 01/11] LP-187 MSYS2: fix windows header using extern rather than explicitly redeclaring --- .../gcs/src/plugins/ophid/inc/ophid_usbmon.h | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/ground/gcs/src/plugins/ophid/inc/ophid_usbmon.h b/ground/gcs/src/plugins/ophid/inc/ophid_usbmon.h index eda27387f..b55ffeb27 100644 --- a/ground/gcs/src/plugins/ophid/inc/ophid_usbmon.h +++ b/ground/gcs/src/plugins/ophid/inc/ophid_usbmon.h @@ -54,26 +54,10 @@ #include #include #include +extern "C" +{ #include - -// from working mingw hidsdi.h -#ifdef __cplusplus -extern "C" { -#endif - -HIDAPI VOID WINAPI HidD_GetHidGuid(LPGUID); -HIDAPI BOOL WINAPI HidD_GetPreparsedData(HANDLE, PHIDP_PREPARSED_DATA *); -HIDAPI BOOL WINAPI HidD_FreePreparsedData(PHIDP_PREPARSED_DATA); -HIDAPI BOOL WINAPI HidD_FlushQueue(HANDLE); -HIDAPI BOOL WINAPI HidD_GetConfiguration(HANDLE, PHIDD_CONFIGURATION, ULONG); -HIDAPI BOOL WINAPI HidD_SetConfiguration(HANDLE, PHIDD_CONFIGURATION, ULONG); -HIDAPI BOOL WINAPI HidD_GetPhysicalDescriptor(HANDLE, PVOID, ULONG); -HIDAPI BOOL WINAPI HidD_GetIndexedString(HANDLE, ULONG, PVOID, ULONG); -HIDAPI BOOL WINAPI HidD_GetSerialNumberString(HANDLE, PVOID, ULONG); - -#ifdef __cplusplus } -#endif #endif // if defined(Q_OS_MAC) From df04a87831faec2e75b20e5ee2505e78216b8bc1 Mon Sep 17 00:00:00 2001 From: James Duley Date: Wed, 25 Nov 2015 10:25:38 +0000 Subject: [PATCH 02/11] LP-187 MSYS2: correct copy data dlls for msys2 --- ground/gcs/copydata.pro | 33 ++++++++++++++------- ground/gcs/src/libs/osgearth/copydata.pro | 12 ++++---- ground/gcs/src/libs/sdlgamepad/copydata.pro | 2 +- package/winx86/gcs.nsi | 2 +- 4 files changed, 31 insertions(+), 18 deletions(-) diff --git a/ground/gcs/copydata.pro b/ground/gcs/copydata.pro index 4fb80f27c..6e1593b95 100644 --- a/ground/gcs/copydata.pro +++ b/ground/gcs/copydata.pro @@ -81,13 +81,26 @@ equals(copyqt, 1) { Qt5Quick$${DS}.dll \ Qt5QuickWidgets$${DS}.dll \ Qt5Qml$${DS}.dll \ - icuin54.dll \ - icudt54.dll \ - icuuc54.dll - # it is more robust to take the following DLLs from Qt rather than from MinGW - QT_DLLS += libgcc_s_dw2-1.dll \ - libstdc++-6.dll \ - libwinpthread-1.dll + libicuin56.dll \ + libicudt56.dll \ + libicuuc56.dll \ + libstdc++-6.dll \ + libwinpthread-1.dll \ + libpcre16-0.dll \ + zlib1.dll \ + libharfbuzz-0.dll \ + libfreetype-6.dll \ + libbz2-1.dll \ + libpng16-16.dll \ + libglib-2.0-0.dll \ + libintl-8.dll \ + libiconv-2.dll + contains(QT_ARCH, i386) { + QT_DLLS += libgcc_s_dw2-1.dll + } else { + QT_DLLS += libgcc_s_seh-1.dll + } + for(dll, QT_DLLS) { addCopyFileTarget($${dll},$$[QT_INSTALL_BINS],$${GCS_APP_PATH}) } @@ -97,14 +110,14 @@ equals(copyqt, 1) { ssleay32.dll \ libeay32.dll for(dll, OPENSSL_DLLS) { - addCopyFileTarget($${dll},$${OPENSSL_DIR},$${GCS_APP_PATH}) + addCopyFileTarget($${dll},$$[QT_INSTALL_BINS],$${GCS_APP_PATH}) } # copy OpenGL DLL OPENGL_DLLS = \ - opengl32_32/opengl32.dll + opengl32.dll for(dll, OPENGL_DLLS) { - addCopyFileTarget($${dll},$${MESAWIN_DIR},$${GCS_APP_PATH}) + addCopyFileTarget($${dll},$$[QT_INSTALL_BINS],$${GCS_APP_PATH}/opengl32) } QT_PLUGINS = iconengines/qsvgicon$${DS}.dll \ diff --git a/ground/gcs/src/libs/osgearth/copydata.pro b/ground/gcs/src/libs/osgearth/copydata.pro index bd93a4fe1..98953ea79 100644 --- a/ground/gcs/src/libs/osgearth/copydata.pro +++ b/ground/gcs/src/libs/osgearth/copydata.pro @@ -3,7 +3,7 @@ # equals(copyosg, 1) { - OSG_VERSION = 3.4.0 + OSG_VERSION = 3.5.1 linux { # copy osg libraries @@ -42,12 +42,12 @@ equals(copyosg, 1) { OSG_LIBS = \ libcurl-4.dll \ libfreetype-6.dll \ - libgdal.dll \ - libgeos-3-3-8.dll \ - libgeos_c-1.dll \ - libjpeg-9.dll \ + libgdal-20.dll \ + libgeos.dll \ + libgeos_c.dll \ + libjpeg-8.dll \ libpng16-16.dll \ - libproj-0.dll \ + libproj-9.dll \ libtiff-5.dll \ libtiffxx-5.dll \ zlib1.dll \ diff --git a/ground/gcs/src/libs/sdlgamepad/copydata.pro b/ground/gcs/src/libs/sdlgamepad/copydata.pro index af9cecbff..ce6d8ff01 100644 --- a/ground/gcs/src/libs/sdlgamepad/copydata.pro +++ b/ground/gcs/src/libs/sdlgamepad/copydata.pro @@ -4,7 +4,7 @@ equals(copydata, 1) { SDL_DLLS = \ SDL.dll for(dll, SDL_DLLS) { - addCopyFileTarget($${dll},$${SDL_DIR}/bin,$${GCS_APP_PATH}) + addCopyFileTarget($${dll},$$[QT_INSTALL_BINS],$${GCS_APP_PATH}) } } } diff --git a/package/winx86/gcs.nsi b/package/winx86/gcs.nsi index 4f1f5bb14..c447c6c2b 100644 --- a/package/winx86/gcs.nsi +++ b/package/winx86/gcs.nsi @@ -222,7 +222,7 @@ SectionEnd ; Copy Opengl32.dll if needed (disabled by default) Section /o "Mesa OpenGL driver" InSecInstallOpenGL SetOutPath "$INSTDIR\bin" - File /r "${GCS_BUILD_TREE}\bin\opengl32_32\opengl32.dll" + File /r "${GCS_BUILD_TREE}\bin\opengl32\opengl32.dll" SectionEnd ; AeroSimRC plugin files From 02e03259d35450366aaf20f0954ca73fffa5e92c Mon Sep 17 00:00:00 2001 From: James Duley Date: Wed, 25 Nov 2015 10:28:04 +0000 Subject: [PATCH 03/11] LP-187 MSYS2: dont't explicitly specifiy qt spec --- Makefile | 13 +++---------- ground/gcs/copydata.pro | 9 ++++----- ground/gcs/src/libs/osgearth/copydata.pro | 5 ++--- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 04db0a97a..8c523eb7e 100644 --- a/Makefile +++ b/Makefile @@ -147,17 +147,10 @@ include $(ROOT_DIR)/make/tools.mk # We almost need to consider autoconf/automake instead of this ifeq ($(UNAME), Linux) - ifeq ($(ARCH), x86_64) - QT_SPEC := linux-g++-64 - else - QT_SPEC := linux-g++-32 - endif UAVOBJGENERATOR := $(BUILD_DIR)/uavobjgenerator/uavobjgenerator else ifeq ($(UNAME), Darwin) - QT_SPEC := macx-g++ UAVOBJGENERATOR := $(BUILD_DIR)/uavobjgenerator/uavobjgenerator else ifeq ($(UNAME), Windows) - QT_SPEC := win32-g++ UAVOBJGENERATOR := $(BUILD_DIR)/uavobjgenerator/uavobjgenerator.exe endif @@ -196,7 +189,7 @@ uavobjgenerator: $(UAVOBJGENERATOR) $(UAVOBJGENERATOR): | $(UAVOBJGENERATOR_DIR) $(V1) cd $(UAVOBJGENERATOR_DIR) && \ ( [ -f Makefile ] || $(QMAKE) $(ROOT_DIR)/ground/uavobjgenerator/uavobjgenerator.pro \ - -spec $(QT_SPEC) CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) ) && \ + CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) ) && \ $(MAKE) --no-print-directory -w UAVOBJ_TARGETS := gcs flight python matlab java wireshark @@ -270,7 +263,7 @@ GCS_MAKEFILE := $(GCS_DIR)/Makefile gcs_qmake $(GCS_MAKEFILE): | $(GCS_DIR) $(V1) cd $(GCS_DIR) && \ $(QMAKE) $(ROOT_DIR)/ground/gcs/gcs.pro \ - -spec $(QT_SPEC) -r CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) \ + -r CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) \ 'GCS_BIG_NAME="$(GCS_BIG_NAME)"' GCS_SMALL_NAME=$(GCS_SMALL_NAME) \ 'ORG_BIG_NAME="$(ORG_BIG_NAME)"' ORG_SMALL_NAME=$(ORG_SMALL_NAME) \ 'WIKI_URL_ROOT="$(WIKI_URL_ROOT)"' \ @@ -304,7 +297,7 @@ UPLOADER_MAKEFILE := $(UPLOADER_DIR)/Makefile uploader_qmake $(UPLOADER_MAKEFILE): | $(UPLOADER_DIR) $(V1) cd $(UPLOADER_DIR) && \ $(QMAKE) $(ROOT_DIR)/ground/gcs/src/experimental/USB_UPLOAD_TOOL/upload.pro \ - -spec $(QT_SPEC) -r CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) $(GCS_QMAKE_OPTS) + -r CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) $(GCS_QMAKE_OPTS) .PHONY: uploader uploader: $(UPLOADER_MAKEFILE) diff --git a/ground/gcs/copydata.pro b/ground/gcs/copydata.pro index 6e1593b95..b5c2f4329 100644 --- a/ground/gcs/copydata.pro +++ b/ground/gcs/copydata.pro @@ -31,7 +31,7 @@ equals(copyqt, 1) { libicui18n.so.54 \ libicuuc.so.54 \ libicudata.so.54 - *-64 { + contains(QT_ARCH, x86_64) { QT_LIBS += libqgsttools_p.so.1 } for(lib, QT_LIBS) { @@ -48,12 +48,11 @@ equals(copyqt, 1) { platforms/libqxcb.so \ xcbglintegrations/libqxcb-glx-integration.so \ sqldrivers/libqsqlite.so - *-32 { - QT_PLUGINS += mediaservice/libqtmedia_audioengine.so - } - *-64 { + contains(QT_ARCH, x86_64) { QT_PLUGINS += mediaservice/libgstaudiodecoder.so \ mediaservice/libgstmediaplayer.so + } else { + QT_PLUGINS += mediaservice/libqtmedia_audioengine.so } } diff --git a/ground/gcs/src/libs/osgearth/copydata.pro b/ground/gcs/src/libs/osgearth/copydata.pro index 98953ea79..e3efc3b65 100644 --- a/ground/gcs/src/libs/osgearth/copydata.pro +++ b/ground/gcs/src/libs/osgearth/copydata.pro @@ -9,10 +9,9 @@ equals(copyosg, 1) { # copy osg libraries data_copy.commands += $(MKDIR) $${GCS_LIBRARY_PATH}/osg $$addNewline() - *-64 { + contains(QT_ARCH, x86_64) { data_copy.commands += $(COPY_DIR) $$shell_quote($$OSG_SDK_DIR/lib64/)* $$shell_quote($$GCS_LIBRARY_PATH/osg/) - } - *-32 { + } else { data_copy.commands += $(COPY_DIR) $$shell_quote($$OSG_SDK_DIR/lib/)* $$shell_quote($$GCS_LIBRARY_PATH/osg/) } From 0020ab7a128ddbe020115d89e51274d9a85aa4d3 Mon Sep 17 00:00:00 2001 From: James Duley Date: Wed, 25 Nov 2015 10:29:31 +0000 Subject: [PATCH 04/11] LP-187 MSYS2: add system_path make function --- Makefile | 9 --------- make/functions.mk | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 8c523eb7e..c1ddac086 100644 --- a/Makefile +++ b/Makefile @@ -130,15 +130,6 @@ else ifeq ($(V), 0) else ifeq ($(V), 1) endif -# Make sure we know few things about the architecture before including -# the tools.mk to ensure that we download/install the right tools. -UNAME := $(shell uname) -ARCH := $(shell uname -m) -# Here and everywhere if not Linux or Mac then assume Windows -ifeq ($(filter Linux Darwin, $(UNAME)), ) - UNAME := Windows -endif - # Include tools installers include $(ROOT_DIR)/make/tools.mk diff --git a/make/functions.mk b/make/functions.mk index 5b39e23b5..ab3d3eba2 100644 --- a/make/functions.mk +++ b/make/functions.mk @@ -16,6 +16,21 @@ # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# Make sure we know few things about the architecture before including +# the tools.mk to ensure that we download/install the right tools. +UNAME := $(shell uname) +ARCH := $(shell uname -m) +# Here and everywhere if not Linux or Mac then assume Windows +ifeq ($(filter Linux Darwin, $(UNAME)), ) + UNAME := Windows +endif + +ifeq ($(UNAME),Windows) + system_path = $(shell cygpath -w $(1)) +else + system_path = $(1) +endif + # Function for converting Windows style slashes into Unix style slashfix = $(subst \,/,$(1)) From 0f33a036c811f745a4d1751b9927537699d3b7fe Mon Sep 17 00:00:00 2001 From: James Duley Date: Wed, 25 Nov 2015 10:30:52 +0000 Subject: [PATCH 05/11] LP-187 MSYS2: fix paths for msys2 --- Makefile | 2 +- package/Windows.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c1ddac086..ef5d4e741 100644 --- a/Makefile +++ b/Makefile @@ -494,7 +494,7 @@ OPFW_FILES := $(foreach fw_targ, $(PACKAGE_FW_TARGETS), $(FIRMWARE_DIR)/$(fw_tar OPFW_CONTENTS := \ \ \ - $(foreach fw_file, $(OPFW_FILES), $(fw_file)) \ + $(foreach fw_file, $(OPFW_FILES), $(call system_path, $(fw_file))) \ \ diff --git a/package/Windows.mk b/package/Windows.mk index 705fb186a..b3d6030f3 100644 --- a/package/Windows.mk +++ b/package/Windows.mk @@ -8,7 +8,7 @@ endif VERSION_CMD := $(VERSION_INFO) -NSIS_OPTS := /V3 +NSIS_OPTS := -V3 NSIS_WINX86 := $(ROOT_DIR)/package/winx86 NSIS_SCRIPT := $(NSIS_WINX86)/gcs.nsi NSIS_TEMPLATE := $(NSIS_WINX86)/gcs.tpl From 98d75433e28668a3f4519676e722b34a4636d0f8 Mon Sep 17 00:00:00 2001 From: James Duley Date: Wed, 25 Nov 2015 10:31:51 +0000 Subject: [PATCH 06/11] LP-187 MSYS2: fix unzip for msys2 --- tool_install.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tool_install.sh b/tool_install.sh index 1ad5244f4..ae8aeca9f 100755 --- a/tool_install.sh +++ b/tool_install.sh @@ -76,12 +76,7 @@ function download_file #2 The output directory function zip_extract { - if [ "$uname" = Windows ] - then - 7za.exe x -o"$2" "$1" - else - unzip "$1" -d "$2" - fi + unzip "$1" -d "$2" } ## Extracts a 7zip file From cc45b5a6f38dfda239f8c845f2227538b2d454aa Mon Sep 17 00:00:00 2001 From: James Duley Date: Wed, 25 Nov 2015 10:32:44 +0000 Subject: [PATCH 07/11] LP-187 MSYS2: fix windows package because osg isn't yet part of build --- package/winx86/gcs.nsi | 7 ------- 1 file changed, 7 deletions(-) diff --git a/package/winx86/gcs.nsi b/package/winx86/gcs.nsi index c447c6c2b..706341946 100644 --- a/package/winx86/gcs.nsi +++ b/package/winx86/gcs.nsi @@ -182,13 +182,6 @@ Section "-Plugins" InSecPlugins File /r "${GCS_BUILD_TREE}\lib\${GCS_SMALL_NAME}\plugins\*.pluginspec" SectionEnd -; Copy OSG libs -Section "-OsgLibs" InSecOsgLibs - SectionIn RO - SetOutPath "$INSTDIR\lib\${GCS_SMALL_NAME}\osg" - File /r "${GCS_BUILD_TREE}\lib\${GCS_SMALL_NAME}\osg\*.dll" -SectionEnd - ; Copy GCS resources Section "-Resources" InSecResources SetOutPath "$INSTDIR\share" From 86c262d70805df35502e4716499e2ab30c0ee4d8 Mon Sep 17 00:00:00 2001 From: James Duley Date: Sun, 23 Aug 2015 08:04:48 +1200 Subject: [PATCH 08/11] nsis packaging remove extra template layer And make required fixes which include an extra function in version-info.py: ${VERSION_FOR_NUM} e.g. 15.09.1.12344 --- make/scripts/version-info.py | 20 ++++++++++++++++++++ package/Linux.mk | 6 +++--- package/Windows.mk | 26 +++++++++++--------------- package/winx86/gcs.nsi | 29 +++++++++-------------------- package/winx86/gcs.tpl | 28 ---------------------------- 5 files changed, 43 insertions(+), 66 deletions(-) delete mode 100644 package/winx86/gcs.tpl diff --git a/make/scripts/version-info.py b/make/scripts/version-info.py index 140ec7c85..d8b19b05f 100644 --- a/make/scripts/version-info.py +++ b/make/scripts/version-info.py @@ -195,6 +195,25 @@ class Repo: except: return None + def version_four_num(self): + """Return package version in format X.X.X.X using only numbers""" + + try: + (release, junk, candidate) = self._last_tag.partition("-RC") + (year, dot, month_and_patch) = release.partition(".") + (month, dot, patch) = month_and_patch.partition(".") + + if candidate == "": + candidate = "64" # Need to stay below 65536 for last part + + if patch == "": + patch = "0" + + return "{}.{}.{}.{}{:0>3.3}".format(year,month,patch,candidate,self._num_commits_past_tag) + except: + return None + + def revision(self): """Return full revison string (tag if defined, or branch:hash date time if no tag)""" try: @@ -463,6 +482,7 @@ string given. TAG_OR_BRANCH = r.tag(r.branch('unreleased')), TAG_OR_HASH8 = r.tag(r.hash(8, 'untagged')), LABEL = r.label(), + VERSION_FOUR_NUM = r.version_four_num(), REVISION = r.revision(), DIRTY = r.dirty(), FWTAG = xtrim(r.tag(r.branch('unreleased')), r.dirty(), 25), diff --git a/package/Linux.mk b/package/Linux.mk index 399490d44..72a64510c 100644 --- a/package/Linux.mk +++ b/package/Linux.mk @@ -54,9 +54,9 @@ install: uninstall $(V1) $(MKDIR) -p $(DESTDIR)$(datadir) $(V1) $(MKDIR) -p $(DESTDIR)$(datadir)/applications $(V1) $(MKDIR) -p $(DESTDIR)$(datadir)/pixmaps - $(V1) $(INSTALL) $(BUILD_DIR)/$(GCS_SMALL_NAME)_$(GCS_BUILD_CONF)/bin/$(GCS_SMALL_NAME) $(DESTDIR)$(bindir) - $(V1) $(INSTALL) $(BUILD_DIR)/$(GCS_SMALL_NAME)_$(GCS_BUILD_CONF)/$(libbasename)/$(GCS_SMALL_NAME) $(DESTDIR)$(libdir) - $(V1) $(INSTALL) $(BUILD_DIR)/$(GCS_SMALL_NAME)_$(GCS_BUILD_CONF)/share/$(GCS_SMALL_NAME) $(DESTDIR)$(datadir) + $(V1) $(INSTALL) $(GCS_DIR)/bin/$(GCS_SMALL_NAME) $(DESTDIR)$(bindir) + $(V1) $(INSTALL) $(GCS_DIR)/$(libbasename)/$(GCS_SMALL_NAME) $(DESTDIR)$(libdir) + $(V1) $(INSTALL) $(GCS_DIR)/share/$(GCS_SMALL_NAME) $(DESTDIR)$(datadir) $(V1) $(INSTALL) -T $(ROOT_DIR)/package/linux/gcs.desktop $(DESTDIR)$(datadir)/applications/$(ORG_SMALL_NAME).desktop $(V1) $(INSTALL) -T $(ROOT_DIR)/ground/gcs/src/plugins/coreplugin/images/$(ORG_SMALL_NAME)_logo_128.png \ $(DESTDIR)$(datadir)/pixmaps/$(ORG_SMALL_NAME).png diff --git a/package/Windows.mk b/package/Windows.mk index b3d6030f3..82228db04 100644 --- a/package/Windows.mk +++ b/package/Windows.mk @@ -6,13 +6,9 @@ ifndef TOP_LEVEL_MAKEFILE $(error Top level Makefile must be used to build this target) endif -VERSION_CMD := $(VERSION_INFO) - NSIS_OPTS := -V3 NSIS_WINX86 := $(ROOT_DIR)/package/winx86 NSIS_SCRIPT := $(NSIS_WINX86)/gcs.nsi -NSIS_TEMPLATE := $(NSIS_WINX86)/gcs.tpl -NSIS_HEADER := $(OPGCSSYNTHDIR)/gcs.nsh .PHONY: package package: gcs uavobjects_matlab | $(PACKAGE_DIR) @@ -20,17 +16,17 @@ ifneq ($(GCS_BUILD_CONF),release) # We can only package release builds $(error Packaging is currently supported for release builds only) endif - $(V1) mkdir -p "$(dir $(NSIS_HEADER))" - $(VERSION_CMD) \ - --template='$(NSIS_TEMPLATE)' \ - --outfile='$(NSIS_HEADER)' \ - ORG_BIG_NAME='$(ORG_BIG_NAME)' \ - GCS_BIG_NAME='$(GCS_BIG_NAME)' \ - GCS_SMALL_NAME='$(GCS_SMALL_NAME)' \ - PACKAGE_LBL='$(PACKAGE_LBL)' \ - PACKAGE_NAME='$(PACKAGE_NAME)' \ - PACKAGE_SEP='$(PACKAGE_SEP)' $(V1) echo "Building Windows installer, please wait..." $(V1) echo "If you have a script error in line 1 - use Unicode NSIS 2.46+" $(V1) echo " http://www.scratchpaper.com" - $(NSIS) $(NSIS_OPTS) $(NSIS_SCRIPT) + $(NSIS) $(NSIS_OPTS) \ + -DORG_BIG_NAME='$(ORG_BIG_NAME)' \ + -DGCS_BIG_NAME='$(GCS_BIG_NAME)' \ + -DGCS_SMALL_NAME='$(GCS_SMALL_NAME)' \ + -DPACKAGE_LBL='$(PACKAGE_LBL)' \ + -DVERSION_FOUR_NUM='$(shell $(VERSION_INFO) --format=\$${VERSION_FOUR_NUM})' \ + -DOUT_FILE='$(call system_path,$(PACKAGE_EXE))' \ + -DPROJECT_ROOT='$(call system_path,$(ROOT_DIR))' \ + -DGCS_BUILD_TREE='$(call system_path,$(GCS_DIR))' \ + -DUAVO_SYNTH_TREE='$(call system_path,$(UAVOBJ_OUT_DIR))' \ + $(NSIS_SCRIPT) diff --git a/package/winx86/gcs.nsi b/package/winx86/gcs.nsi index 706341946..ba7b49fb1 100644 --- a/package/winx86/gcs.nsi +++ b/package/winx86/gcs.nsi @@ -29,16 +29,11 @@ ; Includes !include "x64.nsh" -!include "..\..\build\gcs-synthetics\gcs.nsh" ;-------------------------------- ; Paths - ; Tree root locations (relative to this script location) - !define PROJECT_ROOT "..\.." !define NSIS_DATA_TREE "." - !define GCS_BUILD_TREE "..\..\build\${GCS_SMALL_NAME}_release" - !define UAVO_SYNTH_TREE "..\..\build\uavobject-synthetics" !define AEROSIMRC_TREE "${GCS_BUILD_TREE}\misc\AeroSIM-RC" ; Default installation folder @@ -50,21 +45,15 @@ ;-------------------------------- ; Version information - ; Program name and installer file - !define PRODUCT_NAME "${GCS_BIG_NAME}" - !define INSTALLER_NAME "${GCS_BIG_NAME} Installer" + Name "${GCS_BIG_NAME}" + OutFile "${OUT_FILE}" - Name "${PRODUCT_NAME}" - OutFile "${PACKAGE_DIR}\..\${OUT_FILE}" - - VIProductVersion ${PRODUCT_VERSION} - VIAddVersionKey "ProductName" "${INSTALLER_NAME}" - VIAddVersionKey "FileVersion" "${FILE_VERSION}" - VIAddVersionKey "Comments" "${INSTALLER_NAME}. ${BUILD_DESCRIPTION}" + VIProductVersion ${VERSION_FOUR_NUM} + VIAddVersionKey "ProductName" "${GCS_BIG_NAME}" + VIAddVersionKey "ProductVersion" "${VERSION_FOUR_NUM}" VIAddVersionKey "CompanyName" "The LibrePilot Team, http://www.librepilot.org" - VIAddVersionKey "LegalTrademarks" "${PRODUCT_NAME} is a trademark of The LibrePilot Team" VIAddVersionKey "LegalCopyright" "© 2015 The LibrePilot Team" - VIAddVersionKey "FileDescription" "${INSTALLER_NAME}" + VIAddVersionKey "FileDescription" "${GCS_BIG_NAME} Installer" ;-------------------------------- ; Installer interface and base settings @@ -229,9 +218,9 @@ Section "Shortcuts" InSecShortcuts SetOutPath "$INSTDIR" CreateDirectory "$SMPROGRAMS\${ORG_BIG_NAME}" CreateShortCut "$SMPROGRAMS\${ORG_BIG_NAME}\${GCS_BIG_NAME}.lnk" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" \ - "" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" 0 "" "" "${PRODUCT_NAME} ${PRODUCT_VERSION}. ${BUILD_DESCRIPTION}" + "" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" 0 CreateShortCut "$SMPROGRAMS\${ORG_BIG_NAME}\${GCS_BIG_NAME} (clean configuration).lnk" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" \ - "-reset" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" 0 "" "" "${PRODUCT_NAME} ${PRODUCT_VERSION}. ${BUILD_DESCRIPTION}" + "-reset" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" 0 CreateShortCut "$SMPROGRAMS\${ORG_BIG_NAME}\License.lnk" "$INSTDIR\LICENSE.txt" \ "" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" 0 CreateShortCut "$SMPROGRAMS\${ORG_BIG_NAME}\ReadMe.lnk" "$INSTDIR\README.txt" \ @@ -247,7 +236,7 @@ Section "Shortcuts" InSecShortcuts CreateShortCut "$SMPROGRAMS\${ORG_BIG_NAME}\Forums.lnk" "http://forum.librepilot.org" \ "" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" 0 CreateShortCut "$DESKTOP\${GCS_BIG_NAME}.lnk" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" \ - "" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" 0 "" "" "${PRODUCT_NAME} ${PRODUCT_VERSION}. ${BUILD_DESCRIPTION}" + "" "$INSTDIR\bin\${GCS_SMALL_NAME}.exe" 0 CreateShortCut "$SMPROGRAMS\${ORG_BIG_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 SectionEnd diff --git a/package/winx86/gcs.tpl b/package/winx86/gcs.tpl deleted file mode 100644 index 24067201b..000000000 --- a/package/winx86/gcs.tpl +++ /dev/null @@ -1,28 +0,0 @@ -# -# ***************************************************************************** -# -# @file ${OUTFILENAME} -# @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011-2015. -# @brief Autogenerated NSIS header file, built using template -# ${TEMPLATE} -# -# @see The GNU Public License (GPL) Version 3 -# -# ***************************************************************************** -# - -; Some names, paths and constants -!define ORG_BIG_NAME "${ORG_BIG_NAME}" -!define GCS_BIG_NAME "${GCS_BIG_NAME}" -!define GCS_SMALL_NAME "${GCS_SMALL_NAME}" -!define PACKAGE_LBL "${PACKAGE_LBL}" -!define PACKAGE_NAME "${PACKAGE_NAME}" -!define PACKAGE_SEP "${PACKAGE_SEP}" -!define PACKAGE_DIR "..\..\build\package" -!define FIRMWARE_DIR "firmware" -!define OUT_FILE "$${PACKAGE_NAME}$${PACKAGE_SEP}$${PACKAGE_LBL}$${PACKAGE_SEP}win32.exe" - -; Installer version info -!define PRODUCT_VERSION "0.0.0.0" -!define FILE_VERSION "${TAG_OR_BRANCH}:${HASH8}${DIRTY} ${DATETIME}" -!define BUILD_DESCRIPTION "${PACKAGE_LBL} built from ${ORIGIN}, committed ${DATETIME} as ${HASH}" From 9c0b8d3f71c66268868b29fff981111e4de815d4 Mon Sep 17 00:00:00 2001 From: James Duley Date: Thu, 26 Nov 2015 04:25:32 +0000 Subject: [PATCH 09/11] Add Make function to get architecture --- make/functions.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/make/functions.mk b/make/functions.mk index ab3d3eba2..acd77b302 100644 --- a/make/functions.mk +++ b/make/functions.mk @@ -51,3 +51,4 @@ endef smallify = $(subst $(SPACE),-,$(call lc,$1)) +get_arch = $(shell $(CC) -dumpmachine | sed s/-.*//) From 672749d0d72f4b7f91ca62f91cfecf1e822449b9 Mon Sep 17 00:00:00 2001 From: James Duley Date: Wed, 25 Nov 2015 16:06:17 +0000 Subject: [PATCH 10/11] LP-187 MSYS2: add arch to installer filename --- Makefile | 2 ++ make/functions.mk | 1 - package/Windows.mk | 11 ++++++++++- package/winx86/gcs.nsi | 6 +++++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ef5d4e741..0d03a9510 100644 --- a/Makefile +++ b/Makefile @@ -130,6 +130,8 @@ else ifeq ($(V), 0) else ifeq ($(V), 1) endif +ARCH := $(call get_arch) + # Include tools installers include $(ROOT_DIR)/make/tools.mk diff --git a/make/functions.mk b/make/functions.mk index acd77b302..9054524fa 100644 --- a/make/functions.mk +++ b/make/functions.mk @@ -19,7 +19,6 @@ # Make sure we know few things about the architecture before including # the tools.mk to ensure that we download/install the right tools. UNAME := $(shell uname) -ARCH := $(shell uname -m) # Here and everywhere if not Linux or Mac then assume Windows ifeq ($(filter Linux Darwin, $(UNAME)), ) UNAME := Windows diff --git a/package/Windows.mk b/package/Windows.mk index 82228db04..ee6e50c0e 100644 --- a/package/Windows.mk +++ b/package/Windows.mk @@ -6,12 +6,20 @@ ifndef TOP_LEVEL_MAKEFILE $(error Top level Makefile must be used to build this target) endif +PACKAGE_EXE := $(BUILD_DIR)/$(PACKAGE_FULL_NAME)_$(ARCH).exe + NSIS_OPTS := -V3 NSIS_WINX86 := $(ROOT_DIR)/package/winx86 NSIS_SCRIPT := $(NSIS_WINX86)/gcs.nsi +ifeq ($(ARCH),x86_64) +WIN_DEF = -DW64 +endif + .PHONY: package -package: gcs uavobjects_matlab | $(PACKAGE_DIR) +package: $(PACKAGE_EXE) + +$(PACKAGE_EXE): $(NSIS_SCRIPT) gcs uavobjects_matlab | $(PACKAGE_DIR) ifneq ($(GCS_BUILD_CONF),release) # We can only package release builds $(error Packaging is currently supported for release builds only) @@ -29,4 +37,5 @@ endif -DPROJECT_ROOT='$(call system_path,$(ROOT_DIR))' \ -DGCS_BUILD_TREE='$(call system_path,$(GCS_DIR))' \ -DUAVO_SYNTH_TREE='$(call system_path,$(UAVOBJ_OUT_DIR))' \ + $(WIN_DEF) \ $(NSIS_SCRIPT) diff --git a/package/winx86/gcs.nsi b/package/winx86/gcs.nsi index ba7b49fb1..3d5b1f6f2 100644 --- a/package/winx86/gcs.nsi +++ b/package/winx86/gcs.nsi @@ -37,7 +37,11 @@ !define AEROSIMRC_TREE "${GCS_BUILD_TREE}\misc\AeroSIM-RC" ; Default installation folder - InstallDir "$PROGRAMFILES\${ORG_BIG_NAME}" +!ifdef W64 + InstallDir "$PROGRAMFILES64\${ORG_BIG_NAME}" +!else + InstallDir "$PROGRAMFILES32\${ORG_BIG_NAME}" +!endif ; Get installation folder from registry if available InstallDirRegKey HKLM "Software\${ORG_BIG_NAME}" "Install Location" From 25a8a35ed52aa02cc4337a1b4d76f3e4be1a63cb Mon Sep 17 00:00:00 2001 From: Brian Webb Date: Sun, 20 Dec 2015 19:17:05 -0700 Subject: [PATCH 11/11] LP-187 Msys2: Removes unnecessary targets from Windows SDK targets and updates CONTRIBUTING.md --- CONTRIBUTING.md | 53 ++++++++++++++++++++++++++++++------------------- make/tools.mk | 6 ++++-- 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 15544b42b..56ba98fc4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,40 +1,53 @@ -How to build from source? -========================= +# How to build from source? Both development environment and GCS are supported on Windows, Linux and Mac OS X +## Install prerequisites + The first step is to Install all OS specific prerequisites. -###Mac OS X + +### Mac OS X + Install XCode and its relatated command line tools (follow Apple documentation). Install git, curl and p7zip. You can use brew `brew install git curl p7zip` or macport: `sudo port install git curl p7zip` -###Ubuntu - - sudo apt-get install git build-essential curl gdb wget debhelper p7zip-full unzip flex bison libsdl1.2-dev libudev-dev libusb-1.0-0-dev libc6-i386 mesa-common-dev -###Windows -Install [msysGIT](https://msysgit.github.io/) under `C:\git` +### Ubuntu -Clone LibrePilot Git repository. -Open Git Bash and run + sudo apt-get install git build-essential curl gdb wget debhelper p7zip-full unzip flex bison libsdl1.2-dev libudev-dev libusb-1.0-0-dev libc6-i386 mesa-common-dev - cd /path/to/LibrePilot_root - ./make/scripts/win_sdk_install.sh -You can build using the `/path/to/LibrePilot_root/make/winx86/bin/make` wrapper to call `mingw32-make.exe` as: +### Windows - ./make/winx86/bin/make all_sdk_install -or call `mingw32-make` directly +Install [Msys2](https://msys2.github.io/) following the instructions on the web site. You can either install the i686 (32 bit) or x86_64 (64 bit) version. - mingw32-make all_sdk_install +Start a "MinGW-w64 Win32 Shell" or "MinGW-w64 Win32 Win64 Shell" (NOT "MSYS2 Shell") + +Install the dependent packages (32 bit): + + pacman -S --needed git unzip tar mingw-w64-i686-toolchain mingw-w64-i686-qt5 mingw-w64-i686-SDL mingw-w64-i686-mesa mingw-w64-i686-openssl + +Or for a 64 bit build: + + pacman -S --needed git unzip tar mingw-w64-x86_64-toolchain mingw-w64-x86_64-qt5 mingw-w64-x86_64-SDL mingw-w64-x86_64-mesa mingw-w64-x86_64-openssl + +*NOTE* On Windows you need to run the mingw version of make, which is 'mingw32-make' + + +## Setup the build environment and build -##Setup the build environment and build The `all_sdk_install` target will automatically retrieve and install all needed tools (qt, arm gcc etc.) in a local folder `/path/to/LibrePilot_root/tools` +### Ubuntu / Mac OS X - make all_sdk_install - make package + make all_sdk_install + make package -The `package` target will build the complete installable package for the current platform. +### Windows + + mingw32-make all_sdk_install + mingw32-make package + +The `package` target will build the complete installable package for the current platform. You can build the 'all' target to just build the software. Run make with no arguments to show the complete list of supported targets. diff --git a/make/tools.mk b/make/tools.mk index 881813c99..2df72f9b3 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -166,9 +166,11 @@ QT_SDK_PREFIX := $(QT_SDK_DIR) # ############################## -BUILD_SDK_TARGETS := arm_sdk qt_sdk osg +BUILD_SDK_TARGETS := arm_sdk ifeq ($(UNAME), Windows) - BUILD_SDK_TARGETS += sdl nsis mesawin openssl ccache + BUILD_SDK_TARGETS += nsis +else + BUILD_SDK_TARGETS += qt_sdk endif ALL_SDK_TARGETS := $(BUILD_SDK_TARGETS) gtest uncrustify doxygen