From dca8f91d26239262dc865552b4e95d0e84e83365 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Mon, 17 Oct 2022 23:33:27 +0200 Subject: 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/ --- src/makerepropkg.in | 13 +++++++------ 1 file 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 -- cgit v1.2.3-54-g00ecf