===============================Migration to Package Management===============================This document gives an overview of what changes with the migration to packagemanagement. It has sections for different groups of Haiku users. All applyingsections should be read in order.Changes for Users=================- Almost all software lives in packages and is only virtually extracted. Thevirtually extracted package content is read-only.- Software (i.e. packages) can be installed via the command line package manager``pkgman`` -- ``pkgman search/install/uninstall/update ...`` searches for,installs, uninstalls, and updates packages respectively. Packages can also beinstalled manually by moving (not copying) them to the respective "packages"subdirectory in "/boot/system" or "/boot/home/config".- The directory layout has changed and many directories have become read-only.Cf. `DirectoryStructure`_ for details... _DirectoryStructure: DirectoryStructure.rst- The Deskbar menu works differently. It uses a new virtual directoryTracker/Deskbar feature to generate its content. Any package can contributeDeskbar menu entries by including respective symlinks in "data/deskbar/menu".The virtual directory merges the respective directories from all installationlocations plus the user settings directory"/boot/home/config/settings/deskbar/menu". That means whenever a package isinstalled/removed its Desbar menu entries will be added/removed automatically.The user settings directory allows the user to add new entries manually. Thewhole behavior can be changed by overriding the default virtual directory.Before using the default virtual directory"/boot/system/data/deskbar/menu_entries" Deskbar first looks for"/boot/home/config/settings/deskbar/menu_entries". This can be a virtualdirectory as well, or a regular directory, or a symlink to either. E.g. makingit a symlink to the "menu" directory will cause Deskbar to use only thecontents of that directory, i.e. the menu contents is completely user-defined.- The MIME type management works a bit differently now as well. The databaseentries for the default MIME types are included in the system package andthose for application MIME types are included in the package containing therespective applications. Neither of those can therefore be removed. By editingthem in the FileTypes preferences application they can be overridden, though.ATM there are still a few known bugs and missing features -- e.g. applicationMIME types aren't automatically added/removed when installing/removing apackage, and the MIME type removal functionality in FileTypes needs to bereworked.- Haiku's stage 1 boot loader (the boot block in the BFS partition) has changed.That means a Haiku partition made bootable from an old Haiku -- or moregenerally: with a ``makebootable`` that predates package management -- willnot be able to boot a package management Haiku. You will have to run the new``makebootable`` to make it bootable again. The new ``makebootable`` may ormay not run on an old Haiku. The safest way is to do that from a runningpackage management Haiku (e.g. booted off a USB stick or CD).Changes for Application Developers==================================- All development files (headers, libraries, the tool chain) have moved to"develop" in the respective installation location. Headers live in"develop/headers", development libraries in "develop/lib". Developmentlibraries means besides static libraries also symlinks to shared libraries.The shared libraries themselves as well as all symlinks required to run aprogram using the library (at most one symlink per library -- the soname) livein "lib".- Commands, libraries, add-ons, and headers for the secondary architecture of ahybrid Haiku live in an "<arch>" subdirectory of their usual location. Thisdoesn't hold for the system headers which exist only in the primary location.- ``setgcc`` is gone. The commands of the tool chain for the secondaryarchitecture (by default) live in "/boot/system/bin/<arch>". Prepending thatpath to the ``PATH`` environment variable would make them shadow therespective primary architecture commands -- the effect would be similar to theone ``setgcc`` had, but only for the current shell session. Executing the newcommand ``setarch <arch>`` will start a new shell with a respectively modified``PATH``. The commands of the secondary tool chain are also available in thestandard path with a name suffixed with "-<arch>" (e.g. "gcc-x86" for thegcc 4 executable on a gcc2/gcc4 hybrid).- Software can be packaged using the ``package`` tool. Cf. `BuildingPackages`_for more information... _BuildingPackages: BuildingPackages.rst- The ``find_directory()`` API has been partially deprecated. While there arestill some use cases where it should be used, in many cases the new``find_path*()`` API, respectively the ``BPathFinder`` class should be usedinstead (cf. the `API documentation`_)... _API documentation: https://www.haiku-os.org/docs/api/FindDirectory_8h.htmlChanges for Haiku Developers============================- Hybrid builds no longer require two separate generated directories. Insteadthe build is configured with both compilers and all output files are put in asingle generated directory.- The notion of a packaging architecture has been introduced. It is mostlysynonymous with the architecture, save for x86 where "x86_gcc2" refers tox86 gcc 2 and "x86" to x86 gcc 4.- Several ``configure`` script option have changed:- ``--build-cross-tools`` and ``--build-cross-tools-gcc4`` have been merged.The (packaging) architecture must always be specified.- ``--build-cross-tools`` and ``--cross-tools-prefix`` can be given multipletimes to specify hybrid builds. Only for the first ``--build-cross-tools``the path to the build tools must be given.For example, for building the default configuration of Haiku from a filesystem with proper xattr support, your configure options could look likethis::$ ./configure --build-cross-tools x86_gcc2 ../buildtools --build-cross-tools x86 --use-xattr- The new option ``--target-arch`` has been introduced for use on Haiku forbuilds with the native compiler. By default, if neither``--build-cross-tools`` nor ``--cross-tools-prefix`` are specified the buildis configured for a (hybrid) configuration matching the host system's (i.e.on a gcc2/gcc4 hybrid the build is configure for that configuration as well,on a pure gcc4 Haiku you'd get a gcc4 build). ``--target-arch`` overridesthe default, allowing to specify the architecture to build for. The optioncan be given multiple times to specify a hybrid configuration. E.g."--target-arch x86_gcc2 --target-arch x86" specifies a gcc2/gcc4 hybrid andcan be used on a gcc2/gcc4 or gcc4/gcc2 Haiku.- The new option ``--use-xattr-ref`` can be used when extended attributes areavailable, but their size limit prevents use of ``--use-xattr`` (e.g. withext4). The build system will use a slightly different version of the genericattribute emulation via separate files that involves tagging the attributedfiles with a unique ID, so there cannot be any mixups between attributes ordifferent files when the inode ID of a file changes or files with attributesget deleted without removing their attribute files.- Configuring a gcc 2 build should now also work on a 64 bit system (without a32 bit environment). Tested only on openSUSE 12.3 so far, but should also workon other Linux distributions and Unixes. The ``--use-32bit`` should thereforebe superfluous.- build/jam has experienced some reorganization, particularly with respect toHaiku images and (optional) packages:- Most stuff that is built ends up in the "haiku.hpkg" and "haiku_devel.hpkg"packages (or the respective "haiku_<arch>.hpkg", "haiku_<arch>_devel.hpkg"packages for the secondary architecture). The contents of the packages isdefined in the respective files in the "packages" subdirectory.- The files defining the contents of the Haiku images live now in the "images"subdirectory.- The "repositories" subdirectory defines external repositories. Most relevantfor a regular build is the HaikuPorts repository. For each architecturethere is a file defining the contents of the repository. Changes in thatfile require a respective version of the repository to be built. Currentlythat has to be done manually on the haiku-files.org server. The process willbe automated soon.- ReleaseBuildProfiles is now DefaultBuildProfiles.- The optional packages are mostly gone. There are only a few meta optionalpackages left. Adding regular packages to the image is done via theAddHaikuImagePackages rule. The parameters are package names (all lower case)without the version.- All build variables that depend on the architecture and aren't only relevantto the primary architecture have been renamed to have a "_<arch>" suffix (e.g.TARGET_GCC_<arch>, TARGET_DEFINES_<arch>, etc.). The variables are mostly onlyused by rule implementations, so this has not that much of an impact onJamfiles.- There are new build variables HAIKU_PACKAGING_ARCHS andTARGET_PACKAGING_ARCH[S]. The plural versions are set to the list of allconfigured architectures, e.g. for a gcc2/gcc4 hybrid "x86_gcc2 x86".TARGET_PACKAGING_ARCH is set to the current architecture. Usually that meansthe primary architecture. In some cases (mostly for libraries) a target has tobe built for all architectures. That is done in a loop which setsTARGET_PACKAGING_ARCH (and other variables) according to the architecturehandled in that iteration. Cf. `src/kits/textencoding/Jamfile`_ for a smallexample... _src/kits/textencoding/Jamfile:https://github.com/haiku/haiku/blob/master/src/kits/textencoding/Jamfile- Build features (as defined in "build/jam/BuildFeatures") work differently now.Instead of build variables there are dedicated rules to deal with buildfeatures (FIsBuildFeatureEnabled, UseBuildFeatureHeaders,BuildFeatureAttribute). Cf.`src/add-ons/mail_daemon/inbound_protocols/pop3/Jamfile`_ for an example... _src/add-ons/mail_daemon/inbound_protocols/pop3/Jamfile:https://github.com/haiku/haiku/blob/master/src/add-ons/mail_daemon/inbound_protocols/pop3/Jamfile- The semantics of the "update" build profile action has changed somewhat, sincedue to the packages we now have two container levels, the image and thepackage. A ``jam -q @alpha-raw update libbe.so`` will first update libbe.so inthe haiku.hpkg package and then update haiku.hpkg in the image. A``jam -q @alpha-raw update haiku.hpkg`` will update "haiku.hpkg" in the image,but "haiku.hpkg" will not be rebuilt. If that is desired, it first has to berebuilt explicitly -- via ``jam -q haiku.hpkg``. Note that this might beproblematic as well, since which optional build features are active depends onthe specified build profile.- There's a new build profile action "update-packages". It updates all packages,empties "/boot/system/packages" in the image, and copies the updated packagesthere. It's a poor man's system update. Packages you have installed manuallywill be removed. The old "update-all" build profile action still exits. It hasthe effect of "update-packages" and additionally replaces all other files thatare usually copied to the image.Changes for Porters===================- The format of the recipe (formerly bep) files has changed. Many recipes havenot been updated yet. haikuporter also has changed significantly. Cf. the`haikuporter documentation`_ for more information... _haikuporter documentation:https://github.com/haikuports/haikuports/wiki/HaikuPorterForPM