diff options
author | Hugo Osvaldo Barrera <hugo@whynothugo.nl> | 2022-10-17 23:33:27 +0200 |
---|---|---|
committer | Levente Polyak <anthraxx@archlinux.org> | 2022-11-08 22:25:32 +0100 |
commit | dca8f91d26239262dc865552b4e95d0e84e83365 (patch) | |
tree | f19b25bfcb63f61126d5fcae2ad5e1f68e8cbfd7 | |
parent | b64d8ebacf8268e986bde912cff839311ac74fa8 (diff) | |
download | devtools-dca8f91d26239262dc865552b4e95d0e84e83365.tar.xz |
makerepropkg: Use $CARCH instead of hardcoded x86_64
`makerepropkg` has a hardcoded "x86_64", so fails to run on other
[unofficial] architectures, because it tries to use an x86_64-specific
makepkg config, which overrides CARCH=x86_64.
This patch addresses hardcoded half of the problem; ArchLinux derivates
still needs to ship a custom `devtools` package with their own
`makepkg-$CARCH.conf`. Usually, the only thing that really needs to be
changed in the per-architecture custom makepkg.conf is CARCH and CHOST.
See: https://lists.archlinux.org/archives/list/arch-projects@lists.archlinux.org/thread/XEEW5LXYFN3XXI5YXAUY5E4LZLMKOFTL/
-rw-r--r-- | src/makerepropkg.in | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/makerepropkg.in b/src/makerepropkg.in index b271f25..c58a923 100644 --- a/src/makerepropkg.in +++ b/src/makerepropkg.in @@ -86,13 +86,14 @@ get_pkgfile() { get_makepkg_conf() { local fname=${1} - local makepkg_conf="${2}" + local arch="${2}" + local makepkg_conf="${3}" if ! buildtool_file=$(get_pkgfile "${fname}"); then error "failed to retrieve ${fname}" return 1 fi msg2 "using makepkg.conf from ${fname}" - bsdtar xOqf "${buildtool_file/file:\/\//}" usr/share/devtools/makepkg-x86_64.conf > "${makepkg_conf}" + bsdtar xOqf "${buildtool_file/file:\/\//}" "usr/share/devtools/makepkg-${arch}.conf" > "${makepkg_conf}" return 0 } @@ -213,17 +214,17 @@ TEMPDIR=$(mktemp -d --tmpdir makerepropkg.XXXXXXXXXX) makepkg_conf="${TEMPDIR}/makepkg.conf" # anything before buildtool support is pinned to the last none buildtool aware release if [[ -z "${BUILDTOOL}" ]]; then - get_makepkg_conf "devtools-20210202-3-any" "${makepkg_conf}" || exit 1 + get_makepkg_conf "devtools-20210202-3-any" "${CARCH}" "${makepkg_conf}" || exit 1 # prefere to assume devtools up until matching makepkg version so repository packages remain reproducible elif [[ "${BUILDTOOL}" = makepkg ]] && (( $(vercmp "${BUILDTOOLVER}" 6.0.1) <= 0 )); then - get_makepkg_conf "devtools-20210202-3-any" "${makepkg_conf}" || exit 1 + get_makepkg_conf "devtools-20210202-3-any" "${CARCH}" "${makepkg_conf}" || exit 1 # all devtools builds -elif [[ "${BUILDTOOL}" = devtools ]] && get_makepkg_conf "${BUILDTOOL}-${BUILDTOOLVER}" "${makepkg_conf}"; then +elif [[ "${BUILDTOOL}" = devtools ]] && get_makepkg_conf "${BUILDTOOL}-${BUILDTOOLVER}" "${CARCH}" "${makepkg_conf}"; then true # fallback to current makepkg.conf else warning "Unknown buildtool (${BUILDTOOL}-${BUILDTOOLVER}), using fallback" - makepkg_conf=@pkgdatadir@/makepkg-x86_64.conf + makepkg_conf=@pkgdatadir@/makepkg-${CARCH}.conf fi printf '%s\n' "${allpkgfiles[@]}" | mkarchroot -M "${makepkg_conf}" -U "${archroot_args[@]}" "${namespace}/root" - || exit 1 |