The build scripts are used to compile and install the source. It is stored in builds/<os>-<arch>.
Note
The appropiate build script will be automatically run by upe-cli build make <manifest>, so you have to enter the name exactly:
OS | Code |
---|---|
Linux | linux |
Mac OS X | darwin [1] |
Windows [2] | win32 — standard Windows |
cygwin — if using CygWin |
Warning
If you are building for Windows, take note that:
- Most Windows doesn’t have build tools.
- Windows uses a different directory structure: C:\ instead of /.
Hint
The OS code (and arch) can be found with:
>>> # Let's assume a 64-bits Linux computer
>>> from platform import system, machine
>>> system().lower() # Will get the OS
'linux'
>>> machine() # Will get the arch
'x86_64'
These commands can be used in a script file (commands inside [] or written in italics are optional):
Create the build directory (Usually build). This is required to be run on the start of the script.
Create a directory inside the build dir:
/usr/bin/ → ./build/usr/bin/
Hint
0o000 means 000 in octal (the permissions are set in octal, not in decimal).
Note
You have to create every directory, even those that must exist (/usr, /opt...)
Copy a file from src/ to build/:
install foo /usr/bin/foo
# Copy ./src/foo to ./build/usr/bin/foo
Run a shell command. It’ll be notified to the user.
Warning
The user may choose to disable shell commands or to be asked before running.
[1] | This is based on Mac OS X’s kernel: Darwin. See issue 7850. |
[2] | Note that Windows may or may not work, we haven’t tested it yet. |