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
This commit is contained in:
Ingo Weinhold
2010-02-25 16:13:22 +00:00
parent 3cd300bc61
commit 76fa0be374
3 changed files with 34 additions and 12 deletions
+16 -12
View File
@@ -369,32 +369,36 @@ actions DataFileToSourceFile1
$(2[1]) $(DATA_VARIABLE) $(SIZE_VARIABLE) $(2[2]) $(1) $(2[1]) $(DATA_VARIABLE) $(SIZE_VARIABLE) $(2[2]) $(1)
} }
rule DownloadFile target : url rule DownloadLocatedFile target : url
{ {
URL on $(target) = $(url) ; URL on $(target) = $(url) ;
DownloadFile1 $(target) ; DownloadLocatedFile1 $(target) ;
} }
actions DownloadFile1 actions DownloadLocatedFile1
{ {
wget -O $(1) $(URL) wget -O $(1) $(URL)
} }
rule DownloadOptionalPackage package : url rule DownloadFile file : url
{ {
# download zip file file = $(file:G=download) ;
local zipFile = $(package:G=download).zip ;
# Request the download only once. # Request the download only once.
if [ on $(zipFile) return $(HAIKU_OPTIONAL_PACKAGE_DOWNLOAD) ] { if [ on $(file) return $(HAIKU_FILE_DOWNLOAD) ] {
return $(zipFile) ; return $(file) ;
} }
HAIKU_OPTIONAL_PACKAGE_DOWNLOAD on $(zipFile) = 1 ; HAIKU_FILE_DOWNLOAD on $(file) = 1 ;
MakeLocate $(zipFile) : $(HAIKU_DOWNLOAD_DIR) ; MakeLocate $(file) : $(HAIKU_DOWNLOAD_DIR) ;
DownloadFile $(zipFile) : $(url) ; DownloadLocatedFile $(file) : $(url) ;
return $(zipFile) ; return $(file) ;
}
rule DownloadOptionalPackage package : url
{
return [ DownloadFile $(package).zip : $(url) ] ;
} }
+11
View File
@@ -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 rule InstallOptionalHaikuImagePackage package : url : dirTokens : isCDPackage
{ {
# download zip file # download zip file
Vendored
+7
View File
@@ -62,6 +62,10 @@ options:
implement patented ideas and techniques. This implement patented ideas and techniques. This
option only disables code that is currently known option only disables code that is currently known
to be problematic. 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. --include-3rdparty Include 3rdparty/ in the build system.
-j<n> Only relevant for --build-cross-tools and -j<n> Only relevant for --build-cross-tools and
--build-cross-tools-gcc4. Is passed on to the --build-cross-tools-gcc4. Is passed on to the
@@ -279,6 +283,7 @@ HOST_GCC_RAW_VERSION=`gcc -dumpversion`
HOST_GCC_MACHINE=`gcc -dumpmachine` HOST_GCC_MACHINE=`gcc -dumpmachine`
HAIKU_INCLUDE_GPL_ADDONS=0 HAIKU_INCLUDE_GPL_ADDONS=0
HAIKU_INCLUDE_PATENTED_CODE=0 HAIKU_INCLUDE_PATENTED_CODE=0
HAIKU_INCLUDE_SOURCES=0
HAIKU_INCLUDE_3RDPARTY=0 HAIKU_INCLUDE_3RDPARTY=0
HAIKU_ENABLE_MULTIUSER=0 HAIKU_ENABLE_MULTIUSER=0
HAIKU_DISTRO_COMPATIBILITY=default HAIKU_DISTRO_COMPATIBILITY=default
@@ -390,6 +395,7 @@ while [ $# -gt 0 ] ; do
--help | -h) usage; exit 0;; --help | -h) usage; exit 0;;
--include-gpl-addons) HAIKU_INCLUDE_GPL_ADDONS=1; shift 1;; --include-gpl-addons) HAIKU_INCLUDE_GPL_ADDONS=1; shift 1;;
--include-patented-code) HAIKU_INCLUDE_PATENTED_CODE=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;; --include-3rdparty) HAIKU_INCLUDE_3RDPARTY=1; shift 1;;
-j*) buildCrossToolsJobs="$1"; shift 1;; -j*) buildCrossToolsJobs="$1"; shift 1;;
--target=*) TARGET_PLATFORM=`echo $1 | cut -d'=' -f2-`; 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_GPL_ADDONS ?= "${HAIKU_INCLUDE_GPL_ADDONS}" ;
HAIKU_INCLUDE_PATENTED_CODE ?= "${HAIKU_INCLUDE_PATENTED_CODE}" ; HAIKU_INCLUDE_PATENTED_CODE ?= "${HAIKU_INCLUDE_PATENTED_CODE}" ;
HAIKU_INCLUDE_SOURCES ?= "${HAIKU_INCLUDE_SOURCES}" ;
HAIKU_INCLUDE_3RDPARTY ?= "${HAIKU_INCLUDE_3RDPARTY}" ; HAIKU_INCLUDE_3RDPARTY ?= "${HAIKU_INCLUDE_3RDPARTY}" ;
HAIKU_ENABLE_MULTIUSER ?= "${HAIKU_ENABLE_MULTIUSER}" ; HAIKU_ENABLE_MULTIUSER ?= "${HAIKU_ENABLE_MULTIUSER}" ;
HAIKU_DISTRO_COMPATIBILITY ?= "${HAIKU_DISTRO_COMPATIBILITY}" ; HAIKU_DISTRO_COMPATIBILITY ?= "${HAIKU_DISTRO_COMPATIBILITY}" ;