forked from Mirror/pmbootstrap
Adjust to Alpine's APKBUILD where jansson-dev and zstd-dev are only set
if $BOOTSTRAP is empty. The APKBUILD parser in pmbootstrap doesn't
recognize this, and therefore doesn't install the depends unless we
replace makedepends_host= outside of the condition.
Related: fe73f3a28c
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230522065220.2841-3-ollieparanoid@postmarketos.org%3E
28 lines
897 B
Python
28 lines
897 B
Python
# Copyright 2023 Oliver Smith
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
import pmb.aportgen.core
|
|
import pmb.helpers.git
|
|
import pmb.helpers.run
|
|
|
|
|
|
def generate(args, pkgname):
|
|
# Copy original aport
|
|
arch = pkgname.split("-")[1]
|
|
upstream = pmb.aportgen.core.get_upstream_aport(args, "binutils")
|
|
pmb.helpers.run.user(args, ["cp", "-r", upstream, args.work + "/aportgen"])
|
|
|
|
# Rewrite APKBUILD
|
|
fields = {
|
|
"arch": pmb.config.arch_native,
|
|
"makedepends_host": "zlib-dev jansson-dev zstd-dev",
|
|
"pkgdesc": f"Tools necessary to build programs for {arch} targets",
|
|
"pkgname": pkgname,
|
|
}
|
|
|
|
below_header = """
|
|
CTARGET_ARCH=""" + arch + """
|
|
CTARGET="$(arch_to_hostspec $CTARGET_ARCH)"
|
|
"""
|
|
|
|
pmb.aportgen.core.rewrite(args, pkgname, "main/binutils", fields,
|
|
"binutils", below_header=below_header)
|