2012-11-21 15:36:34 -06:00
|
|
|
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
|
|
|
|
#
|
|
|
|
# This file is part of the LibreOffice project.
|
|
|
|
#
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
#
|
|
|
|
|
|
|
|
fetch_LOGFILE := $(TARFILE_LOCATION)/fetch.log
|
|
|
|
|
|
|
|
ifneq (,$(WGET))
|
|
|
|
define fetch_Download__wget_command
|
2016-01-08 08:08:32 -06:00
|
|
|
&& bash -c '$(WGET) --progress=dot:mega -4 -Q 0 -P "." -l 0 -nd -nH -N --no-use-server-timestamps $1/$2 2>&1 | tee -a $(fetch_LOGFILE) && [ $$PIPESTATUS -eq 0 ]'
|
2012-11-21 15:36:34 -06:00
|
|
|
endef
|
|
|
|
|
|
|
|
else
|
|
|
|
define fetch_Download__wget_command
|
2015-10-05 10:44:10 -05:00
|
|
|
&& echo fetching $2 && bash -c '$(CURL) -O $1/$2 2>&1 | tee -a $(fetch_LOGFILE) && [ $$PIPESTATUS -eq 0 ]'
|
2012-11-21 15:36:34 -06:00
|
|
|
endef
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq (,$(MD5SUM))
|
|
|
|
define fetch_Download__checksum_command
|
|
|
|
&& SUM=`$(MD5SUM) $1 | sed "s/ .*//"` \
|
|
|
|
&& if test "$$SUM" != "$2"; then \
|
|
|
|
echo ERROR: expected checksum for $1 is $2 2>&1 | tee -a $(fetch_LOGFILE); \
|
|
|
|
false; \
|
|
|
|
fi
|
|
|
|
endef
|
|
|
|
|
|
|
|
else
|
|
|
|
fetch_Download__checksum_command :=
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2012-11-23 05:54:15 -06:00
|
|
|
# fetch__Download_item url tarball-name md5sum
|
|
|
|
define fetch__Download_item
|
2012-11-21 15:36:34 -06:00
|
|
|
$(if $(wildcard $(TARFILE_LOCATION)/$2),, \
|
|
|
|
cd $(TARFILE_LOCATION)/tmp \
|
|
|
|
$(call fetch_Download__wget_command,$1,$2) \
|
2012-11-23 05:54:15 -06:00
|
|
|
$(if $3,$(call fetch_Download__checksum_command,$2,$3)) \
|
2012-11-21 15:36:34 -06:00
|
|
|
&& mv $2 ../ \
|
|
|
|
)
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
2014-05-11 07:42:44 -05:00
|
|
|
# fetch_Download__is_checksum checksum
|
|
|
|
define fetch_Download__is_checksum
|
|
|
|
$(filter 32,$(words $(shell echo $(1) | sed -e 's/./& /g')))
|
|
|
|
endef
|
|
|
|
|
2014-05-15 01:23:15 -05:00
|
|
|
define fetch_Download__subst_var
|
2016-06-23 06:20:58 -05:00
|
|
|
$(subst _DLL,_MD5SUM,$(subst _TARBALL,_MD5SUM,$(subst _PACK,_MD5SUM,$(subst _JAR,_MD5SUM,$(1)))))
|
2014-05-15 01:23:15 -05:00
|
|
|
endef
|
|
|
|
|
2014-05-11 07:42:44 -05:00
|
|
|
# fetch_Download_item url variable-name
|
2012-11-23 05:54:15 -06:00
|
|
|
define fetch_Download_item
|
2014-05-11 08:30:35 -05:00
|
|
|
$(if $(strip $($(2))),,$(error fetch__Download_item: $(2) is empty))
|
2014-05-15 01:23:15 -05:00
|
|
|
$(if $(filter undefined,$(origin $(call fetch_Download__subst_var,$(2)))),\
|
2014-05-11 07:42:44 -05:00
|
|
|
$(if $(call fetch_Download__is_checksum,$(firstword $(subst -, ,$($(2))))),\
|
|
|
|
$(call fetch__Download_item,$1,$($2),$(firstword $(subst -, ,$($(2))))),\
|
2014-05-15 01:23:15 -05:00
|
|
|
$(error "fetch_Download_item: no checksum found for $($(2)). Please define $(call fetch_Download__subst_var,$(2)) in download.lst.") \
|
2014-05-11 07:42:44 -05:00
|
|
|
),\
|
2014-05-15 01:23:15 -05:00
|
|
|
$(call fetch__Download_item,$(1),$($2),$($(call fetch_Download__subst_var,$(2)))) \
|
2014-05-11 07:42:44 -05:00
|
|
|
)
|
2012-11-23 05:54:15 -06:00
|
|
|
|
|
|
|
endef
|
|
|
|
|
2014-05-11 07:42:44 -05:00
|
|
|
# fetch_Download_item url tarball-name
|
|
|
|
define fetch_Download_item_unchecked
|
|
|
|
$(call fetch__Download_item,$1,$2)
|
2012-11-23 05:54:15 -06:00
|
|
|
|
|
|
|
endef
|
|
|
|
|
2012-11-22 12:15:18 -06:00
|
|
|
fetch_BUILD_TYPE := $(sort $(BUILD_TYPE))
|
2014-02-27 09:19:43 -06:00
|
|
|
ifneq ($(CROSS_COMPILING),)
|
2012-11-22 12:15:18 -06:00
|
|
|
fetch_BUILD_TYPE := $(sort $(fetch_BUILD_TYPE) $(shell . $(SRCDIR)/bin/get_config_variables --build BUILD_TYPE && echo $$BUILD_TYPE))
|
|
|
|
endif
|
|
|
|
|
2014-05-11 07:42:44 -05:00
|
|
|
# Return variable-name if this tarball should be fetched.
|
|
|
|
#
|
|
|
|
# This function is used for tarballs predefined in download.lst.
|
|
|
|
#
|
|
|
|
# fetch_Optional build-type variable-name
|
2012-11-22 04:21:58 -06:00
|
|
|
define fetch_Optional
|
2012-11-22 12:15:18 -06:00
|
|
|
$(if $(filter ALL,$(DO_FETCH_TARBALLS))$(filter $1,$(fetch_BUILD_TYPE)),$2)
|
2012-11-22 04:21:58 -06:00
|
|
|
endef
|
|
|
|
|
2014-05-11 07:42:44 -05:00
|
|
|
# Return variable-name if this pack should be fetched.
|
|
|
|
#
|
|
|
|
# This function is used for packs defined by configure.
|
|
|
|
#
|
|
|
|
# fetch_Optional_pack variable-name
|
|
|
|
define fetch_Optional_pack
|
|
|
|
$(if $(strip $($(1))),$(1))
|
|
|
|
endef
|
|
|
|
|
2012-11-29 03:04:31 -06:00
|
|
|
download: $(WORKDIR)/download
|
2012-11-26 07:17:18 -06:00
|
|
|
|
2012-12-11 08:39:49 -06:00
|
|
|
$(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR)/Makefile.fetch
|
2013-07-24 12:44:52 -05:00
|
|
|
-@mkdir -p $(TARFILE_LOCATION)/tmp
|
2012-11-26 07:17:18 -06:00
|
|
|
@date >> $(fetch_LOGFILE)
|
2013-05-10 13:21:30 -05:00
|
|
|
$(foreach item, \
|
2014-01-13 10:01:32 -06:00
|
|
|
$(call fetch_Optional,ABW,ABW_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,APACHE_COMMONS,APACHE_COMMONS_LOGGING_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,APR,APR_TARBALL) \
|
|
|
|
$(call fetch_Optional,APR,APR_UTIL_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,BOOST,BOOST_TARBALL) \
|
2015-11-14 21:39:24 -06:00
|
|
|
$(call fetch_Optional,BREAKPAD,BREAKPAD_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,BSH,BSH_TARBALL) \
|
2015-07-03 04:58:27 -05:00
|
|
|
$(call fetch_Optional,BZIP2,BZIP2_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,CAIRO,CAIRO_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,CAIRO,PIXMAN_TARBALL) \
|
|
|
|
$(call fetch_Optional,CDR,CDR_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,CLUCENE,CLUCENE_TARBALL) \
|
|
|
|
$(call fetch_Optional,CMIS,CMIS_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,COINMP,COINMP_TARBALL) \
|
2014-04-10 06:37:38 -05:00
|
|
|
$(call fetch_Optional,COLLADA2GLTF,COLLADA2GLTF_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,CPPUNIT,CPPUNIT_TARBALL) \
|
|
|
|
$(call fetch_Optional,CT2N,CT2N_TARBALL) \
|
|
|
|
$(call fetch_Optional,CURL,CURL_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,EBOOK,EBOOK_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,EPM,EPM_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,ETONYEK,ETONYEK_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,EXPAT,EXPAT_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,FIREBIRD,FIREBIRD_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,FONTCONFIG,FONTCONFIG_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,FREEHAND,FREEHAND_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,FREETYPE,FREETYPE_TARBALL) \
|
|
|
|
$(call fetch_Optional,GLEW,GLEW_TARBALL) \
|
|
|
|
$(call fetch_Optional,GLM,GLM_TARBALL) \
|
2015-10-12 17:11:13 -05:00
|
|
|
$(call fetch_Optional,GLYPHY,GLYPHY_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional_pack,GOOGLE_DOCS_EXTENSION_PACK) \
|
|
|
|
$(call fetch_Optional,GRAPHITE,GRAPHITE_TARBALL) \
|
|
|
|
$(call fetch_Optional,HARFBUZZ,HARFBUZZ_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,HSQLDB,HSQLDB_TARBALL) \
|
|
|
|
$(call fetch_Optional,HUNSPELL,HUNSPELL_TARBALL) \
|
|
|
|
$(call fetch_Optional,HYPHEN,HYPHEN_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,ICU,ICU_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,JFREEREPORT,JFREEREPORT_FLOW_ENGINE_TARBALL) \
|
|
|
|
$(call fetch_Optional,JFREEREPORT,JFREEREPORT_FLUTE_TARBALL) \
|
|
|
|
$(call fetch_Optional,JFREEREPORT,JFREEREPORT_LIBBASE_TARBALL) \
|
|
|
|
$(call fetch_Optional,JFREEREPORT,JFREEREPORT_LIBFONTS_TARBALL) \
|
|
|
|
$(call fetch_Optional,JFREEREPORT,JFREEREPORT_LIBFORMULA_TARBALL) \
|
|
|
|
$(call fetch_Optional,JFREEREPORT,JFREEREPORT_LIBLAYOUT_TARBALL) \
|
|
|
|
$(call fetch_Optional,JFREEREPORT,JFREEREPORT_LIBLOADER_TARBALL) \
|
|
|
|
$(call fetch_Optional,JFREEREPORT,JFREEREPORT_LIBREPOSITORY_TARBALL) \
|
|
|
|
$(call fetch_Optional,JFREEREPORT,JFREEREPORT_LIBSERIALIZER_TARBALL) \
|
|
|
|
$(call fetch_Optional,JFREEREPORT,JFREEREPORT_LIBXML_TARBALL) \
|
|
|
|
$(call fetch_Optional,JFREEREPORT,JFREEREPORT_SAC_TARBALL) \
|
|
|
|
$(call fetch_Optional,JPEG,JPEG_TARBALL) \
|
2014-11-17 02:16:34 -06:00
|
|
|
$(call fetch_Optional,JPEG_TURBO,JPEG_TURBO_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,LANGUAGETOOL,LANGUAGETOOL_TARBALL) \
|
|
|
|
$(call fetch_Optional,LCMS2,LCMS2_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,LIBATOMIC_OPS,LIBATOMIC_OPS_TARBALL) \
|
|
|
|
$(call fetch_Optional,LIBEOT,LIBEOT_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,LIBEXTTEXTCAT,LIBEXTTEXTCAT_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,LIBLANGTAG,LANGTAGREG_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,LIBLANGTAG,LIBLANGTAG_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,LIBPNG,PNG_TARBALL) \
|
2016-07-28 10:16:19 -05:00
|
|
|
$(call fetch_Optional,LIBTOMMATH,LIBTOMMATH_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,LIBXML2,LIBXML_TARBALL) \
|
|
|
|
LIBXMLSEC_TARBALL \
|
|
|
|
$(call fetch_Optional,LIBXSLT,LIBXSLT_TARBALL) \
|
|
|
|
$(call fetch_Optional,LPSOLVE,LPSOLVE_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,MARIADB,MARIADB_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,MDDS,MDDS_TARBALL) \
|
2015-11-27 16:54:40 -06:00
|
|
|
$(call fetch_Optional,MDNSRESPONDER,MDNSRESPONDER_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,MORE_FONTS,FONT_CALADEA_TARBALL) \
|
|
|
|
$(call fetch_Optional,MORE_FONTS,FONT_CARLITO_TARBALL) \
|
|
|
|
$(call fetch_Optional,MORE_FONTS,FONT_DEJAVU_TARBALL) \
|
|
|
|
$(call fetch_Optional,MORE_FONTS,FONT_GENTIUM_TARBALL) \
|
|
|
|
$(call fetch_Optional,MORE_FONTS,FONT_LIBERATION_NARROW_TARBALL) \
|
|
|
|
$(call fetch_Optional,MORE_FONTS,FONT_LIBERATION_TARBALL) \
|
|
|
|
$(call fetch_Optional,MORE_FONTS,FONT_LINLIBERTINEG_TARBALL) \
|
|
|
|
$(call fetch_Optional,MORE_FONTS,FONT_OPENSANS_TARBALL) \
|
|
|
|
$(call fetch_Optional,MORE_FONTS,FONT_PTSERIF_TARBALL) \
|
|
|
|
$(call fetch_Optional,MORE_FONTS,FONT_SOURCECODE_TARBALL) \
|
|
|
|
$(call fetch_Optional,MORE_FONTS,FONT_SOURCESANS_TARBALL) \
|
2016-06-30 05:29:58 -05:00
|
|
|
$(call fetch_Optional,MORE_FONTS,FONT_NOTOEMOJI_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,MSPUB,MSPUB_TARBALL) \
|
|
|
|
$(call fetch_Optional,MWAW,MWAW_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,MYSQLCPPCONN,MYSQLCPPCONN_TARBALL) \
|
|
|
|
$(call fetch_Optional,MYTHES,MYTHES_TARBALL) \
|
|
|
|
$(call fetch_Optional,NEON,NEON_TARBALL) \
|
|
|
|
$(call fetch_Optional,NSS,NSS_TARBALL) \
|
|
|
|
$(call fetch_Optional_pack,NUMBERTEXT_EXTENSION_PACK) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,ODFGEN,ODFGEN_TARBALL) \
|
2014-10-20 07:21:22 -05:00
|
|
|
$(call fetch_Optional,OPENCOLLADA,OPENCOLLADA_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,OPENLDAP,OPENLDAP_TARBALL) \
|
|
|
|
$(call fetch_Optional,OPENSSL,OPENSSL_TARBALL) \
|
|
|
|
$(call fetch_Optional,ORCUS,ORCUS_TARBALL) \
|
2015-02-02 13:49:37 -06:00
|
|
|
$(call fetch_Optional,OWNCLOUD_ANDROID_LIB,OWNCLOUD_ANDROID_LIB_TARBALL) \
|
2014-06-27 04:07:06 -05:00
|
|
|
$(call fetch_Optional,PAGEMAKER,PAGEMAKER_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,POPPLER,POPPLER_TARBALL) \
|
|
|
|
$(call fetch_Optional,POSTGRESQL,POSTGRESQL_TARBALL) \
|
|
|
|
$(call fetch_Optional,PYTHON,PYTHON_TARBALL) \
|
|
|
|
$(call fetch_Optional,REDLAND,RAPTOR_TARBALL) \
|
|
|
|
$(call fetch_Optional,REDLAND,RASQAL_TARBALL) \
|
|
|
|
$(call fetch_Optional,REDLAND,REDLAND_TARBALL) \
|
2014-05-24 01:39:54 -05:00
|
|
|
$(call fetch_Optional,REVENGE,REVENGE_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,RHINO,RHINO_TARBALL) \
|
|
|
|
$(call fetch_Optional,RHINO,SWING_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,SERF,SERF_TARBALL) \
|
2016-08-10 05:43:56 -05:00
|
|
|
$(call fetch_Optional,STAROFFICE,STAROFFICE_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,UCPP,UCPP_TARBALL) \
|
2014-05-11 07:50:24 -05:00
|
|
|
$(call fetch_Optional,VISIO,VISIO_TARBALL) \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,WPD,WPD_TARBALL) \
|
|
|
|
$(call fetch_Optional,WPG,WPG_TARBALL) \
|
|
|
|
$(call fetch_Optional,WPS,WPS_TARBALL) \
|
|
|
|
$(call fetch_Optional,XSLTML,XSLTML_TARBALL) \
|
|
|
|
$(call fetch_Optional,ZLIB,ZLIB_TARBALL) \
|
2016-06-22 11:02:29 -05:00
|
|
|
$(call fetch_Optional,ZMF,ZMF_TARBALL) \
|
2012-11-21 15:36:34 -06:00
|
|
|
,$(call fetch_Download_item,http://dev-www.libreoffice.org/src,$(item)))
|
|
|
|
$(foreach item, \
|
2014-05-11 07:42:44 -05:00
|
|
|
$(call fetch_Optional,DBGHELP,DBGHELP_DLL) \
|
|
|
|
$(call fetch_Optional,ODK,UNOWINREG_DLL) \
|
2016-06-23 06:20:58 -05:00
|
|
|
$(call fetch_Optional,ODFVALIDATOR,ODFVALIDATOR_JAR) \
|
2016-07-21 11:26:12 -05:00
|
|
|
$(call fetch_Optional,OFFICEOTRON,OFFICEOTRON_JAR) \
|
2012-11-21 15:36:34 -06:00
|
|
|
,$(call fetch_Download_item,http://dev-www.libreoffice.org/extern,$(item)))
|
2014-07-14 05:07:06 -05:00
|
|
|
$(if $(call fetch_Optional,LIBGLTF,LIBGLTF_TARBALL) \
|
|
|
|
, $(call fetch_Download_item,http://dev-www.libreoffice.org/src/libgltf,$(call fetch_Optional,LIBGLTF,LIBGLTF_TARBALL)))
|
2012-11-29 03:04:31 -06:00
|
|
|
@mkdir -p $(dir $@) && touch $@
|
2012-11-21 15:36:34 -06:00
|
|
|
|
|
|
|
# vim: set noet sw=4 ts=4:
|