From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A0DA2159C9B for ; Mon, 12 Aug 2024 19:02:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A42452BC054; Mon, 12 Aug 2024 19:02:30 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8D8402BC054 for ; Mon, 12 Aug 2024 19:02:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 900B3342FF7 for ; Mon, 12 Aug 2024 19:02:29 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CB076E6F for ; Mon, 12 Aug 2024 19:02:27 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1723489317.a2b06caae07eddf6ee4597f0dbe53a476a6005ce.ulm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/ltprune.eclass X-VCS-Directories: eclass/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: a2b06caae07eddf6ee4597f0dbe53a476a6005ce X-VCS-Branch: master Date: Mon, 12 Aug 2024 19:02:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c3e911b1-769a-4d4d-b546-3ccee8a91029 X-Archives-Hash: 85129d8fe7af6079323d7f599fff614e commit: a2b06caae07eddf6ee4597f0dbe53a476a6005ce Author: Ulrich Müller gentoo org> AuthorDate: Mon Aug 12 19:01:57 2024 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Mon Aug 12 19:01:57 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a2b06caa ltprune.eclass: Remove dead eclass Signed-off-by: Ulrich Müller gentoo.org> eclass/ltprune.eclass | 177 -------------------------------------------------- 1 file changed, 177 deletions(-) diff --git a/eclass/ltprune.eclass b/eclass/ltprune.eclass deleted file mode 100644 index 51f5aaabfea7..000000000000 --- a/eclass/ltprune.eclass +++ /dev/null @@ -1,177 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# @DEAD -# @ECLASS: ltprune.eclass -# @MAINTAINER: -# Michał Górny -# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 -# @BLURB: Smart .la file pruning -# @DEPRECATED: none -# @DESCRIPTION: -# A function to locate and remove unnecessary .la files. -# -# Discouraged. Whenever possible, please use much simpler: -# @CODE -# find "${ED}" -type f -name '*.la' -delete || die -# @CODE - -if [[ -z ${_LTPRUNE_ECLASS} ]]; then - -case ${EAPI:-0} in - 0|1|2|3|4|5|6) - ;; - *) - die "${ECLASS}: banned in EAPI=${EAPI}; use 'find' instead";; -esac - -inherit toolchain-funcs - -# @FUNCTION: prune_libtool_files -# @USAGE: [--all|--modules] -# @DESCRIPTION: -# Locate unnecessary libtool files (.la) and libtool static archives -# (.a) and remove them from installation image. -# -# By default, .la files are removed whenever the static linkage can -# either be performed using pkg-config or doesn't introduce additional -# flags. -# -# If '--modules' argument is passed, .la files for modules (plugins) are -# removed as well. This is usually useful when the package installs -# plugins and the plugin loader does not use .la files. -# -# If '--all' argument is passed, all .la files are removed without -# performing any heuristic on them. You shouldn't ever use that, -# and instead report a bug in the algorithm instead. -# -# The .a files are only removed whenever corresponding .la files state -# that they should not be linked to, i.e. whenever these files -# correspond to plugins. -# -# Note: if your package installs both static libraries and .pc files -# which use variable substitution for -l flags, you need to add -# pkg-config to your DEPEND. -prune_libtool_files() { - debug-print-function ${FUNCNAME} "$@" - - local removing_all removing_modules opt - for opt; do - case "${opt}" in - --all) - removing_all=1 - removing_modules=1 - ;; - --modules) - removing_modules=1 - ;; - *) - die "Invalid argument to ${FUNCNAME}(): ${opt}" - esac - done - - local f - local queue=() - while IFS= read -r -d '' f; do # for all .la files - local archivefile=${f/%.la/.a} - - # The following check is done by libtool itself. - # It helps us avoid removing random files which match '*.la', - # see bug #468380. - if ! sed -n -e '/^# Generated by .*libtool/q0;4q1' "${f}"; then - continue - fi - - [[ ${f} != ${archivefile} ]] || die 'regex sanity check failed' - local reason= pkgconfig_scanned= - local snotlink=$(sed -n -e 's:^shouldnotlink=::p' "${f}") - - if [[ ${snotlink} == yes ]]; then - - # Remove static libs we're not supposed to link against. - if [[ -f ${archivefile} ]]; then - einfo "Removing unnecessary ${archivefile#${D%/}} (static plugin)" - queue+=( "${archivefile}" ) - fi - - # The .la file may be used by a module loader, so avoid removing it - # unless explicitly requested. - if [[ ${removing_modules} ]]; then - reason='module' - fi - - else - - # Remove .la files when: - # - user explicitly wants us to remove all .la files, - # - respective static archive doesn't exist, - # - they are covered by a .pc file already, - # - they don't provide any new information (no libs & no flags). - - if [[ ${removing_all} ]]; then - reason='requested' - elif [[ ! -f ${archivefile} ]]; then - reason='no static archive' - elif [[ ! $(sed -nre \ - "s/^(dependency_libs|inherited_linker_flags)='(.*)'$/\2/p" \ - "${f}") ]]; then - reason='no libs & flags' - else - if [[ ! ${pkgconfig_scanned} ]]; then - # Create a list of all .pc-covered libs. - local pc_libs=() - if [[ ! ${removing_all} ]]; then - local pc - local tf=${T}/prune-lt-files.pc - local pkgconf=$(tc-getPKG_CONFIG) - - while IFS= read -r -d '' pc; do # for all .pc files - local arg libs - - # Use pkg-config if available (and works), - # fallback to sed. - if ${pkgconf} --exists "${pc}" &>/dev/null; then - sed -e '/^Requires:/d' "${pc}" > "${tf}" - libs=$(${pkgconf} --libs "${tf}") - else - libs=$(sed -ne 's/^Libs://p' "${pc}") - fi - - for arg in ${libs}; do - if [[ ${arg} == -l* ]]; then - if [[ ${arg} == '*$*' ]]; then - eerror "${FUNCNAME}: variable substitution likely failed in ${pc}" - eerror "(arg: ${arg})" - eerror "Most likely, you need to add virtual/pkgconfig to DEPEND." - die "${FUNCNAME}: unsubstituted variable found in .pc" - fi - - pc_libs+=( lib${arg#-l}.la ) - fi - done - done < <(find "${D}" -type f -name '*.pc' -print0) - - rm -f "${tf}" - fi - - pkgconfig_scanned=1 - fi # pkgconfig_scanned - - has "${f##*/}" "${pc_libs[@]}" && reason='covered by .pc' - fi # removal due to .pc - - fi # shouldnotlink==no - - if [[ ${reason} ]]; then - einfo "Removing unnecessary ${f#${D%/}} (${reason})" - queue+=( "${f}" ) - fi - done < <(find "${D}" -xtype f -name '*.la' -print0) - - if [[ ${queue[@]} ]]; then - rm -f "${queue[@]}" - fi -} - -_LTPRUNE_ECLASS=1 -fi #_LTPRUNE_ECLASS