diff --git a/build/jam/FileRules b/build/jam/FileRules index c41e5b595e..2a702b4549 100644 --- a/build/jam/FileRules +++ b/build/jam/FileRules @@ -369,32 +369,36 @@ actions DataFileToSourceFile1 $(2[1]) $(DATA_VARIABLE) $(SIZE_VARIABLE) $(2[2]) $(1) } -rule DownloadFile target : url +rule DownloadLocatedFile target : url { URL on $(target) = $(url) ; - DownloadFile1 $(target) ; + DownloadLocatedFile1 $(target) ; } -actions DownloadFile1 +actions DownloadLocatedFile1 { wget -O $(1) $(URL) } -rule DownloadOptionalPackage package : url +rule DownloadFile file : url { - # download zip file - local zipFile = $(package:G=download).zip ; + file = $(file:G=download) ; # Request the download only once. - if [ on $(zipFile) return $(HAIKU_OPTIONAL_PACKAGE_DOWNLOAD) ] { - return $(zipFile) ; + if [ on $(file) return $(HAIKU_FILE_DOWNLOAD) ] { + return $(file) ; } - HAIKU_OPTIONAL_PACKAGE_DOWNLOAD on $(zipFile) = 1 ; + HAIKU_FILE_DOWNLOAD on $(file) = 1 ; - MakeLocate $(zipFile) : $(HAIKU_DOWNLOAD_DIR) ; - DownloadFile $(zipFile) : $(url) ; + MakeLocate $(file) : $(HAIKU_DOWNLOAD_DIR) ; + DownloadLocatedFile $(file) : $(url) ; - return $(zipFile) ; + return $(file) ; +} + +rule DownloadOptionalPackage package : url +{ + return [ DownloadFile $(package).zip : $(url) ] ; } diff --git a/build/jam/ImageRules b/build/jam/ImageRules index 0378e4f0fd..d129bf7088 100644 --- a/build/jam/ImageRules +++ b/build/jam/ImageRules @@ -758,6 +758,17 @@ rule OptionalPackageDependencies package : dependencies } } +rule InstallSourceArchive file : url +{ + if $(HAIKU_INCLUDE_SOURCES) = 1 { + # download archive file + local archiveFile = [ DownloadFile $(file) : $(url) ] ; + + # copy directly into image + AddFilesToHaikuImage develop sources : $(archiveFile) ; + } +} + rule InstallOptionalHaikuImagePackage package : url : dirTokens : isCDPackage { # download zip file diff --git a/configure b/configure index 18fbcc477a..9fa9dafecb 100755 --- a/configure +++ b/configure @@ -62,6 +62,10 @@ options: implement patented ideas and techniques. This option only disables code that is currently known to be problematic. + --include-sources Includes the source code of projects that require + either an offer of source code or a copy of the + patched sources. This is preferable when + distributing on physical mediums. --include-3rdparty Include 3rdparty/ in the build system. -j Only relevant for --build-cross-tools and --build-cross-tools-gcc4. Is passed on to the @@ -279,6 +283,7 @@ HOST_GCC_RAW_VERSION=`gcc -dumpversion` HOST_GCC_MACHINE=`gcc -dumpmachine` HAIKU_INCLUDE_GPL_ADDONS=0 HAIKU_INCLUDE_PATENTED_CODE=0 +HAIKU_INCLUDE_SOURCES=0 HAIKU_INCLUDE_3RDPARTY=0 HAIKU_ENABLE_MULTIUSER=0 HAIKU_DISTRO_COMPATIBILITY=default @@ -390,6 +395,7 @@ while [ $# -gt 0 ] ; do --help | -h) usage; exit 0;; --include-gpl-addons) HAIKU_INCLUDE_GPL_ADDONS=1; shift 1;; --include-patented-code) HAIKU_INCLUDE_PATENTED_CODE=1; shift 1;; + --include-sources) HAIKU_INCLUDE_SOURCES=1; shift 1;; --include-3rdparty) HAIKU_INCLUDE_3RDPARTY=1; shift 1;; -j*) buildCrossToolsJobs="$1"; shift 1;; --target=*) TARGET_PLATFORM=`echo $1 | cut -d'=' -f2-`; shift 1;; @@ -514,6 +520,7 @@ HOST_PLATFORM ?= "${HOST_PLATFORM}" ; HAIKU_INCLUDE_GPL_ADDONS ?= "${HAIKU_INCLUDE_GPL_ADDONS}" ; HAIKU_INCLUDE_PATENTED_CODE ?= "${HAIKU_INCLUDE_PATENTED_CODE}" ; +HAIKU_INCLUDE_SOURCES ?= "${HAIKU_INCLUDE_SOURCES}" ; HAIKU_INCLUDE_3RDPARTY ?= "${HAIKU_INCLUDE_3RDPARTY}" ; HAIKU_ENABLE_MULTIUSER ?= "${HAIKU_ENABLE_MULTIUSER}" ; HAIKU_DISTRO_COMPATIBILITY ?= "${HAIKU_DISTRO_COMPATIBILITY}" ;