HaikuPorts
  • Login
  • Preferences
  • Help/Guide
  • Wiki
  • Timeline
  • Roadmap
  • View Tickets
  • Search
  • Port Log
  • Blog

Context Navigation

  • ← Previous Change
  • Wiki History
  • Next Change →

Changes between Version 1 and Version 2 of HaikuPorterForPM/BuildRecipes


Ignore:
Timestamp:
06/11/13 12:11:20 (2 years ago)
Author:
zooey
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HaikuPorterForPM/BuildRecipes

    v1 v2  
    2424Here's a list of all input environment variables: 
    2525 
    26  TODO:: 
    27   it would be useful to be able to specify some kind of prefix for those variables, as otherwise there can be namespace clashes with the actual build process used by specific port (git is an example). 
    28  
    29  - '''addOnsDir:''' The absolute directory for add-ons. 
    30  - '''appsDir:'''  The absolute directory for applications. 
    31  - '''binDir:''' The absolute directory for binaries. 
    32  - '''buildArchitecture:''' The Haiku architecture !HaikuPorter is running on (e.g. `x86_gcc2`). 
    33  - '''configureDirArgs:''' A string containing all the standard configure options with their respective value. This can be used instead of passing all the individual variables to configure (but you should use `runConfigure()` instead, anyway). 
    34  - '''configureDirVariables:''' A string containing a space separated list of names of all directory variable names. 
    35  - '''dataDir:''' The absolute directory for data. 
    36  - '''dataRootDir:''' The absolute base directory for data. On Haiku, this is the same as `dataDir`. 
    37  - '''developDir:''' The absolute path to the directory underneath of which all development-related files should be put. 
    38  - '''developDocDir:''' The absolute base directory for development-related documentation specific to the port being built. Documentation in html- or pdf-format should be put here, manpages should be put into `manDir`. 
    39  - '''developLibDir:''' The absolute directory for development libraries (i.e. static and shared libraries provided by a devel package). Shared libraries required at runtime don't belong here, they should be put into `libDir`. 
    40  - '''docDir:''' The absolute base directory for (non-development) documentation specific to the port being built. Documentation in html- or pdf-format should be put here, manpages should be put into `manDir`. 
    41  - '''documentationDir:''' The absolute base directory underneath of which all documentation should be put. This is not a port-specific directory. 
    42  - '''fontsDir:''' The absolute directory for fonts. 
    43  - '''haikuVersion:''' The version of Haiku for which the port is being built. 
    44  - '''includeDir:''' The absolute directory for header files 
    45  - '''infoDir:''' The absolute directory for documentation in `info`-format (which is frowned upon by Haiku ports) 
    46  - '''isCrossRepository:''' Is `true` if the ports tree being used is the one dealing with cross-building the bootstrap packages. 
    47  - '''jobArgs:''' If !HaikuPorter has been invoked with `--jobs=<num>`, this contains the job-number specification applicable to make (i.e. `-j<num>`) 
    48  - '''jobs:''' The number of build jobs to run concurrently (can be set with `haikuporter --jobs=<num>` 
    49  - '''libDir:''' The absolute directory for shared libraries to be used at runtime (i.e. by Haiku's runtime loader) 
    50  - '''libExecDir:''' The absolute directory for executables that a port may invoke internally. On Haiku, this is the same as `libDir`. 
    51  - '''localStateDir:''' The absolute directory for putting files created at runtime. This corresponds to the `var`-hierarchy. 
    52  - '''manDir:''' The absolute directory for man-pages. For each man section, a subdir exists underneath this directory. 
    53  - '''oldIncludeDir:''' Another name of the absolute directory for putting header files. 
    54  - '''portBaseDir:''' The absolute directory (on the build host!) of this build recipe file. This can be useful if you'd like to use local (i.e. `file:///`-) URLs to other ports. An example is the `gcc`-recipe using a local URL to reference the source directory of the `binutils` port (which both live in the same git repository). 
    55  - '''portDir:''' The absolute directory (on the build host!) where the files of the current port (patches, license, recipes) can be accessed. 
    56  - '''portFullVersion:''' Full version of the current port, including revision (e.g. `2.14-1`) 
    57  - '''portName:''' Name of the current port. 
    58  - '''portPackageLinksDir:''' The absolute path to the package-links directory of this port's base (main) package. This is useful if the current port needs to reference files from another (required) ports via absolute path. Again, this make use of the package-links abstraction, such that these cross-package references will work, no matter where a specific package is installed. 
    59  - '''portRevision:''' The revision of the current port (e.g. `1`). 
    60  - '''portRevisionedName:''' The name of the current port, extended by version and revision (e.g. `grep-2.14-1`) 
    61  - '''portVersion:''' The version of the current port (e.g. `2.14`). 
    62  - '''portVersionedName:''' The name of the current port, extended by version (e.g. `grep-2.14`). 
    63  - '''preferencesDir:''' The absolute directory for preflets. 
    64  - '''prefix:''' The absolute base directory of the port (i.e. the installation location). 
    65  - '''relativeAddOnsDir:''' `addOnsDir` as a relative directory (to `prefix`). 
    66  - '''relativeAppsDir:''' `appsDir` as a relative directory (to `prefix`). 
    67  - '''relativeBinDir:''' `binDir` as a relative directory (to `prefix`). 
    68  - '''relativeDataDir:''' `dataDir` as a relative directory (to `prefix`). 
    69  - '''relativeDataRootDir:''' `dataRootDir` as a relative directory (to `prefix`). 
    70  - '''relativeDevelopDir:''' `developDir` as a relative directory (to `prefix`). 
    71  - '''relativeDevelopDocDir:''' `developDocDir` as a relative directory (to `prefix`). 
    72  - '''relativeDevelopLibDir:''' `developLibDir` as a relative directory (to `prefix`). 
    73  - '''relativeDocDir:''' `docDir` as a relative directory (to `prefix`). 
    74  - '''relativeDocumentationDir:''' `documentationDir` as a relative directory (to `prefix`). 
    75  - '''relativeFontsDir:''' `fontsDir` as a relative directory (to `prefix`). 
    76  - '''relativeIncludeDir:''' `includeDir` as a relative directory (to `prefix`). 
    77  - '''relativeInfoDir:''' `infoDir` as a relative directory (to `prefix`). 
    78  - '''relativeLibDir:''' `libDir` as a relative directory (to `prefix`). 
    79  - '''relativeLibExecDir:''' `libExecDir` as a relative directory (to `prefix`). 
    80  - '''relativeLocalStateDir:''' `localStateDir` as a relative directory (to `prefix`). 
    81  - '''relativeManDir:''' `manDir` as a relative directory (to `prefix`). 
    82  - '''relativeOldIncludeDir:''' `oldIncludeDir` as a relative directory (to `prefix`). 
    83  - '''relativePreferencesDir:''' `preferencesDir` as a relative directory (to `prefix`). 
    84  - '''relativeSbinDir:''' `sbinDir` as a relative directory (to `prefix`). 
    85  - '''relativeSettingsDir:''' `settingsDir` as a relative directory (to `prefix`). 
    86  - '''relativeSharedStateDir:''' `sharedStateDir` as a relative directory (to `prefix`). 
    87  - '''sbinDir:''' Absolute directory for super-user binaries. On Haiku, this is the same as `binDir`. 
    88  - '''settingsDir:''' Absolute directory for settings files. 
    89  - '''sharedStateDir:''' Absolute directory for shared state files. On Haiku, this is the same as `localStateDir`, i.e. it corresponds to the `var`-hierarchy. 
    90  - '''sourceDir:''' Absolute path to the source directory of the build. This contains the files implementing the actual build process (`configure`, `Makefile`, ...). 
    91  - '''targetArchitecture:''' The Haiku architecture !HaikuPorter for which the current port is being build (e.g. `x86_gcc2`). Unless the ports tree in use is the one related to cross-builds, this is the same as `buildArchitecture`. 
     26 - '''$addOnsDir:''' The absolute directory for add-ons. 
     27 - '''$appsDir:'''  The absolute directory for applications. 
     28 - '''$binDir:''' The absolute directory for binaries. 
     29 - '''$buildArchitecture:''' The Haiku architecture !HaikuPorter is running on (e.g. `x86_gcc2`). 
     30 - '''$configureDirArgs:''' A string containing all the standard configure options with their respective value. This can be used instead of passing all the individual variables to configure (but you should use `runConfigure()` instead, anyway). 
     31 - '''$configureDirVariables:''' A string containing a space separated list of names of all directory variable names. 
     32 - '''$dataDir:''' The absolute directory for data. 
     33 - '''$dataRootDir:''' The absolute base directory for data. On Haiku, this is the same as `$dataDir`. 
     34 - '''$developDir:''' The absolute path to the directory underneath of which all development-related files should be put. 
     35 - '''$developDocDir:''' The absolute base directory for development-related documentation specific to the port being built. Documentation in html- or pdf-format should be put here, manpages should be put into `$manDir`. 
     36 - '''$developLibDir:''' The absolute directory for development libraries (i.e. static and shared libraries provided by a devel package). Shared libraries required at runtime don't belong here, they should be put into `$libDir`. 
     37 - '''$docDir:''' The absolute base directory for (non-development) documentation specific to the port being built. Documentation in html- or pdf-format should be put here, manpages should be put into `$manDir`. 
     38 - '''$documentationDir:''' The absolute base directory underneath of which all documentation should be put. This is not a port-specific directory. 
     39 - '''$fontsDir:''' The absolute directory for fonts. 
     40 - '''$haikuVersion:''' The version of Haiku for which the port is being built. 
     41 - '''$includeDir:''' The absolute directory for header files 
     42 - '''$infoDir:''' The absolute directory for documentation in `info`-format (which is frowned upon by Haiku ports) 
     43 - '''$isCrossRepository:''' Is `true` if the ports tree being used is the one dealing with cross-building the bootstrap packages. 
     44 - '''$jobArgs:''' If !HaikuPorter has been invoked with `--jobs=<num>`, this contains the job-number specification applicable to make (i.e. `-j<num>`) 
     45 - '''$jobs:''' The number of build jobs to run concurrently (can be set with `haikuporter --jobs=<num>` 
     46 - '''$libDir:''' The absolute directory for shared libraries to be used at runtime (i.e. by Haiku's runtime loader) 
     47 - '''$libExecDir:''' The absolute directory for executables that a port may invoke internally. On Haiku, this is the same as `$libDir`. 
     48 - '''$localStateDir:''' The absolute directory for putting files created at runtime. This corresponds to the `var`-hierarchy. 
     49 - '''$manDir:''' The absolute directory for man-pages. For each man section, a subdir exists underneath this directory. 
     50 - '''$oldIncludeDir:''' Another name of the absolute directory for putting header files (`$includeDir`). 
     51 - '''$portBaseDir:''' The absolute directory (on the build host!) of this build recipe file. This can be useful if you'd like to use local (i.e. `file:///`-) URLs to other ports. An example is the `gcc`-recipe using a local URL to reference the source directory of the `binutils` port (which both live in the same git repository). 
     52 - '''$portDir:''' The absolute directory (on the build host!) where the files of the current port (patches, license, recipes) can be found. 
     53 - '''$portFullVersion:''' Full version of the current port, including revision (e.g. `2.14-1`) 
     54 - '''$portName:''' Name of the current port. 
     55 - '''$portPackageLinksDir:''' The absolute path to the package-links directory of this port's base (main) package. This is useful if the current port needs to reference files from another (required) ports via absolute path. Again, this make use of the package-links abstraction, such that these cross-package references will work, no matter where a specific package is installed. 
     56 - '''$portRevision:''' The revision of the current port (e.g. `1`). 
     57 - '''$portRevisionedName:''' The name of the current port, extended by version and revision (e.g. `grep-2.14-1`) 
     58 - '''$portVersion:''' The version of the current port (e.g. `2.14`). 
     59 - '''$portVersionedName:''' The name of the current port, extended by version (e.g. `grep-2.14`). 
     60 - '''$preferencesDir:''' The absolute directory for preflets. 
     61 - '''$prefix:''' The absolute base directory of the port (i.e. the installation location). 
     62 - '''$relativeAddOnsDir:''' `$addOnsDir` as a relative directory (to `prefix`). 
     63 - '''$relativeAppsDir:''' `$appsDir` as a relative directory (to `prefix`). 
     64 - '''$relativeBinDir:''' `$binDir` as a relative directory (to `prefix`). 
     65 - '''$relativeDataDir:''' `$dataDir` as a relative directory (to `prefix`). 
     66 - '''$relativeDataRootDir:''' `$dataRootDir` as a relative directory (to `prefix`). 
     67 - '''$relativeDevelopDir:''' `$developDir` as a relative directory (to `prefix`). 
     68 - '''$relativeDevelopDocDir:''' `$developDocDir` as a relative directory (to `prefix`). 
     69 - '''$relativeDevelopLibDir:''' `$developLibDir` as a relative directory (to `prefix`). 
     70 - '''$relativeDocDir:''' `$docDir` as a relative directory (to `prefix`). 
     71 - '''$relativeDocumentationDir:''' `$documentationDir` as a relative directory (to `prefix`). 
     72 - '''$relativeFontsDir:''' `$fontsDir` as a relative directory (to `prefix`). 
     73 - '''$relativeIncludeDir:''' `$includeDir` as a relative directory (to `prefix`). 
     74 - '''$relativeInfoDir:''' `$infoDir` as a relative directory (to `prefix`). 
     75 - '''$relativeLibDir:''' `$libDir` as a relative directory (to `prefix`). 
     76 - '''$relativeLibExecDir:''' `$libExecDir` as a relative directory (to `prefix`). 
     77 - '''$relativeLocalStateDir:''' `$localStateDir` as a relative directory (to `prefix`). 
     78 - '''$relativeManDir:''' `$manDir` as a relative directory (to `prefix`). 
     79 - '''$relativeOldIncludeDir:''' `$oldIncludeDir` as a relative directory (to `prefix`). 
     80 - '''$relativePreferencesDir:''' `$preferencesDir` as a relative directory (to `prefix`). 
     81 - '''$relativeSbinDir:''' `$sbinDir` as a relative directory (to `prefix`). 
     82 - '''$relativeSettingsDir:''' `$settingsDir` as a relative directory (to `prefix`). 
     83 - '''$relativeSharedStateDir:''' `$sharedStateDir` as a relative directory (to `prefix`). 
     84 - '''$sbinDir:''' Absolute directory for super-user binaries. On Haiku, this is the same as `$binDir`. 
     85 - '''$settingsDir:''' Absolute directory for settings files. 
     86 - '''$sharedStateDir:''' Absolute directory for shared state files. On Haiku, this is the same as `$localStateDir`, i.e. it corresponds to the `var`-hierarchy. 
     87 - '''$sourceDir:''' Absolute path to the source directory of the build. This contains the files implementing the actual build process (`configure`, `Makefile`, ...). 
     88 - '''$targetArchitecture:''' The Haiku architecture !HaikuPorter for which the current port is being build (e.g. `x86_gcc2`). Unless the ports tree in use is the one related to cross-builds, this is the same as `$buildArchitecture`. 
    9289 
    9390When the ports tree for cross-builds is active, there are some more variables available: 
    … …  
    9895 - '''targetMachineTripleAsName:''' The machine-triple for the machine this port is being built for as a name usable in requires/provides definitions (e.g. `i586_pc_haiku_gcc2`) 
    9996 
     97 TODO:: it would be useful to be able to specify some kind of prefix for all of the above variables, as otherwise there can be namespace clashes with the actual build process used by specific port (git is an example). 
     98 
    10099=== Shell Functions === 
    101100 
    102101The following shell functions are defined by !HaikuPorter to make them available to the build recipe script: 
    103102 
     103==== fixDevelopLibDirReferences() ==== 
     104 
     105 usage:: `fixDevelopLibDirReferences <file> ...` 
     106 purpose:: Replaces instances of `$libDir` in the given files with `$developLibDir`. This is useful for fixing a `<portname>-config` script with respect to where it locates development libraries. Usually, those believe libraries to be found in `$libDir`, but on Haiku, those live in `$developLibDir`. 
     107 
     108==== fixPkgconfig() ==== 
     109 
     110 usage:: `fixPkgConfig` 
     111 purpose:: Moves `pkgconfig`-subfolder from $libDir to $developLibDir and adjusts all files in there to reference libraries via `$prefix/develop/lib` and headers via `$prefix/develop/headers`. 
     112 
     113==== packageEntries() ==== 
     114 
     115 usage:: `packageEntries <packageSuffix> <entry> ...` 
     116 purpose:: Moves the given entries to the packaging directory for the sibling package specified by `packageSuffix`. In effect, the given entries will not be put into the main package, but they will be put into the sibling package instead. 
     117 params:: 
     118 - '''packageSuffix;''' The suffix of the sibling package where the entries should be moved to. 
     119 - '''entry;''' Specifies a single entry to be moved from the main package to the sibling package. The given entry paths can be absolute or relative to `$prefix`. 
     120 
     121==== prepareInstalledDevelLib() ==== 
     122 
     123 usage:: `prepareInstalledDevelLib <libBaseName> [ <soPattern> [ <pattern> ] ]` 
     124 purpose:: Moves all libraries matching a given base name from $prefix/lib to $prefix/develop/lib and creates symlinks as required. 
     125 params:: 
     126 - libBaseName:''' The base name of the library, e.g. "libfoo". 
     127 - soPattern:''' The glob pattern to be used to enumerate the shared library entries. Is appended to $libDir/${libBaseName}' to form the complete pattern. Defaults to ".so*". 
     128 - '''pattern:''' The glob pattern to be used to enumerate all library entries. Is appended to $libDir/${libBaseName} to form the complete pattern. Defaults to ".*". 
     129 
     130==== prepareInstalledDevelLibs() ==== 
     131 
     132 usage:: `prepareInstalledDevelLibs <libBaseName> ...` 
     133 purpose:: Invokes `prepareInstalledDevelLib()` for all given library base names (using the defaults for `soPattern` and `pattern`). 
     134 
     135==== runConfigure() ==== 
     136 
     137 usage:: `runConfigure [ --omit-dirs <dirsToOmit> ] <configure> <argsToConfigure> ...` 
     138 purpose:: Helper function to invoke a configure script with the correct directory arguments. 
     139 params:: 
     140 - '''configure:''' The configure program to be called. 
     141 - '''dirsToOmit:''' Space-separated list of directory arguments not to be passed to configure, e.g. "docDir manDir" (as a single argument!). 
     142 - '''argsToConfigure:''' The additional arguments passed to configure. 
     143 
     144== Output == 
     145 
     146=== Environment Variables === 
     147 
    104148...TODO... 
    105149 
    106 == Output == 
    107  
    108 === Environment Variables === 
     150=== Shell Functions === 
     151 
     152The following shell functions will be invoked by !HaikuPorter to execute the corresponding build stage. If a recipe doesn't provide a definition for one of these functions, the corresponding build stage will be empty, i.e. nothing will happen. 
     153 
     154==== PATCH() ==== 
     155 
     156 purpose:: Apply algorithmic patches to the port's sources. Usually, sources are patched by providing a patchset, but sometimes it is just more convenient to apply the patches programatically, which can be done in this function. 
     157 generic example:: 
     158{{{ 
     159PATCH() 
     160{ 
     161        find . -name '*.py' -exec sed -i -e 's|/usr/bin/env|/bin/env|g' {} \; 
     162} 
     163}}} 
     164 
     165==== BUILD() ==== 
     166 
     167 purpose:: Execute the build stage for the current port. For a port based on `autotools`, this usually involves invocation of `configure` and `make`. 
     168 generic example:: 
     169{{{ 
     170BUILD() 
     171{ 
     172        libtoolize --force --copy --install 
     173        runConfigure ./configure 
     174        make $jobArgs 
     175} 
     176}}} 
     177 
     178==== INSTALL() ==== 
     179 
     180 purpose:: Collect the build results into one or more subfolders of the `/packaging` directory (one for each resulting package). 
     181 generic example:: 
     182{{{ 
     183INSTALL() 
     184{ 
     185        make install 
     186        strip $binDir/* 
     187} 
     188}}} 
     189 
     190==== TEST() ==== 
     191 
     192 purpose:: Run any tests on the build results. 
     193 generic example:: 
     194{{{ 
     195TEST() 
     196{ 
     197        make check 
     198} 
     199}}} 
     200 
     201== Example == 
    109202 
    110203...TODO... 
    111  
    112 === Shell Functions === 
    113  
    114 ...TODO... 
    115  
    116 == Example == 
    117  
    118 ...TODO... 

Trac Powered

Powered by Trac 0.13dev-r10686
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/