Lucio Andrés Illanes Albornoz 531158
> N.B. If you're interested in building Midipix using this script, please join
Lucio Andrés Illanes Albornoz 531158
the project's IRC channel #midipix on Libera and ask for the address of the
Lucio Andrés Illanes Albornoz 531158
internal repositories required in order to build Midipix.
Lucio Andrés Illanes Albornoz 531158

ce2a76
> N.B. Due to the present state of the (largely) automated package upstream
ce2a76
updates integration script and, despite frequent contributions, lack of
ce2a76
human resources, it bears mentioning that the 3rd party packages built
ce2a76
and distributed by this script are often not up to date with their resp.
ce2a76
upstream and *may* hence be **insecure**. It is advised that this be taken
ce2a76
into account when deploying and using Midipix distributions.
ce2a76

Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ Table of contents"
Lucio Andrés Illanes Albornoz 531158
# Table of Contents
Lucio Andrés Illanes Albornoz 531158

ce2a76
1. [What is Midipix, and how is it different?](#1-what-is-midipix-and-how-is-it-different)  
Lucio Andrés Illanes Albornoz 531158
2. [Building and deployment](#2-building-and-deployment)  
ce2a76
	2.1. [Building, installing, and using a Midipix distribution](#21-building-installing-and-using-a-midipix-distribution)  
Lucio Andrés Illanes Albornoz 531158
		2.1.1. [Build-time dependencies](#211-build-time-dependencies)  
Lucio Andrés Illanes Albornoz 531158
			2.1.1.1. [Alpine-specific notate bene](#2111-alpine-specific-notate-bene)  
Lucio Andrés Illanes Albornoz 531158
	2.2. [Deployment](#22-deployment)  
Lucio Andrés Illanes Albornoz 531158
	2.3. [System requirements](#23-system-requirements)  
Lucio Andrés Illanes Albornoz 531158
	2.4. [Troubleshooting](#24-troubleshooting)  
Lucio Andrés Illanes Albornoz 531158
3. [Common concepts and tasks](#3-common-concepts-and-tasks)  
Lucio Andrés Illanes Albornoz 531158
	3.1. [Common tasks](#31-common-tasks)  
Lucio Andrés Illanes Albornoz 531158
	3.2. [Adding a package](#32-adding-a-package)  
Lucio Andrés Illanes Albornoz 531158
	3.3. [Addressing build failure](#33-addressing-build-failure)  
Lucio Andrés Illanes Albornoz 531158
	3.4. [Package archive files and Git repositories](#34-package-archive-files-and-git-repositories)  
Lucio Andrés Illanes Albornoz 531158
	3.5. [``-s``: package build shell environment](#35--s-package-build-shell-environment)  
Lucio Andrés Illanes Albornoz 531158
	3.6. [Package-package and {package,group}-group relationships](#36-package-package-and-packagegroup-group-relationships)  
Lucio Andrés Illanes Albornoz 531158
	3.7. [Patches and ``vars`` files](#37-patches-and-vars-files)  
Lucio Andrés Illanes Albornoz 531158
4. [Units reference](#4-units-reference)  
Lucio Andrés Illanes Albornoz 531158
	4.1. [Build steps](#41-build-steps)  
Lucio Andrés Illanes Albornoz 531158
	4.2. [Build variables](#42-build-variables)  
Lucio Andrés Illanes Albornoz 531158
	4.3. [Fault-tolerant & highly optimised 3D laser show-equipped usage screen](#43-fault-tolerant--highly-optimised-3d-laser-show-equipped-usage-screen)  
Lucio Andrés Illanes Albornoz 531158
	4.4. [File installation DSL](#44-file-installation-dsl)  
Lucio Andrés Illanes Albornoz 531158
	4.5. [Package variables](#45-package-variables)  
Lucio Andrés Illanes Albornoz 531158
		4.5.1. [Package variable types](#451-package-variable-types)  
Lucio Andrés Illanes Albornoz 531158
		4.5.2. [Package variables](#452-package-variables)  
Lucio Andrés Illanes Albornoz 531158
	4.6. [``pkgtool.sh``](#46-pkgtoolsh)  
Lucio Andrés Illanes Albornoz 531158
5. [References](#5-references)  
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: "}}}"
Lucio Andrés Illanes Albornoz 531158

ce2a76
[//]: # "{{{ 1. What is Midipix, and how is it different?"
ce2a76
## 1. What is Midipix, and how is it different?
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
midipix is a development environment that lets you create programs
Lucio Andrés Illanes Albornoz 531158
for Windows using the standard C and POSIX APIs. No compromises made,
Lucio Andrés Illanes Albornoz 531158
no shortcuts taken.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
If you are interested in cross-platform programming that reclaims
Lucio Andrés Illanes Albornoz 531158
the notion of write once, compile everywhere; if you believe that the
Lucio Andrés Illanes Albornoz 531158
'standard' in the C Standard Library should not be a null signifier;
Lucio Andrés Illanes Albornoz 531158
and if you like cooking your code without #ifdef hell and low-level
Lucio Andrés Illanes Albornoz 531158
minutiae, then this page is for you.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
midipix makes cross-platform programming better, simpler and faster,
Lucio Andrés Illanes Albornoz 531158
specifically by bringing a modern, conforming C Runtime Library to the
Lucio Andrés Illanes Albornoz 531158
Windows platform. While the idea itself is not new, the approach taken
Lucio Andrés Illanes Albornoz 531158
in midipix to code portability is radically different from that found
Lucio Andrés Illanes Albornoz 531158
in other projects.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
*(reproduced from [[2](https://midipix.org/#sec-midipix)])*
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: "}}}"
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 2. Building and deployment"
Lucio Andrés Illanes Albornoz 531158
## 2. Building and deployment
Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
ce2a76
[//]: # "{{{ 2.1. Building, installing, and using a Midipix distribution"
ce2a76
### 2.1. Building, installing and using a Midipix distribution
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
A Midipix distribution consists of the following:
7a0b92

Lucio Andrés Illanes Albornoz 531158
* the native Midipix toolchain, consisting of perk, gcc, its dependencies,
Lucio Andrés Illanes Albornoz 531158
  and binutils,
Lucio Andrés Illanes Albornoz 531158
* musl, a lightweight, fast, simple, and free libc[[1](https://www.musl-libc.org/faq.html)] used by Midipix,
Lucio Andrés Illanes Albornoz 531158
* the Midipix runtime components that bridge the gap between the libc and the
Lucio Andrés Illanes Albornoz 531158
  executive subsystems of all Windows NT-derived Windows OS starting with and
Lucio Andrés Illanes Albornoz 531158
  including Windows XP, and
Lucio Andrés Illanes Albornoz 531158
* a steadily increasing number of 3rd party open source packages, as expected in
Lucio Andrés Illanes Albornoz 531158
  any modern POSIX-compliant \*nix environment, including GNU coreutils, shells,
Lucio Andrés Illanes Albornoz 531158
  libraries such as ncurses, libressl, as well as Perl and Python.
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
Install the build-time dependencies listed in section [2.1.1](#211-build-time-dependencies),
Lucio Andrés Illanes Albornoz 531158
clone this repository (e.g. ``git clone https://dev.midipix.org/build/midipix_build``)
Lucio Andrés Illanes Albornoz 531158
and run the following command line:
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
```shell
Lucio Andrés Illanes Albornoz 531158
./build.sh -a nt64 -b release -D zipdist -P -v
Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
By default, the build will take place within ``${HOME}/midipix/nt64/release``
Lucio Andrés Illanes Albornoz 531158
and package archive files and/or Git repositores will be downloaded into
Lucio Andrés Illanes Albornoz 531158
``${HOME}/midipix/dlcache``. Consult sections [4.2](#42-build-variables) and
Lucio Andrés Illanes Albornoz 531158
[4.5](#45-package-variables) for the list of available build/package variables
Lucio Andrés Illanes Albornoz 531158
and how to override them.  
Lucio Andrés Illanes Albornoz 531158
Parallelisation is enabled by the above command line for both packages that can
Lucio Andrés Illanes Albornoz 531158
be built independently of each other and ``make(1)`` via ``-j``, limited to the
Lucio Andrés Illanes Albornoz 531158
amount of logical processors on the build host divided by two (2).
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 2.1.1. Build-time dependencies"
Lucio Andrés Illanes Albornoz 531158
### 2.1.1. Build-time dependencies
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
* **Alpine Linux**:
328571
  binutils bison bzip2 cmake coreutils curl findutils g++ gawk gcc git grep gzip libc-dev linux-headers lzip m4 make musl-dev net-tools patch perl perl-xml-parser procps sed tar util-linux wget xz zip
Lucio Andrés Illanes Albornoz 531158
* **Debian/-derived Linux**:
328571
  binutils bison bzip2 cmake coreutils curl findutils g++ gawk gcc git grep gzip hostname libc6-dev libxml-parser-perl lzip m4 make patch perl procps sed tar util-linux wget xz-utils zip
Lucio Andrés Illanes Albornoz 531158
* **Gentoo Linux**:
328571
  binutils bison bzip2 cmake coreutils curl findutils gawk =gcc-7.5.0-r1 dev-vcs/git grep gzip lzip m4 make patch perl dev-perl/XML-Parser procps sed tar util-linux wget xz-utils zip
Lucio Andrés Illanes Albornoz 531158
* **OpenSUSE Linux**:
328571
  binutils bison bzip2 cmake coreutils curl findutils gawk gcc gcc-c++ git grep gzip hostname linux-glibc-devel lzip m4 make patch perl perl-XML-Parser procps sed tar util-linux wget xz zip
Lucio Andrés Illanes Albornoz 531158
  
ba0fc3
#### The distro matrix:
ba0fc3

ba0fc3
|   Alpine Linux:   |   Debian/-derived Linux:   |   Gentoo Linux:      |   OpenSUSE Linux:   |
b9f4d6
| ----------------- | -------------------------- | -------------------- | ------------------- |
ba0fc3
| binutils          | binutils                   | binutils             | binutils            |
328571
| bison             | bison                      | bison                | bison               |
ba0fc3
| bzip2             | bzip2                      | bzip2                | bzip2               |
ba0fc3
| cmake             | cmake                      | cmake                | cmake               |
ba0fc3
| coreutils         | coreutils                  | coreutils            | coreutils           |
ba0fc3
| curl              | curl                       | curl                 | curl                |
ba0fc3
| findutils         | findutils                  | findutils            | findutils           |
ba0fc3
| g++               | g++                        | -                    | gcc-c++             |
ba0fc3
| gawk              | gawk                       | gawk                 | gawk                |
ba0fc3
| gcc               | gcc                        | =gcc-7.5.0-r1        | gcc                 |
ba0fc3
| git               | git                        | dev-vcs/git          | git                 |
ba0fc3
| grep              | grep                       | grep                 | grep                |
ba0fc3
| gzip              | gzip                       | gzip                 | gzip                |
ba0fc3
| -                 | hostname                   | -                    | hostname            |
ba0fc3
| libc-dev          | libc6-dev                  | -                    | linux-glibc-devel   |
ba0fc3
| linux-headers     | -                          | -                    | -                   |
ba0fc3
| lzip              | lzip                       | lzip                 | lzip                |
84270f
| m4                | m4                         | m4                   | m4                  |
ba0fc3
| make              | make                       | make                 | make                |
ba0fc3
| musl-dev          | -                          | -                    | -                   |
ba0fc3
| net-tools         | -                          | -                    | -                   |
ba0fc3
| patch             | patch                      | patch                | patch               |
ba0fc3
| perl              | perl                       | perl                 | perl                |
6e5bab
| perl-xml-parser   | libxml-parser-perl         | dev-perl/XML-Parser  | perl-XML-Parser     |
ba0fc3
| procps            | procps                     | procps               | procps              |
ba0fc3
| sed               | sed                        | sed                  | sed                 |
ba0fc3
| tar               | tar                        | tar                  | tar                 |
ba0fc3
| util-linux        | util-linux                 | util-linux           | util-linux          |
ba0fc3
| wget              | wget                       | wget                 | wget                |
ba0fc3
| xz                | xz-utils                   | xz-utils             | xz                  |
ba0fc3
| zip               | zip                        | zip                  | zip                 |
ba0fc3

Lucio Andrés Illanes Albornoz 531158
> N.B. Busybox is not supported. Awk implementations other than GNU Awk are not supported.  
Lucio Andrés Illanes Albornoz 531158
  
082c08
> N.B. clang is not supported.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 2.1.1.1. Alpine-specific notate bene"
Lucio Andrés Illanes Albornoz 531158
#### 2.1.1.1. Alpine-specific notate bene
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
Some packages (*coreutils*, *grep*, and *tar*, among others) override Alpine's
Lucio Andrés Illanes Albornoz 531158
BusyBox utilities of the same name, as the latter are either non-conformant or
Lucio Andrés Illanes Albornoz 531158
defective.
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 2.2. Deployment"
Lucio Andrés Illanes Albornoz 531158
### 2.2. Deployment
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
On successful completion of the build, a ZIP archive containing the Midipix
Lucio Andrés Illanes Albornoz 531158
distribution will be created inside ``${PREFIX}`` (see section [4.2](#42-build-variables).)
Lucio Andrés Illanes Albornoz 531158
Create a directory on the target machine and extract the contents of the distribution
Lucio Andrés Illanes Albornoz 531158
ZIP archive into it, run ``bash.bat``, and then ``/install.sh`` inside the resulting
Lucio Andrés Illanes Albornoz 531158
self-contained Midipix installation shell window.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
> N.B. The pathname of the target directory containing ``bash.bat`` and all other
Lucio Andrés Illanes Albornoz 531158
distribution files must not contain whitespaces.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
> N.B. The Midipix installer defaults to ``/dev/fs/c/midipix (C:\midipix)``. If left
Lucio Andrés Illanes Albornoz 531158
unchanged, the distribution ZIP archive must not be extracted into a directory of the
Lucio Andrés Illanes Albornoz 531158
same pathname.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
> N.B. The user installing and using Midipix must have been delegated the ``SeCreateSymbolicLinkPrivilege``
Lucio Andrés Illanes Albornoz 531158
("Create symbolic links") privilege[[3](https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/user-rights-assignment)] and additionally be a non-administrator account
Lucio Andrés Illanes Albornoz 531158
owing to the UAC-related filtering policy of tokens introduced by Windows Vista[[4](https://docs.microsoft.com/en-us/previous-versions/dotnet/articles/bb530410%28v%3dmsdn%2e10%29)].  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 2.3. System requirements"
Lucio Andrés Illanes Albornoz 531158
### 2.3. System requirements
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
The following build-time system requirements are assessed on build hosts
Lucio Andrés Illanes Albornoz 531158
equipped with the following hardware at minimum:
e522b8

Lucio Andrés Illanes Albornoz 531158
* Intel(R) Xeon(R) CPU W3520 @ 2.67GHz (8 cores)
Lucio Andrés Illanes Albornoz 531158
* 7200 RPM SATA 3.1 HDD
Lucio Andrés Illanes Albornoz 531158
* 6 GB RAM
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
| Target architecture | Build kind | Distribution kinds selected | Average build time | Disk space required | Peak RAM usage |
Lucio Andrés Illanes Albornoz 531158
| ------------------- | ---------- | --------------------------- | ------------------ | ------------------- | -------------- |
Lucio Andrés Illanes Albornoz 531158
| nt64                | debug      | (none)                      | 2 hours            | 57.62 GB            | 3.55 GB        |
Lucio Andrés Illanes Albornoz 531158
| nt64                | release    | (none)                      | 1 hours 45 minutes | 36.51 GB            | 3.21 GB        |
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
Package archive files and/or Git repositories additionally consume at least
Lucio Andrés Illanes Albornoz 531158
1.82 GB.
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
*(last update: Thu, 05 Mar 2020 09:25:41 +0000)*
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
These are the Midipix distribution disk space system requirements:
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
| Target architecture | Build kind | Distribution | Installation directory | Archive file |
Lucio Andrés Illanes Albornoz 531158
| ------------------- | ---------- | ------------ | ---------------------- | ------------ |
Lucio Andrés Illanes Albornoz 531158
| nt64                | debug      | 7.3 GB       |  2.3 GB                | 2.1 GB       |
Lucio Andrés Illanes Albornoz 531158
| nt64                | release    | 3.2 GB       |  913 MB                | 830 MB       |
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
The installation directory and archive file may be safely deleted post-installation.
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
*(last update: Thu, 07 Jan 2021 18:20:06 +0000)*
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 2.4. Troubleshooting"
Lucio Andrés Illanes Albornoz 531158
### 2.4. Troubleshooting
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
Midipix presently provides, inter alia, strace-like functionality via
Lucio Andrés Illanes Albornoz 531158
ntctty's logging capabilities. This is available both through the regular
Lucio Andrés Illanes Albornoz 531158
``strace(1)`` command as distributed, which however **must** be provided
Lucio Andrés Illanes Albornoz 531158
with an absolute pathname without consideration for ``${PATH}``, as well
Lucio Andrés Illanes Albornoz 531158
as directly via ``ntctty.exe`` for a session by running ``ntctty.exe``
Lucio Andrés Illanes Albornoz 531158
with the ``--log-level 7`` option, e.g.:
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
```shell
Lucio Andrés Illanes Albornoz 531158
$ #strace ls -la /        # (incorrect, relative pathname)
Lucio Andrés Illanes Albornoz 531158
$ strace /bin/ls -la /    # (correct, absolute pathname)
Lucio Andrés Illanes Albornoz 531158
$ ntctty.exe --log-level 7 -e /bin/ls -la /
Lucio Andrés Illanes Albornoz 531158
$ ntctty.exe --log-level=7 -e /bin/ls -la /
Lucio Andrés Illanes Albornoz 531158
$ ntctty.exe --log-level 7 -e /bin/sh -c "ls -la /"
Lucio Andrés Illanes Albornoz 531158
$ ntctty.exe --log-level=7 -e /bin/sh -c "ls -la /"
Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
By default, ``ntctty.exe`` log files are written into the /var/log/ntctty
Lucio Andrés Illanes Albornoz 531158
directory; this may be adjusted with the ``--log-dir`` and/or
Lucio Andrés Illanes Albornoz 531158
``--log-file`` options. ``strace(1)`` logs to stderr by default.
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 3. Common concepts and tasks"
Lucio Andrés Illanes Albornoz 531158
## 3. Common concepts and tasks
Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 3.1. Common tasks"
Lucio Andrés Illanes Albornoz 531158
### 3.1. Common tasks
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
Rebuild set of packages in isolation:
Lucio Andrés Illanes Albornoz 531158
```shell
Lucio Andrés Illanes Albornoz 531158
./build.sh [ ... ] -r mc,zsh
Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
Restart the ``@install`` (shorthand alias) step, with implicit ``finish``, of the
Lucio Andrés Illanes Albornoz 531158
``mc`` and ``zsh`` packages.
Lucio Andrés Illanes Albornoz 531158
```shell
Lucio Andrés Illanes Albornoz 531158
./build.sh [ ... ] -r mc,zsh:@install
Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
Rebuild set of packages along w/ their dependencies, if any, as needed, or forcibly,
Lucio Andrés Illanes Albornoz 531158
respectively:
Lucio Andrés Illanes Albornoz 531158
```shell
Lucio Andrés Illanes Albornoz 531158
./build.sh [ ... ] -r \*mc,zsh
Lucio Andrés Illanes Albornoz 531158
./build.sh [ ... ] -r \*\*mc,zsh
Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
Forcibly rebuild all reverse dependencies of a set of packages:
Lucio Andrés Illanes Albornoz 531158
```shell
Lucio Andrés Illanes Albornoz 531158
./build.sh [ ... ] -r \*\*\*glib,libflac
Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
Restart the ``@configure``, ``@build``, and ``@install`` (shorthand alias) steps of the
Lucio Andrés Illanes Albornoz 531158
``coreutils`` package:
Lucio Andrés Illanes Albornoz 531158
```shell
Lucio Andrés Illanes Albornoz 531158
./build.sh -r coreutils:@configure,@build,@install
Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
Rebuild entire build groups including or excluding group dependencies, respectively:
Lucio Andrés Illanes Albornoz 531158
```shell
Lucio Andrés Illanes Albornoz 531158
./build.sh [ ... ] -r ALL native_runtime
Lucio Andrés Illanes Albornoz 531158
./build.sh [ ... ] -r ALL =native_runtime
Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
Forcibly (re)download all archive files and/or Git repositories associated with all packages:
Lucio Andrés Illanes Albornoz 531158
```shell
Lucio Andrés Illanes Albornoz 531158
./build.sh [ ... ] -r ALL:@fetch
Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 3.2. Adding a package"
Lucio Andrés Illanes Albornoz 531158
## 3.2. Adding a package
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
Packages are grouped into *build groups* according to sets of common package
Lucio Andrés Illanes Albornoz 531158
variable defaults, such as ``${PKG_CFLAGS_CONFIGURE}, ${PKG_LDFLAGS_CONFIGURE}``
Lucio Andrés Illanes Albornoz 531158
and ``${PKG_CONFIGURE_ARGS}``, and semantic interrelatedness, such as the
Lucio Andrés Illanes Albornoz 531158
``native_runtime`` build group comprising the Midipix runtime components.
Lucio Andrés Illanes Albornoz 531158
Packages may belong to more than one build group such as when subsumed by a shorthand
Lucio Andrés Illanes Albornoz 531158
build group e.g. the ``dev_packages`` build group, as long as the default set of build
Lucio Andrés Illanes Albornoz 531158
groups or as overriden on the command line does not entail group membership conflicts.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
Build groups files beneath ``groups/`` named ``[0-9][0-9][0-9].<group name>.group``
Lucio Andrés Illanes Albornoz 531158
contain package variable defaults, the alphabetically sorted list of contained
Lucio Andrés Illanes Albornoz 531158
packages in ``<upper case group name>_PACKAGES``, and their package variables
Lucio Andrés Illanes Albornoz 531158
sorted alphabetically with the exception of ``${PKG_DEPENDS}`` (if present,)
Lucio Andrés Illanes Albornoz 531158
``${PKG_SHA256SUM}``, ``${PKG_URL}``, and ``${PKG_VERSION}``, and/or ``${PKG_URLS_GIT}``,
Lucio Andrés Illanes Albornoz 531158
which are specified in this order.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
Pick a build group according to the criteria mentioned, add the package to the
Lucio Andrés Illanes Albornoz 531158
build group's list of contained packages in its corresponding file, and add the
Lucio Andrés Illanes Albornoz 531158
set of package variables required (see above and section [4.5](#45-package-variables).)  
Lucio Andrés Illanes Albornoz 531158
Consult section [3.7](#37-patches-and-vars-files) if the package to be added
Lucio Andrés Illanes Albornoz 531158
requires patches or additional code amending or replacing package build steps
Lucio Andrés Illanes Albornoz 531158
or the entire package build. Consult section [4.1](#41-build-steps) for a list
Lucio Andrés Illanes Albornoz 531158
of package build steps and how they are overriden.
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 3.3. Addressing build failure"
Lucio Andrés Illanes Albornoz 531158
## 3.3. Addressing build failure
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
During package build, standard error and output are redirected into a log file beneath
Lucio Andrés Illanes Albornoz 531158
``${BUILD_WORKDIR}`` named ``${PKG_NAME}_stderrout.log``, following a package variable
Lucio Andrés Illanes Albornoz c6f88c
dump. If ``-V build`` was specified, package logs will additionally be printed to standard
Lucio Andrés Illanes Albornoz c6f88c
output. If ``-V xtrace`` was specified, ``xtrace`` will be set during package builds for
Lucio Andrés Illanes Albornoz 531158
rudimentary debugging purposes. Additionally, packages using GNU autotools will, if
Lucio Andrés Illanes Albornoz 531158
package configuration failed or appears relevant, log the configuration process in detail
Lucio Andrés Illanes Albornoz 531158
in, most usually, ``${PKG_BUILD_DIR}/config.log``.  
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
If ``--dump-on-abort`` was specified, a subset of the variables set and environment
Lucio Andrés Illanes Albornoz 531158
variables exported will be written to ``${BUILD_WORKDIR}/${PKG_NAME}.dump``, which may
Lucio Andrés Illanes Albornoz 531158
subsequently be used in order to obtain a package build shell environment with the
Lucio Andrés Illanes Albornoz 531158
``pkgtool.sh`` script (see sections [4.6](#46-pkgtoolsh), [3.5](#35--s-package-build-shell-environment).)
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 3.4. Package archive files and Git repositories"
Lucio Andrés Illanes Albornoz 531158
### 3.4. Package archive files and Git repositories
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
Packages may have either or both of a SHA-256 message digest checked and to be extracted tarball
Lucio Andrés Illanes Albornoz 531158
(set in ``${PKG_URL}``, ``${PKG_FNAME}``, and ``${PKG_SHA256SUM}``) and/or Git repository or set
Lucio Andrés Illanes Albornoz 531158
thereof (set in ``${PKG_URLS_GIT}``.) Complementing these, an implicitly inferred or, in the
Lucio Andrés Illanes Albornoz 531158
presence of both, explicit primary source directory is specified for each package in ``${PKG_SUBDIR}``.
Lucio Andrés Illanes Albornoz 531158
Furthermore, these may be subject to download caching and/or setting up as well as maintaining
Lucio Andrés Illanes Albornoz 531158
mirrors, including automatic cleanup as well as deduplication in both cases.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
A list of pertinent package variables and their formats follows:  
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
| Name           | Format                                          |
Lucio Andrés Illanes Albornoz 531158
| -------------- | ----------------------------------------------- |
Lucio Andrés Illanes Albornoz 531158
| PKG_FNAME      | ``<single file name>``                          |
Lucio Andrés Illanes Albornoz 531158
| PKG_SHA256SUM  | ``<SHA-256 message digest>``                    |
Lucio Andrés Illanes Albornoz 531158
| PKG_SUBDIR     | ``<relative or single directory name>``         |
Lucio Andrés Illanes Albornoz 531158
| PKG_URL        | ``scheme:[//authority]path[?query][#fragment]`` |
Lucio Andrés Illanes Albornoz 531158
| PKG_URLS_GIT   | ``[subdir=]URL[@branch]``                       |
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 3.5. -s: package build shell environment"
Lucio Andrés Illanes Albornoz 531158
### 3.5. -s: package build shell environment
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
When ``build.sh`` is executed with the ``--dump-on-abort`` option, a subset of the
Lucio Andrés Illanes Albornoz 531158
variables set and environment variables exported will be written to ``${BUILD_WORKDIR}/${PKG_NAME}.dump``
Lucio Andrés Illanes Albornoz 531158
on build failure, which may subsequently be used in order to obtain a package build shell
Lucio Andrés Illanes Albornoz 531158
environment with the ``pkgtool.sh`` script, e.g.:  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158
midipix_build@sandbox:(src/midipix_build)> $ ./pkgtool.sh -a nt64 -b debug -s mc
Lucio Andrés Illanes Albornoz 531158
==> 2020/03/11 15:46:28 Launching shell `/usr/bin/zsh' within package environment and `/home/midipix_build/midipix/nt64/debug/tmp'.
Lucio Andrés Illanes Albornoz 531158
==> 2020/03/11 15:46:28 Run $R to rebuild `mc'.
Lucio Andrés Illanes Albornoz 531158
==> 2020/03/11 15:46:28 Run $RS <step> to restart the specified build step of `mc'
Lucio Andrés Illanes Albornoz 531158
==> 2020/03/11 15:46:28 Run $D to automatically regenerate the patch for `mc'.
Lucio Andrés Illanes Albornoz 531158
midipix_build@sandbox:(mc-native-x86_64-nt64-midipix/obj)> $
Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
If a package build shell environment is desired for a package that has either not been
Lucio Andrés Illanes Albornoz 531158
built at all or built successfully, ``pkgshell.sh`` will attempt to rebuild the package
Lucio Andrés Illanes Albornoz 531158
at build steps up until, by default, ``build``, and then forcibly abort the build and
Lucio Andrés Illanes Albornoz 531158
write ``${BUILD_WORKDIR}/${PKG_NAME}.dump`` as above prior to entering the shell.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
Consult sections [3.2](#32-adding-a-package), [3.7](#37-patches-and-vars-files), [4.2](#42-build-variables),
Lucio Andrés Illanes Albornoz 531158
[4.1](#41-build-steps), and [4.5](#45-package-variables) for further information
Lucio Andrés Illanes Albornoz 531158
concerning the package build process.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 3.6. Package-package and {package,group}-group relationships"
Lucio Andrés Illanes Albornoz 531158
### 3.6. Package-package and {package,group}-group relationships
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
Packages, as well as groups, are interrelated through implicit as well as explicit parametrised,
Lucio Andrés Illanes Albornoz 531158
typed relationships and form namespaces correspondingly.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
These primarily, by expressing modalities of constraining, derivation, and/or subdividision, govern
Lucio Andrés Illanes Albornoz 531158
the build and mirroring, etc. processes with regard to ordering constraints (e.g. ``depends``)
Lucio Andrés Illanes Albornoz 531158
and derivation or sharing of sets of variables and/or patches and/or ``vars/`` files (e.g.
Lucio Andrés Illanes Albornoz 531158
``group``, ``flavour``, ``inherit``) or build and/or source directories (e.g. ``module``,) etc.  
Lucio Andrés Illanes Albornoz 531158
They may, however, also be subject to enquiry for descriptive, diagnostic, or visualising purposes,
Lucio Andrés Illanes Albornoz 531158
particularly as concerns the namespaces they form.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
A list of relationship types follows:  
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
| Type     | Mode     | Description                                                                                                                            |
Lucio Andrés Illanes Albornoz 531158
| -------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------- |
Lucio Andrés Illanes Albornoz 531158
| depends  | implicit | Direct and recursively evaluated package dependency                                                                                    |
Lucio Andrés Illanes Albornoz 531158
| suggests | explicit | Suggested or recommended optional package                                                                                              |
Lucio Andrés Illanes Albornoz 531158
| group    | implicit | Simple and overridable group variable inheritance (e.g. ``host_toolchain``, ``native_packages``)                                       |
Lucio Andrés Illanes Albornoz 531158
| inherit  | both     | Simple and overridable package variable inheritance                                                                                    |
Lucio Andrés Illanes Albornoz 531158
| flavour  | explicit | Exclusive package flavours set membership (e.g. ``vim_gtk``, ``vim_x11``) (conflicts w/ ``module``)                                    |
Lucio Andrés Illanes Albornoz 531158
| module   | explicit | Package modularisation with implicit source and build directory sharing (e.g. ``gcc_stage1``, ``gcc_full``) (conflicts w/ ``flavour``) |
Lucio Andrés Illanes Albornoz 531158
| target   | both     | Simple super- or subset derivation (e.g. ``host``, ``minipix``)                                                                        |
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 3.7. Patches and ``vars`` files"
Lucio Andrés Illanes Albornoz 531158
## 3.7. Patches and ``vars`` files
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
Package patches are applied prior and/or subsequent to (GNU autotools or similar) package
Lucio Andrés Illanes Albornoz 531158
configuration during the ``configure_patch_pre`` and/or ``configure_patch`` build steps,
Lucio Andrés Illanes Albornoz 531158
respectively (see section [4.1](#41-build-steps).) Patch files are searched for beneath
Lucio Andrés Illanes Albornoz 531158
``patches/`` with the following globs and in-order:
Lucio Andrés Illanes Albornoz 531158
* ``${PKG_NAME}-${PKG_VERSION}_pre.local.patch``
Lucio Andrés Illanes Albornoz 531158
  or ``${PKG_NAME}_pre.local.patch`` (for packages lacking ``${PKG_VERSION}``)
Lucio Andrés Illanes Albornoz 531158
* ``${PKG_NAME}-${PKG_VERSION}_pre.local@${BUILD_HNAME}.patch``
Lucio Andrés Illanes Albornoz 531158
  or ``${PKG_NAME}_pre.local@${BUILD_HNAME}.patch`` (for packages lacking ``${PKG_VERSION}``)
Lucio Andrés Illanes Albornoz 531158
* ``${PKG_NAME}/*.patch``
Lucio Andrés Illanes Albornoz 531158
* ``${PKG_NAME}-${PKG_VERSION}.local.patch``
Lucio Andrés Illanes Albornoz 531158
  or ``${PKG_NAME}.local.patch`` (for packages lacking ``${PKG_VERSION}``)
Lucio Andrés Illanes Albornoz 531158
* ``${PKG_NAME}-${PKG_VERSION}.local@${BUILD_HNAME}.patch``
Lucio Andrés Illanes Albornoz 531158
  or ``${PKG_NAME}.local@${BUILD_HNAME}.patch`` (for packages lacking ``${PKG_VERSION}``)
Lucio Andrés Illanes Albornoz 531158
* ``${PKG_PATCHES_EXTRA}`` (if set)
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
If the default set of package build steps does not suffice, such as if additional commands
Lucio Andrés Illanes Albornoz 531158
must be executed after package configuration or prior to building, or if an entire or all
Lucio Andrés Illanes Albornoz 531158
build step must be replaced, overrides may be specified in the form of functions in the
Lucio Andrés Illanes Albornoz 531158
package's ``vars/${PKG_NAME}.vars`` ``vars`` file. Consult section [4.1](#41-build-steps)
Lucio Andrés Illanes Albornoz 531158
for a list of package build steps and how they are overriden.
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 4. Units reference"
Lucio Andrés Illanes Albornoz 531158
## 4. Units reference
Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 4.1. Build steps"
Lucio Andrés Illanes Albornoz 531158
## 4.1. Build steps
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
Package builds are divided up into consecutively executed build steps until
Lucio Andrés Illanes Albornoz 531158
completion or aborted on failure unless relaxed mode is enabled by passing
Lucio Andrés Illanes Albornoz 531158
``-R``.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
Each build step corresponds to a function in the corresponding ``subr/pkg_*.subr``
Lucio Andrés Illanes Albornoz 531158
script and may be overriden entirely by a function named ``pkg_<package name>_<build step>()``
Lucio Andrés Illanes Albornoz 531158
or composed in terms of prior and/or subsequent execution by a function named
Lucio Andrés Illanes Albornoz 531158
``pkg_<package name>_<build step>_pre()`` and/or ``pkg_<package name>_<build step>_post()``,
Lucio Andrés Illanes Albornoz 531158
respectively, in the package's ``vars`` file. If a function named ``pkg_<package name>_all()``
Lucio Andrés Illanes Albornoz 531158
exists, it will override all build steps.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
Build step status is tracked on a per-package basis by state files beneath
Lucio Andrés Illanes Albornoz 531158
``${BUILD_WORKDIR}`` following the format ``.<package name>.<build step>``;
Lucio Andrés Illanes Albornoz 531158
package build completion corresponds to the pseudo-build step ``finish``.
Lucio Andrés Illanes Albornoz 531158

8e9332
| Name                | Description                                                                                                                                                                                                                                              |
8e9332
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
8e9332
| fetch_clean         | Delete and create ``${PKG_SUBDIR}''                                                                                                                                                                                                                      |
8e9332
| fetch_download      | Download package archive & verify w/ SHA-256 message digest and/or clone Git repository/ies                                                                                                                                                              |
8e9332
| fetch_extract       | Extract package archive, if any                                                                                                                                                                                                                          |
8e9332
| configure_clean     | Delete and create ``${PKG_BUILD_DIR}''                                                                                                                                                                                                                   |
8e9332
| configure_patch_pre | Apply ``chainport`` patches and/or patches beneath ``patches/`` prior to (GNU autotools or similar) configuration                                                                                                                                        |
8e9332
| configure_autotools | Bootstrap (GNU autools or similar) environment, and install ``config.sub`` and ``config.cache``                                                                                                                                                          |
8e9332
| configure_patch     | Apply patches beneath ``patches/`` and/or set in ``${PKG_PATCHES_EXTRA}`` after (GNU autotools or similar) configuration                                                                                                                                 |
8e9332
| configure           | Perform package (GNU autools or similar or CMake) configuration w/ configuration-time set of environment variables                                                                                                                                       |
8e9332
| build_clean         | Clean ``${PKG_BUILD_DIR}'' w/ ``make clean'' invocation                                                                                                                                                                                                  |
8e9332
| build               | Call ``make(1)`` w/ build-time set of make variables                                                                                                                                                                                                     |
8e9332
| install_clean       | Delete and create ``${PKG_DESTDIR}''                                                                                                                                                                                                                     |
8e9332
| install_subdirs     | Create default directory hierarchy in ``${PKG_DESTDIR}``, optionally amended w/ ``${PKG_INSTALL_FILES_DESTDIR_EXTRA}``                                                                                                                                   |
8e9332
| install_make        | Call ``make(1)`` w/ ``${PKG_INSTALL_TARGET}`` (defaults to ``install``) and installation-time set of make variables                                                                                                                                      |
8e9332
| install_files       | Install ``${PKG_INSTALL_FILES}`` and/or ``${PKG_INSTALL_FILES_V2}``, fix directory and file mode bits within ``${PKG_DESTDIR}`` and optionally ``${PKG_DESTDIR_HOST}``, ``pkgconf(1)`` package files, and/or stripped binaries within ``${PKG_DESTDIR}`` |
8e9332
| install_libs        | Purge libtool ``.la`` files and install shared objects within ``${PKG_DESTDIR}`` w/ ``perk`` and corresponding symbolic links                                                                                                                            |
8e9332
| install             | Install into ``${PKG_PREFIX}``, and optionally ``${PKG_DESTDIR_HOST}`` into ``${PREFIX}``, under mutex, and add package to ``${PREFIX}/pkglist.${PKG_BUILD_TYPE}`` (unless inhibited)                                                                    |
8e9332
| install_rpm         | Build package RPM w/ auto-generated specifiation file based on ``etc/package.spec`` beneath ``${PREFIX_RPM}``                                                                                                                                            |
8e9332
| clean               | Clean ``${PKG_BUILD_DIR}`` and/or ``${PKG_DESTDIR}`` and/or ``${PKG_DESTDIR_HOST}`` and/or ``${PKG_BASE_DIR}/${PKG_SUBDIR}`` as per ``-C build,dest,src``, resp., if any                                                                                 |
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 4.2. Build variables"
Lucio Andrés Illanes Albornoz 531158
## 4.2. Build variables
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
The following variables are primarily defined in ``midipix.env`` and may be
Lucio Andrés Illanes Albornoz 531158
overriden on a per-build basis on the command-line, the environment, and/or
Lucio Andrés Illanes Albornoz 531158
``${HOME}/midipix_build.vars``, ``${HOME}/.midipix_build.vars``, and/or
Lucio Andrés Illanes Albornoz 531158
``../midipix_build.vars``, e.g.:
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
```shell
Lucio Andrés Illanes Albornoz 531158
./build.sh -a nt64 -b release -D minipix,zipdist -P -v PREFIX_ROOT="${HOME}/midipix_tmp"
Lucio Andrés Illanes Albornoz 531158
env ARCH=nt64 BUILD_KIND=release PREFIX_ROOT="${HOME}/midipix_tmp" ./build.sh -D minipix,zipdist -P -v
Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
| Variable name    | Default value                        | Description                                                                   |
Lucio Andrés Illanes Albornoz 531158
| ---------------- | ------------------------------------ | ----------------------------------------------------------------------------- |
Lucio Andrés Illanes Albornoz 531158
| ARCH             | nt64                                 | Target 32-bit (nt32) or 64-bit (nt64) architecture                            |
Lucio Andrés Illanes Albornoz 531158
| BUILD_DLCACHEDIR | ${PREFIX_ROOT}/dlcache               | Absolute pathname to package downloads cache root directory                   |
Lucio Andrés Illanes Albornoz 531158
| BUILD_HNAME      | $(hostname)                          | Build system hostname                                                         |
Lucio Andrés Illanes Albornoz 531158
| BUILD_KIND       | debug                                | Build w/ debugging (debug) or release compiler flags                          |
Lucio Andrés Illanes Albornoz 531158
| BUILD_WORKDIR    | ${PREFIX}/tmp                        | Absolute pathname to temporary package build root directory                   |
Lucio Andrés Illanes Albornoz 531158
| PREFIX           | ${PREFIX_ROOT}/${ARCH}/${BUILD_KIND} | Absolute pathname to architecture- & build type-specific build root directory |
Lucio Andrés Illanes Albornoz 531158
| PREFIX_CROSS     | ${PREFIX}/${DEFAULT_TARGET}          | Absolute pathname to toolchain root directory                                 |
Lucio Andrés Illanes Albornoz 531158
| PREFIX_MINGW32   | ${PREFIX}/x86_64-w64-mingw32         | Absolute pathname to MinGW toolchain root directory                           |
Lucio Andrés Illanes Albornoz 531158
| PREFIX_MINIPIX   | ${PREFIX}/minipix                    | Absolute pathname to minipix distribution root directory                      |
Lucio Andrés Illanes Albornoz 531158
| PREFIX_NATIVE    | ${PREFIX}/native                     | Absolute pathname to cross-compiled packages root directory                   |
Lucio Andrés Illanes Albornoz 531158
| PREFIX_ROOT      | ${HOME}/midipix                      | Absolute pathname to top-level directory                                      |
Lucio Andrés Illanes Albornoz 531158
| PREFIX_RPM       | ${PREFIX}/rpm                        | Absolute pathname to package RPM archive root directory                       |
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 4.3. Fault-tolerant & highly optimised 3D laser show-equipped usage screen"
Lucio Andrés Illanes Albornoz 531158
## 4.3. Fault-tolerant & highly optimised 3D laser show-equipped usage screen
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158
usage: ./build.sh [-a nt32|nt64]  [-b debug|release]    [-C dir[,..]]  [-D kind[,..]]
Lucio Andrés Illanes Albornoz 30cdf7
                  [-F ipv4|ipv6|offline]    [-h|--help] [-p jobs|-P]    [-r ALL|LAST]
Lucio Andrés Illanes Albornoz 1f7547
                  [-r [*[*[*]]]name[,..][:ALL|LAST|[^|<|<=|>|>=]step,..]]        [-R]
Lucio Andrés Illanes Albornoz b1d432
		  [-v] [-V [+]tag|pat[,..]]
Lucio Andrés Illanes Albornoz 1f7547

Lucio Andrés Illanes Albornoz 531158
                  [--as-needed]  [--debug-minipix] [--dump-on-abort]  [--reset-state]
Lucio Andrés Illanes Albornoz 531158
                  [--roar]      [[=]<group>|<variable name>=<variable override>[ ..]]
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz b1d432
        -a nt32|nt64        Selects 32-bit or 64-bit architecture; defaults to nt64.
Lucio Andrés Illanes Albornoz b1d432
        -b debug|release    Selects debug or release build kind; defaults to debug.
Lucio Andrés Illanes Albornoz b1d432
        -C dir[,..]         Clean build directory (build,) ${PREFIX} before processing build
Lucio Andrés Illanes Albornoz b1d432
                            scripts (prefix,) source directory (src,) and/or destination
Lucio Andrés Illanes Albornoz b1d432
                            directory (dest) after successful package builds.
Lucio Andrés Illanes Albornoz b1d432
        -D kind[,..]        Produce minimal midipix distribution directory (minipix,) RPM
Lucio Andrés Illanes Albornoz b1d432
                            binary packages (rpm,) and/or deployable distribution ZIP
Lucio Andrés Illanes Albornoz b1d432
                            archive (zipdist.) zipdist implies minipix.
Lucio Andrés Illanes Albornoz 531158
        -F ipv4|ipv6|offline
Lucio Andrés Illanes Albornoz b1d432
                            Force IPv4 (ipv4) or IPv6 (ipv6) when downloading package
Lucio Andrés Illanes Albornoz b1d432
                            archives and/or Git repositories or don't download either at all
Lucio Andrés Illanes Albornoz b1d432
                            (offline.)
Lucio Andrés Illanes Albornoz b1d432
        -h|--help           Show short/full help screen, respectively.
Lucio Andrés Illanes Albornoz b1d432
        -p jobs|-P          Enables parallelisation at group-level, whenever applicable.
Lucio Andrés Illanes Albornoz b1d432
                            The maximum count of jobs defaults to the number of logical
Lucio Andrés Illanes Albornoz b1d432
                            processors on the host system divided by two (2.)
Lucio Andrés Illanes Albornoz b1d432

Lucio Andrés Illanes Albornoz b1d432
                            If -R is not specified and at least one (1) package fails to
Lucio Andrés Illanes Albornoz b1d432
                            build, all remaining package builds will be forcibly aborted.
Lucio Andrés Illanes Albornoz b1d432

Lucio Andrés Illanes Albornoz b1d432
        -r ALL|LAST         Restart all packages or the last failed package and resume
Lucio Andrés Illanes Albornoz b1d432
                            build, resp.
Lucio Andrés Illanes Albornoz 531158
        -r [*[*[*]]]name[,..][:ALL|LAST|[^|<|<=|>|>=]step,..]
Lucio Andrés Illanes Albornoz b1d432
                            Restart the specified comma-separated package(s) w/ inhibition
Lucio Andrés Illanes Albornoz b1d432
                            of package build step state resetting completely (`ALL',) starting
Lucio Andrés Illanes Albornoz b1d432
                            at the resp. last successfully executed build steps (`LAST',) or the
Lucio Andrés Illanes Albornoz b1d432
                            specified comma-separated list of build steps, optionally subject
Lucio Andrés Illanes Albornoz b1d432
                            concerning package name(s) and/or build step(s) to the below modifiers:
Lucio Andrés Illanes Albornoz b1d432

Lucio Andrés Illanes Albornoz b1d432
                            Prepend name w/ `*' to automatically include dependencies, `**'
Lucio Andrés Illanes Albornoz b1d432
                            to forcibly rebuild all dependencies, and `***' to forcibly
Lucio Andrés Illanes Albornoz b1d432
                            rebuild all packages that depend on the specified package(s).
Lucio Andrés Illanes Albornoz b1d432

Lucio Andrés Illanes Albornoz b1d432
                            Prepend step w/ `^' to filter build steps with, `<' or `<='
Lucio Andrés Illanes Albornoz b1d432
                            to constrain build steps to below or below or equal with, resp.,
Lucio Andrés Illanes Albornoz b1d432
                            `>' or `>=' to constrain build steps to above or above or equal
Lucio Andrés Illanes Albornoz b1d432
                            with, resp.
Lucio Andrés Illanes Albornoz b1d432

Lucio Andrés Illanes Albornoz b1d432
                            Currently defined build steps are:
Lucio Andrés Illanes Albornoz b1d432
                            fetch_clean, fetch_download, fetch_extract, configure_clean,
Lucio Andrés Illanes Albornoz b1d432
                            configure_patch_pre, configure_autotools, configure_patch,
Lucio Andrés Illanes Albornoz b1d432
                            configure, build_clean, build, install_clean, install_subdirs,
Lucio Andrés Illanes Albornoz b1d432
                            install_make, install_files, install_libs, install, install_rpm,
Lucio Andrés Illanes Albornoz b1d432
                            and clean.
Lucio Andrés Illanes Albornoz b1d432

Lucio Andrés Illanes Albornoz b1d432
                            Additionally, the following virtual steps are provided:
Lucio Andrés Illanes Albornoz b1d432
                            @fetch, @configure, @build, @install, @clean, and finish.
Lucio Andrés Illanes Albornoz b1d432

Lucio Andrés Illanes Albornoz b1d432
        -R                  Ignore build failures, skip printing package logs, and continue
Lucio Andrés Illanes Albornoz b1d432
                            building (relaxed mode.)
Lucio Andrés Illanes Albornoz b1d432

Lucio Andrés Illanes Albornoz b1d432
        -v                  Increase logging verbosity.
Lucio Andrés Illanes Albornoz b1d432
        -V [+]tag|pat[,..]  Enable logging for messages with tag or pattern matching tags of:
Lucio Andrés Illanes Albornoz b1d432
                            + (prefix)..: initialise tags with normal verbosity (implies normal) (see etc/build.theme,)
Lucio Andrés Illanes Albornoz b1d432
                            all.........: log everything (see etc/build.theme,)
Lucio Andrés Illanes Albornoz b1d432
                            clear|none..: log nothing,
Lucio Andrés Illanes Albornoz b1d432
                            normal......: log at normal verbosity (see etc/build.theme,)
Lucio Andrés Illanes Albornoz b1d432
                            verbose.....: log at increased verbosity (implies normal) (see etc/build.theme) (-v,)
Lucio Andrés Illanes Albornoz b1d432

Lucio Andrés Illanes Albornoz b1d432
                            build.......: log package build logs,
Lucio Andrés Illanes Albornoz b1d432
                            fileops.....: log RTL file operations,
Lucio Andrés Illanes Albornoz b1d432
                            install.....: log RTL installation DSL operations,
Lucio Andrés Illanes Albornoz b1d432
                            zipdist.....: log deployable distribution ZIP archive operations,
Lucio Andrés Illanes Albornoz b1d432
                            xtrace......: set xtrace during package builds,
Lucio Andrés Illanes Albornoz b1d432

Lucio Andrés Illanes Albornoz b1d432
                            fatal.......: fatal, unrecoverable errors,
Lucio Andrés Illanes Albornoz b1d432
                            info........: informational messages,
Lucio Andrés Illanes Albornoz b1d432
                            verbose.....: verbose informational messages,
Lucio Andrés Illanes Albornoz b1d432
                            warning.....: warning messages possibly relating to imminent fatal, unrecoverable errors,
Lucio Andrés Illanes Albornoz b1d432

Lucio Andrés Illanes Albornoz b1d432
                            build_*.....: general build messages (viz.: begin, finish, finish_time, vars,)
Lucio Andrés Illanes Albornoz b1d432
                            group_*.....: build group messages (viz.: begin, finish,)
Lucio Andrés Illanes Albornoz b1d432
                            pkg_*.......: package build messages (viz.: begin, faildump, finish, msg, skip, step, strip.)
Lucio Andrés Illanes Albornoz b1d432

Lucio Andrés Illanes Albornoz b1d432
        --as-needed         Don't build unless the midipix_build repository has received
Lucio Andrés Illanes Albornoz b1d432
                            new commits.
Lucio Andrés Illanes Albornoz b1d432
        --debug-minipix     Don't strip(1) minipix binaries to facilitate debugging minipix.
Lucio Andrés Illanes Albornoz b1d432
        --dump-on-abort     Produce package environment dump files on build failure to be
Lucio Andrés Illanes Albornoz b1d432
                            used in conjuction with pkg_shell.sh script (excludes -R.)
Lucio Andrés Illanes Albornoz b1d432
        --reset-state       Reset package build step state on exit.
Lucio Andrés Illanes Albornoz b1d432

Lucio Andrés Illanes Albornoz b1d432
        <group>[ ..]        One of: dev_packages, dist, host_deps, host_deps_rpm,
Lucio Andrés Illanes Albornoz b1d432
                            host_toolchain, host_tools, minipix, native_packages,
Lucio Andrés Illanes Albornoz b1d432
                            native_runtime, native_toolchain, native_tools.
Lucio Andrés Illanes Albornoz b1d432

Lucio Andrés Illanes Albornoz b1d432
                            Prepend w/ `=' to inhibit group-group dependency expansion.
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
        <variable name>=<variable override>[ ..]
Lucio Andrés Illanes Albornoz b1d432
                            Override build or package variable.
Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 4.4. File installation DSL"
Lucio Andrés Illanes Albornoz 531158
## 4.4. File installation DSL
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
File and directory installation, comprising e.g. copying, moving, creating
Lucio Andrés Illanes Albornoz 531158
symbolic links, setting owner and/or permission metadata, are expressed in
Lucio Andrés Illanes Albornoz 531158
a descriptive domain-specific language and integrated with package building
8e9332
via the package variable ``${PKG_INSTALL_FILES_V2}``, applying during
8e9332
``install_files`` after the ``install_make`` build step, and ``${PKG_INSTALL_FILES_DESTDIR}``
8e9332
and ``${PKG_INSTALL_FILES_DESTDIR_EXTRA}`` during ``install_subdirs``. The
8e9332
``${PKG_INSTALL_FILES_V2}`` must adhere to the following syntax specified in EBNF:  
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158
(*
Lucio Andrés Illanes Albornoz 531158
SH_GLOB_PATTERN      = any valid portable shell pattern (see sh(1)); superset of PATHNAME
Lucio Andrés Illanes Albornoz 531158
SH_SUBSTRING_PATTERN = any valid portable substring processing shell pattern (see sh(1));
Lucio Andrés Illanes Albornoz 531158
                       superset of PATHNAME
Lucio Andrés Illanes Albornoz 531158
PARAMETER            = any valid portable shell variable name except that [0-9] may occur
Lucio Andrés Illanes Albornoz 531158
                       the beginning
Lucio Andrés Illanes Albornoz 531158
PATHNAME             = any valid filename, directory name, relative or absolute pathname
Lucio Andrés Illanes Albornoz 531158
                       excluding the characters NUL and NL
Lucio Andrés Illanes Albornoz 531158
 *)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
spec                 = { op_flag, } op_unary, "=", op_spec, "\n", { spec } ;
Lucio Andrés Illanes Albornoz 531158
                     | { op_flag, } op_binary, op_spec, "=" op_spec, "\n", { spec } ;
Lucio Andrés Illanes Albornoz 531158
                     | "#" COMMENT ;
Lucio Andrés Illanes Albornoz 531158
op_unary             = "-" | "/" | "t" ;
Lucio Andrés Illanes Albornoz 531158
op_binary            = ":" | "!" | "@" | "+" | "g" | "m" | "o" | "T" ;
Lucio Andrés Illanes Albornoz 531158
op_flag              = "?" ;
Lucio Andrés Illanes Albornoz 531158
op_spec              = pattern_spec | PATHNAME | expr_spec | op_spec ;
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
pattern_spec         = "%<", SH_GLOB_PATTERN, ">" ;
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
expr_spec            = "%[", expr, { sexpr_spec }, "%]" ;
Lucio Andrés Illanes Albornoz 531158
expr                 = [ "@" ], "0" .. "9" | "DNAME" | "FNAME" | "ITEM" | PARAMETER ;
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
sexpr_spec           = sexpr_op_unary, SH_SUBSTRING_PATTERN, { sexpr } ;
Lucio Andrés Illanes Albornoz 531158
sexpr_op_unary       = "##" | "#" | "%%" | "%" ;
Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
Single ``"="`` characters in ``spec``, the ``"%<"`` and ``"%["`` character
Lucio Andrés Illanes Albornoz 531158
sequences in ``pattern_spec`` and ``expr_spec``, resp., and the ``sexpr_op_unary``
Lucio Andrés Illanes Albornoz 531158
as well as ``sexpr_op_binary`` characters or character sequences may be
Lucio Andrés Illanes Albornoz 531158
escaped with a single backslash (``"\"``.) ``SH_SUBSTRING_PATTERN`` differs
Lucio Andrés Illanes Albornoz 531158
from ``SH_GLOB_PATTERN`` solely in that any of ``sexpr_op_unary`` and
Lucio Andrés Illanes Albornoz 531158
``sexpr_op_binary`` occuring at the beginning of or in the former must
Lucio Andrés Illanes Albornoz 531158
be escaped with a single backslash (``"\"``,) e.g. ``"#\#pattern"`` and
Lucio Andrés Illanes Albornoz 531158
``"%\%pattern"``, etc. and ``"#pat\%ern"`` and ``%patt\#ern", etc., resp.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
Named parameters (``PARAMETER``) are supplied via the ``-p name=value``
Lucio Andrés Illanes Albornoz 531158
argument to ``rtl_install()``, whereas numbered parameters are for
Lucio Andrés Illanes Albornoz 531158
internal usage only; the ``"DNAME"``, ``"FNAME"``, and ``"ITEM"`` parameters
Lucio Andrés Illanes Albornoz 531158
lazily evaluate to the directory name, file (aka base) name, and full
Lucio Andrés Illanes Albornoz 531158
pathname of the current item being processed relative to a specification
Lucio Andrés Illanes Albornoz 531158
with a pattern in it.
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
The following parameters are defined by default during ``install_files``:
7a0b92

Lucio Andrés Illanes Albornoz 531158
| Name           | Value                                  |
Lucio Andrés Illanes Albornoz 531158
| -------------  | -------------------------------------- |
Lucio Andrés Illanes Albornoz 531158
| _builddir      | ${PKG_BUILD_DIR}                       |
Lucio Andrés Illanes Albornoz 531158
| _destdir       | ${PKG_BASE_DIR}/${PKG_DESTDIR}         |
Lucio Andrés Illanes Albornoz 531158
| _destdir_host  | ${PKG_BASE_DIR}/${PKG_DESTDIR_HOST}    |
Lucio Andrés Illanes Albornoz 531158
| _files         | ${MIDIPIX_BUILD_PWD}/files/${PKG_NAME} |
Lucio Andrés Illanes Albornoz 531158
| _name          | ${PKG_NAME}                            |
Lucio Andrés Illanes Albornoz 531158
| _prefix        | ${PKG_PREFIX}                          |
Lucio Andrés Illanes Albornoz 531158
| _prefix_host   | ${PREFIX}                              |
Lucio Andrés Illanes Albornoz 531158
| _prefix_native | ${PREFIX_NATIVE}                       |
Lucio Andrés Illanes Albornoz 531158
| _subdir        | ${PKG_BASE_DIR}/${PKG_SUBDIR}          |
Lucio Andrés Illanes Albornoz 531158
| _target        | ${PKG_TARGET}                          |
Lucio Andrés Illanes Albornoz 531158
| _version       | ${PKG_VERSION:-}                       |
Lucio Andrés Illanes Albornoz 531158
| _workdir       | ${BUILD_WORKDIR}                       |
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
The following operation flags are defined:
7a0b92

Lucio Andrés Illanes Albornoz 531158
| Flag      | Description              |
Lucio Andrés Illanes Albornoz 531158
| --------- | ------------------------ |
Lucio Andrés Illanes Albornoz 531158
| ``?``     | Continue on soft failure |
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
The following operations are defined:
7a0b92

Lucio Andrés Illanes Albornoz 531158
| Operation      | Arity  | Description                                                      |
Lucio Andrés Illanes Albornoz 531158
| -------------- | ------ | ---------------------------------------------------------------- |
Lucio Andrés Illanes Albornoz 531158
| ``-``          | Unary  | Remove directories and/or files                                  |
Lucio Andrés Illanes Albornoz 531158
| ``/``          | Unary  | Create directories or trees thereof                              |
Lucio Andrés Illanes Albornoz 531158
| ``t``          | Unary  | touch(1) files and/or directories                                |
Lucio Andrés Illanes Albornoz 95707c
| ``:``          | Binary | Copy directories and/or files                                    |
Lucio Andrés Illanes Albornoz 531158
| ``!``          | Binary | Move/rename directories and/or files                             |
Lucio Andrés Illanes Albornoz 531158
| ``@``          | Binary | Create/update symbolic links                                     |
Lucio Andrés Illanes Albornoz 531158
| ``+``          | Binary | Copy directories and/or files if newer and follow symbolic links |
Lucio Andrés Illanes Albornoz 531158
| ``g``          | Binary | Set group owner of files and/or directories                      |
Lucio Andrés Illanes Albornoz 531158
| ``m``          | Binary | Set mode bits of files and/or directories                        |
Lucio Andrés Illanes Albornoz 531158
| ``o``          | Binary | Set user and/or group owner of files and/or directories          |
Lucio Andrés Illanes Albornoz 531158
| ``T``          | Binary | touch(1) files and/or directories with timestamp                 |
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
The following expression modifiers are defined:
7a0b92

Lucio Andrés Illanes Albornoz 531158
| Modifier       | Description                               |
Lucio Andrés Illanes Albornoz 531158
| -------------- | ----------------------------------------- |
Lucio Andrés Illanes Albornoz 531158
| ``@``          | Recursively reevaluate after substituting |
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
The following subexpression operators are defined:
7a0b92

Lucio Andrés Illanes Albornoz 531158
| Operation      | Arity  | Description                                                      |
Lucio Andrés Illanes Albornoz 531158
| -------------- | ------ | ---------------------------------------------------------------- |
Lucio Andrés Illanes Albornoz 531158
| ``##``         | Unary  | Remove largest prefix from left-hand side                        |
Lucio Andrés Illanes Albornoz 531158
| ``#``          | Unary  | Remove prefix from left-hand side                                |
Lucio Andrés Illanes Albornoz 531158
| ``%%``         | Unary  | Remove largest postfix from right-hand side                      |
Lucio Andrés Illanes Albornoz 531158
| ``%``          | Unary  | Remove postfix from right-hand side                              |
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
```shell
Lucio Andrés Illanes Albornoz 531158
#
Lucio Andrés Illanes Albornoz 531158
# Examples:
Lucio Andrés Illanes Albornoz 531158
# 
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
#
Lucio Andrés Illanes Albornoz 531158
# Create directory %[_minipix]/bin and copy all files
Lucio Andrés Illanes Albornoz 531158
# in %[_minipix_dist]/bin/ to %[_minipix]/bin/ with
Lucio Andrés Illanes Albornoz 531158
# identical file names.
Lucio Andrés Illanes Albornoz 531158
/=%[_minipix]/bin
Lucio Andrés Illanes Albornoz 531158
?%[_minipix_dist]/bin/%<*>=%[_minipix]/bin/%[FNAME]
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
#
Lucio Andrés Illanes Albornoz 531158
# Rename all files in share/info/ matching *.info to
Lucio Andrés Illanes Albornoz 531158
# their filenames with the `.info' postfix removed and
Lucio Andrés Illanes Albornoz 531158
# `-2.64.info' appended and all files in share/man/man1/
Lucio Andrés Illanes Albornoz 531158
# matching *.1 with the `.1' postfix removed and -2.64.1
Lucio Andrés Illanes Albornoz 531158
# appended.
Lucio Andrés Illanes Albornoz 531158
!share/info/%<*.info>=share/info/%[FNAME%.info]-2.64.info
Lucio Andrés Illanes Albornoz 531158
!share/man/man1/%<*.1>=share/man/man1/%[FNAME%.1]-2.64.1
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
#
Lucio Andrés Illanes Albornoz 531158
# Create/update symbolic links named include/ffi.h and
Lucio Andrés Illanes Albornoz 531158
# include/ffitarget.h with ../lib/libffi-3.2.1/include/ffi.h
Lucio Andrés Illanes Albornoz 531158
# and ../lib/libffi-3.2.1/include/ffitarget.h as targets, resp.
Lucio Andrés Illanes Albornoz 531158
@../lib/libffi-3.2.1/include/ffi.h=include/ffi.h
Lucio Andrés Illanes Albornoz 531158
@../lib/libffi-3.2.1/include/ffitarget.h=include/ffitarget.h
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
#
Lucio Andrés Illanes Albornoz 531158
# Manual invocation:
8e9332
PKG_INSTALL_FILES_V2="
Lucio Andrés Illanes Albornoz 531158
        [ ... ]
Lucio Andrés Illanes Albornoz 531158
";
Lucio Andrés Illanes Albornoz 531158
rtl_install                                                     \
Lucio Andrés Illanes Albornoz 531158
                -p "_builddir=${PKG_BASE_DIR}/${PKG_BUILD_DIR}" \
Lucio Andrés Illanes Albornoz 531158
                -p "_minipix=${PREFIX_MINIPIX##*/}"             \
Lucio Andrés Illanes Albornoz 531158
                -p "_minipix_dist=${PREFIX}/minipix_dist"       \
Lucio Andrés Illanes Albornoz 531158
                -p "_native=${PREFIX_NATIVE##*/}"               \
Lucio Andrés Illanes Albornoz 531158
                -p "_subdir=${PKG_BASE_DIR}/${PKG_SUBDIR}"      \
Lucio Andrés Illanes Albornoz 531158
                -p "_target=${PKG_TARGET}"                      \
Lucio Andrés Illanes Albornoz 531158
                -n -- "${PREFIX}"                               \
8e9332
                "${PKG_INSTALL_FILES_V2}"; then
Lucio Andrés Illanes Albornoz 531158
        return 1;
Lucio Andrés Illanes Albornoz 531158
fi;
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
#
Lucio Andrés Illanes Albornoz 531158
# Usage screen:
Lucio Andrés Illanes Albornoz 531158
usage: rtl_install [-i] [-I ifs] [-n] [-p name=val] [-v] prefix spec_list
Lucio Andrés Illanes Albornoz 531158
       -i...........: continue on soft errors
Lucio Andrés Illanes Albornoz 531158
       -I ifs.......: process spec_list with ifs instead of NL
Lucio Andrés Illanes Albornoz 531158
       -n...........: perform dry run
Lucio Andrés Illanes Albornoz 531158
       -p name=val..: set named parameter
Lucio Andrés Illanes Albornoz 531158
       -v...........: increase verbosity
Lucio Andrés Illanes Albornoz 531158
       prefix.......: pathname prefix
Lucio Andrés Illanes Albornoz 531158
       spec_list....: ifs-separated list of specs
Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 4.5. Package variables"
Lucio Andrés Illanes Albornoz 531158
### 4.5. Package variables
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
The following variables are package-specific and receive their value from either
Lucio Andrés Illanes Albornoz 531158
top-level defaults defined in ``midipix.env``, build group-specific defaults from the
Lucio Andrés Illanes Albornoz 531158
build group the package pertains to and defined in its corresponding file beneath
Lucio Andrés Illanes Albornoz 531158
``groups/``, or package-specific overrides defined either in the latter and/or in its
Lucio Andrés Illanes Albornoz 531158
corresponding file beneath ``vars/``, with one of the following prefixes:
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
| Variable name prefix					|
Lucio Andrés Illanes Albornoz 531158
| ----------------------------------------------------- |
Lucio Andrés Illanes Albornoz 531158
| DEFAULT						|
Lucio Andrés Illanes Albornoz 531158
| DEFAULT_``${BUILD_TYPE}``				|
Lucio Andrés Illanes Albornoz 531158
| DEFAULT_``${GROUP_NAME}``				|
Lucio Andrés Illanes Albornoz 531158
| ``${GROUP_NAME}``					|
Lucio Andrés Illanes Albornoz 531158
| [PKG_``${RELATED_PACKAGE(S)}``]			|
Lucio Andrés Illanes Albornoz 531158
| [PKG_``${RELATED_PACKAGE(S)}``_``${BUILD_KIND}``]	|
Lucio Andrés Illanes Albornoz 531158
| PKG_``${NAME}``					|
Lucio Andrés Illanes Albornoz 531158
| PKG_``${NAME}``_``${BUILD_KIND}``			|
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
Additionally, overrides may be specified on a per-build basis on the command-
Lucio Andrés Illanes Albornoz 531158
line, with each variable prefixed w/ ``PKG_``, e.g.:
Lucio Andrés Illanes Albornoz 531158
``./build.sh [ ... ] PKG_ZSH_CC="/usr/bin/clang"``.  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
The minimum set of package variables that must be provided is ``SHA256SUM, URL,
Lucio Andrés Illanes Albornoz 531158
VERSION`` and/or ``URLS_GIT``, respectively.
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 4.5.1 Package variable types"
Lucio Andrés Illanes Albornoz 531158
## 4.5.1 Package variable types
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
| Type definition               | Description                                                                                                                                  |
Lucio Andrés Illanes Albornoz 531158
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
Lucio Andrés Illanes Albornoz 531158
| DirName(Abs)			| Absolute pathname to directory                                                                                                               |
Lucio Andrés Illanes Albornoz 531158
| DirName(Rel)			| Relative pathname to director                                                                                                                |
Lucio Andrés Illanes Albornoz 531158
| DirName(Unit)			| Single non-{absolute,relative} directory nam                                                                                                 |
Lucio Andrés Illanes Albornoz 531158
| DirName			| Absolute or relative pathname to director                                                                                                    |
Lucio Andrés Illanes Albornoz 531158
| CmdName			| Absolute or relative pathname to comman                                                                                                      |
Lucio Andrés Illanes Albornoz 531158
| FileName(Abs)			| Absolute pathname to file                                                                                                                    |
Lucio Andrés Illanes Albornoz 531158
| FileName(Rel)			| Relative pathname to file                                                                                                                    |
Lucio Andrés Illanes Albornoz 531158
| FileName(Unit)		| Single non-{absolute,relative} file name                                                                                                     |
Lucio Andrés Illanes Albornoz 531158
| FileName			| Absolute or relative pathname to file                                                                                                        |
Lucio Andrés Illanes Albornoz 531158
| Flag(<type>,<default>)	| Boolean flag of type <type>, e.g. Flag(Boolean) (``true``, ``false``,) Flag(UInt) (0, 1,) Flag(ExitStatus) (>=1, 0) with default or ``auto`` |
Lucio Andrés Illanes Albornoz 531158
| FlagLine			| String of {SP,VT}-separated flags, arguments, options, etc. pp. to a command                                                                 |
ebe6d8
| List(<sep>[,<sep\|type>..])	| \<sep\>-separated list, optionally recursively and/or sub-typing, e.g.: ``List(:,=,String)`` and ``"name=value:name2=value"``                |
Lucio Andrés Illanes Albornoz 531158
| PkgName			| Single name of package                                                                                                                       |
Lucio Andrés Illanes Albornoz 4d6e26
| PkgRelation			| Single, possibly parametrised, package-package relation; see section [3.6](#36-package-package-and-packagegroup-group-relationships)         |
Lucio Andrés Illanes Albornoz 531158
| PkgVersion			| Single version of package                                                                                                                    |
Lucio Andrés Illanes Albornoz 531158
| Set(<type>)			| Set of alternatives of <type>, e.g. one of ``cross``, ``host``, ``native``                                                                   |
Lucio Andrés Illanes Albornoz 531158
| String			| Semantically generic string                                                                                                                  |
Lucio Andrés Illanes Albornoz 531158
| URL				| URL in standard format; see section [3.4](#34-package-archive-files-and-git-repositories)                                                    |
Lucio Andrés Illanes Albornoz 531158
| URL(Git)			| Git URL in the format ``[subdir=]URL[@branch]``; see section [3.4](#34-package-archive-files-and-git-repositories)                           |
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 4.5.2 Package variables"
Lucio Andrés Illanes Albornoz 531158
## 4.5.2 Package variables
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
| Package variable name        | Type             | Description                                                                                                                                |
Lucio Andrés Illanes Albornoz 531158
| ---------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
Lucio Andrés Illanes Albornoz 531158
| AR                           | CmdName          | Toolchain library archive editor ``ar(1)``                                                                                                 |
Lucio Andrés Illanes Albornoz 4d6e26
| AUTOCONF_CONFIG_GUESS        | String           | Either of ``midipix`` (copy Midipix ``config.guess`` from ``etc/config.guess``) or ``keep``; defaults to ``midipix``                       |
Lucio Andrés Illanes Albornoz 531158
| BASE_DIR                     | DirName(Abs)     | Package build root directory beneath ``${BUILD_WORKDIR}``                                                                                  |
Lucio Andrés Illanes Albornoz 531158
| BUILD_DIR                    | DirName(Unit)    | Package build directory beneath ``${PKG_BASE_DIR}``                                                                                        |
Lucio Andrés Illanes Albornoz 531158
| BUILD_STAGES_DISABLE         | List( )          | Build stages to disable during package build                                                                                               |
Lucio Andrés Illanes Albornoz 531158
| BUILD_TYPE                   | Set(String)      | ``cross``: Cross-compiled toolchain, ``host``: host, ``native``: cross-compiled package                                                    |
Lucio Andrés Illanes Albornoz 531158
| CC                           | FileName         | Toolchain C compiler ``cc(1)``                                                                                                             |
Lucio Andrés Illanes Albornoz 4d6e26
| CFLAGS_BUILD_EXTRA           | FlagLine         | Additional C compiler flags during package ``make(1)`` build                                                                               |
Lucio Andrés Illanes Albornoz 531158
| CFLAGS_BUILD                 | FlagLine         | C compiler flags during package ``make(1)``  build                                                                                         |
Lucio Andrés Illanes Albornoz 531158
| CFLAGS_CONFIGURE_EXTRA       | FlagLine         | Additional C compiler flags during package (GNU autotools in implementation and/or interface) configuration                                |
Lucio Andrés Illanes Albornoz 531158
| CFLAGS_CONFIGURE             | FlagLine         | C compiler flags during package (GNU autotools in implementation and/or interface) configuration                                           |
Lucio Andrés Illanes Albornoz 531158
| CMAKE_ARGS_EXTRA             | FlagLine         | Additional arguments to ``cmake(1)``                                                                                                       |
Lucio Andrés Illanes Albornoz 531158
| CMAKE_ARGS                   | FlagLine         | Arguments to ``cmake(1)``                                                                                                                  |
Lucio Andrés Illanes Albornoz 531158
| CMAKE                        | CmdName          | ``cmake(1)`` executable                                                                                                                    |
Lucio Andrés Illanes Albornoz 531158
| CMAKE_LISTFILE               | FileName         | ``cmake(1)`` listfile                                                                                                                      |
Lucio Andrés Illanes Albornoz 531158
| CONFIG_CACHE_EXTRA           | List(\n)         | Additional GNU autotools configuration cache variables                                                                                     |
Lucio Andrés Illanes Albornoz 531158
| CONFIG_CACHE                 | List(\n)         | GNU autotools configuration cache variables                                                                                                |
Lucio Andrés Illanes Albornoz 531158
| CONFIG_CACHE_LOCAL           | List(\n)         | Additional GNU autotools configuration cache variables                                                                                     |
Lucio Andrés Illanes Albornoz 531158
| CONFIGURE_ARGS_EXTRA         | FlagLine         | Additional arguments to package (GNU autotools in implementation and/or interface) configuration script                                    |
Lucio Andrés Illanes Albornoz 531158
| CONFIGURE_ARGS               | FlagLine         | Arguments to package (GNU autotools in implementation and/or interface) configuration script                                               |
Lucio Andrés Illanes Albornoz 531158
| CONFIGURE                    | CmdName          | Package's (GNU autotools in implementation and/or interface) configuration script                                                          |
Lucio Andrés Illanes Albornoz 531158
| CONFIGURE_TYPE               | String           | Either of ``autotools`` (GNU autotools or similar) or ``sofort`` or ``cmake`` (CMake)                                                      |
Lucio Andrés Illanes Albornoz 531158
| CXX                          | CmdName          | Toolchain C++ compiler ``c++(1)``                                                                                                          |
Lucio Andrés Illanes Albornoz 531158
| CXXFLAGS_CONFIGURE_EXTRA     | FlagLine         | Additional C++ compiler flags during package (GNU autotools in implementation and/or interface) configuration                              |
Lucio Andrés Illanes Albornoz 531158
| CXXFLAGS_CONFIGURE           | FlagLine         | C++ compiler flags during package (GNU autotools in implementation and/or interface) configuration                                         |
Lucio Andrés Illanes Albornoz 531158
| DEPENDS                      | List( )          | Mandatory package-package dependencies                                                                                                     |
Lucio Andrés Illanes Albornoz 531158
| DESTDIR                      | DirName(Unit)    | Package installation destination directory beneath ``${PKG_BASE_DIR}``                                                                     |
Lucio Andrés Illanes Albornoz 531158
| DESTDIR_HOST                 | DirName(Unit)    | Optional host package installation destination directory beneath ``${PKG_BASE_DIR}``                                                       |
Lucio Andrés Illanes Albornoz 531158
| DISABLED                     | Flag(UInt,0)     | Disable package                                                                                                                            |
Lucio Andrés Illanes Albornoz 531158
| ENV_VARS_EXTRA               | List(:,=)        | Name-value pairs of environment variables to set during package build                                                                      |
Lucio Andrés Illanes Albornoz 531158
| FNAME                        | FileName(Unit)   | Filename of package archive file                                                                                                           |
Lucio Andrés Illanes Albornoz 531158
| FORCE_AUTORECONF             | Flag(UInt,0)     | Forcibly run ``autoreconf -fiv`` prior to package (GNU autotools in implementation and/or interface) configuration                         |
Lucio Andrés Illanes Albornoz 531158
| GITROOT                      | URL              | midipix packages Git URL prefix                                                                                                            |
Lucio Andrés Illanes Albornoz 531158
| INHERIT_FROM                 | String           | Inherit variables from named package                                                                                                       |
Lucio Andrés Illanes Albornoz 531158
| INSTALL_FILES_DESTDIR_EXTRA  | List( )          | Additional files to initialise the package installation destination directory beneath ``${PKG_BASE_DIR}`` with                             |
Lucio Andrés Illanes Albornoz 531158
| INSTALL_FILES_DESTDIR        | List( )          | Files to initialise the package installation destination directory beneath ``${PKG_BASE_DIR}`` with                                        |
Lucio Andrés Illanes Albornoz 531158
| INSTALL_FILES                | List( )          | Files to manually install into the package installation destination directory beneath ``${PKG_BASE_DIR}``                                  |
8e9332
| INSTALL_FILES_V2             | List( )          | Files to manually install into the package installation destination directory beneath ``${PKG_BASE_DIR}``                                  |
Lucio Andrés Illanes Albornoz 531158
| INSTALL_TARGET_EXTRA         | String           | Additional name of package build ``make(1)`` installation target                                                                           |
Lucio Andrés Illanes Albornoz 531158
| INSTALL_TARGET               | String           | Name of package build ``make(1)`` installation target                                                                                      |
Lucio Andrés Illanes Albornoz 531158
| IN_TREE                      | Flag(UInt,auto)  | Build package in-tree within ``${PKG_SUBDIR}``                                                                                             |
Lucio Andrés Illanes Albornoz 531158
| LDFLAGS_BUILD_EXTRA          | FlagLine         | Additional linker flags during package ``make(1)``  build                                                                                  |
Lucio Andrés Illanes Albornoz 531158
| LDFLAGS_CONFIGURE_EXTRA      | FlagLine         | Additional linker flags during package (GNU autotools in implementation and/or interface) configuration                                    |
Lucio Andrés Illanes Albornoz 531158
| LDFLAGS_CONFIGURE            | FlagLine         | Linker flags during package (GNU autotools in implementation and/or interface) configuration                                               |
Lucio Andrés Illanes Albornoz 531158
| LIBTOOL                      | CmdName          | ``libtool(1)`` implementation (defaults to ``slibtool``)                                                                                   |
Lucio Andrés Illanes Albornoz 531158
| MAKE                         | CmdLine          | Command line of ``make(1)``                                                                                                                |
Lucio Andrés Illanes Albornoz 531158
| MAKEFLAGS_BUILD_EXTRA        | FlagLine         | Additional ``make(1)`` flags during package ``make(1)``  build                                                                             |
Lucio Andrés Illanes Albornoz 531158
| MAKEFLAGS_BUILD              | FlagLine         | ``make(1)`` flags during package ``make(1)``  build                                                                                        |
Lucio Andrés Illanes Albornoz 531158
| MAKEFLAGS_INSTALL_EXTRA      | FlagLine         | ``make(1)`` flags during package ``make(1)``  installation                                                                                 |
Lucio Andrés Illanes Albornoz 531158
| MAKEFLAGS_INSTALL            | FlagLine         | ``make(1)`` flags during package ``make(1)``  installation                                                                                 |
Lucio Andrés Illanes Albornoz 531158
| MAKEFLAGS_VERBOSITY          | String           | Variable-value pair to pass to ``make(1)`` in order to force echo-back of command lines prior to execution                                 |
Lucio Andrés Illanes Albornoz 531158
| MAKE_INSTALL_VNAME           | String           | Variable name of ``make(1)`` installation destination directory variable during package ``make(1)``  installation                          |
Lucio Andrés Illanes Albornoz 531158
| MAKE_SUBDIRS                 | List( )          | ``make(1)`` subdirectories to exclusively build                                                                                            |
Lucio Andrés Illanes Albornoz 531158
| MIRRORS_GIT                  | List( )          | Package Git repository mirror base URLs to attempt cloning from; cf. ``pkgtool.sh -m <dname>``                                             |
Lucio Andrés Illanes Albornoz 531158
| MIRRORS                      | List( )          | Package archive mirror base URLs to attempt downloading from; cf. ``pkgtool.sh -m <dname>``                                                |
Lucio Andrés Illanes Albornoz 531158
| NO_CLEAN_BASE_DIR            | Flag(UInt,0)     | Inhibit cleaning of package build root directory beneath ``${BUILD_WORKDIR}``                                                              |
Lucio Andrés Illanes Albornoz 531158
| NO_CLEAN                     | Flag(UInt,0)     | Inhibit cleaning of package build directory beneath ``${PKG_BASE_DIR}`` pre-finish                                                         |
Lucio Andrés Illanes Albornoz 531158
| NO_LOG_VARS                  | Flag(UInt,0)     | Inhibit logging of build & package variables pre-package build                                                                             |
Lucio Andrés Illanes Albornoz 531158
| PATCHES_EXTRA                | List( )          | Additional patches to apply                                                                                                                |
Lucio Andrés Illanes Albornoz 531158
| PKG_CONFIG                   | CmdName          | ``pkg-config(1)`` implementation                                                                                                           |
Lucio Andrés Illanes Albornoz 531158
| PKG_CONFIG_LIBDIR            | DirName          | ``pkg-config(1)`` search directory                                                                                                         |
Lucio Andrés Illanes Albornoz 531158
| PKGLIST_DISABLE              | Flag(UInt,0)     | Inhibit inclusion into ``${PREFIX}/pkglist.${PKG_BUILD_TYPE}``                                                                             |
Lucio Andrés Illanes Albornoz 531158
| PREFIX                       | DirName(Abs)     | Top-level installation directory and package search path                                                                                   |
Lucio Andrés Illanes Albornoz 531158
| PYTHON                       | CmdName          | Python >=3.x interpreter                                                                                                                   |
Lucio Andrés Illanes Albornoz 531158
| RANLIB                       | CmdName          | Toolchain library archive index generator ``ranlib(1)``                                                                                    |
Lucio Andrés Illanes Albornoz 531158
| RELATES                      | Set(PkgRelation) | Package-package relationships                                                                                                              |
Lucio Andrés Illanes Albornoz 531158
| RPM_DISABLE                  | Flag(UInt,0)     | Inhibit creation of RPM archive                                                                                                            |
Lucio Andrés Illanes Albornoz 531158
| SHA256SUM                    | String           | SHA-256 message digest of package archive                                                                                                  |
Lucio Andrés Illanes Albornoz 531158
| SOFORT_NATIVE_CC             | FileName         | ``sofort`` variable during ``native`` build: Toolchain C compiler ``cc(1)``                                                                |
Lucio Andrés Illanes Albornoz 531158
| SOFORT_NATIVE_CFLAGS_EXTRA   | FlagLine         | ``sofort`` variable during ``native`` build: Additional C compiler flags during package (GNU autotools or similar) configuration           |
Lucio Andrés Illanes Albornoz 531158
| SOFORT_NATIVE_CFLAGS         | FlagLine         | ``sofort`` variable during ``native`` build: C compiler flags during package (GNU autotools or similar) configuration                      |
Lucio Andrés Illanes Albornoz 531158
| SOFORT_NATIVE_CXXFLAGS_EXTRA | FlagLine         | ``sofort`` variable during ``native`` build: Additional list of C++ compiler flags during package (GNU autotools or similar) configuration |
Lucio Andrés Illanes Albornoz 531158
| SOFORT_NATIVE_CXXFLAGS       | FlagLine         | ``sofort`` variable during ``native`` build: List of C++ compiler flags during package (GNU autotools or similar) configuration            |
Lucio Andrés Illanes Albornoz 531158
| SOFORT_NATIVE_CXX            | FlagLine         | ``sofort`` variable during ``native`` build: Command- or pathname of toolchain C++ compiler ``c++(1)``                                     |
Lucio Andrés Illanes Albornoz 531158
| SOFORT_NATIVE_LDFLAGS_EXTRA  | FlagLine         | ``sofort`` variable during ``native`` build: Additional linker flags during package (GNU autotools or similar) configuration               |
Lucio Andrés Illanes Albornoz 531158
| SOFORT_NATIVE_LDFLAGS        | FlagLine         | ``sofort`` variable during ``native`` build: Linker flags during package (GNU autotools or similar) configuration                          |
Lucio Andrés Illanes Albornoz 531158
| SOFORT_NATIVE_LD             | FileName         | ``sofort`` variable during ``native`` build: Command- or pathname of toolchain C compiler ``cc(1)``                                        |
Lucio Andrés Illanes Albornoz 531158
| SUBDIR                       | DirName(Rel)     | Extracted archive or git-{clone,pull}(1)'d directory                                                                                       |
Lucio Andrés Illanes Albornoz 531158
| TARGET                       | String           | Dash-separated {build,host,target} triplet                                                                                                 |
Lucio Andrés Illanes Albornoz 531158
| URL                          | List( ,URL)      | URL to package archives w/ optional alternatives; see section [3.4](#34-package-archive-files-and-git-repositories)                        |
Lucio Andrés Illanes Albornoz 531158
| URLS_GIT                     | List( ,URL(Git)) | Package Git URL(s) (format: ``[subdir=]URL[@branch]``, see section [3.4](#34-package-archive-files-and-git-repositories))                  |
Lucio Andrés Illanes Albornoz 531158
| VARS_FILE                    | FileName         | Optional package variables file (defaults to ``vars/${PKG_NAME}.vars``)                                                                    |
Lucio Andrés Illanes Albornoz 531158
| VERSION                      | PkgVersion       | Package version                                                                                                                            |
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 4.6. ``pkgtool.sh``"
Lucio Andrés Illanes Albornoz 531158
## 4.6. ``pkgtool.sh``
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158
usage: ./pkgtool.sh [-a nt32|nt64] [-b debug|release] [-i|-m <dname> -M <dname>|-r|-s|-t] [-v]
Lucio Andrés Illanes Albornoz 531158
                    [<variable name>=<variable override>[ ..]] name
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
        -a nt32|nt64          Selects 32-bit or 64-bit architecture; defaults to nt64.
Lucio Andrés Illanes Albornoz 531158
        -b debug|release      Selects debug or release build kind; defaults to debug.
Lucio Andrés Illanes Albornoz 531158
        -i                    List package variables and dependencies of single named package.
Lucio Andrés Illanes Albornoz 531158
        -m <dname>            Setup package archives mirror in <dname> and/or
Lucio Andrés Illanes Albornoz 531158
        -M <dname>            Setup Git repositories mirror in <dname>
Lucio Andrés Illanes Albornoz 531158
        -r                    List reverse dependencies of single named package.
Lucio Andrés Illanes Albornoz 531158
        -s                    Enter interactive package build shell environment for single
Lucio Andrés Illanes Albornoz 531158
                              named package; requires a package dump file. If the package
Lucio Andrés Illanes Albornoz 531158
                              has not been built yet or built successfully, it will be rebuilt
Lucio Andrés Illanes Albornoz 531158
                              at build steps up until, by default, the `build' build step and
Lucio Andrés Illanes Albornoz 531158
                              forcibly aborted and dumped prior to enterting the shell.
Lucio Andrés Illanes Albornoz 531158
        -t                    Produce tarball of package build root directory and build log
Lucio Andrés Illanes Albornoz 531158
                              file for the purpose of distribution given build failure.
Lucio Andrés Illanes Albornoz 531158
        -v                    Increase verbosity.
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
        <variable name>=<variable override>[ ..]
Lucio Andrés Illanes Albornoz 531158
                              Override build variable.
Lucio Andrés Illanes Albornoz 531158
```
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
> N.B. When using ``pkgtool.sh`` on a build w/ build variables (see section [4.2](#42-build-variables))
Lucio Andrés Illanes Albornoz 531158
overriden on the command line or via the environment, ensure that they are included in the
Lucio Andrés Illanes Albornoz 531158
``pkgtool.sh`` command line, preceding the package name, or exported, respectively.
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "{{{ 5. References"
Lucio Andrés Illanes Albornoz 531158
## 5. References
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
* ``Sun, 25 Apr 2016 09:04:08 +0000 [1]`` musl FAQ  
Lucio Andrés Illanes Albornoz 531158
* ``Wed, 04 Mar 2020 13:36:19 +0000 [2]`` midipix - what is midipix, and how is it different?  
Lucio Andrés Illanes Albornoz 531158
* ``Wed, 29 Apr 2020 23:33:34 +0100 [3]`` User Rights Assignment (Windows 10) - Windows security | Microsoft Docs  
Lucio Andrés Illanes Albornoz 531158
* ``Wed, 29 Apr 2020 23:33:50 +0100 [4]`` Windows Vista Application Development Requirements for User Account Control Compatibility | Microsoft Docs  
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[Back to top](#table-of-contents)
Lucio Andrés Illanes Albornoz 531158

Lucio Andrés Illanes Albornoz 531158
[//]: # "}}}"
Lucio Andrés Illanes Albornoz 531158
  
Lucio Andrés Illanes Albornoz 531158
[modeline]: # ( vim: set ff=dos tw=0: )