• [gentoo-dev] [PATCH v2 1/2] sysroot.eclass: New eclass for using a diff

    From James Le Cuirot@21:1/5 to All on Tue May 27 13:20:02 2025
    I also intend to add another wrapper script generation function for
    running executables while changing the root directory.

    Signed-off-by: James Le Cuirot <chewi@gentoo.org>
    ---
    eclass/sysroot.eclass | 85 +++++++++++++++++++++++++++++++++++++++++++
    1 file changed, 85 insertions(+)
    create mode 100644 eclass/sysroot.eclass

    diff --git a/eclass/sysroot.eclass b/eclass/sysroot.eclass
    new file mode 100644
    index 0000000000000..14f1d251b773d
    --- /dev/null
    +++ b/eclass/sysroot.eclass
    @@ -0,0 +1,85 @@
    +# Copyright 2025 Gentoo Authors
    +# Distributed under the terms of the GNU General Public License v2
    +
    +# @ECLASS: sysroot.eclass
    +# @MAINTAINER:
    +# cross@gentoo.org
    +# @AUTHOR:
    +# James Le Cuirot <chewi@gentoo.org>
    +# @SUPPORTED_EAPIS: 7 8
    +# @BLURB: Common functions for using a different sysroot (e.g. cross-compiling)
    +
    +case ${EAPI} in
    + 7|8) ;;
    + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
    +esac
    +
    +# @FUNCTION: qemu_arch
    +# @DESCRIPTION:
    +# Return the QEMU architecture name for the given target or CHOST. This name is
    +# used in qemu-user binary filenames, e.g. qemu-ppc64le.
    +qemu_arch() {
    + local target=${1:-${CHOST}}
    + case ${target} in
    + a
  • From Roy Bamford@21:1/5 to James Le Cuirot on Tue May 27 18:40:01 2025
    On 2025.05.27 12:08, James Le Cuirot wrote:
    I also intend to add another wrapper script generation function for
    running executables while changing the root directory.

    +# Return the QEMU architecture name for the given target or CHOST.
    This name is
    +# used in qemu-user binary filenames, e.g. qemu-ppc64le.
    +qemu_arch() {
    + local target=${1:-${CHOST}}
    + case ${target} in
    + armeb*) echo armeb ;;
    + arm*) echo arm ;;
    + hppa*) echo hppa ;;
    + i?86*) echo i386 ;;
    + m68*) echo m68k ;;
    + mips64el*-gnuabi64) echo mips64el ;;
    + mips64el*-gnuabin32) echo mipsn32el ;;
    + mips64*-gnuabi64) echo mips64 ;;
    + mips64*-gnuabin32) echo mipsn32 ;;
    + powerpc64le*) echo ppc64le ;;
    + powerpc64*) echo ppc64 ;;
    + powerpc*) echo ppc ;;
    + *) echo "${target%%-*}" ;;
    + esac
    +}
    +

    No arm64/aarch64 ?

    --
    Regards,

    Roy Bamford
    (Neddyseagoon) a member of
    elections
    gentoo-ops
    forum-mods
    arm64
    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCAAdFiEEsOrcx0gZrrCMwJzo/xJODTqpeT4FAmg16d4ACgkQ/xJODTqp eT7rVQgAnWTnqsFw9q105UwUZGn6qSFOwocpiC1SQ/47mPkafzcE9pMlMxFxFgKO LGiEbil8I96AFbFgxGgvrwfp7l+9TOj+NPMbfZKpK843//CJAAMbow/eobVv7kSc 34fnO8v4/yGahCtI1jpKqyrdBzkRGNe90nVmOPyZffYULS/YhdYpQEDqBuAQac0T N4dhw71Cq+D2fAJTENnMog/Qd0SYflQ5WBejvWH9BwBRSnzh7ae/RzpmUAu0Lyg9 mpZXA3qfaSVN+yLGyd4QPHtkApBF4eWiKDUrKXnnPPxxGGEJCLdUbDQ6qVpzSvF6 eM9OczNbszxlw3/mbHxbe0nEcs9KTw==
    =jctT
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Le Cuirot@21:1/5 to Roy Bamford on Tue May 27 21:30:01 2025
    On Tue, 2025-05-27 at 17:35 +0100, Roy Bamford wrote:
    On 2025.05.27 12:08, James Le Cuirot wrote:
    I also intend to add another wrapper script generation function for
    running executables while changing the root directory.

    +# Return the QEMU architecture name for the given target or CHOST.
    This name is
    +# used in qemu-user binary filenames, e.g. qemu-ppc64le.
    +qemu_arch() {
    + local target=${1:-${CHOST}}
    + case ${target} in
    + armeb*) echo armeb ;;
    + arm*) echo arm ;;
    + hppa*) echo hppa ;;
    + i?86*) echo i386 ;;
    + m68*) echo m68k ;;
    + mips64el*-gnuabi64) echo mips64el ;;
    + mips64el*-gnuabin32) echo mipsn32el ;;
    + mips64*-gnuabi64) echo mips64 ;;
    + mips64*-gnuabin32) echo mipsn32 ;;
    + powerpc64le*) echo ppc64le ;;
    + powerpc64*) echo ppc64 ;;
    + powerpc*) echo ppc ;;
    + *) echo "${target%%-*}" ;;
    + esac
    +}
    +

    No arm64/aarch64 ?

    That's covered by the * case. It's what I tested with. :)

    -----BEGIN PGP SIGNATURE-----

    iQJFBAABCAAvFiEEPxcZ3tkwcedKm2a8EiZBXQDdMTcFAmg2EJURHGNoZXdpQGdl bnRvby5vcmcACgkQEiZBXQDdMTfCghAAjATCeMkgfFfFaCHsAvDYNYMkTCNbePtd rjwdPWc8+w3Eu0qm8VZFIKwrQtfOpgu8nXHy5J+bQRiwGTX/Zdjn+qHx2NIHRFa2 PsbFatHwau/zij/lfqcFER6wFk9V1xogm5nwqvu89M3VRnkPkEbga21lQa3vQPQE oGpyFPzblmNWNbetL0NEpm6ukbbSttxq901Wdt0jP9gvcUjSgApVGiSeIFyjae8T SaeNsgkAHGoUMoi1CjejTxEFYnxV9T8S3GXpHzHFI9Fy+TiKwKif/usAQ7mwi2+o AW8o2DhsbjUgoK1Y93GqXoCUFvVU9rswduOyASfqEw9RlVCI7Lif/ABjsQBcfMTS YLZIShAWKhbSP4FIS0naWhmg1Ig8TUqh1JKdH2wtVjYtarEVswR/tmugxOclYNie csUCg60/tZk/CPHbdX1L/yZRkpV43SMmK/up5m9110aypyvmlXg++cw1wYk9Q/5d w5s+8WepWFzJqvtGUuCA1HQdJQEgfbLZ6pEuZKhW5nAwUayiVoGmIo5t9HdXkCiS iQlhGTxXVeaxf3NGFPPxlT4T79KDe2+/cTJlnXQuM9/7giT0kP3QiCIb1YzYbh0V KiTy93usv9FA2R1Ms5EPYOayjfJ3KPlQ0nj/H/HToWEWspDOcpvUqmdS9Eysn8qQ
    sMyvaQ+tT4M=
    =gSRE
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)