From 76fa0be374dd0b9b66c7e1845d6ea0a79c84d231 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 25 Feb 2010 16:13:22 +0000 Subject: [PATCH] Patch by Matt Madia: * Renamed DownloadFile to DownloadLocatedFile. * Pulled a generalized rule DownloadFile out of DownloadOptionalPackage. * Added InstallSourceArchive rule which can be used in OptionalPackages to add sources for installed packages to the image. * Added configure option --include-sources to enable including the sources for third party software in the image. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35617 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/FileRules | 28 ++++++++++++++++------------ build/jam/ImageRules | 11 +++++++++++ configure | 7 +++++++ 3 files changed, 34 insertions(+), 12 deletions(-) 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}" ;