pmb.aportgen package¶
Submodules¶
pmb.aportgen.busybox_static module¶
- pmb.aportgen.busybox_static.generate(pkgname: str)¶
pmb.aportgen.core module¶
- pmb.aportgen.core.format_function(name, body, remove_indent=4)¶
Format the body of a shell function passed to rewrite() below, so it fits the format of the original APKBUILD.
- Parameters:
remove_indent – Maximum number of spaces to remove from the beginning of each line of the function body.
- pmb.aportgen.core.get_upstream_aport(pkgname: str, arch=None)¶
Perform a git checkout of Alpine’s aports and get the path to the aport.
- Parameters:
pkgname – package name
arch – Alpine architecture (e.g. “armhf”), defaults to native arch
- Returns:
absolute path on disk where the Alpine aport is checked out example: /opt/pmbootstrap_work/cache_git/aports/upstream/main/gcc
- pmb.aportgen.core.indent_size(line)¶
Number of spaces at the beginning of a string.
- pmb.aportgen.core.rewrite(pkgname, path_original='', fields={}, replace_pkgname=None, replace_functions={}, replace_simple={}, below_header='', remove_indent=4)¶
Append a header to $WORK/aportgen/APKBUILD, delete maintainer/contributor lines (so they won’t be bugged with issues regarding our generated aports), and add reference to the original aport.
- Parameters:
path_original – The original path of the automatically generated aport.
fields – key-value pairs of fields that shall be changed in the APKBUILD. For example: {“pkgdesc”: “my new package”, “subpkgs”: “”}
replace_pkgname – When set, $pkgname gets replaced with that string in every line.
replace_functions – Function names and new bodies, for example: {“build”: “return 0”} The body can also be None (deletes the function)
replace_simple – Lines that fnmatch the pattern, get replaced/deleted. Example: {”test”: “# test”, “mv test.bin”: None}
below_header – String that gets directly placed below the header.
remove_indent – Number of spaces to remove from function body provided to replace_functions.
pmb.aportgen.device module¶
- pmb.aportgen.device.ask_for_architecture()¶
- pmb.aportgen.device.ask_for_bootimg()¶
- pmb.aportgen.device.ask_for_chassis()¶
- pmb.aportgen.device.ask_for_external_storage() bool ¶
- pmb.aportgen.device.ask_for_flash_method()¶
- pmb.aportgen.device.ask_for_keyboard() bool ¶
- pmb.aportgen.device.ask_for_manufacturer()¶
- pmb.aportgen.device.ask_for_name(manufacturer)¶
- pmb.aportgen.device.ask_for_year()¶
- pmb.aportgen.device.generate(pkgname: str)¶
- pmb.aportgen.device.generate_apkbuild(pkgname: str, name: str, arch: Arch, flash_method: str)¶
- pmb.aportgen.device.generate_deviceinfo(pkgname: str, name: str, manufacturer: str, year: str, arch: Arch, chassis: str, has_keyboard: bool, has_external_storage: bool, flash_method: str, bootimg=None)¶
- pmb.aportgen.device.generate_deviceinfo_fastboot_content(bootimg=None)¶
- pmb.aportgen.device.generate_modules_initfs() None ¶
pmb.aportgen.gcc module¶
- pmb.aportgen.gcc.generate(pkgname: str)¶
pmb.aportgen.grub_efi module¶
- pmb.aportgen.grub_efi.generate(pkgname)¶
pmb.aportgen.linux module¶
- pmb.aportgen.linux.generate(pkgname: str)¶
- pmb.aportgen.linux.generate_apkbuild(pkgname: str, deviceinfo: Deviceinfo, patches: list[str])¶
pmb.aportgen.musl module¶
- pmb.aportgen.musl.generate(pkgname)¶
Module contents¶
- pmb.aportgen.generate(pkgname: str, fork_alpine: bool)¶
- pmb.aportgen.get_cross_package_arches(pkgname)¶
Get the arches for which we want to build cross packages.
- Parameters:
pkgname – package name, e.g. “gcc-aarch64”, “gcc-x86_64”
- Returns:
string of architecture(s) (space separated)
- pmb.aportgen.properties(pkgname)¶
Get the pmb.config.aportgen properties for the aport generator, based on the pkgname prefix.
Example: “musl-armhf” => (“musl”, “cross”, {“confirm_overwrite”: False})
- Parameters:
pkgname – package name
- Returns:
(prefix, folder, options)