History log of /haikuporter/HaikuPorter/BuildPlatform.py
Revision Date Author Comments
# f197120d 18-Sep-2023 jurgenwigg <53076001+jurgenwigg@users.noreply.github.com>

Import statements sorted with isort and fixed MockBuilder.py (#266)

* Fixed missing closing bracket in the MockBuilder.py

* Import statements sorted with isort


# 53e9180d 18-Sep-2023 David Karoly <karolyd577@gmail.com>

BuildPlatform: assume python3 is available on Unix build host


# 31874353 27-Jun-2022 David Karoly <karolyd577@gmail.com>

BuildPlatform: assume git is available on Unix build host


# dfa39ff8 09-Apr-2022 Jerome Duval <jerome.duval@gmail.com>

waitForPackageSelfLink: wait a bit before reading the link

this helps for #207


# b98dc518 17-Nov-2021 davidkaroly <92124087+davidkaroly@users.noreply.github.com>

BuildPlatform: assume 'which' command is available on Unix build host (#222)


# 8d5c14b6 31-Jan-2020 Michael Lotz <mmlr@mlotz.ch>

python3: Finish python3 change. python2 breaking

* Based on mmlr's 2017 work to use Python3 with
changes and adjustments for the current codebase


# e2012a3d 31-Jan-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

python3: begin python3 fixes. print -> print()


# 17aa760e 27-May-2019 Alexander von Gluck IV <kallisti5@unixzen.com>

nonChrootInit: Be more verbose about what's happening


# b88dc4a9 30-Mar-2018 Michael Lotz <mmlr@mlotz.ch>

Rename --list-build-dependencies option to --list-dependencies.

Print out test dependencies when combined with --test, otherwise print
build dependencies as before.


# 89af82b6 10-Dec-2017 Michael Lotz <mmlr@mlotz.ch>

Cleanup: Remove unused imports.


# 269954fb 10-Dec-2017 Michael Lotz <mmlr@mlotz.ch>

Cleanup: Make some constructs more idiomatic.

* Change 'not x in y' to 'x not in y'.
* Use 'is' to compare None singleton.
* Use 'instanceof(x, y)' instead of 'type(x) == y'.
* Replace map builtin with list comprehension.
* Rename self argument to cls for static method.


# 9836ce60 10-Dec-2017 Michael Lotz <mmlr@mlotz.ch>

Cleanup: Whitespace and line length cleanup.


# e0451507 02-Dec-2017 Michael Lotz <mmlr@mlotz.ch>

BuildPlatformUnix: Add B_SYSTEM_PACKAGES_DIRECTORY override.

This allows --analyze-dependencies to work also on this platform when
given a --system-packages-directory.

Shallow init is also enough for --analyze-dependencies.


# 68e3958c 23-Oct-2016 Jérôme Duval <jerome.duval@gmail.com>

Implement local builders.

* provide info(), warn() to be used instead of print. By default outputs to stdout.
For builders, outputs to files.
* replace most calls to check_call by check_output, and log with info(). Also outputs
the outputs an eventual CalledProcessError output attribute.
* add option --local-builders to be used with --build-master: indicates how many
local builders to use instead of remote builders. If paramiko isn't available,
defaults to 1, otherwise 0.
* rename Builder to RemoteBuilder.
* remove changes of current directory: this doesn't work in a
multithreaded environnement. Policy.py is the most affected as it
expected to run in the packaging directory.


# 71a83f90 18-Dec-2016 Jessica Hamilton <jessica.l.hamilton@gmail.com>

Use Unicode strings for warn() & sysExit().


# 1fb46610 20-May-2016 Alexander von Gluck IV <kallisti5@unixzen.com>

haikuporter: Improve package command location detection

* Introduce which utility function to look for binaries
in your PATH
* Look in path first for default binary name if package
command not provided.


# 343a69ab 07-Dec-2015 Michael Lotz <mmlr@mlotz.ch>

Add option to specify a system packages dir for build master.

It allows to set a system packages directory for the
BuildPlatformBuildMaster.


# 0e40e789 01-Dec-2015 waddlesplash <waddlesplash@gmail.com>

BuildPlatform: HaikuPorter most definitely wants bash.

Running HaikuPorter with ZSH for cmd:sh instead of Bash produces some rather odd and confusing errors, so don't do that.


# fb621e7f 22-Nov-2015 Michael Lotz <mmlr@mlotz.ch>

Add BuildMaster mode and class.

Instead of building itself it distributes builds to builders via SSH
and coordinates pushing the dependencies around as needed.


# 97961375 21-Nov-2015 Michael Lotz <mmlr@mlotz.ch>

Add option --no-system-packages to constrain used packages.

If supplied the system packages directory will not be added to the
list of package repositories used to resolve dependencies.

This means that only local packages from the packages path will be used
for the search of all dependency packages, including the search for the
main Haiku package itself. It therefore requires one to provide all
needed packages as part of the local packages but allows for more
control over what exact packages are visible.


# 243cb92f 21-Nov-2015 Michael Lotz <mmlr@mlotz.ch>

BuildPlatform: Use findDirectory instead of hardcoding path.


# 66b58482 02-Jul-2015 Augustin Cavalier <waddlesplash@gmail.com>

Remove local check_output, we're now using Python 2.7.


# 35a5732b 14-Dec-2014 Oliver Tappe <zooey@hirschkaefer.de>

Drop support for $haikuVersion.

* Referring the current haiku version explicitly is not needed, since
the RequiresUpdater takes care of setting the version of Haiku used
for building a package.


# f90f8af9 03-Dec-2014 Oliver Tappe <zooey@hirschkaefer.de>

Fix #40: add explicit check for Haiku with package management.


# 797d2b92 21-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Cleanup imports.


# d6edc6c6 20-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Activate new dependency resolution algorithm.

* Replace most occurrences of .PackageInfo with .DependencyInfo (except
of course where they are required for .hpkg creation).
* Switch Repository from .DependencyInfo files to .PackageInfo.
* Adjust BuildPlatform to delegate dependency resolution to
DependencyResolver (for both platforms, BuildPlatformHaiku is only
adding /system/packages as additional fallback repository)
* Adjust Port to use new dependency resolution.


# ee818876 20-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Refactoring: Drop unused variables.


# f2c282bc 20-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Refactoring: fix use of reserved keywords.

* Apparently, we were using reserved keywords as variable names, which
didn't seem to cause any problems, but could have done so in future
versions of Python.


# 476dbcbe 20-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Refactoring: use properties where it seems fit.

* Trying to be somewhat more Pythonic.


# fc1d58c6 29-Oct-2014 Charlie Clark <charlie.clark@clark-consulting.eu>

Revert to tab spacing for Pe's sake.


# a5f922e3 27-Oct-2014 Charlie Clark <charlie.clark@clark-consulting.eu>

Try again with whitespace.


# 558fbdb0 27-Oct-2014 Charlie Clark <charlie.clark@clark-consulting.eu>

Second attempt to fix whitespace. Options are different on OS X.


# 429ec015 27-Oct-2014 Charlie Clark <charlie.clark@clark-consulting.eu>

Convert tabs to spaces.


# e919ca6e 11-Aug-2014 Oliver Tappe <zooey@hirschkaefer.de>

Add cmd:awk and cmd:xargs requires for cross-builds.


# 54fa4504 22-Jul-2014 François Revol <revol@free.fr>

Fix missing cmd:xres in PROVIDES for cross-compiles

This should fix #35 (ARM bootstrap).


# 706a6695 31-May-2014 Oliver Tappe <zooey@hirschkaefer.de>

Automatic whitespace cleanup - no functional change intended.


# 61b5c53b 24-Apr-2014 Oliver Tappe <zooey@hirschkaefer.de>

On Unix, make sure TARGET_ARCHITECTURE is set.


# 98cfa6f0 24-Apr-2014 Oliver Tappe <zooey@hirschkaefer.de>

Only require LICENSES_DIRECTORY when it is needed.

* The only informational command that needs it is --lint.


# 13acea28 24-Apr-2014 Oliver Tappe <zooey@hirschkaefer.de>

Allow informational commands (e.g. --lint) to run on Linux.

* Introduce support for shallow initialization to Main and
BuildPlatform classes and make use of that for the informational
commands.


# 8d7ac0ec 16-Feb-2014 Oliver Tappe <zooey@hirschkaefer.de>

Add some missing target-arch provides for haiku.

* this gets the source collection step of the bootstrap build to the
part where it actually starts building source packages


# ead5b7c7 08-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformHaiku: Find canonically named Haiku system package


# c4c8633b 03-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

/boot/common has been removed

Mostly the changes are straight-forward (don't look in /boot/common,
adjust paths). A notable change concerns the resolution of port
dependencies: We no longer simply include all /boot/system packages in
the chroot, but only those that have to be pulled in according to the
dependency resolution. This may break some recipes that don't declare
all the things they actually require for building, but have worked
previously due to those dependencies living in /boot/system.


# 8c6be101 16-Sep-2013 Oliver Tappe <zooey@hirschkaefer.de>

Fix and robustify waiting for build package (de-)activation

* in case of an existing symlink, check its target for both activation
and deactivation (we missed the latter case last time)
* negate the check and look for the packaging folder as symlink target
instead of checking for '..' (system) and 'common' - a package with
the same name could be installed in '/boot/home', for example.


# 152f7549 16-Sep-2013 Oliver Tappe <zooey@hirschkaefer.de>

Wait for activation/deactivation of build packages.

* the package daemon is activating/deactivating with a bit of delay,
so we need to wait for the updated symlink in the package-links
folder


# 459bcbd0 15-Sep-2013 Oliver Tappe <zooey@hirschkaefer.de>

Consider buildhost packages when building on Haiku.

* additionally, refactor resolving of dependencies to hopefully
be a bit clearer


# b95d59d7 01-Sep-2013 Oliver Tappe <zooey@hirschkaefer.de>

Drop superfluous invocation of getHaikuVersion().


# 578b1443 29-Aug-2013 Oliver Tappe <zooey@hirschkaefer.de>

Add cmd:awk as build-target provides for cross-build.


# 9e8f5c64 16-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Change machine triple for x86_gcc2 to i586-pc-haiku

The old one was more correct in principle, but we'd have to apply that
change in the autotools as well and make sure that all build systems
using them still work. Too much work for little benefit.


# 673bc2fd 16-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: add more implicit provides


# 0da96b02 06-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove work-around for resolved issue


# 35747791 06-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: add more implicit target provides


# f4197461 06-Aug-2013 Oliver Tappe <zooey@hirschkaefer.de>

Add some missing implicit target provides.

* coreutils, diffutils and cmd:sh are referenced from the haikuports
repository


# 747d4887 04-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: ensure secondary cross devel pkgs are given


# 76b36bd7 04-Aug-2013 Oliver Tappe <zooey@hirschkaefer.de>

Fix resolving of dependencies:

* resolving required and prerequired packages needs to pass the
packages folder before the work repository, as otherwise HaikuPorter
would try to rebuild ports that were already built before
* add support to BuildPlatform.resolveDependencies() for passing in
a list of fallback repositories, which will be searched after the
common/system repositories
* resolving prerequired packages needs to pass the work repository as
a fallback repository, such that it will only be considered if a
prerequired packages isn't provided by the system (in which case it
will be built by HaikuPorter)


# b564eb23 04-Aug-2013 Oliver Tappe <zooey@hirschkaefer.de>

Implement strict separation of buildhost and target packages.

* REQUIRES and BUILD_REQUIRES refer to target architecture packages,
while BUILD_PREREQUIRES refers to buildhost architecture packages
* added support for building prerequired packages when needed
* add a separate set of implicit target packages to BuildPlatformUnix,
which only contains the 'haiku' package


# 842de063 04-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Keep secondary arch Haiku cross devel package's lib/ structure

* Symlink the cross devel package's lib dir, not its secondary arch
subdir, to the compiler's sysroot lib dir. Necessary since we now
build the cross compiler as a secondary compiler, so it searches the
subdir.
* Add temporary work-around: Currently gcc calls the lib subdir "gcc4"
while it should have the name of the secondary architecture. Create a
respective symlink.


# 36337361 03-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: add secondary tool chain to implicit provides


# c8a2c27d 03-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: remove debug output


# c77d74b2 03-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: simplify include/lib dir setup

ATM the include and lib directories we create for the cross tools are
there mostly for aesthetical reasons. ATM they are just symlinks to the
respective directories of the extracted Haiku sysroot package and are
used as the target of the symlinks we create in the actual cross tools
directory. So we can just as well use a simple directory layout.


# 1fa715f2 02-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Support building secondary arch packages from regular recipes

* Add settings SECONDARY_CROSS_DEVEL_PACKAGES, SECONDARY_CROSS_TOOLS,
and SECONDARY_TARGET_ARCHITECTURES to config file and command line
option --secondary-cross-devel-packages, overriding the first.
SECONDARY_TARGET_ARCHITECTURES is the list of secondary target
architectures that ports may be built for (for a hybrid target).
SECONDARY_CROSS_TOOLS is the respectively matching list of cross
tools directories and SECONDARY_CROSS_DEVEL_PACKAGES the list of
Haiku cross development sysroot packages.
* Repository: For all configured secondary architectures add derived
ports.
* BuildPlatformUnix:
- setupNonChrootBuildEnvironment()/cleanNonChrootBuildEnvironment() do
now support an optional secondaryArchitecture parameter which is set
when building a port for a secondary architecture. The build
environment is set up using the respective cross tools and Haiku
cross devel package.
- Fix setting up the system include and library search paths for
gcc 4. It has other paths built in.
* Recipes can now set a SECONDARY_ARCHITECTURES (similar to
ARCHITECTURES) to indicate for which secondary architectures the port
can be built.
* Add new shell variables effectiveTargetArchitecture,
effectiveTargetMachineTriple, and effectiveTargetMachineTripleAsName
which are set to the values for the target architecture we are
actually building for (i.e. the primary or secondary architecture).
When cross-compiling the pre-existing target* variables continue to
correspond to the primary architecture.
* The variables binDir, sbinDir, libDir, includeDir, oldIncludeDir,
developLibDir are set to a respective subdirectory when building for
a secondary architecture.


# dca66113 29-Jul-2013 Oliver Tappe <zooey@hirschkaefer.de>

Add support for meta-ports, specifically 'meta_portsfile'

* a meta-port is a port that just builds other (non-meta) ports, but it
doesn't provide any sources or build actions of its own
* when building a list of ports specified via --portsfile, the meta-
port 'meta_portsfile' is now being used to group all the required
ports (pulling in any runtime requirements, too)
* when building only source packages, consider all packages stable, as
otherwise sources for not-yet-stable packages could not be collected
(one would have to mark them as stable manually)
* add more missing implicit build provides to Unix build platform


# 46432d39 29-Jul-2013 Oliver Tappe <zooey@hirschkaefer.de>

Add some missing implicit provides on Unix build platform.


# eb86eec1 29-Jul-2013 Oliver Tappe <zooey@hirschkaefer.de>

Let BuildProfile default to configured target architecture.

* otherwise, it's impossible to build for a target architecture when
not using the cross-repository - this however is needed for building
the source packages required by a standard Haiku image


# 5c36471c 28-Jul-2013 Oliver Tappe <zooey@hirschkaefer.de>

More work on building only source packages.

* building source packages for a list of ports is now basically
possible, but the current limits of dependency resolution have
the effect that not all required ports are being pulled in


# 036f703c 19-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Add support for separate output directory

* Add configuration file value OUTPUT_DIRECTORY specifying the directory
where haikuporter shall write files. It mirrors the ports repository
directory layout. The default value is the repository path.
* Add configuration file value DOWNLOAD_IN_PORT_DIRECTORY. Only
meaningful, if OUTPUT_DIRECTORY is specified. In that case a value of
"yes" will still cause the download directory to be placed in the port
directory. This may be useful when building for different target
architectures in separate output directories -- the downloads can thus
be shared.


# 99a61dae 19-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Unifiy the Options and GlobalConfig somewhat

* Module GlobalConfig is replaced with new module Configuration. The
global variable globalConfiguration is gone. Instead Configuration
provides getter methods.
* For several of the (newer) command line options there are now optional
configuration file entries. If given the command line values override
the configuration file values. Configuration also provides getter
methods for these options, which should be used instead of
getOption().


# 75bb2474 19-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: add more stuff to implicit build provides


# 925d4ad0 18-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Unix build: Fix package activation and cross package installation

* BuildPlatform*: add getCrossToolsBasePrefix(). It returns a base
installation prefix when building cross packages. Since those must
work on the build platform, we must make sure that the prefix they are
configured with is actually the location they can be installed. That
is mostly of interest on non-Haiku build platforms where we build
without a chroot. Consequently this prefix is outside the work
directory, a directory named "cross_tools" in the repository root.
* Extract all required packages in "system" rather than "common". This
simplifies things mostly for cross packages, since their headers and
libraries will then be automatically in the compiler search paths.
* Create the package symlinks directory and the .self symlink for all
required packages. Also mostly relevant for cross packages, since
those need to be able to resolve their built-in absolute paths.


# 5ff49744 18-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatform: extend getCrossToolsBinPath()

* Rename to getCrossToolsBinPaths() and return an array of paths.
* For BuildPlatformUnix we also include <workDir>/boot/common/bin so
the cross tools (other than binutils and gcc) are also in the path.


# d9301a09 18-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: install cross packages in <work>/boot/common


# c2564e32 18-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: improved dependency resolution for pre-reqs

Use the same algorithm for resolving pre-requires and requires, for the
former only consider cross packages, though.


# c058c9db 18-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: add more implicit build provides


# dc3ed0f7 17-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix crossSysrootDir for non-Haiku build platforms

* BuildPlatform: Determine target architecture and cross sysroot dir.
Add respective getTargetArchitecture() and getCrossSysrootDirectory()
method.
* BuildPlatformUnix: Make getInstallDestDir() synonymous with
getCrossSysrootDirectory().
* Set the crossSysrootDir shell variable in
Port._updateShellVariables() instead of in Main. This way it gets
adjusted depending on whether we're in a chroot or not.


# 8135b508 17-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: add implicit build provides "cmd:cmake"


# 73745ead 17-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatform: missing import


# 2f7004dd 16-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: some architecture/machine fine tuning

* The architecture we pass to our base class needs to be a packaging
architecture. Try to find a match. If unsuccessful use "any". It
shouldn't really matter -- we just need it to be valid so "package"
doesn't complain.
* Replace the first component of the machine triple we get from gcc with
the architecture we get from os.uname(). This works around the issue
that in a linux32 environment gcc still reports the x86_64 machine.
For FreeBSD we'll need to find a different solution. We'll probably
have to add 64-bit platform handling logic to the gcc_bootstrap
recipe instead.


# e09a3a17 16-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: add more implicit build platform provides


# ad2ab282 15-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix.init(): fix copy-and-paste mess-up


# b022cdcb 15-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Package.removeBuildPackage(): also delegate to buildPlatform

Fixes the issue that shutil.rmtree() doesn't work for non-directories
and is nicer anyway.


# 01cbbd6f 15-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatform: let subclass determine architecture

BuildPlatformHaiku already knows the architecture and the architecture
from the machine triple isn't necessarily also a valid package
architecture.


# 13daab4b 15-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformHaiku: build fixes


# 049f04a7 15-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Complete support for non-Haiku build platforms

* Port.build(): When not using chroot, let buildPlatform set up/clean up
a suitable environment. Currently not supported for
BuildPlatformHaiku. BuildPlatformUnix sets up a cross-sysroot subdir
in the work directory. It extracts the haiku_cross_devel_sysroot
package to the boot/system and the other required packages to the
boot/common subtree. Furthermore it sets up a cross-tools directory
with bin, sys-include, lib subdirs. The former points to the cross
tools bin dir and is added to PATH. The latter two refer to
boot/system/develop/{headers,lib} and are symlinked temporarily into
the cross tools directory, so the headers and libraries are picked up
correctly. Not so nice, but I haven't found a cleaner way to do that.
Wrapper scripts might work.
* Package.activateBuildPackage(): delegate to buildPlatform.
BuildPlatformHaiku uses the previous code. BuildPlatformUnix sets up
the package symlinks directory for the package in the cross
sysroot/packages directory (currently only the .self symlink).
* Define installDestDir shell variable when cross-building on non-Haiku.


# 4e82153e 15-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Port: move dependency resolution to BuildPlatform*

* BuildPlatformHaiku uses pkgman to resolve the dependencies as done
before.
* BuildPlatformUnix doesn't need to actually resolve pre-requires.
It just checks them against a list that is expected to be available.
Requires are resolved using RequiresUpdater. That should be good
enough for the bootstrap packages.


# 4cb939be 15-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: check mandatory options


# 794ccdfc 14-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Add --system-mimedb and --command-mimeset options


# c7c29d1f 14-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatform*: move more initialization to init()


# 359be5b0 14-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatform: add getLicensesDirectory()


# 50a0262b 13-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Only use chroot on Haiku


# 2b8a58d5 13-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Start with a build platform abstraction

* Add '--cross-devel-package' option to specify the path to the cross
development package. Can be used for cross-compiling.
* Add module BuildPlatform which exports a buildPlatform variable, which
is initialized to an instance of BuildPlatformHaiku or
BuildPlatformUnix as appropriate.
* Move findDirectory() to BuildPlatformHaiku. BuildPlatformUnix has a
version with some hard-coded mappings.
* Add PackageInfo class. Very simple ATM. It only extracts the version
and the architecture from a package file.
* Rework Main._initGlobalShellVariables() somewhat: Extracting the Haiku
version from the build platform's system haiku package is obviously
not correct when cross-building. Also add support for non-Haiku build
platforms.
* Remove no longer needed MachineArchitecture.getBuildTripleFor().


# 35a5732b0cccd2441230c24a8b7ec3d158097f9e 14-Dec-2014 Oliver Tappe <zooey@hirschkaefer.de>

Drop support for $haikuVersion.

* Referring the current haiku version explicitly is not needed, since
the RequiresUpdater takes care of setting the version of Haiku used
for building a package.


# f90f8af9d0e331d83ed2080b9588a21dace642c1 03-Dec-2014 Oliver Tappe <zooey@hirschkaefer.de>

Fix #40: add explicit check for Haiku with package management.


# 797d2b925aa61ce548f35f9d3b255356c83f5936 21-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Cleanup imports.


# d6edc6c60be3aded5e3eaa96be45d9f24d935edd 20-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Activate new dependency resolution algorithm.

* Replace most occurrences of .PackageInfo with .DependencyInfo (except
of course where they are required for .hpkg creation).
* Switch Repository from .DependencyInfo files to .PackageInfo.
* Adjust BuildPlatform to delegate dependency resolution to
DependencyResolver (for both platforms, BuildPlatformHaiku is only
adding /system/packages as additional fallback repository)
* Adjust Port to use new dependency resolution.


# ee8188765a984cc9c21eeb557d3e08070361592f 20-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Refactoring: Drop unused variables.


# f2c282bc7e38769260bced0980765e02723e9d14 20-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Refactoring: fix use of reserved keywords.

* Apparently, we were using reserved keywords as variable names, which
didn't seem to cause any problems, but could have done so in future
versions of Python.


# 476dbcbe3fe6d63d35a2ac5db1b789f2434e04a4 20-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Refactoring: use properties where it seems fit.

* Trying to be somewhat more Pythonic.


# fc1d58c6abe57c99c11ec02b27be40844fb53572 29-Oct-2014 Charlie Clark <charlie.clark@clark-consulting.eu>

Revert to tab spacing for Pe's sake.


# a5f922e3fded4460be5a3c717862e7e588772487 27-Oct-2014 Charlie Clark <charlie.clark@clark-consulting.eu>

Try again with whitespace.


# 558fbdb04ff6cb063a4afba7f15b6f1bd0343af2 27-Oct-2014 Charlie Clark <charlie.clark@clark-consulting.eu>

Second attempt to fix whitespace. Options are different on OS X.


# 429ec015d0c47da50e302537ed33bc3f80d035a8 27-Oct-2014 Charlie Clark <charlie.clark@clark-consulting.eu>

Convert tabs to spaces.


# e919ca6e3bd787e00f3077b8be3f6dd9d2d7b93c 11-Aug-2014 Oliver Tappe <zooey@hirschkaefer.de>

Add cmd:awk and cmd:xargs requires for cross-builds.


# 54fa4504765b81c9673e1c1927de3306a5174b68 22-Jul-2014 François Revol <revol@free.fr>

Fix missing cmd:xres in PROVIDES for cross-compiles

This should fix #35 (ARM bootstrap).


# 706a669517034546d39d83d92bc6386c26793071 31-May-2014 Oliver Tappe <zooey@hirschkaefer.de>

Automatic whitespace cleanup - no functional change intended.


# 61b5c53ba308d6c34e80c9b74cb4462e88f74c9d 24-Apr-2014 Oliver Tappe <zooey@hirschkaefer.de>

On Unix, make sure TARGET_ARCHITECTURE is set.


# 98cfa6f03a91184fb4d3b6072685a4c050e13374 24-Apr-2014 Oliver Tappe <zooey@hirschkaefer.de>

Only require LICENSES_DIRECTORY when it is needed.

* The only informational command that needs it is --lint.


# 13acea28e5d129c28fb09e2e2275c2373b4ce52c 24-Apr-2014 Oliver Tappe <zooey@hirschkaefer.de>

Allow informational commands (e.g. --lint) to run on Linux.

* Introduce support for shallow initialization to Main and
BuildPlatform classes and make use of that for the informational
commands.


# 8d7ac0ec06948d1e3d048d487f7ce4948ed732c3 16-Feb-2014 Oliver Tappe <zooey@hirschkaefer.de>

Add some missing target-arch provides for haiku.

* this gets the source collection step of the bootstrap build to the
part where it actually starts building source packages


# ead5b7c7ddf20b3aa73e3c833b3f2e6e5b8ae23f 08-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformHaiku: Find canonically named Haiku system package


# c4c8633bbdf41a3e81391183a4325444f08ed02d 03-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

/boot/common has been removed

Mostly the changes are straight-forward (don't look in /boot/common,
adjust paths). A notable change concerns the resolution of port
dependencies: We no longer simply include all /boot/system packages in
the chroot, but only those that have to be pulled in according to the
dependency resolution. This may break some recipes that don't declare
all the things they actually require for building, but have worked
previously due to those dependencies living in /boot/system.


# 8c6be10125b117af5c4fdf957e00d1d2d9d13d71 16-Sep-2013 Oliver Tappe <zooey@hirschkaefer.de>

Fix and robustify waiting for build package (de-)activation

* in case of an existing symlink, check its target for both activation
and deactivation (we missed the latter case last time)
* negate the check and look for the packaging folder as symlink target
instead of checking for '..' (system) and 'common' - a package with
the same name could be installed in '/boot/home', for example.


# 152f7549daabd82a482fe50e8da1f1b17a5a56e4 16-Sep-2013 Oliver Tappe <zooey@hirschkaefer.de>

Wait for activation/deactivation of build packages.

* the package daemon is activating/deactivating with a bit of delay,
so we need to wait for the updated symlink in the package-links
folder


# 459bcbd0c6fcb0e0707ab86b69e775e85cc8945b 15-Sep-2013 Oliver Tappe <zooey@hirschkaefer.de>

Consider buildhost packages when building on Haiku.

* additionally, refactor resolving of dependencies to hopefully
be a bit clearer


# b95d59d7313699495dcb934834ec8b632ba347a9 01-Sep-2013 Oliver Tappe <zooey@hirschkaefer.de>

Drop superfluous invocation of getHaikuVersion().


# 578b1443b08bac1841b209fc62a5d9c56f8f05f3 29-Aug-2013 Oliver Tappe <zooey@hirschkaefer.de>

Add cmd:awk as build-target provides for cross-build.


# 9e8f5c64647984f2735ef05ea56c8194e228066b 16-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Change machine triple for x86_gcc2 to i586-pc-haiku

The old one was more correct in principle, but we'd have to apply that
change in the autotools as well and make sure that all build systems
using them still work. Too much work for little benefit.


# 673bc2fd1f3b37819afad7a2105c0fa1a90bbca0 16-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: add more implicit provides


# 0da96b0252dcc7adc9cb8ad23748d31a78d0aedd 06-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove work-around for resolved issue


# 35747791f90cbfe2e6dda6256ecb450cc1277257 06-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: add more implicit target provides


# f41974614a883c0146452c5ca9637a6d42dd74b2 06-Aug-2013 Oliver Tappe <zooey@hirschkaefer.de>

Add some missing implicit target provides.

* coreutils, diffutils and cmd:sh are referenced from the haikuports
repository


# 747d48878b958be8db956ac2aa29dce705ef9251 04-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: ensure secondary cross devel pkgs are given


# 76b36bd73ef6615531bbc60e431efad0f363e53e 04-Aug-2013 Oliver Tappe <zooey@hirschkaefer.de>

Fix resolving of dependencies:

* resolving required and prerequired packages needs to pass the
packages folder before the work repository, as otherwise HaikuPorter
would try to rebuild ports that were already built before
* add support to BuildPlatform.resolveDependencies() for passing in
a list of fallback repositories, which will be searched after the
common/system repositories
* resolving prerequired packages needs to pass the work repository as
a fallback repository, such that it will only be considered if a
prerequired packages isn't provided by the system (in which case it
will be built by HaikuPorter)


# b564eb2389381cff3b2adffaa775d92530220f59 04-Aug-2013 Oliver Tappe <zooey@hirschkaefer.de>

Implement strict separation of buildhost and target packages.

* REQUIRES and BUILD_REQUIRES refer to target architecture packages,
while BUILD_PREREQUIRES refers to buildhost architecture packages
* added support for building prerequired packages when needed
* add a separate set of implicit target packages to BuildPlatformUnix,
which only contains the 'haiku' package


# 842de063366ac0d8e822dd049de64b965cfcc2d4 04-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Keep secondary arch Haiku cross devel package's lib/ structure

* Symlink the cross devel package's lib dir, not its secondary arch
subdir, to the compiler's sysroot lib dir. Necessary since we now
build the cross compiler as a secondary compiler, so it searches the
subdir.
* Add temporary work-around: Currently gcc calls the lib subdir "gcc4"
while it should have the name of the secondary architecture. Create a
respective symlink.


# 363373618e726a14b83a1b82ff4f5ca14de8589a 03-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: add secondary tool chain to implicit provides


# c8a2c27d2cd58590a0c3d5710e8fef17480d889b 03-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: remove debug output


# c77d74b263bdbfb2102d3d9d14eaebdfdae783db 03-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: simplify include/lib dir setup

ATM the include and lib directories we create for the cross tools are
there mostly for aesthetical reasons. ATM they are just symlinks to the
respective directories of the extracted Haiku sysroot package and are
used as the target of the symlinks we create in the actual cross tools
directory. So we can just as well use a simple directory layout.


# 1fa715f2a326234d09474bfe732045cb38f2d902 02-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Support building secondary arch packages from regular recipes

* Add settings SECONDARY_CROSS_DEVEL_PACKAGES, SECONDARY_CROSS_TOOLS,
and SECONDARY_TARGET_ARCHITECTURES to config file and command line
option --secondary-cross-devel-packages, overriding the first.
SECONDARY_TARGET_ARCHITECTURES is the list of secondary target
architectures that ports may be built for (for a hybrid target).
SECONDARY_CROSS_TOOLS is the respectively matching list of cross
tools directories and SECONDARY_CROSS_DEVEL_PACKAGES the list of
Haiku cross development sysroot packages.
* Repository: For all configured secondary architectures add derived
ports.
* BuildPlatformUnix:
- setupNonChrootBuildEnvironment()/cleanNonChrootBuildEnvironment() do
now support an optional secondaryArchitecture parameter which is set
when building a port for a secondary architecture. The build
environment is set up using the respective cross tools and Haiku
cross devel package.
- Fix setting up the system include and library search paths for
gcc 4. It has other paths built in.
* Recipes can now set a SECONDARY_ARCHITECTURES (similar to
ARCHITECTURES) to indicate for which secondary architectures the port
can be built.
* Add new shell variables effectiveTargetArchitecture,
effectiveTargetMachineTriple, and effectiveTargetMachineTripleAsName
which are set to the values for the target architecture we are
actually building for (i.e. the primary or secondary architecture).
When cross-compiling the pre-existing target* variables continue to
correspond to the primary architecture.
* The variables binDir, sbinDir, libDir, includeDir, oldIncludeDir,
developLibDir are set to a respective subdirectory when building for
a secondary architecture.


# dca66113fe25cff7181c0df0226274dd3aeb273d 29-Jul-2013 Oliver Tappe <zooey@hirschkaefer.de>

Add support for meta-ports, specifically 'meta_portsfile'

* a meta-port is a port that just builds other (non-meta) ports, but it
doesn't provide any sources or build actions of its own
* when building a list of ports specified via --portsfile, the meta-
port 'meta_portsfile' is now being used to group all the required
ports (pulling in any runtime requirements, too)
* when building only source packages, consider all packages stable, as
otherwise sources for not-yet-stable packages could not be collected
(one would have to mark them as stable manually)
* add more missing implicit build provides to Unix build platform


# 46432d39787c59040119abfdc1a57f04ee690be8 29-Jul-2013 Oliver Tappe <zooey@hirschkaefer.de>

Add some missing implicit provides on Unix build platform.


# eb86eec13f32c344cc9f3bb2f6a14af856bdf3ee 29-Jul-2013 Oliver Tappe <zooey@hirschkaefer.de>

Let BuildProfile default to configured target architecture.

* otherwise, it's impossible to build for a target architecture when
not using the cross-repository - this however is needed for building
the source packages required by a standard Haiku image


# 5c36471c5d1cc377ae9021e3d5ca3e308e2c48cd 28-Jul-2013 Oliver Tappe <zooey@hirschkaefer.de>

More work on building only source packages.

* building source packages for a list of ports is now basically
possible, but the current limits of dependency resolution have
the effect that not all required ports are being pulled in


# 036f703cba4efe93ccea4c5babcda5e195589019 19-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Add support for separate output directory

* Add configuration file value OUTPUT_DIRECTORY specifying the directory
where haikuporter shall write files. It mirrors the ports repository
directory layout. The default value is the repository path.
* Add configuration file value DOWNLOAD_IN_PORT_DIRECTORY. Only
meaningful, if OUTPUT_DIRECTORY is specified. In that case a value of
"yes" will still cause the download directory to be placed in the port
directory. This may be useful when building for different target
architectures in separate output directories -- the downloads can thus
be shared.


# 99a61dae85929042affb1fe60e038aa4149261d5 19-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Unifiy the Options and GlobalConfig somewhat

* Module GlobalConfig is replaced with new module Configuration. The
global variable globalConfiguration is gone. Instead Configuration
provides getter methods.
* For several of the (newer) command line options there are now optional
configuration file entries. If given the command line values override
the configuration file values. Configuration also provides getter
methods for these options, which should be used instead of
getOption().


# 75bb2474e6d825fe413352550bd1aca1059de860 19-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: add more stuff to implicit build provides


# 925d4ad0768914254976b966ddb7acbe25938b4e 18-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Unix build: Fix package activation and cross package installation

* BuildPlatform*: add getCrossToolsBasePrefix(). It returns a base
installation prefix when building cross packages. Since those must
work on the build platform, we must make sure that the prefix they are
configured with is actually the location they can be installed. That
is mostly of interest on non-Haiku build platforms where we build
without a chroot. Consequently this prefix is outside the work
directory, a directory named "cross_tools" in the repository root.
* Extract all required packages in "system" rather than "common". This
simplifies things mostly for cross packages, since their headers and
libraries will then be automatically in the compiler search paths.
* Create the package symlinks directory and the .self symlink for all
required packages. Also mostly relevant for cross packages, since
those need to be able to resolve their built-in absolute paths.


# 5ff4974460581a075eb2c7cbf5f6ca83b3241f86 18-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatform: extend getCrossToolsBinPath()

* Rename to getCrossToolsBinPaths() and return an array of paths.
* For BuildPlatformUnix we also include <workDir>/boot/common/bin so
the cross tools (other than binutils and gcc) are also in the path.


# d9301a0987672ce2b34972b4cd4d2cab5f4c9284 18-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: install cross packages in <work>/boot/common


# c2564e326228b03c652dcd188a2371018ba057b6 18-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: improved dependency resolution for pre-reqs

Use the same algorithm for resolving pre-requires and requires, for the
former only consider cross packages, though.


# c058c9dbe79b0049673ac9f349a5a40979e77795 18-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: add more implicit build provides


# dc3ed0f7ffb5329a3d8e96b7b920aca52ecc23a9 17-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix crossSysrootDir for non-Haiku build platforms

* BuildPlatform: Determine target architecture and cross sysroot dir.
Add respective getTargetArchitecture() and getCrossSysrootDirectory()
method.
* BuildPlatformUnix: Make getInstallDestDir() synonymous with
getCrossSysrootDirectory().
* Set the crossSysrootDir shell variable in
Port._updateShellVariables() instead of in Main. This way it gets
adjusted depending on whether we're in a chroot or not.


# 8135b508821595e6b90ab392de7231b5f4c9fa20 17-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: add implicit build provides "cmd:cmake"


# 73745ead8119deb2f3e12f12405cd9ac342400bb 17-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatform: missing import


# 2f7004dd5468622d52b126f3720681fe808c32c4 16-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: some architecture/machine fine tuning

* The architecture we pass to our base class needs to be a packaging
architecture. Try to find a match. If unsuccessful use "any". It
shouldn't really matter -- we just need it to be valid so "package"
doesn't complain.
* Replace the first component of the machine triple we get from gcc with
the architecture we get from os.uname(). This works around the issue
that in a linux32 environment gcc still reports the x86_64 machine.
For FreeBSD we'll need to find a different solution. We'll probably
have to add 64-bit platform handling logic to the gcc_bootstrap
recipe instead.


# e09a3a176cd6e5c143fc4acb4d08080c4f5e777a 16-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: add more implicit build platform provides


# ad2ab2827b82b4a7ce5aae81b8cb83a3586eee77 15-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix.init(): fix copy-and-paste mess-up


# b022cdcb6cf12926750bd971a20d1ee3e37c6b54 15-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Package.removeBuildPackage(): also delegate to buildPlatform

Fixes the issue that shutil.rmtree() doesn't work for non-directories
and is nicer anyway.


# 01cbbd6f4fcb9d2e1d2a2a0d20ad1be64658b4d8 15-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatform: let subclass determine architecture

BuildPlatformHaiku already knows the architecture and the architecture
from the machine triple isn't necessarily also a valid package
architecture.


# 13daab4b6da664f206209c36e8450a38b5659524 15-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformHaiku: build fixes


# 049f04a71577b841e4cf21409e5f6adba96bae88 15-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Complete support for non-Haiku build platforms

* Port.build(): When not using chroot, let buildPlatform set up/clean up
a suitable environment. Currently not supported for
BuildPlatformHaiku. BuildPlatformUnix sets up a cross-sysroot subdir
in the work directory. It extracts the haiku_cross_devel_sysroot
package to the boot/system and the other required packages to the
boot/common subtree. Furthermore it sets up a cross-tools directory
with bin, sys-include, lib subdirs. The former points to the cross
tools bin dir and is added to PATH. The latter two refer to
boot/system/develop/{headers,lib} and are symlinked temporarily into
the cross tools directory, so the headers and libraries are picked up
correctly. Not so nice, but I haven't found a cleaner way to do that.
Wrapper scripts might work.
* Package.activateBuildPackage(): delegate to buildPlatform.
BuildPlatformHaiku uses the previous code. BuildPlatformUnix sets up
the package symlinks directory for the package in the cross
sysroot/packages directory (currently only the .self symlink).
* Define installDestDir shell variable when cross-building on non-Haiku.


# 4e82153ec0ada7b64c619de36180dba37c78e817 15-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Port: move dependency resolution to BuildPlatform*

* BuildPlatformHaiku uses pkgman to resolve the dependencies as done
before.
* BuildPlatformUnix doesn't need to actually resolve pre-requires.
It just checks them against a list that is expected to be available.
Requires are resolved using RequiresUpdater. That should be good
enough for the bootstrap packages.


# 4cb939be21a8a5a23aec662db416f5154552ae5a 15-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatformUnix: check mandatory options


# 794ccdfc956148686ba1b7afc509503fee37fea3 14-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Add --system-mimedb and --command-mimeset options


# c7c29d1f4903be58b233775bf732174ea6780f2d 14-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatform*: move more initialization to init()


# 359be5b05c737507de1a33e6b2351552a8578e9d 14-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BuildPlatform: add getLicensesDirectory()


# 50a0262bc3787cfd9c0d0c5b4ecb13e50c2140a0 13-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Only use chroot on Haiku


# 2b8a58d5a6e9e88c974dc5a9600d9c769b47d8fd 13-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Start with a build platform abstraction

* Add '--cross-devel-package' option to specify the path to the cross
development package. Can be used for cross-compiling.
* Add module BuildPlatform which exports a buildPlatform variable, which
is initialized to an instance of BuildPlatformHaiku or
BuildPlatformUnix as appropriate.
* Move findDirectory() to BuildPlatformHaiku. BuildPlatformUnix has a
version with some hard-coded mappings.
* Add PackageInfo class. Very simple ATM. It only extracts the version
and the architecture from a package file.
* Rework Main._initGlobalShellVariables() somewhat: Extracting the Haiku
version from the build platform's system haiku package is obviously
not correct when cross-building. Also add support for non-Haiku build
platforms.
* Remove no longer needed MachineArchitecture.getBuildTripleFor().