logo

overlay

My (experimental) gentoo overlay
commit: fb3daeefd909765d65394909fcacc0e0150a68ec
parent: 780a383cf7e850ceb98c3c4de193e0703864fe35
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue,  4 Dec 2018 06:28:54 +0100

sys-libs/gcompat: New Package

Diffstat:

Asys-libs/gcompat/Manifest1+
Asys-libs/gcompat/gcompat-0.3.0.ebuild44++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/sys-libs/gcompat/Manifest b/sys-libs/gcompat/Manifest @@ -0,0 +1 @@ +DIST gcompat-0.3.0.tar.xz 20812 BLAKE2B 9783cd5c4fd9da508749043b9f554f8dd9015045aa3b35d18892daf4f5575b8eb5b884c0b3a13a454f6b4ca23f777f49eeeb936150fe75743ef51032f3729d1f SHA512 1f7dd73efd556b7e0f7f1c80751185583de24daf4ab235b488ea1ab98cea2d3a94abed341b922be0bd43c8d539a00176b892c78acf09f2adacb279c09648b3be diff --git a/sys-libs/gcompat/gcompat-0.3.0.ebuild b/sys-libs/gcompat/gcompat-0.3.0.ebuild @@ -0,0 +1,44 @@ +# Copyright 2018 Haelwenn (lanodan) Monnier <contact@hacktivis.me> +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit multilib-minimal + +DESCRIPTION="The GNU C Library compatibility layer for musl" +HOMEPAGE="https://code.foxkit.us/adelie/gcompat" +KEYWORDS="~x86 ~amd64" +LICENSE="UoI-NCSA" +SRC_URI="https://distfiles.adelielinux.org/source/gcompat/${P}.tar.xz" +SLOT="0" + +arch=$(ldd 2>&1 | sed -n '1s/^musl libc (\(.*\))$/\1/p') + +get_loader_name() { + # Loosely based on Adélie APKBUILD + # TODO: Check against glibc’s logic + + case "$ABI" in + x86) echo "ld-linux.so.2" ;; + amd64) echo "ld-linux-x86-64.so.2" ;; + arm*) echo "ld-linux-armhf.so.3" ;; + arm64) echo "ld-linux-aarch64.so.1" ;; + mips | powerpc | s390) echo "ld.so.1" ;; + esac +} + +src_compile() { + emake \ + LINKER_PATH="/lib/ld-musl-${arch}.so.1" \ + LOADER_NAME="$(get_loader_name)" \ + WITH_LIBUCONTEXT=YesPlease +} + +src_install() { + emake \ + LINKER_PATH="/lib/ld-musl-${arch}.so.1" \ + LOADER_NAME="$(get_loader_name)" \ + WITH_LIBUCONTEXT=YesPlease \ + DESTDIR="${D}" \ + install +}