>From a97725b5ccc44d4987d0fa29a026652af69a6506 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin
Date: Thu, 23 Jul 2015 23:52:17 +0200 Subject: [PATCH] Allow using arbitrary wxWidgets commits in install_wx.make. In addition to allowing to have a local file with a not officially released wxWidgets version, also allow getting such versions on the fly from Github. This is useful at least for checking install_msw.sh script as it allows to specify a working wxWidgets version in it. --- install_wx.make | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/install_wx.make b/install_wx.make index 01e1dcc..25f0a42 100644 --- a/install_wx.make +++ b/install_wx.make @@ -25,7 +25,15 @@ this_makefile := $(abspath $(lastword $(MAKEFILE_LIST))) # Configurable settings ######################################################## +# If wx_commit_sha is defined on make command line, it overrides wx_version and +# the commit with this SHA is retrieved from github. Otherwise the official +# release wx_version (which can also be overridden on make command line) is +# downloaded. +ifneq ($(wx_commit_sha),) +wx_version := $(wx_commit_sha) +else wx_version := 3.0.0 +endif mingw_dir := /MinGW_ @@ -37,6 +45,17 @@ wx_dir := /opt/lmi/wx-scratch # URLs and archive md5sums ##################################################### +ifneq ($(wx_commit_sha),) +ifeq ($(wx_md5),) +$(error Please specify wx_md5 for $(wx_commit_sha) on make command line.) +endif + +wx_archive := wxWidgets-$(wx_commit_sha).zip + +$(wx_archive)-md5 := $(wx_md5) + +$(wx_archive)-url := https://github.com/wxWidgets/wxWidgets/archive/$(wx_commit_sha).zip +else wx-2.8.6-md5 := 8a130e5b25448a17454a6b957a5e075c wx-2.8.7-md5 := e3455083afdf6404a569a8bf0701cf13 wx-2.8.9-md5 := b0b2d0f6915a21ca6f33896ee8f50387 @@ -54,6 +73,7 @@ wx_archive := wxWidgets-$(wx_version).tar.bz2 $(wx_archive)-md5 := $(wx_md5) $(wx_archive)-url := ftp://ftp.wxwidgets.org/pub/$(wx_version)/$(wx_archive) +endif # Variables that normally should be left alone ################################# @@ -119,6 +139,7 @@ MKDIR := mkdir PATCH := patch RM := rm TAR := tar +UNZIP := unzip WGET := wget # Targets ###################################################################### @@ -142,6 +163,13 @@ initial_setup: @$(MKDIR) --parents $(cache_dir) @$(MKDIR) --parents $(build_dir) +ifneq ($(wx_commit_sha),) +.PHONY: %.zip +%.zip: + cd $(cache_dir) && [ -e $@ ] || $(WGET) $(WGETFLAGS) --output-document=$@ $(address@hidden) + cd $(cache_dir) && $(ECHO) "$(address@hidden) *$@" | $(MD5SUM) --check + -$(UNZIP) $(cache_dir)/$@ -d $(wx_dir) +else WGETFLAGS := '--timestamping' TARFLAGS := --keep-old-files @@ -153,6 +181,7 @@ TARFLAGS := --keep-old-files cd $(cache_dir) && [ -e $@ ] || $(WGET) $(WGETFLAGS) $(address@hidden) cd $(cache_dir) && $(ECHO) "$(address@hidden) *$@" | $(MD5SUM) --check -$(TAR) --extract $(TARFLAGS) --directory=$(wx_dir) --file=$(cache_dir)/$@ +endif .PHONY: wx wx: -- 2.1.0