Merge pull request #262 from flatcar-linux/krnowak/eclass-update

eclass: Sync some with gentoo to support EAPI 8, but keep supporting EAPI 4 too
This commit is contained in:
Krzesimir Nowak 2022-01-11 13:25:30 +01:00 committed by GitHub
commit d133e03f4a
58 changed files with 1252 additions and 2903 deletions

View File

@ -0,0 +1 @@
- parted ([3.4](https://savannah.gnu.org/forum/forum.php?forum_id=9924) (includes [3.3](https://savannah.gnu.org/forum/forum.php?forum_id=9569)))

View File

@ -1,4 +1,3 @@
DIST cmake-3.13.5.tar.gz 8618821 BLAKE2B 765678bc92821207c53bfb4ac995a791b938f20236c3a6fda873b8edd11cd1401b4f4c05f170b8f600f38bde5f1227c715499eee072a8de3bb29d4f5cd230226 SHA512 99e3a8f5bc147dd90b9cab11f06892d87f289aa1354ad323711fe96ebc9c32b1e887e8f9d3575a37831c4d2153a070ff9115c5e27a185d54170bad9dbbaabc26
DIST cmake-3.18.5.tar.gz 8975784 BLAKE2B 62ea68b602e7e352c22ba6122aa010fb78fb5c4e484aa51bc336e750280d5fc03ffa439bd8005d2c43176f5a5db4ebfd419beca65cc59c5b8cd5666e38394fb8 SHA512 c15e0937a9c0ce0b6164c3d02a147e679ea57e1119cff4189a15de71429a7facb3c04eb8db467471876b5da5dbd4a25acb228efa7101fe78efd205f0d2c96343
DIST cmake-3.19.7.tar.gz 9271358 BLAKE2B 379b89c0d6bcfe81a397257cb3f95e4b4a8987566258f6d5b312e8ffd455fd07f09ed570c47111f9a519d76f43014b680e8242cddef13810ba87f9b9ec7e2e2f SHA512 6af1fe3ea41906324d4c29f5f982281d92145d086f4a47fa2220b93483bc65d59b1e23f5b51d82305c630690be7c552827bb795560674b03620763e0917bf14a
DIST cmake-3.20.2.tar.gz 9438694 BLAKE2B b1e1c091047d5ccae77d64ffda8201cfa7661f09fac2aceadfede8be09257cebdc8c2536f10ced82c700fd87174979344489fa6ab1b460e3ddfc41325ca6f19b SHA512 675a92f84b437169aee86dbfa59715671b9195ddeffc6fea83c7803a70abe3116106ad0a627b9e4bef326bfb2a10fdf624ad341fd9d3d08e3d8a69c271cd2b32
DIST cmake-3.20.5.tar.gz 9441947 BLAKE2B f073d7c3968c714be315f5014076c785790ed47e9a746f2d16bc59769fb6862009f67c2e118038c6c9d8390b709f2b4ed4a4dfc41a93996fedd9d7d77111b84a SHA512 4ad7f194353be291e76d86d95928633daea653a0bd8d35369ac6ee2bb3f811c3a1aabe6a2bd51c6d5b07af2c6edc7e38d8b347ded32ab1ddcf331dbfce40c008
DIST cmake-3.21.4.tar.gz 9630991 BLAKE2B ca6b6c50d984cc6713f3e88e1a6438c360d80c34927e60a20cc006ba47df2b91a290f1578d556f58d2d40711848a9b9caf36f65a043df892b81c1d48e3edb0d8 SHA512 0262a666f6da106576c26215580c40b54497bcdac400e847e1799716c31c71068293e719416338132a7da6122826c08ff50ac23dfed2711ab42631e96303f544
DIST cmake-3.22.1.tar.gz 9778031 BLAKE2B 8c91e9e666ece94e0cfb5868ad257b1de824206b6f5420a5f516f684e4fd655e634918c59955f41a3f27b604b76946d86ab51cf975de7052c067a9dc4f952400 SHA512 b1e900fe573cd1cc76d26386f2298d7722737c9ff67930ee108994972b4561ef69caeb537177c9b95b7f17b755e20e034825d3807ea0d2dd4c391310b03adc11

View File

@ -1,230 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_MAKEFILE_GENERATOR="emake"
CMAKE_REMOVE_MODULES_LIST=( none )
inherit bash-completion-r1 cmake elisp-common flag-o-matic toolchain-funcs virtualx xdg-utils
MY_P="${P/_/-}"
DESCRIPTION="Cross platform Make"
HOMEPAGE="https://cmake.org/"
SRC_URI="https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}.tar.gz"
LICENSE="CMake"
SLOT="0"
[[ "${PV}" = *_rc* ]] || \
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
IUSE="doc emacs system-jsoncpp ncurses qt5"
RDEPEND="
app-crypt/rhash
>=app-arch/libarchive-3.0.0:=
>=dev-libs/expat-2.0.1
>=dev-libs/libuv-1.10.0:=
>=net-misc/curl-7.21.5[ssl]
sys-libs/zlib
virtual/pkgconfig
emacs? ( >=app-editors/emacs-23.1:* )
ncurses? ( sys-libs/ncurses:0= )
qt5? (
dev-qt/qtcore:5
dev-qt/qtgui:5
dev-qt/qtwidgets:5
)
system-jsoncpp? ( >=dev-libs/jsoncpp-0.6.0_rc2:0= )
"
DEPEND="${RDEPEND}"
BDEPEND="
doc? (
dev-python/requests
dev-python/sphinx
)
"
S="${WORKDIR}/${MY_P}"
SITEFILE="50${PN}-gentoo.el"
PATCHES=(
# prefix
"${FILESDIR}"/${PN}-3.4.0_rc1-darwin-bundle.patch
"${FILESDIR}"/${PN}-3.13.4-prefix-dirs.patch
"${FILESDIR}"/${PN}-3.1.0-darwin-isysroot.patch
# handle gentoo packaging in find modules
"${FILESDIR}"/${PN}-3.11.0_rc2-FindBLAS.patch
"${FILESDIR}"/${PN}-3.0.2-FindLAPACK.patch
"${FILESDIR}"/${PN}-3.5.2-FindQt4.patch
# respect python eclasses
"${FILESDIR}"/${PN}-2.8.10.2-FindPythonLibs.patch
"${FILESDIR}"/${PN}-3.9.0_rc2-FindPythonInterp.patch
# boost (#660980)
"${FILESDIR}"/${PN}-3.11.4-fix-boost-detection.patch
# upstream fixes (can usually be removed with a version bump)
)
cmake_src_bootstrap() {
# Cleanup args to extract only JOBS.
# Because bootstrap does not know anything else.
grep -Eo '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' <<< "${MAKEOPTS}" > /dev/null
if [[ $? -eq 0 ]] ; then
par_arg=$(grep -Eo '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' <<< "${MAKEOPTS}" | tail -n1 | grep -o '[[:digit:]]+')
par_arg="--parallel=${par_arg}"
else
par_arg="--parallel=1"
fi
# disable running of cmake in boostrap command
sed -i \
-e '/"${cmake_bootstrap_dir}\/cmake"/s/^/#DONOTRUN /' \
bootstrap || die "sed failed"
# execinfo.h on Solaris isn't quite what it is on Darwin
if [[ ${CHOST} == *-solaris* ]] ; then
sed -i -e 's/execinfo\.h/blablabla.h/' \
Source/kwsys/CMakeLists.txt || die
fi
tc-export CC CXX LD
# bootstrap script isn't exactly /bin/sh compatible
${CONFIG_SHELL:-sh} ./bootstrap \
--prefix="${T}/cmakestrap/" \
${par_arg} \
|| die "Bootstrap failed"
}
cmake_src_test() {
# fix OutDir and SelectLibraryConfigurations tests
# these are altered thanks to our eclass
sed -i -e 's:^#_cmake_modify_IGNORE ::g' \
"${S}"/Tests/{OutDir,CMakeOnly/SelectLibraryConfigurations}/CMakeLists.txt \
|| die
pushd "${BUILD_DIR}" > /dev/null
local ctestargs
[[ -n ${TEST_VERBOSE} ]] && ctestargs="--extra-verbose --output-on-failure"
# Excluded tests:
# BootstrapTest: we actualy bootstrap it every time so why test it.
# BundleUtilities: bundle creation broken
# CMakeOnly.AllFindModules: pthread issues
# CTest.updatecvs: which fails to commit as root
# Fortran: requires fortran
# RunCMake.CompilerLauncher: also requires fortran
# RunCMake.CPack_RPM: breaks if app-arch/rpm is installed because
# debugedit binary is not in the expected location
# RunCMake.CPack_DEB: breaks if app-arch/dpkg is installed because
# it can't find a deb package that owns libc
# TestUpload, which requires network access
"${BUILD_DIR}"/bin/ctest \
-j "$(makeopts_jobs)" \
--test-load "$(makeopts_loadavg)" \
${ctestargs} \
-E "(BootstrapTest|BundleUtilities|CMakeOnly.AllFindModules|CTest.UpdateCVS|Fortran|RunCMake.CompilerLauncher|RunCMake.CPack_(DEB|RPM)|TestUpload)" \
|| die "Tests failed"
popd > /dev/null
}
src_prepare() {
cmake_src_prepare
# disable Xcode hooks, bug #652134
if [[ ${CHOST} == *-darwin* ]] ; then
sed -i -e 's/__APPLE__/__DISABLED_APPLE__/' \
Source/cmGlobalXCodeGenerator.cxx || die
fi
# Add gcc libs to the default link paths
sed -i \
-e "s|@GENTOO_PORTAGE_GCCLIBDIR@|${EPREFIX}/usr/${CHOST}/lib/|g" \
-e "$(usex prefix-guest "s|@GENTOO_HOST@||" "/@GENTOO_HOST@/d")" \
-e "s|@GENTOO_PORTAGE_EPREFIX@|${EPREFIX}/|g" \
Modules/Platform/{UnixPaths,Darwin}.cmake || die "sed failed"
if ! has_version \>=${CATEGORY}/${PN}-3.4.0_rc1 ; then
CMAKE_BINARY="${S}/Bootstrap.cmk/cmake"
cmake_src_bootstrap
fi
}
src_configure() {
# Fix linking on Solaris
[[ ${CHOST} == *-solaris* ]] && append-ldflags -lsocket -lnsl
local mycmakeargs=(
-DCMAKE_USE_SYSTEM_LIBRARIES=ON
-DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=$(usex system-jsoncpp)
-DCMAKE_DOC_DIR=/share/doc/${PF}
-DCMAKE_MAN_DIR=/share/man
-DCMAKE_DATA_DIR=/share/${PN}
-DSPHINX_MAN=$(usex doc)
-DSPHINX_HTML=$(usex doc)
-DBUILD_CursesDialog="$(usex ncurses)"
)
if use qt5 ; then
mycmakeargs+=(
-DBUILD_QtDialog=ON
$(cmake_use_find_package qt5 Qt5Widgets)
)
fi
cmake_src_configure
}
src_compile() {
cmake_src_compile
use emacs && elisp-compile Auxiliary/cmake-mode.el
}
src_test() {
virtx cmake_src_test
}
src_install() {
cmake_src_install
if use emacs; then
elisp-install ${PN} Auxiliary/cmake-mode.el Auxiliary/cmake-mode.elc
elisp-site-file-install "${FILESDIR}/${SITEFILE}"
fi
insinto /usr/share/vim/vimfiles/syntax
doins Auxiliary/vim/syntax/cmake.vim
insinto /usr/share/vim/vimfiles/indent
doins Auxiliary/vim/indent/cmake.vim
insinto /usr/share/vim/vimfiles/ftdetect
doins "${FILESDIR}/${PN}.vim"
dobashcomp Auxiliary/bash-completion/{${PN},ctest,cpack}
rm -r "${ED}"/usr/share/cmake/{completions,editors} || die
}
pkg_postinst() {
use emacs && elisp-site-regen
if use qt5; then
xdg_icon_cache_update
xdg_desktop_database_update
xdg_mimeinfo_database_update
fi
}
pkg_postrm() {
use emacs && elisp-site-regen
if use qt5; then
xdg_icon_cache_update
xdg_desktop_database_update
xdg_mimeinfo_database_update
fi
}

View File

@ -17,7 +17,7 @@ SRC_URI="https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}.tar.gz"
LICENSE="CMake"
SLOT="0"
[[ "${PV}" = *_rc* ]] || \
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="doc emacs ncurses qt5 test"
RESTRICT="!test? ( test )"
@ -120,7 +120,7 @@ cmake_src_test() {
-j "$(makeopts_jobs)" \
--test-load "$(makeopts_loadavg)" \
${ctestargs} \
-E "(BootstrapTest|BundleUtilities|CMakeOnly.AllFindModules|CompileOptions|CTest.UpdateCVS|DependencyGraph|Fortran|RunCMake.CompilerLauncher|RunCMake.IncompatibleQt|RunCMake.ObsoleteQtMacros|RunCMake.PrecompileHeaders|RunCMake.CPack_(DEB|RPM)|TestUpload)" \
-E "(BootstrapTest|BundleUtilities|ConfigSources|CMakeOnly.AllFindModules|CPackComponentsDEB-components-depend2|CompileOptions|CTest.UpdateCVS|DependencyGraph|Fortran|RunCMake.CompilerLauncher|RunCMake.IncompatibleQt|RunCMake.ObsoleteQtMacros|RunCMake.PrecompileHeaders|RunCMake.CPack_(DEB|RPM)|TestUpload)" \
|| die "Tests failed"
popd > /dev/null

View File

@ -3,7 +3,7 @@
EAPI=7
CMAKE_MAKEFILE_GENERATOR="emake" # Fixed in 3.19, see commit 491dddfb; bug #596460
CMAKE_MAKEFILE_GENERATOR="emake" # TODO RunCMake.LinkWhatYouUse fails consistently w/ ninja
CMAKE_REMOVE_MODULES_LIST=( none )
inherit bash-completion-r1 cmake elisp-common flag-o-matic multiprocessing \
toolchain-funcs virtualx xdg-utils
@ -17,7 +17,7 @@ SRC_URI="https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}.tar.gz"
LICENSE="CMake"
SLOT="0"
[[ "${PV}" = *_rc* ]] || \
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="doc emacs ncurses qt5 test"
RESTRICT="!test? ( test )"
@ -55,12 +55,12 @@ PATCHES=(
# prefix
"${FILESDIR}"/${PN}-3.16.0_rc4-darwin-bundle.patch
"${FILESDIR}"/${PN}-3.14.0_rc3-prefix-dirs.patch
# Next patch requires new work from prefix people
#"${FILESDIR}"/${PN}-3.1.0-darwin-isysroot.patch
"${FILESDIR}"/${PN}-3.19.1-darwin-gcc.patch
# handle gentoo packaging in find modules
"${FILESDIR}"/${PN}-3.17.0_rc1-FindBLAS.patch
"${FILESDIR}"/${PN}-3.17.0_rc1-FindLAPACK.patch
# Next patch needs to be reworked
#"${FILESDIR}"/${PN}-3.17.0_rc1-FindLAPACK.patch
"${FILESDIR}"/${PN}-3.5.2-FindQt4.patch
# respect python eclasses
@ -120,7 +120,7 @@ cmake_src_test() {
-j "$(makeopts_jobs)" \
--test-load "$(makeopts_loadavg)" \
${ctestargs} \
-E "(BootstrapTest|BundleUtilities|CMakeOnly.AllFindModules|CompileOptions|CTest.UpdateCVS|Fortran|RunCMake.CompilerLauncher|RunCMake.IncompatibleQt|RunCMake.ObsoleteQtMacros|RunCMake.PrecompileHeaders|RunCMake.CPack_(DEB|RPM)|TestUpload)" \
-E "(BootstrapTest|BundleUtilities|ConfigSources|CMakeOnly.AllFindModules|CPackComponentsDEB-components-depend2|CompileOptions|CTest.UpdateCVS|DependencyGraph|Fortran|RunCMake.CompilerLauncher|RunCMake.IncompatibleQt|RunCMake.ObsoleteQtMacros|RunCMake.PrecompileHeaders|RunCMake.CPack_(DEB|RPM)|TestUpload)" \
|| die "Tests failed"
popd > /dev/null
@ -129,10 +129,28 @@ cmake_src_test() {
src_prepare() {
cmake_src_prepare
# disable Xcode hooks, bug #652134
if [[ ${CHOST} == *-darwin* ]] ; then
sed -i -e 's/__APPLE__/__DISABLED_APPLE__/' \
Source/cmGlobalXCodeGenerator.cxx || die
# disable Xcode hooks, bug #652134
sed -i -e 's/cm\(\|Global\|Local\)XCode[^.]\+\.\(cxx\|h\)//' \
Source/CMakeLists.txt || die
sed -i -e '/define CMAKE_USE_XCODE/s/XCODE/NO_XCODE/' \
-e '/cmGlobalXCodeGenerator.h/d' \
Source/cmake.cxx || die
# disable isysroot usage with GCC, we've properly instructed
# where things are via GCC configuration and ldwrapper
sed -i -e '/cmake_gnu_set_sysroot_flag/d' \
Modules/Platform/Apple-GNU-*.cmake || die
# disable isysroot usage with clang as well
sed -i -e '/_SYSROOT_FLAG/d' \
Modules/Platform/Apple-Clang.cmake || die
# don't set a POSIX standard, system headers don't like that, #757426
sed -i -e 's/^#if !defined(_WIN32) && !defined(__sun)/& \&\& !defined(__APPLE__)/' \
Source/cmLoadCommandCommand.cxx \
Source/cmStandardLexer.h \
Source/cmSystemTools.cxx \
Source/cmTimestamp.cxx
sed -i -e 's/^#if !defined(_POSIX_C_SOURCE) && !defined(_WIN32) && !defined(__sun)/& \&\& !defined(__APPLE__)/' \
Source/cmStandardLexer.h
fi
# Add gcc libs to the default link paths

View File

@ -1,7 +1,7 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
CMAKE_MAKEFILE_GENERATOR="emake" # TODO RunCMake.LinkWhatYouUse fails consistently w/ ninja
CMAKE_REMOVE_MODULES_LIST=( none )

View File

@ -1,43 +0,0 @@
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -4,6 +4,10 @@
#
# Find LAPACK library
#
+# Version modified for Gentoo Linux.
+# If a valid PkgConfig configuration is found, this overrides and cancels
+# all further checks.
+#
# This module finds an installed fortran library that implements the
# LAPACK linear-algebra interface (see http://www.netlib.org/lapack/).
#
@@ -140,6 +144,23 @@
endmacro()
+#
+# first, try PkgConfig
+#
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(PC_LAPACK lapack)
+if(PC_LAPACK_FOUND)
+ foreach(PC_LIB ${PC_LAPACK_LIBRARIES})
+ find_library(${PC_LIB}_LIBRARY NAMES ${PC_LIB} HINTS ${PC_LAPACK_LIBRARY_DIRS} )
+ if (NOT ${PC_LIB}_LIBRARY)
+ message(FATAL_ERROR "Something is wrong in your pkg-config file - lib ${PC_LIB} not found in ${PC_LAPACK_LIBRARY_DIRS}")
+ endif (NOT ${PC_LIB}_LIBRARY)
+ list(APPEND LAPACK_LIBRARIES ${${PC_LIB}_LIBRARY})
+ endforeach(PC_LIB)
+ find_package_handle_standard_args(LAPACK DEFAULT_MSG LAPACK_LIBRARIES)
+ mark_as_advanced(LAPACK_LIBRARIES)
+else(PC_LAPACK_FOUND)
+message(STATUS "No PkgConfig configuration for LAPACK found; starting more extensive search.")
set(LAPACK_LINKER_FLAGS)
set(LAPACK_LIBRARIES)
@@ -348,3 +369,5 @@
endif()
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
+
+endif(PC_LAPACK_FOUND)

View File

@ -1,48 +0,0 @@
Do not detect Xcode and set -isysroot for its SDK, since that messes up
our toolchain, and hence makes any compilation fail, bug #445308
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -1,16 +1,16 @@
# Ask xcode-select where to find /Developer or fall back to ancient location.
-execute_process(COMMAND xcode-select -print-path
- OUTPUT_VARIABLE _stdout
- OUTPUT_STRIP_TRAILING_WHITESPACE
- ERROR_VARIABLE _stderr
- RESULT_VARIABLE _failed)
-if(NOT _failed AND IS_DIRECTORY ${_stdout})
- set(OSX_DEVELOPER_ROOT ${_stdout})
-elseif(IS_DIRECTORY "/Developer")
- set(OSX_DEVELOPER_ROOT "/Developer")
-else()
+#execute_process(COMMAND xcode-select -print-path
+# OUTPUT_VARIABLE _stdout
+# OUTPUT_STRIP_TRAILING_WHITESPACE
+# ERROR_VARIABLE _stderr
+# RESULT_VARIABLE _failed)
+#if(NOT _failed AND IS_DIRECTORY ${_stdout})
+# set(OSX_DEVELOPER_ROOT ${_stdout})
+#elseif(IS_DIRECTORY "/Developer")
+# set(OSX_DEVELOPER_ROOT "/Developer")
+#else()
set(OSX_DEVELOPER_ROOT "")
-endif()
+#endif()
execute_process(COMMAND sw_vers -productVersion
OUTPUT_VARIABLE CURRENT_OSX_VERSION
@@ -91,10 +91,10 @@
# CMAKE_OSX_DEPLOYMENT_TARGET
# Set cache variable - end user may change this during ccmake or cmake-gui configure.
-if(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
- set(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING
- "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
-endif()
+#if(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
+# set(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING
+# "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
+#endif()
#----------------------------------------------------------------------------
# CMAKE_OSX_SYSROOT

View File

@ -1,23 +0,0 @@
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -4,6 +4,10 @@
#
# Find BLAS library
#
+# Version modified for Gentoo Linux.
+# If a valid PkgConfig configuration is found, this overrides and cancels
+# all further checks.
+#
# This module finds an installed fortran library that implements the
# BLAS linear-algebra interface (see http://www.netlib.org/blas/). The
# list of libraries searched for is taken from the autoconf macro file,
@@ -50,6 +54,9 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+# first, try PkgConfig
+set(BLA_PREFER_PKGCONFIG On)
+
include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake)

View File

@ -1,13 +0,0 @@
https://bugs.gentoo.org/660980
--- cmake-3.11.4/Modules/FindBoost.cmake
+++ cmake-3.11.4/Modules/FindBoost.cmake
@@ -1680,7 +1680,7 @@
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}${COMPONENT_PYTHON_VERSION_MAJOR}-py${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-py${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
# Gentoo
- list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
+ list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}.${COMPONENT_PYTHON_VERSION_MINOR}")
# RPMs
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
endif()

View File

@ -1,127 +0,0 @@
From b1f045122fb210728081ae2165197aebff4ee498 Mon Sep 17 00:00:00 2001
From: Lars Wendler <polynomial-c@gentoo.org>
Date: Fri, 9 Jun 2017 01:47:55 +0200
Subject: [PATCH] Set some proper paths to make cmake find our tools.
The ebuild now adds an extra / at the end of $EPREFIX so that it is
never the empty string (so that CMAKE_SYSTEM_PREFIX_PATH remains
correct)
Original patch by Heiko Przybyl.
Updated by Chris Reffett (cmake-2.8.8)
Updated by Johannes Huber (cmake-2.8.9)
Updated by Michael Palimaka (cmake-2.8.10)
Updated by Chris Reffett (cmake-2.8.11)
Updated by Michael Palimaka (cmake-3.0.0)
Updated by Lars Wendler (cmake-3.9.0_rc2)
---
Modules/Platform/Darwin.cmake | 12 ++++++++----
Modules/Platform/UnixPaths.cmake | 29 ++++++++++++++++++++++++-----
2 files changed, 32 insertions(+), 9 deletions(-)
Index: cmake-3.13.3/Modules/Platform/Darwin.cmake
===================================================================
--- cmake-3.13.3.orig/Modules/Platform/Darwin.cmake
+++ cmake-3.13.3/Modules/Platform/Darwin.cmake
@@ -108,9 +108,9 @@ set(CMAKE_C_FRAMEWORK_SEARCH_FLAG -F)
set(CMAKE_CXX_FRAMEWORK_SEARCH_FLAG -F)
set(CMAKE_Fortran_FRAMEWORK_SEARCH_FLAG -F)
-# default to searching for frameworks first
+# default to searching for frameworks last
if(NOT DEFINED CMAKE_FIND_FRAMEWORK)
- set(CMAKE_FIND_FRAMEWORK FIRST)
+ set(CMAKE_FIND_FRAMEWORK LAST)
endif()
# Older OS X linkers do not report their framework search path
@@ -132,6 +132,8 @@ endif()
# set up the default search directories for frameworks
set(CMAKE_SYSTEM_FRAMEWORK_PATH
+ @GENTOO_PORTAGE_EPREFIX@Frameworks
+ @GENTOO_PORTAGE_EPREFIX@usr/lib
~/Library/Frameworks
)
if(_CMAKE_OSX_SYSROOT_PATH)
@@ -178,13 +180,15 @@ if(CMAKE_OSX_SYSROOT)
endif()
endif()
-# default to searching for application bundles first
+# default to searching for application bundles last
if(NOT DEFINED CMAKE_FIND_APPBUNDLE)
- set(CMAKE_FIND_APPBUNDLE FIRST)
+ set(CMAKE_FIND_APPBUNDLE LAST)
endif()
# set up the default search directories for application bundles
set(_apps_paths)
foreach(_path
+ @GENTOO_PORTAGE_EPREFIX@Applications
+ @GENTOO_PORTAGE_EPREFIX@usr/bin
"~/Applications"
"/Applications"
"${OSX_DEVELOPER_ROOT}/../Applications" # Xcode 4.3+
Index: cmake-3.13.3/Modules/Platform/UnixPaths.cmake
===================================================================
--- cmake-3.13.3.orig/Modules/Platform/UnixPaths.cmake
+++ cmake-3.13.3/Modules/Platform/UnixPaths.cmake
@@ -23,7 +23,8 @@ get_filename_component(_CMAKE_INSTALL_DI
# search types.
list(APPEND CMAKE_SYSTEM_PREFIX_PATH
# Standard
- /usr/local /usr /
+ @GENTOO_PORTAGE_EPREFIX@usr/local @GENTOO_PORTAGE_EPREFIX@usr @GENTOO_PORTAGE_EPREFIX@
+ @GENTOO_HOST@/usr/local /usr /
# CMake install location
"${_CMAKE_INSTALL_DIR}"
@@ -50,23 +51,41 @@ list(APPEND CMAKE_SYSTEM_PREFIX_PATH
# List common include file locations not under the common prefixes.
list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
- # X11
- /usr/include/X11
+ @GENTOO_PORTAGE_EPREFIX@usr/include
)
list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
- # X11
- /usr/lib/X11
+ @GENTOO_PORTAGE_GCCLIBDIR@/gcc
+ @GENTOO_PORTAGE_GCCLIBDIR@
+ @GENTOO_PORTAGE_EPREFIX@usr/lib64
+ @GENTOO_PORTAGE_EPREFIX@usr/libx32
+ @GENTOO_PORTAGE_EPREFIX@usr/lib32
+ @GENTOO_PORTAGE_EPREFIX@usr/lib
+ @GENTOO_PORTAGE_EPREFIX@lib
+ )
+
+list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
+ @GENTOO_PORTAGE_EPREFIX@usr/bin
+ @GENTOO_PORTAGE_EPREFIX@bin
)
list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
- /lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64
+ @GENTOO_PORTAGE_GCCLIBDIR@/gcc
+ @GENTOO_PORTAGE_GCCLIBDIR@
+ @GENTOO_PORTAGE_EPREFIX@usr/lib64
+ @GENTOO_PORTAGE_EPREFIX@usr/libx32
+ @GENTOO_PORTAGE_EPREFIX@usr/lib32
+ @GENTOO_PORTAGE_EPREFIX@usr/lib
+ @GENTOO_PORTAGE_EPREFIX@lib
+ @GENTOO_HOST@/lib /usr/lib /usr/lib32 /usr/lib64 /usr/libx32
)
list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+ @GENTOO_PORTAGE_EPREFIX@usr/include
+ @GENTOO_HOST@/usr/include
)
list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+ @GENTOO_PORTAGE_EPREFIX@usr/include
+ @GENTOO_HOST@/usr/include
)
list(APPEND CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES

View File

@ -1,56 +0,0 @@
From 7459f27dd4bb9b60067ac49ee2c6be93d20c2c1e Mon Sep 17 00:00:00 2001
From: Lars Wendler <polynomial-c@gentoo.org>
Date: Thu, 13 Feb 2020 13:16:16 +0100
Subject: [PATCH] Prefer pkgconfig in FindLAPACK
---
Modules/FindLAPACK.cmake | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index c9629769f0..de852d562c 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -7,6 +7,10 @@ FindLAPACK
Find Linear Algebra PACKage (LAPACK) library
+Version modified for Gentoo Linux.
+If a valid PkgConfig configuration is found, this overrides and cancels
+all further checks.
+
This module finds an installed Fortran library that implements the
LAPACK linear-algebra interface (see http://www.netlib.org/lapack/).
@@ -186,6 +190,22 @@ macro(CHECK_LAPACK_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _a
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
endmacro()
+# first, try PkgConfig
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(PC_LAPACK lapack)
+if(PC_LAPACK_FOUND)
+ foreach(PC_LIB ${PC_LAPACK_LIBRARIES})
+ find_library(${PC_LIB}_LIBRARY NAMES ${PC_LIB} HINTS ${PC_LAPACK_LIBRARY_DIRS} )
+ if (NOT ${PC_LIB}_LIBRARY)
+ message(FATAL_ERROR "Something is wrong in your pkg-config file - lib ${PC_LIB} not found in ${PC_LAPACK_LIBRARY_DIRS}")
+ endif (NOT ${PC_LIB}_LIBRARY)
+ list(APPEND LAPACK_LIBRARIES ${${PC_LIB}_LIBRARY})
+ endforeach(PC_LIB)
+ find_package_handle_standard_args(LAPACK DEFAULT_MSG LAPACK_LIBRARIES)
+ mark_as_advanced(LAPACK_LIBRARIES)
+else(PC_LAPACK_FOUND)
+message(STATUS "No PkgConfig configuration for LAPACK found; starting more extensive search.")
+
set(LAPACK_LINKER_FLAGS)
set(LAPACK_LIBRARIES)
set(LAPACK95_LIBRARIES)
@@ -494,3 +514,5 @@ endif()
cmake_pop_check_state()
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
+
+endif(PC_LAPACK_FOUND)
--
2.25.0

View File

@ -1,25 +0,0 @@
Don't use .so for modules on darwin/macos. Use .bundle instead.
Patch by Heiko Przybyl
Forward-ported from 2.8.10 to 3.4.0-rc1
--- cmake-3.4.0-rc1/Modules/Platform/Darwin.cmake
+++ cmake-3.4.0-rc1/Modules/Platform/Darwin.cmake
@@ -26,7 +26,7 @@
set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
set(CMAKE_SHARED_MODULE_PREFIX "lib")
-set(CMAKE_SHARED_MODULE_SUFFIX ".so")
+set(CMAKE_SHARED_MODULE_SUFFIX ".bundle")
set(CMAKE_MODULE_EXISTS 1)
set(CMAKE_DL_LIBS "")
@@ -53,7 +53,7 @@
set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
set(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
set(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
-set(CMAKE_FIND_LIBRARY_SUFFIXES ".tbd" ".dylib" ".so" ".a")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".tbd" ".dylib" ".bundle" ".a")
# hack: if a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old build tree
# (where install_name_tool was hardcoded) and where CMAKE_INSTALL_NAME_TOOL isn't in the cache

View File

@ -1,13 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>kde@gentoo.org</email>
<name>Gentoo KDE Project</name>
</maintainer>
<use>
<flag name="system-jsoncpp">Use system copy of <pkg>dev-libs/jsoncpp</pkg> instead of bundled one.</flag>
</use>
<upstream>
<remote-id type="cpe">cpe:/a:cmake_project:cmake</remote-id>
</upstream>

View File

@ -1,10 +1,12 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 0 and 4.
# @ECLASS: autotools.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
# @SUPPORTED_EAPIS: 0 4 5 6 7 8
# @BLURB: Regenerates auto* build scripts
# @DESCRIPTION:
# This eclass is for safely handling autotooled software packages that need to
@ -19,31 +21,38 @@ if [[ ${__AUTOTOOLS_AUTO_DEPEND+set} == "set" ]] ; then
# eclass at that point, but that adds overhead, and it's trivial
# to re-order inherit in eclasses/ebuilds instead. #409611
if [[ ${__AUTOTOOLS_AUTO_DEPEND} != ${AUTOTOOLS_AUTO_DEPEND} ]] ; then
die "AUTOTOOLS_AUTO_DEPEND changed value between inherits; please inherit autotools.eclass first! ${__AUTOTOOLS_AUTO_DEPEND} -> ${AUTOTOOLS_AUTO_DEPEND}"
die "AUTOTOOLS_AUTO_DEPEND changed value between inherits; please inherit ${ECLASS} first! ${__AUTOTOOLS_AUTO_DEPEND} -> ${AUTOTOOLS_AUTO_DEPEND}"
fi
fi
if [[ -z ${_AUTOTOOLS_ECLASS} ]]; then
if [[ -z ${_AUTOTOOLS_ECLASS} ]] ; then
_AUTOTOOLS_ECLASS=1
case ${EAPI:-0} in
0|1|2|3|4|5|6|7) ;;
0|4|5|6)
# Needed for eqawarn
inherit eutils
;;
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
esac
inherit libtool
inherit gnuconfig libtool
# @ECLASS-VARIABLE: WANT_AUTOCONF
# @PRE_INHERIT
# @DESCRIPTION:
# The major version of autoconf your package needs
: ${WANT_AUTOCONF:=latest}
# @ECLASS-VARIABLE: WANT_AUTOMAKE
# @PRE_INHERIT
# @DESCRIPTION:
# The major version of automake your package needs
: ${WANT_AUTOMAKE:=latest}
# @ECLASS-VARIABLE: WANT_LIBTOOL
# @PRE_INHERIT
# @DESCRIPTION:
# Do you want libtool? Valid values here are "latest" and "none".
: ${WANT_LIBTOOL:=latest}
@ -54,36 +63,31 @@ inherit libtool
# CONSTANT!
# The latest major unstable and stable version/slot of automake available
# on each arch.
# Only add unstable version if it is in a different slot than latest stable
# version.
# List latest unstable version first to boost testing adoption rate because
# most package manager dependency resolver will pick the first suitable
# version.
# If a newer slot is stable on any arch, and is NOT reflected in this list,
# then circular dependencies may arise during emerge @system bootstraps.
#
# See bug 312315 and 465732 for further information and context.
# See bug #312315 and bug #465732 for further information and context.
#
# Do NOT change this variable in your ebuilds!
# If you want to force a newer minor version, you can specify the correct
# WANT value by using a colon: <PV>:<WANT_AUTOMAKE>
_LATEST_AUTOMAKE=( 1.16.1:1.16 1.15.1:1.15 )
_LATEST_AUTOMAKE=( 1.16.2-r1:1.16 )
_automake_atom="sys-devel/automake"
_autoconf_atom="sys-devel/autoconf"
if [[ -n ${WANT_AUTOMAKE} ]]; then
if [[ -n ${WANT_AUTOMAKE} ]] ; then
case ${WANT_AUTOMAKE} in
# Even if the package doesn't use automake, we still need to depend
# on it because we run aclocal to process m4 macros. This matches
# the autoreconf tool, so this requirement is correct. #401605
# the autoreconf tool, so this requirement is correct, bug #401605.
none) ;;
latest)
# Use SLOT deps if we can. For EAPI=0, we get pretty close.
if [[ ${EAPI:-0} != 0 ]] ; then
_automake_atom="|| ( `printf '>=sys-devel/automake-%s:%s ' ${_LATEST_AUTOMAKE[@]/:/ }` )"
else
_automake_atom="|| ( `printf '>=sys-devel/automake-%s ' ${_LATEST_AUTOMAKE[@]/%:*}` )"
fi
;;
*) _automake_atom="=sys-devel/automake-${WANT_AUTOMAKE}*" ;;
latest) _automake_atom="|| ( `printf '>=sys-devel/automake-%s:%s ' ${_LATEST_AUTOMAKE[@]/:/ }` )" ;;
*) _automake_atom="=sys-devel/automake-${WANT_AUTOMAKE}*";;
esac
export WANT_AUTOMAKE
fi
@ -109,15 +113,18 @@ if [[ -n ${WANT_LIBTOOL} ]] ; then
export WANT_LIBTOOL
fi
# Force people (nicely) to upgrade to a newer version of gettext as
# older ones are known to be crappy. #496454
AUTOTOOLS_DEPEND="!<sys-devel/gettext-0.18.1.1-r3
${_automake_atom}
# @ECLASS-VARIABLE: AUTOTOOLS_DEPEND
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# Contains the combination of requested automake/autoconf/libtool
# versions in *DEPEND format.
AUTOTOOLS_DEPEND="${_automake_atom}
${_autoconf_atom}
${_libtool_atom}"
RDEPEND=""
# @ECLASS-VARIABLE: AUTOTOOLS_AUTO_DEPEND
# @PRE_INHERIT
# @DESCRIPTION:
# Set to 'no' to disable automatically adding to DEPEND. This lets
# ebuilds form conditional depends by using ${AUTOTOOLS_DEPEND} in
@ -125,8 +132,8 @@ RDEPEND=""
: ${AUTOTOOLS_AUTO_DEPEND:=yes}
if [[ ${AUTOTOOLS_AUTO_DEPEND} != "no" ]] ; then
case ${EAPI:-0} in
0|1|2|3|4|5|6) DEPEND=${AUTOTOOLS_DEPEND} ;;
7) BDEPEND=${AUTOTOOLS_DEPEND} ;;
0|4|5|6) DEPEND=${AUTOTOOLS_DEPEND} ;;
*) BDEPEND=${AUTOTOOLS_DEPEND} ;;
esac
fi
__AUTOTOOLS_AUTO_DEPEND=${AUTOTOOLS_AUTO_DEPEND} # See top of eclass
@ -138,6 +145,14 @@ unset _automake_atom _autoconf_atom
# @DESCRIPTION:
# Additional options to pass to automake during
# eautoreconf call.
: ${AM_OPTS:=}
# @ECLASS-VARIABLE: AT_NOEAUTOHEADER
# @DEFAULT_UNSET
# @DESCRIPTION:
# Don't run eautoheader command if set to 'yes'; only used to work around
# packages that don't want their headers being modified.
: ${AT_NOEAUTOHEADER:=}
# @ECLASS-VARIABLE: AT_NOEAUTOMAKE
# @DEFAULT_UNSET
@ -145,6 +160,7 @@ unset _automake_atom _autoconf_atom
# Don't run eautomake command if set to 'yes'; only used to workaround
# broken packages. Generally you should, instead, fix the package to
# not call AM_INIT_AUTOMAKE if it doesn't actually use automake.
: ${AT_NOEAUTOMAKE:=}
# @ECLASS-VARIABLE: AT_NOELIBTOOLIZE
# @DEFAULT_UNSET
@ -152,13 +168,16 @@ unset _automake_atom _autoconf_atom
# Don't run elibtoolize command if set to 'yes',
# useful when elibtoolize needs to be ran with
# particular options
: ${AT_NOELIBTOOLIZE:=}
# @ECLASS-VARIABLE: AT_M4DIR
# @DEFAULT_UNSET
# @DESCRIPTION:
# Additional director(y|ies) aclocal should search
: ${AT_M4DIR:=}
# @ECLASS-VARIABLE: AT_SYS_M4DIR
# @DEFAULT_UNSET
# @INTERNAL
# @DESCRIPTION:
# For system integrators, a list of additional aclocal search paths.
@ -177,13 +196,13 @@ unset _automake_atom _autoconf_atom
eautoreconf() {
local x g
# Subdirs often share a common build dir #529404. If so, we can't safely
# Subdirs often share a common build dir, bug #529404. If so, we can't safely
# run in parallel because many tools clobber the content in there. Libtool
# and automake both `rm && cp` while aclocal reads the output. We might be
# able to handle this if we split the steps and grab locks on the dirs the
# tools actually write to. Then we'd run all the common tools that use
# those inputs. Doing this in bash does not scale easily.
# If we do re-enable parallel support, make sure #426512 is handled.
# If we do re-enable parallel support, make sure bug #426512 is handled.
if [[ -z ${AT_NO_RECURSIVE} ]] ; then
# Take care of subdirs
for x in $(autotools_check_macro_val AC_CONFIG_SUBDIRS) ; do
@ -234,12 +253,12 @@ eautoreconf() {
done
${rerun_aclocal} && eaclocal
if [[ ${WANT_AUTOCONF} = 2.1 ]] ; then
if [[ ${WANT_AUTOCONF} == "2.1" ]] ; then
eautoconf
else
eautoconf --force
fi
eautoheader
[[ ${AT_NOEAUTOHEADER} != "yes" ]] && eautoheader
[[ ${AT_NOEAUTOMAKE} != "yes" ]] && FROM_EAUTORECONF="yes" eautomake ${AM_OPTS}
if [[ ${AT_NOELIBTOOLIZE} != "yes" ]] ; then
@ -254,6 +273,7 @@ eautoreconf() {
# @FUNCTION: _at_uses_pkg
# @USAGE: <macros>
# @INTERNAL
# @DESCRIPTION:
# See if the specified macros are enabled.
_at_uses_pkg() {
if [[ -n $(autotools_check_macro "$@") ]] ; then
@ -289,8 +309,8 @@ eaclocal_amflags() {
[[ -e ${amflags_file} ]] || continue
# setup the env in case the pkg does something crazy
# in their ACLOCAL_AMFLAGS. like run a shell script
# which turns around and runs autotools. #365401
# or split across multiple lines. #383525
# which turns around and runs autotools (bug #365401)
# or split across multiple lines (bug #383525)
autotools_env_setup
aclocal_opts=$(sed -n \
"/^ACLOCAL_AMFLAGS[[:space:]]*=/{ \
@ -312,7 +332,7 @@ eaclocal_amflags() {
# specified parametes. The name of the tool run is the same of the function
# without e prefix.
# They also force installing the support files for safety.
# Respects AT_M4DIR for additional directories to search for macro's.
# Respects AT_M4DIR for additional directories to search for macros.
eaclocal() {
[[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \
autotools_run_tool --at-m4flags aclocal "$@" $(eaclocal_amflags)
@ -326,7 +346,7 @@ eaclocal() {
_elibtoolize() {
local LIBTOOLIZE=${LIBTOOLIZE:-$(type -P glibtoolize > /dev/null && echo glibtoolize || echo libtoolize)}
if [[ $1 == "--auto-ltdl" ]] ; then
if [[ ${1} == "--auto-ltdl" ]] ; then
shift
_at_uses_libltdl && set -- "$@" --ltdl
fi
@ -354,12 +374,29 @@ eautoconf() {
echo
die "No configure.{ac,in} present!"
fi
if [[ ${WANT_AUTOCONF} != "2.1" && -e configure.in ]] ; then
eqawarn "This package has a configure.in file which has long been deprecated. Please"
eqawarn "update it to use configure.ac instead as newer versions of autotools will die"
eqawarn "when it finds this file. See https://bugs.gentoo.org/426262 for details."
case ${EAPI:-0} in
0|1|2|3|4|5|6|7)
eqawarn "This package has a configure.in file which has long been deprecated. Please"
eqawarn "update it to use configure.ac instead as newer versions of autotools will die"
eqawarn "when it finds this file. See https://bugs.gentoo.org/426262 for details."
;;
*)
# Move configure file to the new location only on newer EAPIs to ensure
# checks are done rather than retroactively breaking ebuilds.
eqawarn "Moving configure.in to configure.ac (bug #426262)"
mv configure.{in,ac} || die
;;
esac
fi
# Install config.guess and config.sub which are required by many macros
# in autoconf >=2.70.
local _gnuconfig=$(gnuconfig_findnewest)
cp "${_gnuconfig}"/config.{guess,sub} . || die
autotools_run_tool --at-m4flags autoconf "$@"
}
@ -385,7 +422,7 @@ eautomake() {
if [[ -z ${makefile_name} ]] ; then
_at_uses_automake || return 0
elif [[ -z ${FROM_EAUTORECONF} && -f ${makefile_name%.am}.in ]]; then
elif [[ -z ${FROM_EAUTORECONF} && -f ${makefile_name%.am}.in ]] ; then
local used_automake
local installed_automake
@ -393,7 +430,7 @@ eautomake() {
used_automake=$(head -n 1 < ${makefile_name%.am}.in | \
sed -e 's:.*by automake \(.*\) from .*:\1:')
if [[ ${installed_automake} != ${used_automake} ]]; then
if [[ ${installed_automake} != ${used_automake} ]] ; then
ewarn "Automake used for the package (${used_automake}) differs from" \
"the installed version (${installed_automake})."
ewarn "Forcing a full rebuild of the autotools to workaround."
@ -406,10 +443,10 @@ eautomake() {
|| extra_opts+=( --foreign )
# Older versions of automake do not support --force-missing. But we want
# to use this whenever possible to update random bundled files #133489.
# to use this whenever possible to update random bundled files, bug #133489.
case $(_automake_version) in
1.4|1.4[.-]*) ;;
*) extra_opts+=( --force-missing ) ;;
1.4|1.4[.-]*) ;;
*) extra_opts+=( --force-missing ) ;;
esac
autotools_run_tool automake --add-missing --copy "${extra_opts[@]}" "$@"
@ -429,7 +466,16 @@ eautopoint() {
# use gettext directly. So we have to copy it in manually since
# we can't let `autopoint` do it for us.
config_rpath_update() {
local dst src=$(type -P gettext | sed 's:bin/gettext:share/gettext/config.rpath:')
local dst src
case ${EAPI:-0} in
0|4|5|6)
src="${EPREFIX}/usr/share/gettext/config.rpath"
;;
*)
src="${BROOT}/usr/share/gettext/config.rpath"
;;
esac
[[ $# -eq 0 ]] && set -- $(find -name config.rpath)
[[ $# -eq 0 ]] && return 0
@ -448,13 +494,13 @@ config_rpath_update() {
autotools_env_setup() {
# We do the "latest" → version switch here because it solves
# possible order problems, see bug #270010 as an example.
if [[ ${WANT_AUTOMAKE} == "latest" ]]; then
if [[ ${WANT_AUTOMAKE} == "latest" ]] ; then
local pv
for pv in ${_LATEST_AUTOMAKE[@]/#*:} ; do
# Break on first hit to respect _LATEST_AUTOMAKE order.
local hv_args=""
case ${EAPI:-0} in
5|6)
0|4|5|6)
hv_args="--host-root"
;;
7)
@ -478,30 +524,30 @@ autotools_env_setup() {
autotools_run_tool() {
# Process our own internal flags first
local autofail=true m4flags=false missing_ok=false return_output=false
while [[ -n $1 ]] ; do
case $1 in
--at-no-fail) autofail=false;;
--at-m4flags) m4flags=true;;
--at-missing) missing_ok=true;;
--at-output) return_output=true;;
# whatever is left goes to the actual tool
*) break;;
while [[ -n ${1} ]] ; do
case ${1} in
--at-no-fail) autofail=false ;;
--at-m4flags) m4flags=true ;;
--at-missing) missing_ok=true ;;
--at-output) return_output=true ;;
# whatever is left goes to the actual tool
*) break ;;
esac
shift
done
if [[ ${EBUILD_PHASE} != "unpack" && ${EBUILD_PHASE} != "prepare" ]]; then
ewarn "QA Warning: running $1 in ${EBUILD_PHASE} phase"
if [[ ${EBUILD_PHASE_FUNC} != "src_unpack" && ${EBUILD_PHASE_FUNC} != "src_prepare" ]] ; then
eqawarn "Running '${1}' in ${EBUILD_PHASE_FUNC} phase"
fi
if ${missing_ok} && ! type -P ${1} >/dev/null ; then
einfo "Skipping '$*' due $1 not installed"
einfo "Skipping '$*' because '${1}' not installed"
return 0
fi
autotools_env_setup
# Allow people to pass in full paths. #549268
# Allow people to pass in full paths, bug #549268
local STDERR_TARGET="${T}/${1##*/}.out"
# most of the time, there will only be one run, but if there are
# more, make sure we get unique log filenames
@ -515,7 +561,7 @@ autotools_run_tool() {
fi
if ${m4flags} ; then
set -- "${1}" $(autotools_m4dir_include) "${@:2}" $(autotools_m4sysdir_include)
set -- "${1}" $(autotools_m4dir_include) $(autotools_m4sysdir_include) "${@:2}"
fi
# If the caller wants to probe something, then let them do it directly.
@ -524,19 +570,19 @@ autotools_run_tool() {
return
fi
printf "***** $1 *****\n***** PWD: ${PWD}\n***** $*\n\n" > "${STDERR_TARGET}"
printf "***** ${1} *****\n***** PWD: ${PWD}\n***** $*\n\n" > "${STDERR_TARGET}"
ebegin "Running $@"
ebegin "Running '$@'"
"$@" >> "${STDERR_TARGET}" 2>&1
if ! eend $? && ${autofail} ; then
echo
eerror "Failed Running $1 !"
eerror "Failed running '${1}'!"
eerror
eerror "Include in your bugreport the contents of:"
eerror "Include in your bug report the contents of:"
eerror
eerror " ${STDERR_TARGET}"
echo
die "Failed Running $1 !"
die "Failed running '${1}'!"
fi
}
@ -609,7 +655,7 @@ _autotools_m4dir_include() {
# We handle it below
-${flag}) ;;
*)
[[ ! -d ${x} ]] && ewarn "autotools.eclass: '${x}' does not exist"
[[ ! -d ${x} ]] && ewarn "${ECLASS}: '${x}' does not exist"
include_opts+=" -${flag} ${x}"
;;
esac

View File

@ -1,50 +1,64 @@
# Copyright 1999-2019 Gentoo Authors
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 6.
# @ECLASS: cmake-multilib.eclass
# @MAINTAINER:
# gx86-multilib team <multilib@gentoo.org>
# Michał Górny <mgorny@gentoo.org>
# @AUTHOR:
# Author: Michał Górny <mgorny@gentoo.org>
# @SUPPORTED_EAPIS: 6 7
# @BLURB: cmake-utils wrapper for multilib builds
# @SUPPORTED_EAPIS: 6 7 8
# @PROVIDES: cmake cmake-utils multilib-minimal
# @BLURB: cmake wrapper for multilib builds
# @DESCRIPTION:
# The cmake-multilib.eclass provides a glue between cmake-utils.eclass(5)
# The cmake-multilib.eclass provides a glue between cmake.eclass(5)
# and multilib-minimal.eclass(5), aiming to provide a convenient way
# to build packages using cmake for multiple ABIs.
#
# Inheriting this eclass sets IUSE and exports default multilib_src_*()
# sub-phases that call cmake-utils phase functions for each ABI enabled.
# sub-phases that call cmake phase functions for each ABI enabled.
# The multilib_src_*() functions can be defined in ebuild just like
# in multilib-minimal, yet they ought to call appropriate cmake-utils
# in multilib-minimal, yet they ought to call appropriate cmake
# phase rather than 'default'.
[[ ${EAPI} == [67] ]] && : ${CMAKE_ECLASS:=cmake-utils}
# @ECLASS-VARIABLE: CMAKE_ECLASS
# @PRE_INHERIT
# @DESCRIPTION:
# Default is "cmake-utils" for compatibility. Specify "cmake" for ebuilds
# that ported from cmake-utils.eclass to cmake.eclass already.
: ${CMAKE_ECLASS:=cmake-utils}
# Only "cmake" is supported in EAPI-8 and later.
# In EAPI-7, default is "cmake-utils" for compatibility. Specify "cmake" for
# ebuilds that ported to cmake.eclass already.
: ${CMAKE_ECLASS:=cmake}
case ${EAPI:-0} in
[67]) ;;
*) die "EAPI=${EAPI} is not supported" ;;
# @ECLASS-VARIABLE: _CMAKE_ECLASS_IMPL
# @INTERNAL
# @DESCRIPTION:
# TODO: Cleanup once EAPI-7 support is gone.
_CMAKE_ECLASS_IMPL=cmake
case ${EAPI} in
6|7|8)
case ${CMAKE_ECLASS} in
cmake-utils|cmake) ;;
*)
eerror "Unknown value for \${CMAKE_ECLASS}"
die "Value ${CMAKE_ECLASS} is not supported"
;;
esac
_CMAKE_ECLASS_IMPL=${CMAKE_ECLASS}
;;
*) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;;
esac
if [[ ${CMAKE_IN_SOURCE_BUILD} ]]; then
die "${ECLASS}: multilib support requires out-of-source builds."
fi
case ${CMAKE_ECLASS} in
cmake-utils|cmake) ;;
*)
eerror "Unknown value for \${CMAKE_ECLASS}"
die "Value ${CMAKE_ECLASS} is not supported"
;;
esac
if [[ -z ${_CMAKE_MULTILIB_ECLASS} ]]; then
_CMAKE_MULTILIB_ECLASS=1
inherit ${CMAKE_ECLASS} multilib-minimal
EXPORT_FUNCTIONS src_configure src_compile src_test src_install
inherit ${_CMAKE_ECLASS_IMPL} multilib-minimal
cmake-multilib_src_configure() {
local _cmake_args=( "${@}" )
@ -53,7 +67,7 @@ cmake-multilib_src_configure() {
}
multilib_src_configure() {
${CMAKE_ECLASS}_src_configure "${_cmake_args[@]}"
${_CMAKE_ECLASS_IMPL}_src_configure "${_cmake_args[@]}"
}
cmake-multilib_src_compile() {
@ -63,7 +77,7 @@ cmake-multilib_src_compile() {
}
multilib_src_compile() {
${CMAKE_ECLASS}_src_compile "${_cmake_args[@]}"
${_CMAKE_ECLASS_IMPL}_src_compile "${_cmake_args[@]}"
}
cmake-multilib_src_test() {
@ -73,7 +87,7 @@ cmake-multilib_src_test() {
}
multilib_src_test() {
${CMAKE_ECLASS}_src_test "${_cmake_args[@]}"
${_CMAKE_ECLASS_IMPL}_src_test "${_cmake_args[@]}"
}
cmake-multilib_src_install() {
@ -83,5 +97,9 @@ cmake-multilib_src_install() {
}
multilib_src_install() {
${CMAKE_ECLASS}_src_install "${_cmake_args[@]}"
${_CMAKE_ECLASS_IMPL}_src_install "${_cmake_args[@]}"
}
fi
EXPORT_FUNCTIONS src_configure src_compile src_test src_install

View File

@ -1,4 +1,4 @@
# Copyright 1999-2019 Gentoo Authors
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: cmake-utils.eclass
@ -10,8 +10,11 @@
# (undisclosed contributors)
# Original author: Zephyrus (zephyrus@mirach.it)
# @SUPPORTED_EAPIS: 5 6 7
# @PROVIDES: ninja-utils
# @BLURB: common ebuild functions for cmake-based packages
# @DEPRECATED: cmake.eclass
# @DESCRIPTION:
# DEPRECATED: This no longer receives any changes. Everyone must port to cmake.eclass.
# The cmake-utils eclass makes creating ebuilds for cmake-based packages much easier.
# It provides all inherited features (DOCS, HTML_DOCS, PATCHES) along with out-of-source
# builds (default), in-source builds and an implementation of the well-known use_enable
@ -92,6 +95,7 @@ _CMAKE_UTILS_ECLASS=1
# "no" to disable (default) or anything else to enable.
# @ECLASS-VARIABLE: CMAKE_EXTRA_CACHE_FILE
# @USER_VARIABLE
# @DEFAULT_UNSET
# @DESCRIPTION:
# Specifies an extra cache file to pass to cmake. This is the analog of EXTRA_ECONF
@ -99,6 +103,7 @@ _CMAKE_UTILS_ECLASS=1
# Should be set by user in a per-package basis in /etc/portage/package.env.
# @ECLASS-VARIABLE: CMAKE_UTILS_QA_SRC_DIR_READONLY
# @USER_VARIABLE
# @DEFAULT_UNSET
# @DESCRIPTION:
# After running cmake-utils_src_prepare, sets ${S} to read-only. This is
@ -338,6 +343,18 @@ cmake-utils_use_find_package() {
_cmake_use_me_now_inverted CMAKE_DISABLE_FIND_PACKAGE_ "$@" ;
}
# @FUNCTION: cmake_use_find_package
# @USAGE: <USE flag> <package name>
# @DESCRIPTION:
# Alias for cmake-utils_use_find_package.
cmake_use_find_package() {
if [[ "$#" != 2 ]] ; then
die "Usage: cmake_use_find_package <USE flag> <package name>"
fi
cmake-utils_use_find_package "$@" ;
}
# @FUNCTION: cmake-utils_use_disable
# @USAGE: <USE flag> [flag name]
# @DESCRIPTION:
@ -420,10 +437,10 @@ _cmake_modify-cmakelists() {
# Comment out all set (<some_should_be_user_defined_variable> value)
find "${CMAKE_USE_DIR}" -name CMakeLists.txt -exec sed \
-e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_BUILD_TYPE[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \
-e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_BUILD_TYPE\([[:space:]].*)\|)\)/I{s/^/#_cmake_modify_IGNORE /g}' \
-e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_COLOR_MAKEFILE[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \
-e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_INSTALL_PREFIX[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \
-e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_VERBOSE_MAKEFILE[[:space:]].*)/I{s/^/#G_cmake_modify_IGNORE /g}' \
-e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_VERBOSE_MAKEFILE[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \
-i {} + || die "${LINENO}: failed to disable hardcoded settings"
local x
for x in $(find "${CMAKE_USE_DIR}" -name CMakeLists.txt -exec grep -l "^#_cmake_modify_IGNORE" {} +;); do
@ -612,7 +629,7 @@ cmake-utils_src_configure() {
fi
fi
if [[ ${EPREFIX} ]]; then
if use prefix-guest; then
cat >> "${build_rules}" <<- _EOF_ || die
# in Prefix we need rpath and must ensure cmake gets our default linker path
# right ... except for Darwin hosts
@ -644,12 +661,18 @@ cmake-utils_src_configure() {
SET (CMAKE_INSTALL_MANDIR "${EPREFIX}/usr/share/man" CACHE PATH "")
SET (CMAKE_USER_MAKE_RULES_OVERRIDE "${build_rules}" CACHE FILEPATH "Gentoo override rules")
_EOF_
# See bug 689410
if [[ "${ARCH}" == riscv ]]; then
echo 'SET (CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX '"${libdir#lib}"' CACHE STRING "library search suffix" FORCE)' >> "${common_config}" || die
fi
[[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo 'SET (CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> "${common_config}"
if [[ ${EAPI} != [56] ]]; then
cat >> "${common_config}" <<- _EOF_ || die
SET (CMAKE_INSTALL_DOCDIR "${EPREFIX}/usr/share/doc/${PF}" CACHE PATH "")
SET (BUILD_SHARED_LIBS ON CACHE BOOLEAN "")
SET (BUILD_SHARED_LIBS ON CACHE BOOL "")
_EOF_
fi

View File

@ -1,4 +1,4 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: cmake.eclass
@ -9,7 +9,8 @@
# Maciej Mrozowski <reavertm@gentoo.org>
# (undisclosed contributors)
# Original author: Zephyrus (zephyrus@mirach.it)
# @SUPPORTED_EAPIS: 7
# @SUPPORTED_EAPIS: 7 8
# @PROVIDES: ninja-utils
# @BLURB: common ebuild functions for cmake-based packages
# @DESCRIPTION:
# The cmake eclass makes creating ebuilds for cmake-based packages much easier.
@ -17,30 +18,44 @@
# out-of-source builds (default), in-source builds and an implementation of the
# well-known use_enable function for CMake.
case ${EAPI} in
7|8) ;;
*) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;;
esac
if [[ -z ${_CMAKE_ECLASS} ]]; then
_CMAKE_ECLASS=1
inherit flag-o-matic multiprocessing ninja-utils toolchain-funcs xdg-utils
# @ECLASS-VARIABLE: BUILD_DIR
# @DEFAULT_UNSET
# @DESCRIPTION:
# Build directory where all cmake processed files should be generated.
# For in-source build it's fixed to ${CMAKE_USE_DIR}.
# For out-of-source build it can be overridden, by default it uses
# ${WORKDIR}/${P}_build.
: ${BUILD_DIR:=${WORKDIR}/${P}_build}
# ${CMAKE_USE_DIR}_build (in EAPI-7: ${WORKDIR}/${P}_build).
[[ ${EAPI} == 7 ]] && : ${BUILD_DIR:=${WORKDIR}/${P}_build}
# EAPI-8: set inside _cmake_check_build_dir
# @ECLASS-VARIABLE: CMAKE_BINARY
# @DESCRIPTION:
# Eclass can use different cmake binary than the one provided in by system.
: ${CMAKE_BINARY:=cmake}
[[ ${EAPI} == 7 ]] && : ${CMAKE_BUILD_TYPE:=Gentoo}
# @ECLASS-VARIABLE: CMAKE_BUILD_TYPE
# @DESCRIPTION:
# Set to override default CMAKE_BUILD_TYPE. Only useful for packages
# known to make use of "if (CMAKE_BUILD_TYPE MATCHES xxx)".
# If about to be set - needs to be set before invoking cmake_src_configure.
# You usually do *NOT* want nor need to set it as it pulls CMake default
# build-type specific compiler flags overriding make.conf.
: ${CMAKE_BUILD_TYPE:=Gentoo}
#
# The default is RelWithDebInfo as that is least likely to append undesirable
# flags. However, you may still need to sed CMake files or choose a different
# build type to achieve desirable results.
#
# In EAPI 7, the default was non-standard build type of Gentoo.
: ${CMAKE_BUILD_TYPE:=RelWithDebInfo}
# @ECLASS-VARIABLE: CMAKE_IN_SOURCE_BUILD
# @DEFAULT_UNSET
@ -48,6 +63,7 @@ _CMAKE_ECLASS=1
# Set to enable in-source build.
# @ECLASS-VARIABLE: CMAKE_MAKEFILE_GENERATOR
# @PRE_INHERIT
# @DEFAULT_UNSET
# @DESCRIPTION:
# Specify a makefile generator to be used by cmake.
@ -56,17 +72,29 @@ _CMAKE_ECLASS=1
: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
# @ECLASS-VARIABLE: CMAKE_REMOVE_MODULES_LIST
# @PRE_INHERIT
# @DEFAULT_UNSET
# @DESCRIPTION:
# Array of CMake modules that will be removed in $S during src_prepare,
# in order to force packages to use the system version.
# Set to "none" to disable removing modules entirely.
: ${CMAKE_REMOVE_MODULES_LIST:=FindBLAS FindLAPACK}
# Array of .cmake modules to be removed in ${CMAKE_USE_DIR} (in EAPI-7: ${S})
# during src_prepare, in order to force packages to use the system version.
# By default, contains "FindBLAS" and "FindLAPACK".
# Set to empty to disable removing modules entirely.
if [[ ${CMAKE_REMOVE_MODULES_LIST} ]]; then
if [[ ${EAPI} != 7 ]]; then
[[ ${CMAKE_REMOVE_MODULES_LIST@a} == *a* ]] ||
die "CMAKE_REMOVE_MODULES_LIST must be an array"
fi
else
if ! [[ ${CMAKE_REMOVE_MODULES_LIST@a} == *a* && ${#CMAKE_REMOVE_MODULES_LIST[@]} -eq 0 ]]; then
CMAKE_REMOVE_MODULES_LIST=( FindBLAS FindLAPACK )
fi
fi
# @ECLASS-VARIABLE: CMAKE_USE_DIR
# @DESCRIPTION:
# Sets the directory where we are working with cmake, for example when
# application uses autotools and only one plugin needs to be done by cmake.
# By default it uses ${S}.
# By default it uses current working directory (in EAPI-7: ${S}).
# @ECLASS-VARIABLE: CMAKE_VERBOSE
# @DESCRIPTION:
@ -81,6 +109,7 @@ _CMAKE_ECLASS=1
: ${CMAKE_WARN_UNUSED_CLI:=yes}
# @ECLASS-VARIABLE: CMAKE_EXTRA_CACHE_FILE
# @USER_VARIABLE
# @DEFAULT_UNSET
# @DESCRIPTION:
# Specifies an extra cache file to pass to cmake. This is the analog of EXTRA_ECONF
@ -88,24 +117,16 @@ _CMAKE_ECLASS=1
# Should be set by user in a per-package basis in /etc/portage/package.env.
# @ECLASS-VARIABLE: CMAKE_QA_SRC_DIR_READONLY
# @USER_VARIABLE
# @DEFAULT_UNSET
# @DESCRIPTION:
# After running cmake_src_prepare, sets ${S} to read-only. This is
# a user flag and should under _no circumstances_ be set in the ebuild.
# Helps in improving QA of build systems that write to source tree.
case ${EAPI} in
7) ;;
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
inherit toolchain-funcs ninja-utils flag-o-matic multiprocessing xdg-utils
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
# After running cmake_src_prepare, sets ${CMAKE_USE_DIR} (in EAPI-7: ${S}) to
# read-only. This is a user flag and should under _no circumstances_ be set in
# the ebuild. Helps in improving QA of build systems that write to source tree.
[[ ${CMAKE_MIN_VERSION} ]] && die "CMAKE_MIN_VERSION is banned; if necessary, set BDEPEND=\">=dev-util/cmake-${CMAKE_MIN_VERSION}\" directly"
[[ ${CMAKE_BUILD_DIR} ]] && die "The ebuild must be migrated to BUILD_DIR"
[[ ${CMAKE_REMOVE_MODULES} ]] && die "CMAKE_REMOVE_MODULES is banned, set CMAKE_REMOVE_MODULES_LIST=\"\" instead"
[[ ${CMAKE_REMOVE_MODULES} ]] && die "CMAKE_REMOVE_MODULES is banned, set CMAKE_REMOVE_MODULES_LIST array instead"
[[ ${CMAKE_UTILS_QA_SRC_DIR_READONLY} ]] && die "Use CMAKE_QA_SRC_DIR_READONLY instead"
[[ ${WANT_CMAKE} ]] && die "WANT_CMAKE has been removed and is a no-op"
[[ ${PREFIX} ]] && die "PREFIX has been removed and is a no-op"
@ -124,27 +145,23 @@ case ${CMAKE_MAKEFILE_GENERATOR} in
esac
if [[ ${PN} != cmake ]]; then
BDEPEND+=" dev-util/cmake"
BDEPEND+=" >=dev-util/cmake-3.20.5"
fi
# @FUNCTION: _cmake_banned_func
# @INTERNAL
# @FUNCTION: cmake_run_in
# @USAGE: <working dir> <run command>
# @DESCRIPTION:
# Banned functions are banned.
_cmake_banned_func() {
die "${FUNCNAME[1]} is banned. use -D$1<related_CMake_variable>=\"\$(usex $2)\" instead"
}
# Determine using IN or OUT source build
_cmake_check_build_dir() {
: ${CMAKE_USE_DIR:=${S}}
if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then
# we build in source dir
BUILD_DIR="${CMAKE_USE_DIR}"
# Set the desired working dir for a function or command.
cmake_run_in() {
if [[ -z ${2} ]]; then
die "${FUNCNAME[0]} must be passed at least two arguments"
fi
mkdir -p "${BUILD_DIR}" || die
einfo "Working in BUILD_DIR: \"$BUILD_DIR\""
[[ -e ${1} ]] || die "${FUNCNAME[0]}: Nonexistent path: ${1}"
pushd ${1} > /dev/null || die
"${@:2}"
popd > /dev/null || die
}
# @FUNCTION: cmake_comment_add_subdirectory
@ -153,16 +170,17 @@ _cmake_check_build_dir() {
# Comment out one or more add_subdirectory calls in CMakeLists.txt in the current directory
cmake_comment_add_subdirectory() {
if [[ -z ${1} ]]; then
die "comment_add_subdirectory must be passed at least one directory name to comment"
die "${FUNCNAME[0]} must be passed at least one directory name to comment"
fi
if [[ -e "CMakeLists.txt" ]]; then
local d
for d in $@; do
sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${d//\//\\/}[[:space:]]*)/I s/^/#DONOTCOMPILE /" \
-i CMakeLists.txt || die "failed to comment add_subdirectory(${d})"
done
fi
[[ -e "CMakeLists.txt" ]] || return
local d
for d in $@; do
d=${d//\//\\/}
sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${d}[[:space:]]*)/I s/^/#DONOTCOMPILE /" \
-i CMakeLists.txt || die "failed to comment add_subdirectory(${d})"
done
}
# @FUNCTION: comment_add_subdirectory
@ -173,18 +191,6 @@ comment_add_subdirectory() {
die "comment_add_subdirectory is banned. Use cmake_comment_add_subdirectory instead"
}
# @FUNCTION: cmake-utils_use_with
# @INTERNAL
# @DESCRIPTION:
# Banned. Use -DWITH_FOO=$(usex foo) instead.
cmake-utils_use_with() { _cmake_banned_func WITH_ "$@" ; }
# @FUNCTION: cmake-utils_use_enable
# @INTERNAL
# @DESCRIPTION:
# Banned. Use -DENABLE_FOO=$(usex foo) instead.
cmake-utils_use_enable() { _cmake_banned_func ENABLE_ "$@" ; }
# @FUNCTION: cmake_use_find_package
# @USAGE: <USE flag> <package name>
# @DESCRIPTION:
@ -203,6 +209,26 @@ cmake_use_find_package() {
echo "-DCMAKE_DISABLE_FIND_PACKAGE_$2=$(use $1 && echo OFF || echo ON)"
}
# @FUNCTION: _cmake_banned_func
# @INTERNAL
# @DESCRIPTION:
# Banned functions are banned.
_cmake_banned_func() {
die "${FUNCNAME[1]} is banned. use -D$1<related_CMake_variable>=\"\$(usex $2)\" instead"
}
# @FUNCTION: cmake-utils_use_with
# @INTERNAL
# @DESCRIPTION:
# Banned. Use -DWITH_FOO=$(usex foo) instead.
cmake-utils_use_with() { _cmake_banned_func WITH_ "$@" ; }
# @FUNCTION: cmake-utils_use_enable
# @INTERNAL
# @DESCRIPTION:
# Banned. Use -DENABLE_FOO=$(usex foo) instead.
cmake-utils_use_enable() { _cmake_banned_func ENABLE_ "$@" ; }
# @FUNCTION: cmake-utils_use_disable
# @INTERNAL
# @DESCRIPTION:
@ -251,6 +277,32 @@ cmake-utils_use() { _cmake_banned_func "" "$@" ; }
# Banned. Use -DNOFOO=$(usex !foo) instead.
cmake-utils_useno() { _cmake_banned_func "" "$@" ; }
# @FUNCTION: _cmake_check_build_dir
# @INTERNAL
# @DESCRIPTION:
# Determine using IN or OUT source build
_cmake_check_build_dir() {
if [[ ${EAPI} == 7 ]]; then
: ${CMAKE_USE_DIR:=${S}}
else
: ${CMAKE_USE_DIR:=${PWD}}
fi
if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then
# we build in source dir
BUILD_DIR="${CMAKE_USE_DIR}"
else
: ${BUILD_DIR:=${CMAKE_USE_DIR}_build}
fi
einfo "Source directory (CMAKE_USE_DIR): \"${CMAKE_USE_DIR}\""
einfo "Build directory (BUILD_DIR): \"${BUILD_DIR}\""
mkdir -p "${BUILD_DIR}" || die
}
# @FUNCTION: _cmake_modify-cmakelists
# @INTERNAL
# @DESCRIPTION:
# Internal function for modifying hardcoded definitions.
# Removes dangerous definitions that override Gentoo settings.
_cmake_modify-cmakelists() {
@ -275,7 +327,7 @@ _cmake_modify-cmakelists() {
# NOTE Append some useful summary here
cat >> "${CMAKE_USE_DIR}"/CMakeLists.txt <<- _EOF_ || die
MESSAGE(STATUS "<<< Gentoo configuration >>>
message(STATUS "<<< Gentoo configuration >>>
Build type \${CMAKE_BUILD_TYPE}
Install path \${CMAKE_INSTALL_PREFIX}
Compiler flags:
@ -290,16 +342,18 @@ _cmake_modify-cmakelists() {
# @FUNCTION: cmake_src_prepare
# @DESCRIPTION:
# Apply ebuild and user patches.
# Apply ebuild and user patches. *MUST* be run or cmake_src_configure will fail.
cmake_src_prepare() {
debug-print-function ${FUNCNAME} "$@"
# FIXME: workaround from cmake-utils; use current working directory instead, bug #704524
# esp. test with 'special' pkgs like: app-arch/brotli, media-gfx/gmic, net-libs/quiche
pushd "${S}" > /dev/null || die
if [[ ${EAPI} == 7 ]]; then
pushd "${S}" > /dev/null || die # workaround from cmake-utils
# in EAPI-8, we use current working directory instead, bug #704524
# esp. test with 'special' pkgs like: app-arch/brotli, media-gfx/gmic, net-libs/quiche
fi
_cmake_check_build_dir
default_src_prepare
_cmake_check_build_dir
# check if CMakeLists.txt exist and if no then die
if [[ ! -e ${CMAKE_USE_DIR}/CMakeLists.txt ]] ; then
@ -317,49 +371,55 @@ cmake_src_prepare() {
fi
local modules_list
if [[ $(declare -p CMAKE_REMOVE_MODULES_LIST) == "declare -a"* ]]; then
modules_list=( "${CMAKE_REMOVE_MODULES_LIST[@]}" )
else
if [[ ${EAPI} == 7 && $(declare -p CMAKE_REMOVE_MODULES_LIST) != "declare -a"* ]]; then
modules_list=( ${CMAKE_REMOVE_MODULES_LIST} )
else
modules_list=( "${CMAKE_REMOVE_MODULES_LIST[@]}" )
fi
local name
for name in "${modules_list[@]}" ; do
find "${S}" -name ${name}.cmake -exec rm -v {} + || die
if [[ ${EAPI} == 7 ]]; then
find "${S}" -name ${name}.cmake -exec rm -v {} + || die
else
find -name "${name}.cmake" -exec rm -v {} + || die
fi
done
# Remove dangerous things.
_cmake_modify-cmakelists
popd > /dev/null || die
if [[ ${EAPI} == 7 ]]; then
popd > /dev/null || die
fi
# make ${S} read-only in order to detect broken build-systems
# Make ${CMAKE_USE_DIR} (in EAPI-7: ${S}) read-only in order to detect
# broken build systems.
if [[ ${CMAKE_QA_SRC_DIR_READONLY} && ! ${CMAKE_IN_SOURCE_BUILD} ]]; then
chmod -R a-w "${S}"
if [[ ${EAPI} == 7 ]]; then
chmod -R a-w "${S}"
else
chmod -R a-w "${CMAKE_USE_DIR}"
fi
fi
_CMAKE_SRC_PREPARE_HAS_RUN=1
}
# @VARIABLE: mycmakeargs
# @DEFAULT_UNSET
# @DESCRIPTION:
# Optional cmake defines as a bash array. Should be defined before calling
# src_configure.
# @CODE
# src_configure() {
# local mycmakeargs=(
# $(cmake_use_with openconnect)
# )
#
# cmake_src_configure
# }
# @CODE
# @FUNCTION: cmake_src_configure
# @DESCRIPTION:
# General function for configuring with cmake. Default behaviour is to start an
# out-of-source build.
# Passes arguments to cmake by reading from an optionally pre-defined local
# mycmakeargs bash array.
# @CODE
# src_configure() {
# local mycmakeargs=(
# $(cmake_use_find_package foo LibFoo)
# )
# cmake_src_configure
# }
# @CODE
cmake_src_configure() {
debug-print-function ${FUNCNAME} "$@"
@ -375,12 +435,12 @@ cmake_src_configure() {
local build_rules=${BUILD_DIR}/gentoo_rules.cmake
cat > "${build_rules}" <<- _EOF_ || die
SET (CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "ASM compile command" FORCE)
SET (CMAKE_ASM-ATT_COMPILE_OBJECT "<CMAKE_ASM-ATT_COMPILER> <DEFINES> <INCLUDES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c -x assembler <SOURCE>" CACHE STRING "ASM-ATT compile command" FORCE)
SET (CMAKE_ASM-ATT_LINK_FLAGS "-nostdlib" CACHE STRING "ASM-ATT link flags" FORCE)
SET (CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE)
SET (CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE)
SET (CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> ${FCFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "Fortran compile command" FORCE)
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "ASM compile command" FORCE)
set(CMAKE_ASM-ATT_COMPILE_OBJECT "<CMAKE_ASM-ATT_COMPILER> <DEFINES> <INCLUDES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c -x assembler <SOURCE>" CACHE STRING "ASM-ATT compile command" FORCE)
set(CMAKE_ASM-ATT_LINK_FLAGS "-nostdlib" CACHE STRING "ASM-ATT link flags" FORCE)
set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE)
set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE)
set(CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> ${FCFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "Fortran compile command" FORCE)
_EOF_
local myCC=$(tc-getCC) myCXX=$(tc-getCXX) myFC=$(tc-getFC)
@ -392,14 +452,14 @@ cmake_src_configure() {
# space separated.
local toolchain_file=${BUILD_DIR}/gentoo_toolchain.cmake
cat > ${toolchain_file} <<- _EOF_ || die
SET (CMAKE_ASM_COMPILER "${myCC/ /;}")
SET (CMAKE_ASM-ATT_COMPILER "${myCC/ /;}")
SET (CMAKE_C_COMPILER "${myCC/ /;}")
SET (CMAKE_CXX_COMPILER "${myCXX/ /;}")
SET (CMAKE_Fortran_COMPILER "${myFC/ /;}")
SET (CMAKE_AR $(type -P $(tc-getAR)) CACHE FILEPATH "Archive manager" FORCE)
SET (CMAKE_RANLIB $(type -P $(tc-getRANLIB)) CACHE FILEPATH "Archive index generator" FORCE)
SET (CMAKE_SYSTEM_PROCESSOR "${CHOST%%-*}")
set(CMAKE_ASM_COMPILER "${myCC/ /;}")
set(CMAKE_ASM-ATT_COMPILER "${myCC/ /;}")
set(CMAKE_C_COMPILER "${myCC/ /;}")
set(CMAKE_CXX_COMPILER "${myCXX/ /;}")
set(CMAKE_Fortran_COMPILER "${myFC/ /;}")
set(CMAKE_AR $(type -P $(tc-getAR)) CACHE FILEPATH "Archive manager" FORCE)
set(CMAKE_RANLIB $(type -P $(tc-getRANLIB)) CACHE FILEPATH "Archive index generator" FORCE)
set(CMAKE_SYSTEM_PROCESSOR "${CHOST%%-*}")
_EOF_
# We are using the C compiler for assembly by default.
@ -415,24 +475,24 @@ cmake_src_configure() {
Winnt)
sysname="Windows"
cat >> "${toolchain_file}" <<- _EOF_ || die
SET (CMAKE_RC_COMPILER $(tc-getRC))
set(CMAKE_RC_COMPILER $(tc-getRC))
_EOF_
;;
*) sysname="${KERNEL}" ;;
esac
cat >> "${toolchain_file}" <<- _EOF_ || die
SET (CMAKE_SYSTEM_NAME "${sysname}")
set(CMAKE_SYSTEM_NAME "${sysname}")
_EOF_
if [ "${SYSROOT:-/}" != "/" ] ; then
# When cross-compiling with a sysroot (e.g. with crossdev's emerge wrappers)
# we need to tell cmake to use libs/headers from the sysroot but programs from / only.
cat >> "${toolchain_file}" <<- _EOF_ || die
SET (CMAKE_FIND_ROOT_PATH "${SYSROOT}")
SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH "${SYSROOT}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
_EOF_
fi
fi
@ -441,20 +501,16 @@ cmake_src_configure() {
cat >> "${build_rules}" <<- _EOF_ || die
# in Prefix we need rpath and must ensure cmake gets our default linker path
# right ... except for Darwin hosts
IF (NOT APPLE)
SET (CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE)
SET (CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH "${EPREFIX}/usr/${CHOST}/lib/gcc;${EPREFIX}/usr/${CHOST}/lib;${EPREFIX}/usr/$(get_libdir);${EPREFIX}/$(get_libdir)"
CACHE STRING "" FORCE)
ELSE ()
SET (CMAKE_PREFIX_PATH "${EPREFIX}/usr" CACHE STRING "" FORCE)
SET (CMAKE_MACOSX_RPATH ON CACHE BOOL "" FORCE)
SET (CMAKE_SKIP_BUILD_RPATH OFF CACHE BOOL "" FORCE)
SET (CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE)
SET (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOL "" FORCE)
ENDIF (NOT APPLE)
if(NOT APPLE)
set(CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE)
set(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH "${EPREFIX}/usr/${CHOST}/lib/gcc;${EPREFIX}/usr/${CHOST}/lib;${EPREFIX}/usr/$(get_libdir);${EPREFIX}/$(get_libdir)" CACHE STRING "" FORCE)
else()
set(CMAKE_PREFIX_PATH "${EPREFIX}/usr" CACHE STRING "" FORCE)
set(CMAKE_MACOSX_RPATH ON CACHE BOOL "" FORCE)
set(CMAKE_SKIP_BUILD_RPATH OFF CACHE BOOL "" FORCE)
set(CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOL "" FORCE)
endif()
_EOF_
fi
@ -462,31 +518,46 @@ cmake_src_configure() {
local common_config=${BUILD_DIR}/gentoo_common_config.cmake
local libdir=$(get_libdir)
cat > "${common_config}" <<- _EOF_ || die
SET (CMAKE_GENTOO_BUILD ON CACHE BOOL "Indicate Gentoo package build")
SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE)
SET (CMAKE_INSTALL_LIBDIR ${libdir} CACHE PATH "Output directory for libraries")
SET (CMAKE_INSTALL_INFODIR "${EPREFIX}/usr/share/info" CACHE PATH "")
SET (CMAKE_INSTALL_MANDIR "${EPREFIX}/usr/share/man" CACHE PATH "")
SET (CMAKE_USER_MAKE_RULES_OVERRIDE "${build_rules}" CACHE FILEPATH "Gentoo override rules")
SET (CMAKE_INSTALL_DOCDIR "${EPREFIX}/usr/share/doc/${PF}" CACHE PATH "")
SET (BUILD_SHARED_LIBS ON CACHE BOOL "")
set(CMAKE_GENTOO_BUILD ON CACHE BOOL "Indicate Gentoo package build")
set(LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE)
set(CMAKE_INSTALL_LIBDIR ${libdir} CACHE PATH "Output directory for libraries")
set(CMAKE_INSTALL_INFODIR "${EPREFIX}/usr/share/info" CACHE PATH "")
set(CMAKE_INSTALL_MANDIR "${EPREFIX}/usr/share/man" CACHE PATH "")
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${build_rules}" CACHE FILEPATH "Gentoo override rules")
set(CMAKE_INSTALL_DOCDIR "${EPREFIX}/usr/share/doc/${PF}" CACHE PATH "")
set(BUILD_SHARED_LIBS ON CACHE BOOL "")
_EOF_
if [[ -n ${_ECM_ECLASS} ]]; then
echo 'set(ECM_DISABLE_QMLPLUGINDUMP ON CACHE BOOL "")' >> "${common_config}" || die
fi
# See bug 689410
if [[ "${ARCH}" == riscv ]]; then
echo 'set(CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX '"${libdir#lib}"' CACHE STRING "library search suffix" FORCE)' >> "${common_config}" || die
fi
if [[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]]; then
echo 'SET (CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> "${common_config}" || die
echo 'set(CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> "${common_config}" || die
fi
# See bug 735820
if [[ ${EAPI} != 7 ]]; then
echo 'set(CMAKE_INSTALL_ALWAYS 1)' >> "${common_config}" || die
fi
# Wipe the default optimization flags out of CMake
if [[ ${CMAKE_BUILD_TYPE} != Gentoo ]]; then
cat >> ${common_config} <<- _EOF_ || die
SET (CMAKE_ASM_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_ASM-ATT_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_MODULE_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_STATIC_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
set(CMAKE_ASM_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
set(CMAKE_ASM-ATT_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
set(CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
set(CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
set(CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
set(CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
set(CMAKE_MODULE_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
set(CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
set(CMAKE_STATIC_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
_EOF_
fi
@ -538,8 +609,8 @@ cmake_src_configure() {
# @FUNCTION: cmake_src_compile
# @DESCRIPTION:
# General function for compiling with cmake.
# Automatically detects the build type. All arguments are passed to emake.
# General function for compiling with cmake. All arguments are passed
# to cmake_build.
cmake_src_compile() {
debug-print-function ${FUNCNAME} "$@"
@ -549,7 +620,8 @@ cmake_src_compile() {
# @FUNCTION: cmake_build
# @DESCRIPTION:
# Function for building the package. Automatically detects the build type.
# All arguments are passed to emake.
# All arguments are passed to eninja (default) or emake depending on the value
# of CMAKE_MAKEFILE_GENERATOR.
cmake_build() {
debug-print-function ${FUNCNAME} "$@"
@ -629,9 +701,17 @@ cmake_src_install() {
die "died running ${CMAKE_MAKEFILE_GENERATOR} install"
popd > /dev/null || die
pushd "${S}" > /dev/null || die
einstalldocs
popd > /dev/null || die
if [[ ${EAPI} == 7 ]]; then
pushd "${S}" > /dev/null || die
einstalldocs
popd > /dev/null || die
else
pushd "${CMAKE_USE_DIR}" > /dev/null || die
einstalldocs
popd > /dev/null || die
fi
}
fi
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install

View File

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: desktop.eclass
@ -10,7 +10,7 @@ if [[ -z ${_DESKTOP_ECLASS} ]]; then
_DESKTOP_ECLASS=1
# @FUNCTION: make_desktop_entry
# @USAGE: make_desktop_entry(<command>, [name], [icon], [type], [fields])
# @USAGE: <command> [name] [icon] [type] [fields]
# @DESCRIPTION:
# Make a .desktop file.
#
@ -162,8 +162,15 @@ make_desktop_entry() {
else
local desktop_name="${PN}-${slot}"
fi
local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop"
#local desktop=${T}/${exec%% *:-${desktop_name}}.desktop
local desktop_exec="${exec%%[[:space:]]*}"
desktop_exec="${desktop_exec##*/}"
# Prevent collisions if a file with the same name already exists #771708
local desktop="${desktop_exec}-${desktop_name}" count=0
while [[ -e ${ED}/usr/share/applications/${desktop}.desktop ]]; do
desktop="${desktop_exec}-$((++count))-${desktop_name}"
done
desktop="${T}/${desktop}.desktop"
# Don't append another ";" when a valid category value is provided.
type=${type%;}${type:+;}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: eapi7-ver.eclass
@ -17,8 +17,7 @@
#
# https://bugs.gentoo.org/482170
#
# @ROFF .SS
# Version strings
# @SUBSECTION Version strings
#
# The functions support arbitrary version strings consisting of version
# components interspersed with (possibly empty) version separators.
@ -50,8 +49,7 @@
# 0 1 1
# @CODE
#
# @ROFF .SS
# Ranges
# @SUBSECTION Ranges
#
# A range can be specified as 'm' for m-th version component, 'm-'
# for all components starting with m-th or 'm-n' for components starting
@ -60,7 +58,7 @@
case ${EAPI:-0} in
0|1|2|3|4|5|6) ;;
7) die "${ECLASS}: EAPI=${EAPI} includes all functions from this eclass" ;;
7|8) die "${ECLASS}: EAPI=${EAPI} includes all functions from this eclass" ;;
*) die "${ECLASS}: EAPI=${EAPI} unknown" ;;
esac

View File

@ -0,0 +1,21 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: edos2unix.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @BLURB: convert files from DOS CRLF to UNIX LF line endings
# @FUNCTION: edos2unix
# @USAGE: <file> [more files ...]
# @DESCRIPTION:
# A handy replacement for dos2unix, recode, fixdos, etc... This allows
# you to remove all of these text utilities from DEPEND variables
# because this is a script based solution. Just give it a list of files
# to convert and they will all be changed from the DOS CRLF format to
# the UNIX LF format.
edos2unix() {
[[ $# -eq 0 ]] && return 0
sed -i 's/\r$//' -- "$@" || die
}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: epatch.eclass
@ -6,6 +6,7 @@
# base-system@gentoo.org
# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6
# @BLURB: easy patch application functions
# @DEPRECATED: eapply from EAPI 7
# @DESCRIPTION:
# An eclass providing epatch and epatch_user functions to easily apply
# patches to ebuilds. Mostly superseded by eapply* in EAPI 6.
@ -19,6 +20,8 @@ case ${EAPI:-0} in
die "${ECLASS}: banned in EAPI=${EAPI}; use eapply* instead";;
esac
inherit estack
# @VARIABLE: EPATCH_SOURCE
# @DESCRIPTION:
# Default directory to search for patches.
@ -209,14 +212,13 @@ epatch() {
# Let people filter things dynamically
if [[ -n ${EPATCH_EXCLUDE}${EPATCH_USER_EXCLUDE} ]] ; then
# let people use globs in the exclude
local prev_noglob=$(shopt -p -o noglob)
set -o noglob
eshopts_push -o noglob
local ex
for ex in ${EPATCH_EXCLUDE} ; do
if [[ ${patchname} == ${ex} ]] ; then
einfo " Skipping ${patchname} due to EPATCH_EXCLUDE ..."
${prev_noglob}
eshopts_pop
continue 2
fi
done
@ -224,12 +226,12 @@ epatch() {
for ex in ${EPATCH_USER_EXCLUDE} ; do
if [[ ${patchname} == ${ex} ]] ; then
einfo " Skipping ${patchname} due to EPATCH_USER_EXCLUDE ..."
${prev_noglob}
eshopts_pop
continue 2
fi
done
${prev_noglob}
eshopts_pop
fi
if [[ ${SINGLE_PATCH} == "yes" ]] ; then
@ -292,7 +294,7 @@ epatch() {
local rel_paths=$(egrep -n '^[-+]{3} [^ ]*[.][.]/' "${PATCH_TARGET}")
if [[ -n ${rel_paths} ]] ; then
echo
eerror "Rejected Patch: ${patchname} !"
eerror "Rejected Patch: ${patchname}!"
eerror " ( ${PATCH_TARGET} )"
eerror
eerror "Your patch uses relative paths '../':"
@ -357,14 +359,14 @@ epatch() {
if [[ ${count} -ge 5 ]] ; then
echo
eerror "Failed Patch: ${patchname} !"
eerror "Failed patch: ${patchname}!"
eerror " ( ${PATCH_TARGET} )"
eerror
eerror "Include in your bugreport the contents of:"
eerror "Include in your bug report the contents of:"
eerror
eerror " ${STDERR_TARGET}"
echo
die "Failed Patch: ${patchname}!"
die "Failed patch: ${patchname}!"
fi
# if everything worked, delete the full debug patch log
@ -387,7 +389,8 @@ epatch() {
case ${EAPI:-0} in
0|1|2|3|4|5)
# @VARIABLE: EPATCH_USER_SOURCE
# @ECLASS_VARIABLE: EPATCH_USER_SOURCE
# @USER_VARIABLE
# @DESCRIPTION:
# Location for user patches, see the epatch_user function.
# Should be set by the user. Don't set this in ebuilds.

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: estack.eclass
@ -115,7 +115,8 @@ evar_pop() {
local cnt=${1:-bad}
case $# in
0) cnt=1 ;;
1) isdigit "${cnt}" || die "${FUNCNAME}: first arg must be a number: $*" ;;
1) [[ -z ${cnt//[0-9]} ]] \
|| die "${FUNCNAME}: first arg must be a number: $*" ;;
*) die "${FUNCNAME}: only accepts one arg: $*" ;;
esac
@ -153,12 +154,13 @@ evar_pop() {
# eshopts_pop
# @CODE
eshopts_push() {
# Save both "shopt" and "set -o" option sets, because otherwise
# restoring posix would disable expand_aliases by side effect. #662586
estack_push eshopts "$(shopt -p -o) $(shopt -p)"
if [[ $1 == -[su] ]] ; then
estack_push eshopts "$(shopt -p)"
[[ $# -eq 0 ]] && return 0
[[ $# -le 1 ]] && return 0
shopt "$@" || die "${FUNCNAME}: bad options to shopt: $*"
else
estack_push eshopts "$(shopt -p -o)"
[[ $# -eq 0 ]] && return 0
set "$@" || die "${FUNCNAME}: bad options to set: $*"
fi
@ -196,17 +198,5 @@ eumask_pop() {
umask ${s} || die "${FUNCNAME}: sanity: could not restore umask: ${s}"
}
# @FUNCTION: isdigit
# @USAGE: <number> [more numbers]
# @DESCRIPTION:
# Return true if all arguments are numbers.
isdigit() {
local d
for d ; do
[[ ${d:-bad} == *[!0-9]* ]] && return 1
done
return 0
}
_ESTACK_ECLASS=1
fi #_ESTACK_ECLASS

View File

@ -1,9 +1,12 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 0 and 4.
# @ECLASS: eutils.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @SUPPORTED_EAPIS: 0 4 5 6 7
# @BLURB: many extra (but common) functions that are used in ebuilds
# @DESCRIPTION:
# The eutils eclass contains a suite of functions that complement
@ -13,24 +16,32 @@
#
# Due to the nature of this eclass, some functions may have maintainers
# different from the overall eclass!
#
# This eclass is DEPRECATED and must not be inherited by any new ebuilds
# or eclasses. Use the more specific split eclasses instead, or native
# package manager functions when available.
if [[ -z ${_EUTILS_ECLASS} ]]; then
_EUTILS_ECLASS=1
# implicitly inherited (now split) eclasses
case ${EAPI:-0} in
0|1|2|3|4|5|6)
inherit desktop epatch estack ltprune multilib preserve-libs \
toolchain-funcs vcs-clean
;;
0|4|5|6)
inherit desktop edos2unix epatch estack ltprune multilib \
preserve-libs strip-linguas toolchain-funcs vcs-clean wrapper
;;
7) inherit edos2unix strip-linguas wrapper ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
# @FUNCTION: emktemp
# @USAGE: [temp dir]
# @DESCRIPTION:
# Cheap replacement for when debianutils (and thus mktemp)
# does not exist on the users system.
# Cheap replacement for when coreutils (and thus mktemp) does not exist
# on the user's system.
emktemp() {
eqawarn "emktemp is deprecated. Create a temporary file in \${T} instead."
local exe="touch"
[[ $1 == -d ]] && exe="mkdir" && shift
local topdir=$1
@ -60,114 +71,6 @@ emktemp() {
fi
}
# @FUNCTION: edos2unix
# @USAGE: <file> [more files ...]
# @DESCRIPTION:
# A handy replacement for dos2unix, recode, fixdos, etc... This allows you
# to remove all of these text utilities from DEPEND variables because this
# is a script based solution. Just give it a list of files to convert and
# they will all be changed from the DOS CRLF format to the UNIX LF format.
edos2unix() {
[[ $# -eq 0 ]] && return 0
sed -i 's/\r$//' -- "$@" || die
}
# @FUNCTION: strip-linguas
# @USAGE: [<allow LINGUAS>|<-i|-u> <directories of .po files>]
# @DESCRIPTION:
# Make sure that LINGUAS only contains languages that
# a package can support. The first form allows you to
# specify a list of LINGUAS. The -i builds a list of po
# files found in all the directories and uses the
# intersection of the lists. The -u builds a list of po
# files found in all the directories and uses the union
# of the lists.
strip-linguas() {
local ls newls nols
if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then
local op=$1; shift
ls=$(find "$1" -name '*.po' -exec basename {} .po ';'); shift
local d f
for d in "$@" ; do
if [[ ${op} == "-u" ]] ; then
newls=${ls}
else
newls=""
fi
for f in $(find "$d" -name '*.po' -exec basename {} .po ';') ; do
if [[ ${op} == "-i" ]] ; then
has ${f} ${ls} && newls="${newls} ${f}"
else
has ${f} ${ls} || newls="${newls} ${f}"
fi
done
ls=${newls}
done
else
ls="$@"
fi
nols=""
newls=""
for f in ${LINGUAS} ; do
if has ${f} ${ls} ; then
newls="${newls} ${f}"
else
nols="${nols} ${f}"
fi
done
[[ -n ${nols} ]] \
&& einfo "Sorry, but ${PN} does not support the LINGUAS:" ${nols}
export LINGUAS=${newls:1}
}
# @FUNCTION: make_wrapper
# @USAGE: <wrapper> <target> [chdir] [libpaths] [installpath]
# @DESCRIPTION:
# Create a shell wrapper script named wrapper in installpath
# (defaults to the bindir) to execute target (default of wrapper) by
# first optionally setting LD_LIBRARY_PATH to the colon-delimited
# libpaths followed by optionally changing directory to chdir.
make_wrapper() {
local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5
local tmpwrapper=$(emktemp)
has "${EAPI:-0}" 0 1 2 && local EPREFIX=""
(
echo '#!/bin/sh'
if [[ -n ${libdir} ]] ; then
local var
if [[ ${CHOST} == *-darwin* ]] ; then
var=DYLD_LIBRARY_PATH
else
var=LD_LIBRARY_PATH
fi
cat <<-EOF
if [ "\${${var}+set}" = "set" ] ; then
export ${var}="\${${var}}:${EPREFIX}${libdir}"
else
export ${var}="${EPREFIX}${libdir}"
fi
EOF
fi
[[ -n ${chdir} ]] && printf 'cd "%s" &&\n' "${EPREFIX}${chdir}"
# We don't want to quote ${bin} so that people can pass complex
# things as ${bin} ... "./someprog --args"
printf 'exec %s "$@"\n' "${bin/#\//${EPREFIX}/}"
) > "${tmpwrapper}"
chmod go+rx "${tmpwrapper}"
if [[ -n ${path} ]] ; then
(
exeopts -m 0755
exeinto "${path}"
newexe "${tmpwrapper}" "${wrapper}"
) || die
else
newbin "${tmpwrapper}" "${wrapper}" || die
fi
}
path_exists() {
eerror "path_exists has been removed. Please see the following post"
eerror "for a replacement snippet:"
@ -182,57 +85,14 @@ path_exists() {
#
# Note that this function should not be used in the global scope.
use_if_iuse() {
eqawarn "use_if_iuse is deprecated."
eqawarn "Define it as a local function, or inline it:"
eqawarn " in_iuse foo && use foo"
in_iuse $1 || return 1
use $1
}
# @FUNCTION: optfeature
# @USAGE: <short description> <package atom to match> [other atoms]
# @DESCRIPTION:
# Print out a message suggesting an optional package (or packages)
# not currently installed which provides the described functionality.
#
# The following snippet would suggest app-misc/foo for optional foo support,
# app-misc/bar or app-misc/baz[bar] for optional bar support
# and either both app-misc/a and app-misc/b or app-misc/c for alphabet support.
# @CODE
# optfeature "foo support" app-misc/foo
# optfeature "bar support" app-misc/bar app-misc/baz[bar]
# optfeature "alphabet support" "app-misc/a app-misc/b" app-misc/c
# @CODE
optfeature() {
debug-print-function ${FUNCNAME} "$@"
local i j msg
local desc=$1
local flag=0
shift
for i; do
for j in ${i}; do
if has_version "${j}"; then
flag=1
else
flag=0
break
fi
done
if [[ ${flag} -eq 1 ]]; then
break
fi
done
if [[ ${flag} -eq 0 ]]; then
for i; do
msg=" "
for j in ${i}; do
msg+=" ${j} and"
done
msg="${msg:0: -4} for ${desc}"
elog "${msg}"
done
fi
}
case ${EAPI:-0} in
0|1|2)
if [[ ${EAPI:-0} == 0 ]] ; then
# @FUNCTION: epause
# @USAGE: [seconds]
@ -264,22 +124,9 @@ ebeep() {
fi
}
;;
*)
fi # EAPI 0
ebeep() {
ewarn "QA Notice: ebeep is not defined in EAPI=${EAPI}, please file a bug at https://bugs.gentoo.org"
}
epause() {
ewarn "QA Notice: epause is not defined in EAPI=${EAPI}, please file a bug at https://bugs.gentoo.org"
}
;;
esac
case ${EAPI:-0} in
0|1|2|3|4)
if [[ ${EAPI:-0} == [04] ]] ; then
# @FUNCTION: usex
# @USAGE: <USE flag> [true output] [false output] [true suffix] [false suffix]
@ -290,11 +137,9 @@ case ${EAPI:-0} in
# otherwise echo [false output][false suffix] (defaults to "no").
usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; } #382963
;;
esac
fi # EAPI [04]
case ${EAPI:-0} in
0|1|2|3|4|5)
if [[ ${EAPI:-0} == [045] ]] ; then
# @FUNCTION: einstalldocs
# @DESCRIPTION:
@ -326,7 +171,6 @@ einstalldocs() {
debug-print-function ${FUNCNAME} "${@}"
local dodoc_opts=-r
has ${EAPI} 0 1 2 3 && dodoc_opts=
if ! declare -p DOCS &>/dev/null ; then
local d
@ -377,11 +221,9 @@ in_iuse() {
has "${flag}" "${liuse[@]#[+-]}"
}
;;
esac
fi # EAPI [045]
case ${EAPI:-0} in
0|1|2|3|4|5|6)
if [[ ${EAPI:-0} == [0456] ]] ; then
# @FUNCTION: eqawarn
# @USAGE: [message]
@ -396,7 +238,6 @@ if ! declare -F eqawarn >/dev/null ; then
}
fi
;;
esac
fi # EAPI [0456]
fi

View File

@ -1,33 +1,69 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 0 and 4.
# @ECLASS: flag-o-matic.eclass
# @MAINTAINER:
# toolchain@gentoo.org
# @SUPPORTED_EAPIS: 0 4 5 6 7 8
# @BLURB: common functions to manipulate and query toolchain flags
# @DESCRIPTION:
# This eclass contains a suite of functions to help developers sanely
# and safely manage toolchain flags in their builds.
case ${EAPI:-0} in
1|2|3) die "flag-o-matic.eclass: EAPI ${EAPI} is too old." ;;
0|4|5|6|7|8) ;;
*) die "EAPI ${EAPI} is not supported by flag-o-matic.eclass." ;;
esac
if [[ -z ${_FLAG_O_MATIC_ECLASS} ]]; then
_FLAG_O_MATIC_ECLASS=1
inherit eutils toolchain-funcs multilib
inherit toolchain-funcs
[[ ${EAPI:-0} == [04567] ]] && inherit eutils
# @FUNCTION: all-flag-vars
# @DESCRIPTION:
# Return all the flag variables that our high level funcs operate on.
all-flag-vars() {
echo {ADA,C,CPP,CXX,CCAS,F,FC,LD}FLAGS
}
# @FUNCTION: setup-allowed-flags
# @INTERNAL
# @DESCRIPTION:
# {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags
# Note: shell globs and character lists are allowed
setup-allowed-flags() {
[[ ${EAPI:-0} == [04567] ]] ||
die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI:-0}."
_setup-allowed-flags "$@"
}
# @FUNCTION: _setup-allowed-flags
# @INTERNAL
# @DESCRIPTION:
# {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags
# Note: shell globs and character lists are allowed
_setup-allowed-flags() {
ALLOWED_FLAGS=(
-pipe -O '-O[12sg]' -mcpu -march -mtune
'-fstack-protector*' '-fsanitize*' '-fstack-check*' -fno-stack-check
'-fstack-protector*'
'-fsanitize*' '-fno-sanitize*'
'-fstack-check*' -fno-stack-check
-fbounds-check -fbounds-checking -fno-strict-overflow
-fno-PIE -fno-pie -nopie -no-pie -fno-unit-at-a-time
-g '-g[0-9]' -ggdb '-ggdb[0-9]' '-gdwarf-*' gstabs -gstabs+ -gz
# debugging symbols should generally be very safe to add
-g '-g[0-9]'
-ggdb '-ggdb[0-9]'
-gdwarf '-gdwarf-*'
-gstabs -gstabs+
-gz
-fno-ident -fpermissive -frecord-gcc-switches
'-fdiagnostics*' '-fplugin*'
'-W*' -w
@ -56,7 +92,9 @@ setup-allowed-flags() {
-mno-faster-structs -mfaster-structs -m32 -m64 -mx32 -mabi
-mlittle-endian -mbig-endian -EL -EB -fPIC -mlive-g0 -mcmodel
-mstack-bias -mno-stack-bias -msecure-plt '-m*-toc' -mfloat-abi
-mfix-r10000 -mno-fix-r10000 -mthumb -marm
-mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400
-mfix-rm7000 -mno-fix-rm7000 -mfix-r10000 -mno-fix-r10000
-mr10k-cache-barrier -mthumb -marm
# gcc 4.5
-mno-fma4 -mno-movbe -mno-xop -mno-lwp
@ -78,7 +116,10 @@ setup-allowed-flags() {
)
}
# inverted filters for hardened compiler. This is trying to unpick
# @FUNCTION: _filter-hardened
# @INTERNAL
# @DESCRIPTION:
# Inverted filters for hardened compiler. This is trying to unpick
# the hardened compiler defaults.
_filter-hardened() {
local f
@ -112,6 +153,9 @@ _filter-hardened() {
done
}
# @FUNCTION: _filter-var
# @INTERNAL
# @DESCRIPTION:
# Remove occurrences of strings from variable given in $1
# Strings removed are matched as globs, so for example
# '-O*' would remove -O1, -O2 etc.
@ -151,7 +195,8 @@ filter-lfs-flags() {
# _LARGEFILE_SOURCE: enable support for new LFS funcs (ftello/etc...)
# _LARGEFILE64_SOURCE: enable support for 64bit variants (off64_t/fseeko64/etc...)
# _FILE_OFFSET_BITS: default to 64bit variants (off_t is defined as off64_t)
filter-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
# _TIME_BITS: default to 64bit time_t (requires _FILE_OFFSET_BITS=64)
filter-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_TIME_BITS=64
}
# @FUNCTION: filter-ldflags
@ -304,6 +349,11 @@ replace-cpu-flags() {
return 0
}
# @FUNCTION: _is_flagq
# @USAGE: <variable> <flag>
# @INTERNAL
# @DESCRIPTION:
# Returns shell true if <flag> is in a given <variable>, else returns shell false.
_is_flagq() {
local x var="$1[*]"
for x in ${!var} ; do
@ -392,10 +442,11 @@ filter-mfpmath() {
# Strip *FLAGS of everything except known good/safe flags. This runs over all
# flags returned by all_flag_vars().
strip-flags() {
[[ $# -ne 0 ]] && die "strip-flags takes no arguments"
local x y var
local ALLOWED_FLAGS
setup-allowed-flags
_setup-allowed-flags
set -f # disable pathname expansion
@ -428,36 +479,112 @@ strip-flags() {
return 0
}
# @FUNCTION: test-flag-PROG
# @USAGE: <compiler> <flag>
# @INTERNAL
# @DESCRIPTION:
# Returns shell true if <flag> is supported by given <compiler>,
# else returns shell false.
test-flag-PROG() {
[[ ${EAPI:-0} == [04567] ]] ||
die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI:-0}."
_test-flag-PROG "$@"
}
# @FUNCTION: _test-flag-PROG
# @USAGE: <compiler> <flag>
# @INTERNAL
# @DESCRIPTION:
# Returns shell true if <flag> is supported by given <compiler>,
# else returns shell false.
_test-flag-PROG() {
local comp=$1
local lang=$2
shift 2
[[ -z ${comp} || -z $1 ]] && return 1
if [[ -z ${comp} ]]; then
return 1
fi
if [[ -z $1 ]]; then
return 1
fi
# verify selected compiler exists before using it
comp=($(tc-get${comp}))
# 'comp' can already contain compiler options.
# 'type' needs a binary name
if ! type -p ${comp[0]} >/dev/null; then
return 1
fi
# Set up test file.
local in_src in_ext cmdline_extra=()
case "${lang}" in
# compiler/assembler only
c)
in_ext='c'
in_src='int main(void) { return 0; }'
cmdline_extra+=(-xc -c)
;;
c++)
in_ext='cc'
in_src='int main(void) { return 0; }'
cmdline_extra+=(-xc++ -c)
;;
f77)
in_ext='f'
# fixed source form
in_src=' end'
cmdline_extra+=(-xf77 -c)
;;
f95)
in_ext='f90'
in_src='end'
cmdline_extra+=(-xf95 -c)
;;
# C compiler/assembler/linker
c+ld)
in_ext='c'
in_src='int main(void) { return 0; }'
cmdline_extra+=(-xc)
;;
esac
local test_in=${T}/test-flag.${in_ext}
local test_out=${T}/test-flag.exe
printf "%s\n" "${in_src}" > "${test_in}" || die "Failed to create '${test_in}'"
# Currently we rely on warning-free output of a compiler
# before the flag to see if a flag prduces any warnings.
# This has a few drawbacks:
# - if compiler already generates warnings we filter out
# every single flag: bug #712488
# - if user actually wants to see warnings we just strip
# them regardless of warnings type.
#
# We can add more selective detection of no-op flags via
# '-Werror=ignored-optimization-argument' and similar error options
# similar to what we are doing with '-Qunused-arguments'.
local cmdline=(
$(tc-get${comp})
"${comp[@]}"
# Clang will warn about unknown gcc flags but exit 0.
# Need -Werror to force it to exit non-zero.
-Werror
# Use -c so we can test the assembler as well.
-c -o /dev/null
)
if "${cmdline[@]}" -x${lang} - </dev/null &>/dev/null ; then
cmdline+=( "$@" -x${lang} - )
else
# XXX: what's the purpose of this? does it even work with
# any compiler?
cmdline+=( "$@" -c -o /dev/null /dev/null )
fi
"$@"
# -x<lang> options need to go before first source file
"${cmdline_extra[@]}"
if ! "${cmdline[@]}" </dev/null &>/dev/null; then
"${test_in}" -o "${test_out}"
)
if ! "${cmdline[@]}" &>/dev/null; then
# -Werror makes clang bail out on unused arguments as well;
# try to add -Qunused-arguments to work-around that
# other compilers don't support it but then, it's failure like
# any other
cmdline+=( -Qunused-arguments )
"${cmdline[@]}" </dev/null &>/dev/null
"${cmdline[@]}" &>/dev/null
fi
}
@ -465,27 +592,51 @@ test-flag-PROG() {
# @USAGE: <flag>
# @DESCRIPTION:
# Returns shell true if <flag> is supported by the C compiler, else returns shell false.
test-flag-CC() { test-flag-PROG "CC" c "$@"; }
test-flag-CC() { _test-flag-PROG CC c "$@"; }
# @FUNCTION: test-flag-CXX
# @USAGE: <flag>
# @DESCRIPTION:
# Returns shell true if <flag> is supported by the C++ compiler, else returns shell false.
test-flag-CXX() { test-flag-PROG "CXX" c++ "$@"; }
test-flag-CXX() { _test-flag-PROG CXX c++ "$@"; }
# @FUNCTION: test-flag-F77
# @USAGE: <flag>
# @DESCRIPTION:
# Returns shell true if <flag> is supported by the Fortran 77 compiler, else returns shell false.
test-flag-F77() { test-flag-PROG "F77" f77 "$@"; }
test-flag-F77() { _test-flag-PROG F77 f77 "$@"; }
# @FUNCTION: test-flag-FC
# @USAGE: <flag>
# @DESCRIPTION:
# Returns shell true if <flag> is supported by the Fortran 90 compiler, else returns shell false.
test-flag-FC() { test-flag-PROG "FC" f95 "$@"; }
test-flag-FC() { _test-flag-PROG FC f95 "$@"; }
# @FUNCTION: test-flag-CCLD
# @USAGE: <flag>
# @DESCRIPTION:
# Returns shell true if <flag> is supported by the C compiler and linker, else returns shell false.
test-flag-CCLD() { _test-flag-PROG CC c+ld "$@"; }
# @FUNCTION: test-flags-PROG
# @USAGE: <compiler> <flag> [more flags...]
# @INTERNAL
# @DESCRIPTION:
# Returns shell true if <flags> are supported by given <compiler>,
# else returns shell false.
test-flags-PROG() {
[[ ${EAPI:-0} == [04567] ]] ||
die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI:-0}."
_test-flags-PROG "$@"
}
# @FUNCTION: _test-flags-PROG
# @USAGE: <compiler> <flag> [more flags...]
# @INTERNAL
# @DESCRIPTION:
# Returns shell true if <flags> are supported by given <compiler>,
# else returns shell false.
_test-flags-PROG() {
local comp=$1
local flags=()
local x
@ -496,7 +647,8 @@ test-flags-PROG() {
while (( $# )); do
case "$1" in
--param)
# '-B /foo': bug # 687198
--param|-B)
if test-flag-${comp} "$1" "$2"; then
flags+=( "$1" "$2" )
fi
@ -521,25 +673,31 @@ test-flags-PROG() {
# @USAGE: <flags>
# @DESCRIPTION:
# Returns shell true if <flags> are supported by the C compiler, else returns shell false.
test-flags-CC() { test-flags-PROG "CC" "$@"; }
test-flags-CC() { _test-flags-PROG CC "$@"; }
# @FUNCTION: test-flags-CXX
# @USAGE: <flags>
# @DESCRIPTION:
# Returns shell true if <flags> are supported by the C++ compiler, else returns shell false.
test-flags-CXX() { test-flags-PROG "CXX" "$@"; }
test-flags-CXX() { _test-flags-PROG CXX "$@"; }
# @FUNCTION: test-flags-F77
# @USAGE: <flags>
# @DESCRIPTION:
# Returns shell true if <flags> are supported by the Fortran 77 compiler, else returns shell false.
test-flags-F77() { test-flags-PROG "F77" "$@"; }
test-flags-F77() { _test-flags-PROG F77 "$@"; }
# @FUNCTION: test-flags-FC
# @USAGE: <flags>
# @DESCRIPTION:
# Returns shell true if <flags> are supported by the Fortran 90 compiler, else returns shell false.
test-flags-FC() { test-flags-PROG "FC" "$@"; }
test-flags-FC() { _test-flags-PROG FC "$@"; }
# @FUNCTION: test-flags-CCLD
# @USAGE: <flags>
# @DESCRIPTION:
# Returns shell true if <flags> are supported by the C compiler and default linker, else returns shell false.
test-flags-CCLD() { _test-flags-PROG CCLD "$@"; }
# @FUNCTION: test-flags
# @USAGE: <flags>
@ -565,13 +723,12 @@ test_version_info() {
# @DESCRIPTION:
# Strip {C,CXX,F,FC}FLAGS of any flags not supported by the active toolchain.
strip-unsupported-flags() {
[[ $# -ne 0 ]] && die "strip-unsupported-flags takes no arguments"
export CFLAGS=$(test-flags-CC ${CFLAGS})
export CXXFLAGS=$(test-flags-CXX ${CXXFLAGS})
export FFLAGS=$(test-flags-F77 ${FFLAGS})
export FCFLAGS=$(test-flags-FC ${FCFLAGS})
# note: this does not verify the linker flags but it is enough
# to strip invalid C flags which are much more likely, #621274
export LDFLAGS=$(test-flags-CC ${LDFLAGS})
export LDFLAGS=$(test-flags-CCLD ${LDFLAGS})
}
# @FUNCTION: get-flag
@ -579,6 +736,7 @@ strip-unsupported-flags() {
# @DESCRIPTION:
# Find and echo the value for a particular flag. Accepts shell globs.
get-flag() {
[[ $# -ne 1 ]] && die "usage: <flag>"
local f var findflag="$1"
# this code looks a little flaky but seems to work for
@ -597,18 +755,11 @@ get-flag() {
return 1
}
has_m64() {
die "${FUNCNAME}: don't use this anymore"
}
has_m32() {
die "${FUNCNAME}: don't use this anymore"
}
# @FUNCTION: replace-sparc64-flags
# @DESCRIPTION:
# Sets mcpu to v8 and uses the original value as mtune if none specified.
replace-sparc64-flags() {
[[ $# -ne 0 ]] && die "replace-sparc64-flags takes no arguments"
local SPARC64_CPUS="ultrasparc3 ultrasparc v9"
if [ "${CFLAGS/mtune}" != "${CFLAGS}" ]; then
@ -692,6 +843,7 @@ raw-ldflags() {
# @FUNCTION: no-as-needed
# @RETURN: Flag to disable asneeded behavior for use with append-ldflags.
no-as-needed() {
[[ $# -ne 0 ]] && die "no-as-needed takes no arguments"
case $($(tc-getLD) -v 2>&1 </dev/null) in
*GNU*) # GNU ld
echo "-Wl,--no-as-needed" ;;

View File

@ -1,24 +1,20 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 4.
# @ECLASS: git-r3.eclass
# @MAINTAINER:
# Michał Górny <mgorny@gentoo.org>
# @SUPPORTED_EAPIS: 4 5 6 7
# @SUPPORTED_EAPIS: 4 5 6 7 8
# @BLURB: Eclass for fetching and unpacking git repositories.
# @DESCRIPTION:
# Third generation eclass for easing maintenance of live ebuilds using
# git as remote repository.
case "${EAPI:-0}" in
0|1|2|3)
die "Unsupported EAPI=${EAPI} (obsolete) for ${ECLASS}"
;;
4|5|6|7)
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
;;
case ${EAPI:-0} in
4|5|6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
EXPORT_FUNCTIONS src_unpack
@ -27,15 +23,14 @@ if [[ ! ${_GIT_R3} ]]; then
PROPERTIES+=" live"
if [[ ! ${_INHERITED_BY_GIT_2} ]]; then
if [[ ${EAPI:-0} != [0123456] ]]; then
BDEPEND=">=dev-vcs/git-1.8.2.1[curl]"
else
DEPEND=">=dev-vcs/git-1.8.2.1[curl]"
fi
if [[ ${EAPI} != [456] ]]; then
BDEPEND=">=dev-vcs/git-1.8.2.1[curl]"
else
DEPEND=">=dev-vcs/git-1.8.2.1[curl]"
fi
# @ECLASS-VARIABLE: EGIT_CLONE_TYPE
# @USER_VARIABLE
# @DESCRIPTION:
# Type of clone that should be used against the remote repository.
# This can be either of: 'mirror', 'single', 'shallow'.
@ -283,50 +278,6 @@ _git-r3_env_setup() {
if [[ ${EGIT_COMMIT} && ${EGIT_COMMIT_DATE} ]]; then
die "EGIT_COMMIT and EGIT_COMMIT_DATE can not be specified simultaneously"
fi
# Migration helpers. Remove them when git-2 is removed.
if [[ ${EGIT_SOURCEDIR} ]]; then
eerror "EGIT_SOURCEDIR has been replaced by EGIT_CHECKOUT_DIR. While updating"
eerror "your ebuild, please check whether the variable is necessary at all"
eerror "since the default has been changed from \${S} to \${WORKDIR}/\${P}."
eerror "Therefore, proper setting of S may be sufficient."
die "EGIT_SOURCEDIR has been replaced by EGIT_CHECKOUT_DIR."
fi
if [[ ${EGIT_MASTER} ]]; then
eerror "EGIT_MASTER has been removed. Instead, the upstream default (HEAD)"
eerror "is used by the eclass. Please remove the assignment or use EGIT_BRANCH"
eerror "as necessary."
die "EGIT_MASTER has been removed."
fi
if [[ ${EGIT_HAS_SUBMODULES} ]]; then
eerror "EGIT_HAS_SUBMODULES has been removed. The eclass no longer needs"
eerror "to switch the clone type in order to support submodules and therefore"
eerror "submodules are detected and fetched automatically. If you need to"
eerror "disable or filter submodules, see EGIT_SUBMODULES."
die "EGIT_HAS_SUBMODULES is no longer necessary."
fi
if [[ ${EGIT_PROJECT} ]]; then
eerror "EGIT_PROJECT has been removed. Instead, the eclass determines"
eerror "the local clone path using path in canonical EGIT_REPO_URI."
eerror "If the current algorithm causes issues for you, please report a bug."
die "EGIT_PROJECT is no longer necessary."
fi
if [[ ${EGIT_BOOTSTRAP} ]]; then
eerror "EGIT_BOOTSTRAP has been removed. Please create proper src_prepare()"
eerror "instead."
die "EGIT_BOOTSTRAP has been removed."
fi
if [[ ${EGIT_NOUNPACK} ]]; then
eerror "EGIT_NOUNPACK has been removed. The eclass no longer calls default"
eerror "unpack function. If necessary, please declare proper src_unpack()."
die "EGIT_NOUNPACK has been removed."
fi
}
# @FUNCTION: _git-r3_set_gitdir
@ -611,7 +562,7 @@ git-r3_fetch() {
local commit_date=${4:-${EGIT_COMMIT_DATE}}
# support new override API for EAPI 6+
if ! has "${EAPI:-0}" 0 1 2 3 4 5; then
if [[ ${EAPI} != [45] ]]; then
# get the name and do some more processing:
# 1) kill .git suffix,
# 2) underscore (remaining) non-variable characters,

View File

@ -1,37 +1,49 @@
# Copyright 1999-2012 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
#
# THIS ECLASS IS DEAD: It has been integrated into portage
#
# Author: Will Woods <wwoods@gentoo.org>
#
# Flatcar: Support EAPI 0 and 4.
# @ECLASS: gnuconfig.eclass
# @MAINTAINER:
# Sam James <sam@gentoo.org>
# @AUTHOR:
# Will Woods <wwoods@gentoo.org>
# @SUPPORTED_EAPIS: 0 4 5 6 7 8
# @BLURB: Refresh bundled gnuconfig files (config.guess, config.sub)
# @DESCRIPTION:
# This eclass is used to automatically update files that typically come with
# automake to the newest version available on the system. The most common use
# of this is to update config.guess and config.sub when configure dies from
# misguessing your canonical system name (CHOST). It can also be used to update
# other files that come with automake, e.g. depcomp, mkinstalldirs, etc.
#
# usage: gnuconfig_update [file1 file2 ...]
case ${EAPI:-0} in
0|4|5|6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_GNUCONFIG_ECLASS} ]] ; then
_GNUCONFIG_CLASS=1
BDEPEND="sys-devel/gnuconfig"
[[ ${EAPI:-0} == [0456] ]] && DEPEND="${BDEPEND}"
# @FUNCTION: gnuconfig_update
# @USAGE: [file1 file2 ...]
# @DESCRIPTION:
# if called without arguments, config.guess and config.sub will be updated.
# All files in the source tree ($S) with the given name(s) will be replaced
# with the newest available versions chosen from the list of locations in
# gnuconfig_findnewest(), below.
#
# gnuconfig_update should generally be called from src_unpack()
DEPEND="sys-devel/gnuconfig"
#
# Wrapper function for gnuconfig_do_update. If no arguments are given, update
# config.sub and config.guess (old default behavior), otherwise update the
# named files.
gnuconfig_update() {
# hmm some packages (like binutils gcc glibc) still use this ...
# echo
# ewarn "QA Notice: Please stop using me, portage updates files for you."
# echo
local startdir # declared here ... used in gnuconfig_do_update
if [[ $1 == /* ]] ; then
@ -50,6 +62,9 @@ gnuconfig_update() {
return $?
}
# @FUNCTION: gnuconfig_do_update
# @INTERNAL
# @DESCRIPTION:
# Copy the newest available version of specified files over any old ones in the
# source dir. This function shouldn't be called directly - use gnuconfig_update
#
@ -83,16 +98,34 @@ gnuconfig_do_update() {
return 0
}
# this searches the standard locations for the newest config.{sub|guess}, and
# @FUNCTION: gnuconfig_findnewest
# @INTERNAL
# @DESCRIPTION:
# This searches the standard locations for the newest config.{sub|guess}, and
# returns the directory where they can be found.
gnuconfig_findnewest() {
local locations=(
"${EPREFIX}"/usr/share/misc/config.sub
"${EPREFIX}"/usr/share/gnuconfig/config.sub
"${EPREFIX}"/usr/share/automake*/config.sub
"${EPREFIX}"/usr/share/libtool/config.sub
local locations=()
local prefix
case ${EAPI:-0} in
0|4|5|6)
prefix="${EPREFIX}"
;;
*)
prefix="${BROOT}"
;;
esac
locations+=(
"${prefix}"/usr/share/misc/config.sub
"${prefix}"/usr/share/gnuconfig/config.sub
"${prefix}"/usr/share/automake*/config.sub
"${prefix}"/usr/share/libtool/config.sub
)
grep -s '^timestamp' "${locations[@]}" | \
sort -r -n -t\' -k2 | \
sed -n '1{s,/config.sub:.*$,,;p;q}'
}
fi

View File

@ -1,337 +0,0 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: kde5-functions.eclass
# @MAINTAINER:
# kde@gentoo.org
# @SUPPORTED_EAPIS: 6 7
# @BLURB: Common ebuild functions for packages based on KDE Frameworks 5.
# @DESCRIPTION:
# This eclass contains functions shared by the other KDE eclasses and forms
# part of their public API.
#
# This eclass should (almost) never be inherited directly by an ebuild.
if [[ -z ${_KDE5_FUNCTIONS_ECLASS} ]]; then
_KDE5_FUNCTIONS_ECLASS=1
inherit toolchain-funcs
case ${EAPI} in
7) ;;
6) inherit eapi7-ver ;;
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
# @ECLASS-VARIABLE: KDE_BUILD_TYPE
# @DESCRIPTION:
# If PV matches "*9999*", this is automatically set to "live".
# Otherwise, this is automatically set to "release".
KDE_BUILD_TYPE="release"
if [[ ${PV} = *9999* ]]; then
KDE_BUILD_TYPE="live"
fi
export KDE_BUILD_TYPE
case ${CATEGORY} in
kde-frameworks)
[[ ${KDE_BUILD_TYPE} = live ]] && : ${FRAMEWORKS_MINIMAL:=9999}
;;
kde-plasma)
[[ ${PV} = 5.15.5 ]] && : ${QT_MINIMAL:=5.11.1}
[[ ${PV} = 5.16* ]] && : ${FRAMEWORKS_MINIMAL:=5.58.0}
[[ ${KDE_BUILD_TYPE} = live ]] && : ${FRAMEWORKS_MINIMAL:=9999}
: ${QT_MINIMAL:=5.12.3}
;;
esac
# @ECLASS-VARIABLE: QT_MINIMAL
# @DESCRIPTION:
# Minimum version of Qt to require. This affects add_qt_dep.
: ${QT_MINIMAL:=5.11.1}
# @ECLASS-VARIABLE: FRAMEWORKS_MINIMAL
# @DESCRIPTION:
# Minimum version of Frameworks to require. This affects add_frameworks_dep.
: ${FRAMEWORKS_MINIMAL:=5.57.0}
# @ECLASS-VARIABLE: PLASMA_MINIMAL
# @DESCRIPTION:
# Minimum version of Plasma to require. This affects add_plasma_dep.
: ${PLASMA_MINIMAL:=5.14.5}
# @ECLASS-VARIABLE: KDE_APPS_MINIMAL
# @DESCRIPTION:
# Minimum version of KDE Applications to require. This affects add_kdeapps_dep.
: ${KDE_APPS_MINIMAL:=18.12.3}
# @ECLASS-VARIABLE: KDE_GCC_MINIMAL
# @DEFAULT_UNSET
# @DESCRIPTION:
# Minimum version of active GCC to require. This is checked in kde5.eclass in
# kde5_pkg_pretend and kde5_pkg_setup.
# @FUNCTION: _check_gcc_version
# @INTERNAL
# @DESCRIPTION:
# Determine if the current GCC version is acceptable, otherwise die.
_check_gcc_version() {
if [[ ${MERGE_TYPE} != binary && -v KDE_GCC_MINIMAL ]] && tc-is-gcc; then
local version=$(gcc-version)
local major=${version%.*}
local minor=${version#*.}
local min_major=${KDE_GCC_MINIMAL%.*}
local min_minor=${KDE_GCC_MINIMAL#*.}
debug-print "GCC version check activated"
debug-print "Version detected:"
debug-print " - Full: ${version}"
debug-print " - Major: ${major}"
debug-print " - Minor: ${minor}"
debug-print "Version required:"
debug-print " - Major: ${min_major}"
debug-print " - Minor: ${min_minor}"
[[ ${major} -lt ${min_major} ]] || \
( [[ ${major} -eq ${min_major} && ${minor} -lt ${min_minor} ]] ) \
&& die "Sorry, but gcc-${KDE_GCC_MINIMAL} or later is required for this package (found ${version})."
fi
}
# @FUNCTION: _add_category_dep
# @INTERNAL
# @DESCRIPTION:
# Implementation of add_plasma_dep, add_frameworks_dep, add_kdeapps_dep,
# and finally, add_qt_dep.
_add_category_dep() {
debug-print-function ${FUNCNAME} "$@"
local category=${1}
local package=${2}
local use=${3}
local version=${4}
local slot=${5}
if [[ -n ${use} ]] ; then
local use="[${use}]"
fi
if [[ -n ${version} ]] ; then
local operator=">="
local version="-${version}"
fi
if [[ -n ${slot} ]] ; then
slot=":${slot}"
elif [[ ${SLOT%\/*} = 5 ]] ; then
slot=":${SLOT%\/*}"
fi
echo " ${operator}${category}/${package}${version}${slot}${use}"
}
# @FUNCTION: add_frameworks_dep
# @USAGE: <package name> [USE flags] [minimum version] [slot + operator]
# @DESCRIPTION:
# Create proper dependency for kde-frameworks/ dependencies.
# This takes 1 to 4 arguments. The first being the package name, the optional
# second is additional USE flags to append, and the optional third is the
# version to use instead of the automatic version (use sparingly). In addition,
# the optional fourth argument defines slot+operator instead of automatic slot
# (use even more sparingly).
# The output of this should be added directly to DEPEND/RDEPEND, and may be
# wrapped in a USE conditional (but not an || conditional without an extra set
# of parentheses).
add_frameworks_dep() {
debug-print-function ${FUNCNAME} "$@"
if [[ $# -gt 4 ]]; then
die "${FUNCNAME} was called with too many arguments"
fi
local version
if [[ -n ${3} ]]; then
version=${3}
elif [[ ${CATEGORY} = kde-frameworks ]]; then
version=$(ver_cut 1-2)
elif [[ -z ${3} ]] ; then
version=${FRAMEWORKS_MINIMAL}
fi
_add_category_dep kde-frameworks "${1}" "${2}" "${version}" "${4}"
}
# @FUNCTION: add_plasma_dep
# @USAGE: <package name> [USE flags] [minimum version] [slot + operator]
# @DESCRIPTION:
# Create proper dependency for kde-plasma/ dependencies.
# This takes 1 to 4 arguments. The first being the package name, the optional
# second is additional USE flags to append, and the optional third is the
# version to use instead of the automatic version (use sparingly). In addition,
# the optional fourth argument defines slot+operator instead of automatic slot
# (use even more sparingly).
# The output of this should be added directly to DEPEND/RDEPEND, and may be
# wrapped in a USE conditional (but not an || conditional without an extra set
# of parentheses).
add_plasma_dep() {
debug-print-function ${FUNCNAME} "$@"
if [[ $# -gt 4 ]]; then
die "${FUNCNAME} was called with too many arguments"
fi
local version
if [[ -n ${3} ]]; then
version=${3}
elif [[ ${CATEGORY} = kde-plasma ]]; then
version=$(ver_cut 1-3)
elif [[ -z ${3} ]] ; then
version=${PLASMA_MINIMAL}
fi
_add_category_dep kde-plasma "${1}" "${2}" "${version}" "${4}"
}
# @FUNCTION: add_kdeapps_dep
# @USAGE: <package name> [USE flags] [minimum version] [slot + operator]
# @DESCRIPTION:
# Create proper dependency for kde-apps/ dependencies.
# This takes 1 to 4 arguments. The first being the package name, the optional
# second is additional USE flags to append, and the optional third is the
# version to use instead of the automatic version (use sparingly). In addition,
# the optional fourth argument defines slot+operator instead of automatic slot
# (use even more sparingly).
# The output of this should be added directly to DEPEND/RDEPEND, and may be
# wrapped in a USE conditional (but not an || conditional without an extra set
# of parentheses).
add_kdeapps_dep() {
debug-print-function ${FUNCNAME} "$@"
if [[ $# -gt 4 ]]; then
die "${FUNCNAME} was called with too many arguments"
fi
local version
if [[ -n ${3} ]]; then
version=${3}
elif [[ ${CATEGORY} = kde-apps ]]; then
version=$(ver_cut 1-3)
elif [[ -z ${3} ]] ; then
version=${KDE_APPS_MINIMAL}
fi
_add_category_dep kde-apps "${1}" "${2}" "${version}" "${4}"
}
# @FUNCTION: add_qt_dep
# @USAGE: <package name> [USE flags] [minimum version] [slot + operator]
# @DESCRIPTION:
# Create proper dependency for dev-qt/ dependencies.
# This takes 1 to 4 arguments. The first being the package name, the optional
# second is additional USE flags to append, and the optional third is the
# version to use instead of the automatic version (use sparingly). In addition,
# the optional fourth argument defines slot+operator instead of automatic slot
# (use even more sparingly).
# The output of this should be added directly to DEPEND/RDEPEND, and may be
# wrapped in a USE conditional (but not an || conditional without an extra set
# of parentheses).
add_qt_dep() {
debug-print-function ${FUNCNAME} "$@"
if [[ $# -gt 4 ]]; then
die "${FUNCNAME} was called with too many arguments"
fi
local version=${3}
local slot=${4}
if [[ -z ${version} ]]; then
version=${QT_MINIMAL}
if [[ ${1} = qtwebkit ]]; then
version=5.9.1
[[ ${EAPI} != 6 ]] && die "${FUNCNAME} is disallowed for 'qtwebkit' in EAPI 7 and later"
fi
fi
if [[ -z ${slot} ]]; then
slot="5"
fi
_add_category_dep dev-qt "${1}" "${2}" "${version}" "${slot}"
}
# @FUNCTION: get_kde_version [version]
# @DESCRIPTION:
# Translates an ebuild version into a major.minor KDE release version, taking
# into account KDE's prerelease versioning scheme.
# For example, get_kde_version 17.07.80 will return "17.08".
# If the version equals 9999, "live" is returned.
# If no version is specified, ${PV} is used.
get_kde_version() {
[[ ${EAPI} != 6 ]] && die "${FUNCNAME} is banned in EAPI 7 and later"
local ver=${1:-${PV}}
local major=$(ver_cut 1 ${ver})
local minor=$(ver_cut 2 ${ver})
local micro=$(ver_cut 3 ${ver})
if [[ ${ver} == 9999 ]]; then
echo live
else
(( micro < 50 )) && echo ${major}.${minor} || echo ${major}.$((minor + 1))
fi
}
# @FUNCTION: kde_l10n2lingua
# @USAGE: <l10n>...
# @INTERNAL
# @DESCRIPTION:
# Output KDE lingua flag name(s) (without prefix(es)) appropriate for
# given l10n(s).
kde_l10n2lingua() {
[[ ${EAPI} != 6 ]] && die "${FUNCNAME} is banned in EAPI 7 and later"
local l
for l; do
case ${l} in
ca-valencia) echo ca@valencia;;
sr-ijekavsk) echo sr@ijekavian;;
sr-Latn-ijekavsk) echo sr@ijekavianlatin;;
sr-Latn) echo sr@latin;;
uz-Cyrl) echo uz@cyrillic;;
*) echo "${l/-/_}";;
esac
done
}
# @FUNCTION: punt_bogus_dep
# @USAGE: <prefix> <dependency>
# @DESCRIPTION:
# Removes a specified dependency from a find_package call with multiple components.
punt_bogus_dep() {
local prefix=${1}
local dep=${2}
if [[ ! -e "CMakeLists.txt" ]]; then
return
fi
pcregrep -Mni "(?s)find_package\s*\(\s*${prefix}[^)]*?${dep}.*?\)" CMakeLists.txt > "${T}/bogus${dep}"
# pcregrep returns non-zero on no matches/error
if [[ $? != 0 ]] ; then
return
fi
local length=$(wc -l "${T}/bogus${dep}" | cut -d " " -f 1)
local first=$(head -n 1 "${T}/bogus${dep}" | cut -d ":" -f 1)
local last=$(( ${length} + ${first} - 1))
sed -e "${first},${last}s/${dep}//" -i CMakeLists.txt || die
if [[ ${length} = 1 ]] ; then
sed -e "/find_package\s*(\s*${prefix}\(\s\+\(REQUIRED\|CONFIG\|COMPONENTS\|\${[A-Z0-9_]*}\)\)\+\s*)/Is/^/# removed by kde5-functions.eclass - /" -i CMakeLists.txt || die
fi
}
fi

View File

@ -1,732 +0,0 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: kde5.eclass
# @MAINTAINER:
# kde@gentoo.org
# @BLURB: Support eclass for packages that follow KDE packaging conventions.
# @DESCRIPTION:
# This eclass is intended to streamline the creation of ebuilds for packages
# that follow KDE upstream packaging conventions. It's primarily intended for
# the three upstream release groups (Frameworks, Plasma, Applications) but
# is also for any package that follows similar conventions.
#
# This eclass unconditionally inherits kde5-functions.eclass and all its public
# functions and variables may be considered as part of this eclass's API.
#
# This eclass unconditionally inherits cmake-utils.eclass and all its public
# variables and helper functions (not phase functions) may be considered as part
# of this eclass's API.
#
# This eclass's phase functions are not intended to be mixed and matched, so if
# any phase functions are overridden the version here should also be called.
if [[ -z ${_KDE5_ECLASS} ]]; then
_KDE5_ECLASS=1
# @ECLASS-VARIABLE: VIRTUALX_REQUIRED
# @DESCRIPTION:
# For proper description see virtualx.eclass manpage.
# Here we redefine default value to be manual, if your package needs virtualx
# for tests you should proceed with setting VIRTUALX_REQUIRED=test.
: ${VIRTUALX_REQUIRED:=manual}
inherit cmake-utils flag-o-matic kde5-functions virtualx xdg
case ${EAPI} in
6) inherit eapi7-ver eutils gnome2-utils ;;
esac
if [[ ${KDE_BUILD_TYPE} = live ]]; then
inherit git-r3
fi
if [[ -v KDE_GCC_MINIMAL ]]; then
EXPORT_FUNCTIONS pkg_pretend
fi
EXPORT_FUNCTIONS pkg_setup pkg_nofetch src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm
# @ECLASS-VARIABLE: ECM_KDEINSTALLDIRS
# @DESCRIPTION:
# If set to "false", do nothing.
# For any other value, assume the package is using KDEInstallDirs macro and switch
# KDE_INSTALL_USE_QT_SYS_PATHS to ON.
: ${ECM_KDEINSTALLDIRS:=true}
# @ECLASS-VARIABLE: KDE_AUTODEPS
# @DESCRIPTION:
# If set to "false", do nothing.
# For any other value, add dependencies on dev-qt/qtcore:5, kde-frameworks/kf-env
# and kde-frameworks/extra-cmake-modules:5. Additionally, required blockers may
# be set depending on the value of CATEGORY.
: ${KDE_AUTODEPS:=true}
# @ECLASS-VARIABLE: KDE_BLOCK_SLOT4
# @DESCRIPTION:
# This variable only has any effect when when CATEGORY = "kde-apps" and
# KDE_AUTODEPS is also set. If set to "true", add RDEPEND block on kde-apps/${PN}:4
: ${KDE_BLOCK_SLOT4:=true}
# @ECLASS-VARIABLE: KDE_DEBUG
# @DESCRIPTION:
# If set to "false", add -DNDEBUG (via cmake-utils_src_configure) and -DQT_NO_DEBUG
# to CPPFLAGS.
# Otherwise, add debug to IUSE.
: ${KDE_DEBUG:=true}
# @ECLASS-VARIABLE: KDE_DESIGNERPLUGIN
# @DESCRIPTION:
# If set to "false", do nothing.
# Otherwise, add "designer" to IUSE to toggle build of designer plugins
# and add the necessary DEPENDs.
: ${KDE_DESIGNERPLUGIN:=false}
# @ECLASS-VARIABLE: KDE_EXAMPLES
# @DESCRIPTION:
# If set to "false", unconditionally ignore a top-level examples subdirectory.
# Otherwise, add "examples" to IUSE to toggle adding that subdirectory.
: ${KDE_EXAMPLES:=false}
# @ECLASS-VARIABLE: KDE_HANDBOOK
# @DESCRIPTION:
# If set to "false", do nothing.
# Otherwise, add "+handbook" to IUSE, add the appropriate dependency, and
# generate and install KDE handbook.
# If set to "optional", config with -DCMAKE_DISABLE_FIND_PACKAGE_KF5DocTools=ON
# when USE=!handbook. In case package requires KF5KDELibs4Support, see next:
# If set to "forceoptional", remove a KF5DocTools dependency from the root
# CMakeLists.txt in addition to the above.
: ${KDE_HANDBOOK:=false}
# @ECLASS-VARIABLE: KDE_DOC_DIR
# @DESCRIPTION:
# Specifies the location of the KDE handbook if not the default.
: ${KDE_DOC_DIR:=doc}
# @ECLASS-VARIABLE: KDE_PO_DIRS
# @DESCRIPTION:
# Specifies the possible locations of KDE l10n files if not the default.
: ${KDE_PO_DIRS:="po poqm"}
# @ECLASS-VARIABLE: KDE_QTHELP
# @DESCRIPTION:
# If set to "false", do nothing.
# Otherwise, add "doc" to IUSE, add the appropriate dependency, generate
# and install Qt compressed help files with -DBUILD_QCH=ON when USE=doc.
if [[ ${CATEGORY} = kde-frameworks ]]; then
: ${KDE_QTHELP:=true}
fi
: ${KDE_QTHELP:=false}
# @ECLASS-VARIABLE: KDE_TEST
# @DESCRIPTION:
# If set to "false", do nothing.
# For any other value, add test to IUSE and add a dependency on dev-qt/qttest:5.
# If set to "optional", configure with -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Test=ON
# when USE=!test.
# If set to "forceoptional", remove a Qt5Test dependency and comment test
# subdirs from the root CMakeLists.txt in addition to the above.
# If set to "forceoptional-recursive", remove Qt5Test dependencies and make
# autotest(s), unittest(s) and test(s) subdirs from *any* CMakeLists.txt in ${S}
# and below conditional on BUILD_TESTING. This is always meant as a short-term
# fix and creates ${T}/${P}-tests-optional.patch to refine and submit upstream.
if [[ ${CATEGORY} = kde-frameworks ]]; then
: ${KDE_TEST:=true}
fi
: ${KDE_TEST:=false}
# @ECLASS-VARIABLE: KDE_SELINUX_MODULE
# @DESCRIPTION:
# If set to "none", do nothing.
# For any other value, add selinux to IUSE, and depending on that useflag
# add a dependency on sec-policy/selinux-${KDE_SELINUX_MODULE} to (R)DEPEND.
: ${KDE_SELINUX_MODULE:=none}
# @ECLASS-VARIABLE: KDE_SUBSLOT
# @DESCRIPTION:
# If set to "false", do nothing.
# If set to "true", add a subslot to the package, where subslot is either
# defined as major.minor version for kde-*/ categories or ${PV} if other.
# For any other value, that value will be used as subslot.
: ${KDE_SUBSLOT:=false}
# @ECLASS-VARIABLE: KDE_UNRELEASED
# @INTERNAL
# @DESCRIPTION
# An array of $CATEGORY-$PV pairs of packages that are unreleased upstream.
# Any package matching this will have fetch restriction enabled, and receive
# a proper error message via pkg_nofetch.
KDE_UNRELEASED=( )
HOMEPAGE="https://kde.org/"
LICENSE="GPL-2"
SLOT=5
if [[ ${CATEGORY} = kde-frameworks ]]; then
KDE_SUBSLOT=true
fi
case ${KDE_SUBSLOT} in
false) ;;
true)
case ${CATEGORY} in
kde-frameworks | \
kde-plasma | \
kde-apps)
SLOT+="/$(ver_cut 1-2)"
;;
*)
SLOT+="/${PV}"
;;
esac
;;
*)
SLOT+="/${KDE_SUBSLOT}"
;;
esac
case ${KDE_AUTODEPS} in
false) ;;
*)
BDEPEND+=" $(add_frameworks_dep extra-cmake-modules)"
RDEPEND+=" >=kde-frameworks/kf-env-4"
COMMONDEPEND+=" $(add_qt_dep qtcore)"
# all packages need breeze/oxygen icons for basic iconset, bug #564838
if [[ ${PN} != breeze-icons && ${PN} != oxygen-icons ]]; then
RDEPEND+=" || ( $(add_frameworks_dep breeze-icons) kde-frameworks/oxygen-icons:* )"
fi
;;
esac
case ${KDE_DEBUG} in
false) ;;
*)
IUSE+=" debug"
;;
esac
case ${KDE_DESIGNERPLUGIN} in
false) ;;
*)
IUSE+=" designer"
BDEPEND+=" designer? ( $(add_frameworks_dep kdesignerplugin) )"
esac
case ${KDE_EXAMPLES} in
false) ;;
*)
IUSE+=" examples"
;;
esac
case ${KDE_HANDBOOK} in
false) ;;
*)
IUSE+=" +handbook"
BDEPEND+=" handbook? ( $(add_frameworks_dep kdoctools) )"
;;
esac
case ${KDE_QTHELP} in
false) ;;
*)
IUSE+=" doc"
COMMONDEPEND+=" doc? ( $(add_qt_dep qt-docs) )"
BDEPEND+=" doc? (
$(add_qt_dep qthelp)
>=app-doc/doxygen-1.8.13-r1
)"
;;
esac
case ${KDE_TEST} in
false) ;;
*)
IUSE+=" test"
DEPEND+=" test? ( $(add_qt_dep qttest) )"
;;
esac
case ${KDE_SELINUX_MODULE} in
none) ;;
*)
IUSE+=" selinux"
RDEPEND+=" selinux? ( sec-policy/selinux-${KDE_SELINUX_MODULE} )"
;;
esac
case ${EAPI} in
6) DEPEND+=" ${BDEPEND}" ;;
esac
DEPEND+=" ${COMMONDEPEND} dev-util/desktop-file-utils"
RDEPEND+=" ${COMMONDEPEND}"
unset COMMONDEPEND
if [[ -n ${KMNAME} && ${KMNAME} != ${PN} && ${KDE_BUILD_TYPE} = release ]]; then
S=${WORKDIR}/${KMNAME}-${PV}
fi
_kde_is_unreleased() {
local pair
for pair in "${KDE_UNRELEASED[@]}" ; do
if [[ "${pair}" = "${CATEGORY}-${PV}" ]]; then
return 0
fi
done
return 1
}
# Determine fetch location for released tarballs
_calculate_src_uri() {
debug-print-function ${FUNCNAME} "$@"
local _kmname
if [[ -n ${KMNAME} ]]; then
_kmname=${KMNAME}
else
_kmname=${PN}
fi
case ${PN} in
kdelibs4support | \
khtml | \
kjs | \
kjsembed | \
kmediaplayer | \
kross)
_kmname="portingAids/${_kmname}"
;;
esac
case ${CATEGORY} in
kde-apps)
case ${PV} in
??.?.[6-9]? | ??.??.[6-9]? )
SRC_URI="mirror://kde/unstable/applications/${PV}/src/${_kmname}-${PV}.tar.xz"
RESTRICT+=" mirror"
;;
*)
SRC_URI="mirror://kde/stable/applications/${PV}/src/${_kmname}-${PV}.tar.xz" ;;
esac
;;
kde-frameworks)
SRC_URI="mirror://kde/stable/frameworks/${PV%.*}/${_kmname}-${PV}.tar.xz" ;;
kde-plasma)
local plasmapv=$(ver_cut 1-3)
case ${PV} in
5.?.[6-9]? | 5.??.[6-9]? )
# Plasma 5 beta releases
SRC_URI="mirror://kde/unstable/plasma/${plasmapv}/${_kmname}-${PV}.tar.xz"
RESTRICT+=" mirror"
;;
*)
# Plasma 5 stable releases
SRC_URI="mirror://kde/stable/plasma/${plasmapv}/${_kmname}-${PV}.tar.xz" ;;
esac
;;
esac
if [[ ${PN} = kdevelop* ]]; then
case ${PV} in
*.*.[6-9]? )
SRC_URI="mirror://kde/unstable/kdevelop/${PV}/src/${_kmname}-${PV}.tar.xz"
RESTRICT+=" mirror"
;;
*)
SRC_URI="mirror://kde/stable/kdevelop/${PV}/src/${_kmname}-${PV}.tar.xz" ;;
esac
fi
if _kde_is_unreleased ; then
RESTRICT+=" fetch"
fi
}
# Determine fetch location for live sources
_calculate_live_repo() {
debug-print-function ${FUNCNAME} "$@"
SRC_URI=""
# @ECLASS-VARIABLE: EGIT_MIRROR
# @DESCRIPTION:
# This variable allows easy overriding of default kde mirror service
# (anongit) with anything else you might want to use.
EGIT_MIRROR=${EGIT_MIRROR:=https://anongit.kde.org}
local _kmname
# @ECLASS-VARIABLE: EGIT_REPONAME
# @DESCRIPTION:
# This variable allows overriding of default repository
# name. Specify only if this differ from PN and KMNAME.
if [[ -n ${EGIT_REPONAME} ]]; then
# the repository and kmname different
_kmname=${EGIT_REPONAME}
elif [[ -n ${KMNAME} ]]; then
_kmname=${KMNAME}
else
_kmname=${PN}
fi
if [[ ${PV} == ??.??.49.9999 && ${CATEGORY} = kde-apps ]]; then
EGIT_BRANCH="Applications/$(ver_cut 1-2)"
fi
if [[ ${PV} != 9999 && ${CATEGORY} = kde-plasma ]]; then
EGIT_BRANCH="Plasma/$(ver_cut 1-2)"
fi
if [[ ${PV} != 9999 && ${PN} = kdevelop* ]]; then
EGIT_BRANCH="$(ver_cut 1-2)"
fi
EGIT_REPO_URI="${EGIT_MIRROR}/${_kmname}"
}
case ${KDE_BUILD_TYPE} in
live) _calculate_live_repo ;;
*) _calculate_src_uri ;;
esac
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
# @FUNCTION: kde5_pkg_pretend
# @DESCRIPTION:
# Checks if the active compiler meets the minimum version requirements.
# phase function is only exported if KDE_GCC_MINIMAL is defined.
kde5_pkg_pretend() {
debug-print-function ${FUNCNAME} "$@"
_check_gcc_version
}
# @FUNCTION: kde5_pkg_setup
# @DESCRIPTION:
# Checks if the active compiler meets the minimum version requirements.
kde5_pkg_setup() {
debug-print-function ${FUNCNAME} "$@"
_check_gcc_version
}
# @FUNCTION: kde5_pkg_nofetch
# @DESCRIPTION:
# Intended for use in the KDE overlay. If this package matches something in
# KDE_UNRELEASED, display a giant warning that the package has not yet been
# released upstream and should not be used.
kde5_pkg_nofetch() {
if ! _kde_is_unreleased ; then
return
fi
eerror " _ _ _ _ ____ _____ _ _____ _ ____ _____ ____ "
eerror "| | | | \ | | _ \| ____| | | ____| / \ / ___|| ____| _ \ "
eerror "| | | | \| | |_) | _| | | | _| / _ \ \___ \| _| | | | |"
eerror "| |_| | |\ | _ <| |___| |___| |___ / ___ \ ___) | |___| |_| |"
eerror " \___/|_| \_|_| \_\_____|_____|_____/_/ \_\____/|_____|____/ "
eerror " "
eerror " ____ _ ____ _ __ _ ____ _____ "
eerror "| _ \ / \ / ___| |/ / / \ / ___| ____|"
eerror "| |_) / _ \| | | ' / / _ \| | _| _| "
eerror "| __/ ___ \ |___| . \ / ___ \ |_| | |___ "
eerror "|_| /_/ \_\____|_|\_\/_/ \_\____|_____|"
eerror
eerror "${CATEGORY}/${P} has not been released to the public yet"
eerror "and is only available to packagers right now."
eerror ""
eerror "This is not a bug. Please do not file bugs or contact upstream about this."
eerror ""
eerror "Please consult the upstream release schedule to see when this "
eerror "package is scheduled to be released:"
eerror "https://community.kde.org/Schedules"
}
# @FUNCTION: kde5_src_unpack
# @DESCRIPTION:
# Unpack the sources, automatically handling both release and live ebuilds.
kde5_src_unpack() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${KDE_BUILD_TYPE} = live ]]; then
git-r3_src_unpack
else
default
fi
}
# @FUNCTION: kde5_src_prepare
# @DESCRIPTION:
# Wrapper for cmake-utils_src_prepare with lots of extra logic for magic
# handling of linguas, tests, handbook etc.
kde5_src_prepare() {
debug-print-function ${FUNCNAME} "$@"
cmake-utils_src_prepare
# only build examples when required
if ! { in_iuse examples && use examples; } ; then
cmake_comment_add_subdirectory examples
fi
# only enable handbook when required
if in_iuse handbook && ! use handbook ; then
cmake_comment_add_subdirectory ${KDE_DOC_DIR}
if [[ ${KDE_HANDBOOK} = forceoptional ]] ; then
punt_bogus_dep KF5 DocTools
sed -i -e "/kdoctools_install/ s/^/#DONT/" CMakeLists.txt || die
fi
fi
# drop translations when nls is not wanted
if in_iuse nls && ! use nls ; then
local po
for po in ${KDE_PO_DIRS}; do
if [[ -d ${po} ]] ; then
rm -r ${po} || die
fi
done
fi
# enable only the requested translations when required
if [[ -v LINGUAS ]] ; then
local po
for po in ${KDE_PO_DIRS}; do
if [[ -d ${po} ]] ; then
pushd ${po} > /dev/null || die
local lang
for lang in *; do
if [[ -e ${lang} ]] && ! has ${lang/.po/} ${LINGUAS} ; then
case ${lang} in
cmake_modules | \
CMakeLists.txt | \
${PN}.pot) ;;
*) rm -r ${lang} || die ;;
esac
if [[ -e CMakeLists.txt ]] ; then
cmake_comment_add_subdirectory ${lang}
sed -e "/add_subdirectory([[:space:]]*${lang}\/.*[[:space:]]*)/d" \
-i CMakeLists.txt || die
fi
fi
done
popd > /dev/null || die
fi
done
fi
if [[ ${KDE_BUILD_TYPE} = release && ${CATEGORY} != kde-apps ]] ; then
if [[ ${KDE_HANDBOOK} != false && -d ${KDE_DOC_DIR} && -v LINGUAS ]] ; then
pushd ${KDE_DOC_DIR} > /dev/null || die
local lang
for lang in *; do
if ! has ${lang} ${LINGUAS} ; then
cmake_comment_add_subdirectory ${lang}
fi
done
popd > /dev/null || die
fi
fi
# only build unit tests when required
if ! { in_iuse test && use test; } ; then
if [[ ${KDE_TEST} = forceoptional ]] ; then
punt_bogus_dep Qt5 Test
# if forceoptional, also cover non-kde categories
cmake_comment_add_subdirectory autotests test tests
elif [[ ${KDE_TEST} = forceoptional-recursive ]] ; then
punt_bogus_dep Qt5 Test
local f pf="${T}/${P}"-tests-optional.patch
touch ${pf} || die "Failed to touch patch file"
for f in $(find . -type f -name "CMakeLists.txt" -exec \
grep -l "^\s*add_subdirectory\s*\(\s*.*\(auto|unit\)\?tests\?\s*)\s*\)" {} \;); do
cp ${f} ${f}.old || die "Failed to prepare patch origfile"
pushd ${f%/*} > /dev/null || die
punt_bogus_dep Qt5 Test
sed -i CMakeLists.txt -e \
"/^#/! s/add_subdirectory\s*\(\s*.*\(auto|unit\)\?tests\?\s*)\s*\)/if(BUILD_TESTING)\n&\nendif()/" \
|| die
popd > /dev/null || die
diff -Naur ${f}.old ${f} 1>>${pf}
rm ${f}.old || die "Failed to clean up"
done
einfo "Build system was modified by KDE_TEST=forceoptional-recursive."
einfo "Unified diff file ready for pickup in:"
einfo " ${pf}"
einfo "Push it upstream to make this message go away."
elif [[ ${CATEGORY} = kde-frameworks || ${CATEGORY} = kde-plasma || ${CATEGORY} = kde-apps ]] ; then
cmake_comment_add_subdirectory autotests test tests
fi
fi
# in frameworks, tests = manual tests so never build them
if [[ ${CATEGORY} = kde-frameworks ]] && [[ ${PN} != extra-cmake-modules ]]; then
cmake_comment_add_subdirectory tests
fi
}
# @FUNCTION: kde5_src_configure
# @DESCRIPTION:
# Wrapper for cmake-utils_src_configure with extra logic for magic handling of
# handbook, tests etc.
kde5_src_configure() {
debug-print-function ${FUNCNAME} "$@"
# we rely on cmake-utils.eclass to append -DNDEBUG too
if in_iuse debug && ! use debug; then
append-cppflags -DQT_NO_DEBUG
fi
local cmakeargs
if in_iuse test && ! use test ; then
cmakeargs+=( -DBUILD_TESTING=OFF )
if [[ ${KDE_TEST} = optional ]] ; then
cmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Test=ON )
fi
fi
if in_iuse handbook && ! use handbook && [[ ${KDE_HANDBOOK} = optional ]] ; then
cmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_KF5DocTools=ON )
fi
if in_iuse designer && ! use designer && [[ ${KDE_DESIGNERPLUGIN} != false ]] ; then
cmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_KF5DesignerPlugin=ON )
fi
if [[ ${KDE_QTHELP} != false ]]; then
cmakeargs+=( -DBUILD_QCH=$(usex doc) )
fi
if [[ ${ECM_KDEINSTALLDIRS} != false ]] ; then
cmakeargs+=(
# install mkspecs in the same directory as qt stuff
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON
)
# move handbook outside of doc dir for at least two QA warnings, bug 667138
[[ ${EAPI} != 6 ]] && cmakeargs+=( -DKDE_INSTALL_DOCBUNDLEDIR="${EPREFIX}/usr/share/help" )
fi
# allow the ebuild to override what we set here
mycmakeargs=("${cmakeargs[@]}" "${mycmakeargs[@]}")
cmake-utils_src_configure
}
# @FUNCTION: kde5_src_compile
# @DESCRIPTION:
# Wrapper for cmake-utils_src_compile. Currently doesn't do anything extra, but
# is included as part of the API just in case it's needed in the future.
kde5_src_compile() {
debug-print-function ${FUNCNAME} "$@"
cmake-utils_src_compile "$@"
}
# @FUNCTION: kde5_src_test
# @DESCRIPTION:
# Wrapper for cmake-utils_src_test with extra logic for magic handling of dbus
# and virtualx.
kde5_src_test() {
debug-print-function ${FUNCNAME} "$@"
_test_runner() {
if [[ -n "${VIRTUALDBUS_TEST}" ]]; then
export $(dbus-launch)
fi
cmake-utils_src_test
}
# When run as normal user during ebuild development with the ebuild command, the
# kde tests tend to access the session DBUS. This however is not possible in a real
# emerge or on the tinderbox.
# > make sure it does not happen, so bad tests can be recognized and disabled
unset DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID
if [[ ${VIRTUALX_REQUIRED} = always || ${VIRTUALX_REQUIRED} = test ]]; then
virtx _test_runner
else
_test_runner
fi
if [[ -n "${DBUS_SESSION_BUS_PID}" ]] ; then
kill ${DBUS_SESSION_BUS_PID}
fi
}
# @FUNCTION: kde5_src_install
# @DESCRIPTION:
# Wrapper for cmake-utils_src_install with extra logic to avoid compressing
# certain types of files. For example, khelpcenter is not able to read
# compressed handbooks.
kde5_src_install() {
debug-print-function ${FUNCNAME} "$@"
cmake-utils_src_install
# We don't want QCH and tags files to be compressed, because then
# cmake can't find the tags and qthelp viewers can't find the docs
local p=$(best_version dev-qt/qtcore:5)
local pv=$(echo ${p/%-r[0-9]*/} | rev | cut -d - -f 1 | rev)
if [[ ${pv} = 5.11* ]]; then
#todo: clean up trailing slash check when EAPI <7 is removed
if [[ -d ${ED%/}/usr/share/doc/qt-${pv} ]]; then
docompress -x /usr/share/doc/qt-${pv}
fi
fi
if [[ ${EAPI} = 6 ]]; then
# We don't want /usr/share/doc/HTML to be compressed,
# because then khelpcenter can't find the docs
#todo: clean up trailing slash check when EAPI <7 is removed
if [[ -d ${ED%/}/usr/share/doc/HTML ]]; then
docompress -x /usr/share/doc/HTML
fi
fi
}
# @FUNCTION: kde5_pkg_preinst
# @DESCRIPTION:
# Sets up environment variables required in kde5_pkg_postinst.
kde5_pkg_preinst() {
debug-print-function ${FUNCNAME} "$@"
xdg_pkg_preinst
}
# @FUNCTION: kde5_pkg_postinst
# @DESCRIPTION:
# Updates the various XDG caches (icon, desktop, mime) if necessary.
kde5_pkg_postinst() {
debug-print-function ${FUNCNAME} "$@"
xdg_pkg_postinst
if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
if [[ ${KDE_BUILD_TYPE} = live ]]; then
echo
einfo "WARNING! This is an experimental live ebuild of ${CATEGORY}/${PN}"
einfo "Use it at your own risk."
einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!"
fi
fi
}
# @FUNCTION: kde5_pkg_postrm
# @DESCRIPTION:
# Updates the various XDG caches (icon, desktop, mime) if necessary.
kde5_pkg_postrm() {
debug-print-function ${FUNCNAME} "$@"
xdg_pkg_postrm
}
fi

View File

@ -1,10 +1,12 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 0 and 4.
# @ECLASS: libtool.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
# @SUPPORTED_EAPIS: 0 4 5 6 7 8
# @BLURB: quickly update bundled libtool code
# @DESCRIPTION:
# This eclass patches ltmain.sh distributed with libtoolized packages with the
@ -18,8 +20,8 @@ if [[ -z ${_LIBTOOL_ECLASS} ]]; then
_LIBTOOL_ECLASS=1
case ${EAPI:-0} in
0|1|2|3|4|5|6) DEPEND=">=app-portage/elt-patches-20170815" ;;
7) BDEPEND=">=app-portage/elt-patches-20170815" ;;
0|4|5|6) DEPEND=">=app-portage/elt-patches-20170815" ;;
7|8) BDEPEND=">=app-portage/elt-patches-20170815" ;;
*) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
esac
@ -43,7 +45,4 @@ elibtoolize() {
eltpatch "${@}" || die "eltpatch failed"
}
uclibctoolize() { die "Use elibtoolize"; }
darwintoolize() { die "Use elibtoolize"; }
fi

View File

@ -1,4 +1,4 @@
# Copyright 1999-2019 Gentoo Authors
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ltprune.eclass
@ -6,12 +6,13 @@
# Michał Górny <mgorny@gentoo.org>
# @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 "${D}" -name '*.la' -type f -delete || die
# find "${ED}" -name '*.la' -delete || die
# @CODE
if [[ -z ${_LTPRUNE_ECLASS} ]]; then

View File

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: multibuild.eclass
@ -6,7 +6,7 @@
# Michał Górny <mgorny@gentoo.org>
# @AUTHOR:
# Author: Michał Górny <mgorny@gentoo.org>
# @SUPPORTED_EAPIS: 4 5 6 7
# @SUPPORTED_EAPIS: 4 5 6 7 8
# @BLURB: A generic eclass for building multiple variants of packages.
# @DESCRIPTION:
# The multibuild eclass aims to provide a generic framework for building
@ -14,10 +14,10 @@
# implementations).
case "${EAPI:-0}" in
0|1|2|3)
[0-3])
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
4|5|6|7)
[4-8])
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
@ -27,6 +27,7 @@ esac
if [[ ! ${_MULTIBUILD} ]]; then
# @ECLASS-VARIABLE: MULTIBUILD_VARIANTS
# @REQUIRED
# @DESCRIPTION:
# An array specifying all enabled variants which multibuild_foreach*
# can execute the process for.
@ -43,6 +44,7 @@ if [[ ! ${_MULTIBUILD} ]]; then
# @CODE
# @ECLASS-VARIABLE: MULTIBUILD_VARIANT
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# The current variant which the function was executed for.
#
@ -52,6 +54,7 @@ if [[ ! ${_MULTIBUILD} ]]; then
# @CODE
# @ECLASS-VARIABLE: MULTIBUILD_ID
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# The unique identifier for a multibuild run. In a simple run, it is
# equal to MULTIBUILD_VARIANT. In a nested multibuild environment, it
@ -65,6 +68,8 @@ if [[ ! ${_MULTIBUILD} ]]; then
# @CODE
# @ECLASS-VARIABLE: BUILD_DIR
# @OUTPUT_VARIABLE
# @DEFAULT_UNSET
# @DESCRIPTION:
# The current build directory. In global scope, it is supposed
# to contain an 'initial' build directory. If unset, ${S} is used.

View File

@ -1,12 +1,15 @@
# Copyright 2013-2019 Gentoo Authors
# Copyright 2013-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 4.
# @ECLASS: multilib-build.eclass
# @MAINTAINER:
# gx86-multilib team <multilib@gentoo.org>
# Michał Górny <mgorny@gentoo.org>
# @AUTHOR:
# Author: Michał Górny <mgorny@gentoo.org>
# @SUPPORTED_EAPIS: 4 5 6 7
# @SUPPORTED_EAPIS: 4 5 6 7 8
# @PROVIDES: multibuild
# @BLURB: flags and utility functions for building multilib packages
# @DESCRIPTION:
# The multilib-build.eclass exports USE flags and utility functions
@ -17,14 +20,14 @@
# dependencies shall use the USE dependency string in ${MULTILIB_USEDEP}
# to properly request multilib enabled.
if [[ ! ${_MULTILIB_BUILD} ]]; then
# EAPI=4 is required for meaningful MULTILIB_USEDEP.
case ${EAPI:-0} in
4|5|6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
case ${EAPI} in
4|5|6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_MULTILIB_BUILD} ]]; then
_MULTILIB_BUILD=1
[[ ${EAPI} == [45] ]] && inherit eutils
inherit multibuild multilib
@ -47,8 +50,6 @@ _MULTILIB_FLAGS=(
abi_mips_o32:o32
# abi_ppc_32:ppc,ppc_aix,ppc_macos
# abi_ppc_64:ppc64
abi_riscv_lp64d:lp64d
abi_riscv_lp64:lp64
abi_s390_32:s390
abi_s390_64:s390x
)
@ -79,6 +80,7 @@ readonly _MULTILIB_FLAGS
# @CODE
# @ECLASS-VARIABLE: MULTILIB_USEDEP
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# The USE-dependency to be used on dependencies (libraries) needing
# to support multilib as well.
@ -90,7 +92,7 @@ readonly _MULTILIB_FLAGS
# @CODE
# @ECLASS-VARIABLE: MULTILIB_ABI_FLAG
# @DEFAULT_UNSET
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# The complete ABI name. Resembles the USE flag name.
#
@ -320,6 +322,7 @@ multilib_copy_sources() {
}
# @ECLASS-VARIABLE: MULTILIB_WRAPPED_HEADERS
# @DEFAULT_UNSET
# @DESCRIPTION:
# A list of headers to wrap for multilib support. The listed headers
# will be moved to a non-standard location and replaced with a file
@ -342,6 +345,7 @@ multilib_copy_sources() {
# @CODE
# @ECLASS-VARIABLE: MULTILIB_CHOST_TOOLS
# @DEFAULT_UNSET
# @DESCRIPTION:
# A list of tool executables to preserve for each multilib ABI.
# The listed executables will be renamed to ${CHOST}-${basename},
@ -369,8 +373,8 @@ multilib_copy_sources() {
# MULTILIB_CHOST_TOOLS=(
# /usr/bin/foo-config
# )
# @CODE
# @FUNCTION: multilib_prepare_wrappers
# @USAGE: [<install-root>]
# @DESCRIPTION:
@ -488,14 +492,6 @@ multilib_prepare_wrappers() {
# elif(_MIPS_SIM == _ABIO32) /* o32 */
# error "abi_mips_o32 not supported by the package."
# endif
#elif defined(__riscv)
# if defined(__riscv_float_abi_double)
# error "abi_riscv_lp64d not supported by the package."
# elif defined(__riscv_float_abi_single)
# error "abi_riscv_lp64f not supported by the package."
# else
# error "abi_riscv_lp64 not supported by the package."
# endif
#elif defined(__sparc__)
# if defined(__arch64__)
# error "abi_sparc_64 not supported by the package."
@ -679,5 +675,4 @@ multilib_native_usex() {
fi
}
_MULTILIB_BUILD=1
fi

View File

@ -1,10 +1,13 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 4.
# @ECLASS: multilib-minimal.eclass
# @MAINTAINER:
# Multilib team <multilib@gentoo.org>
# @SUPPORTED_EAPIS: 4 5 6 7
# Michał Górny <mgorny@gentoo.org>
# @SUPPORTED_EAPIS: 5 6 7 8
# @PROVIDES: multilib-build
# @BLURB: wrapper for multilib builds providing convenient multilib_src_* functions
# @DESCRIPTION:
#
@ -23,10 +26,9 @@
# If you need generic install rules, use multilib_src_install_all function.
# EAPI=4 is required for meaningful MULTILIB_USEDEP.
case ${EAPI:-0} in
4|5|6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
case ${EAPI} in
4|5|6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

View File

@ -1,21 +1,21 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 4.
# @ECLASS: multilib.eclass
# @MAINTAINER:
# toolchain@gentoo.org
# @SUPPORTED_EAPIS: 5 6 7 8
# @SUPPORTED_EAPIS: 4 5 6 7 8
# @BLURB: This eclass is for all functions pertaining to handling multilib configurations.
# @DESCRIPTION:
# This eclass is for all functions pertaining to handling multilib configurations.
# Flatcar: we still have some packages that use old EAPI, revert this
# change when we update those packages.
#case ${EAPI:-0} in
# # EAPI=0 is still used by crossdev, bug #797367
# 0|5|6|7|8) ;;
# *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
#esac
case ${EAPI:-0} in
# EAPI=0 is still used by crossdev, bug #797367
0|4|5|6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_MULTILIB_ECLASS} ]]; then
_MULTILIB_ECLASS=1
@ -56,8 +56,7 @@ has_multilib_profile() {
# fall back on old behavior. Any profile that has these set should also
# depend on a newer version of portage (not yet released) which uses these
# over CONF_LIBDIR in econf, dolib, etc...
# Flatcar: Support older EAPIs for now.
if [[ ${EAPI} == [0345] ]] ; then
if [[ ${EAPI} == [045] ]] ; then
get_libdir() {
local CONF_LIBDIR
if [ -n "${CONF_LIBDIR_OVERRIDE}" ] ; then

View File

@ -1,12 +1,15 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 0 and 4.
# @ECLASS: multiprocessing.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @AUTHOR:
# Brian Harring <ferringb@gentoo.org>
# Mike Frysinger <vapier@gentoo.org>
# @SUPPORTED_EAPIS: 0 4 5 6 7 8
# @BLURB: multiprocessing helper functions
# @DESCRIPTION:
# The multiprocessing eclass contains a suite of utility functions
@ -23,6 +26,11 @@
# }
# @CODE
case ${EAPI:-0} in
[045678]) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_MULTIPROCESSING_ECLASS} ]]; then
_MULTIPROCESSING_ECLASS=1

View File

@ -1,6 +1,8 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 4.
# @ECLASS: ninja-utils.eclass
# @MAINTAINER:
# Michał Górny <mgorny@gentoo.org>
@ -8,7 +10,7 @@
# @AUTHOR:
# Michał Górny <mgorny@gentoo.org>
# Mike Gilbert <floppym@gentoo.org>
# @SUPPORTED_EAPIS: 2 4 5 6 7
# @SUPPORTED_EAPIS: 4 5 6 7 8
# @BLURB: common bits to run dev-util/ninja builder
# @DESCRIPTION:
# This eclass provides a single function -- eninja -- that can be used
@ -18,15 +20,14 @@
# be used indirectly by the eclasses for other build systems (CMake,
# Meson).
if [[ -z ${_NINJA_UTILS_ECLASS} ]]; then
case ${EAPI:-0} in
0|1|3) die "EAPI=${EAPI:-0} is not supported (too old)";;
# copied from cmake-utils
2|4|5|6|7) ;;
*) die "EAPI=${EAPI} is not yet supported" ;;
case ${EAPI} in
4|5|6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_NINJA_UTILS_ECLASS} ]]; then
_NINJA_UTILS_ECLASS=1
# @ECLASS-VARIABLE: NINJAOPTS
# @DEFAULT_UNSET
# @DESCRIPTION:
@ -44,7 +45,7 @@ inherit multiprocessing
# with EAPI 6, it also supports being called via 'nonfatal'.
eninja() {
local nonfatal_args=()
[[ ${EAPI:-0} != [245] ]] && nonfatal_args+=( -n )
[[ ${EAPI} != [45] ]] && nonfatal_args+=( -n )
if [[ -z ${NINJAOPTS+set} ]]; then
NINJAOPTS="-j$(makeopts_jobs) -l$(makeopts_loadavg "${MAKEOPTS}" 0)"
@ -54,5 +55,4 @@ eninja() {
"$@" || die "${nonfatal_args[@]}" "${*} failed"
}
_NINJA_UTILS_ECLASS=1
fi

View File

@ -1,19 +1,74 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 0, 4 and 5.
# @ECLASS: optfeature.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @SUPPORTED_EAPIS: 0 4 5 6 7 8
# @BLURB: Advertise optional functionality that might be useful to users
case ${EAPI:-0} in
[0-7]) ;;
*) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;;
0|4|5|6|7|8) ;;
*) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;;
esac
if [[ -z ${_OPTFEATURE_ECLASS} ]]; then
_OPTFEATURE_ECLASS=1
# @ECLASS-VARIABLE: _OPTFEATURE_DEFAULT_HEADER
# @INTERNAL
# @DESCRIPTION:
# Default header printed ahead of optfeature output. Can be overridden
# by calling optfeature_header function. Will not be displayed if all optional
# dependencies are present.
_OPTFEATURE_DEFAULT_HEADER="Install additional packages for optional runtime features:"
readonly _OPTFEATURE_DEFAULT_HEADER
# @ECLASS-VARIABLE: _OPTFEATURE_HEADER
# @INTERNAL
# @DESCRIPTION:
# Default empty. Custom header printed ahead of optfeature output.
# Set by calling optfeature_header function with the desired output, or reset
# by optfeature_header without argument. Will not be displayed if all optional
# dependencies are present.
_OPTFEATURE_HEADER=
# @ECLASS-VARIABLE: _OPTFEATURE_DOHEADER
# @INTERNAL
# @DESCRIPTION:
# If true, print header ahead of the first optfeature output.
_OPTFEATURE_DOHEADER=true
# @FUNCTION: optfeature_header
# @USAGE: [custom header for follow-up optfeature calls]
# @DESCRIPTION:
# Set a custom header for follow-up optfeature calls, or reset to default
# header by calling it without argument. This can not only be used to customize
# the header but also to distinguish optfeature "groups", e.g. to list a number
# of different possible database backends, and then a number of optional
# regular runtime features.
#
# The following snippet will leave the default header untouched for the first
# two optfeature calls. Then a custom header is set that is going to be
# displayed in case dev-db/a or dev-db/b are not installed.
# @CODE
# pkg_postinst() {
# optfeature "foo support" app-misc/foo
# optfeature "bar support" app-misc/bar
# optfeature_header "Install optional database backends:"
# optfeature "a DB backend" dev-db/a
# optfeature "b DB backend" dev-db/b
# }
# @CODE
optfeature_header() {
debug-print-function ${FUNCNAME} "$@"
_OPTFEATURE_HEADER="${1}"
_OPTFEATURE_DOHEADER=true
}
# @FUNCTION: optfeature
# @USAGE: <short description> <package atom to match> [other atoms]
# @DESCRIPTION:
@ -24,19 +79,23 @@ _OPTFEATURE_ECLASS=1
# app-misc/bar or app-misc/baz[bar] for optional bar support
# and either both app-misc/a and app-misc/b or app-misc/c for alphabet support.
# @CODE
# optfeature "foo support" app-misc/foo
# optfeature "bar support" app-misc/bar app-misc/baz[bar]
# optfeature "alphabet support" "app-misc/a app-misc/b" app-misc/c
# pkg_postinst() {
# optfeature "foo support" app-misc/foo
# optfeature "bar support" app-misc/bar app-misc/baz[bar]
# optfeature "alphabet support" "app-misc/a app-misc/b" app-misc/c
# }
# @CODE
optfeature() {
debug-print-function ${FUNCNAME} "$@"
local i j msg
local -a arr
local desc=$1
local flag=0
shift
for i; do
for j in ${i}; do
read -r -d '' -a arr <<<"${i}"
for j in "${arr[@]}"; do
if has_version "${j}"; then
flag=1
else
@ -49,9 +108,14 @@ optfeature() {
fi
done
if [[ ${flag} -eq 0 ]]; then
if [[ ${_OPTFEATURE_DOHEADER} == true ]]; then
elog ${_OPTFEATURE_HEADER:-${_OPTFEATURE_DEFAULT_HEADER}}
_OPTFEATURE_DOHEADER=false
fi
for i; do
read -r -d '' -a arr <<<"${i}"
msg=" "
for j in ${i}; do
for j in "${arr[@]}"; do
msg+=" ${j} and"
done
msg="${msg:0: -4} for ${desc}"

View File

@ -1,11 +1,19 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 0 and 4.
# @ECLASS: preserve-libs.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @SUPPORTED_EAPIS: 0 4 5 6 7
# @BLURB: preserve libraries after SONAME changes
case ${EAPI:-0} in
[04567]) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_PRESERVE_LIBS_ECLASS} ]]; then
_PRESERVE_LIBS_ECLASS=1

View File

@ -0,0 +1,69 @@
# Copyright 2004-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 0 and 4.
# @ECLASS: strip-linguas.eclass
# @MAINTAINER:
# Ulrich Müller <ulm@gentoo.org>
# @AUTHOR:
# Mike Frysinger <vapier@gentoo.org>
# @SUPPORTED_EAPIS: 0 4 5 6 7 8
# @BLURB: convenience function for LINGUAS support
case ${EAPI:-0} in
0|4|5|6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_STRIP_LINGUAS_ECLASS} ]]; then
_STRIP_LINGUAS_ECLASS=1
# @FUNCTION: strip-linguas
# @USAGE: [<allow LINGUAS>|<-i|-u> <directories of .po files>]
# @DESCRIPTION:
# Make sure that LINGUAS only contains languages that a package can
# support. The first form allows you to specify a list of LINGUAS.
# The -i builds a list of po files found in all the directories and uses
# the intersection of the lists. The -u builds a list of po files found
# in all the directories and uses the union of the lists.
strip-linguas() {
local d f ls newls nols
if [[ $1 == "-i" ]] || [[ $1 == "-u" ]]; then
local op=$1; shift
ls=$(find "$1" -name '*.po' -exec basename {} .po ';'); shift
for d; do
if [[ ${op} == "-u" ]]; then
newls=${ls}
else
newls=""
fi
for f in $(find "${d}" -name '*.po' -exec basename {} .po ';'); do
if [[ ${op} == "-i" ]]; then
has ${f} ${ls} && newls+=" ${f}"
else
has ${f} ${ls} || newls+=" ${f}"
fi
done
ls=${newls}
done
else
ls="$@"
fi
nols=""
newls=""
for f in ${LINGUAS}; do
if has ${f} ${ls}; then
newls+=" ${f}"
else
nols+=" ${f}"
fi
done
[[ -n ${nols} ]] \
&& einfo "Sorry, but ${PN} does not support the LINGUAS:" ${nols}
export LINGUAS=${newls:1}
}
fi

View File

@ -1,10 +1,12 @@
# Copyright 2002-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 4.
# @ECLASS: toolchain-funcs.eclass
# @MAINTAINER:
# Toolchain Ninjas <toolchain@gentoo.org>
# @SUPPORTED_EAPIS: 5 6 7 8
# @SUPPORTED_EAPIS: 4 5 6 7 8
# @BLURB: functions to query common info about the toolchain
# @DESCRIPTION:
# The toolchain-funcs aims to provide a complete suite of functions
@ -13,13 +15,11 @@
# in such a way that you can rely on the function always returning
# something sane.
# Flatcar: we still have some packages that use old EAPI, revert this
# change when we update those packages.
#case ${EAPI:-0} in
# # EAPI=0 is still used by crossdev, bug #797367
# 0|5|6|7|8) ;;
# *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
#esac
case ${EAPI:-0} in
# EAPI=0 is still used by crossdev, bug #797367
0|4|5|6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_TOOLCHAIN_FUNCS_ECLASS} ]]; then
_TOOLCHAIN_FUNCS_ECLASS=1
@ -677,6 +677,7 @@ ninj() { [[ ${type} == "kern" ]] && echo $1 || echo $2 ; }
fi
;;
ia64*) echo ia64;;
loongarch*) ninj loongarch loong;;
m68*) echo m68k;;
metag*) echo metag;;
microblaze*) echo microblaze;;
@ -754,6 +755,7 @@ tc-endian() {
hppa*) echo big;;
i?86*) echo little;;
ia64*) echo little;;
loongarch*) echo little;;
m68*) echo big;;
mips*l*) echo little;;
mips*) echo big;;

View File

@ -1,13 +1,24 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 0 and 4.
# @ECLASS: vcs-clean.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @AUTHOR:
# Benedikt Böhm <hollow@gentoo.org>
# @SUPPORTED_EAPIS: 0 4 5 6 7
# @BLURB: helper functions to remove VCS directories
case ${EAPI:-0} in
[04567]) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_VCS_CLEAN_ECLASS} ]] ; then
_VCS_CLEAN_ECLASS=1
# @FUNCTION: ecvs_clean
# @USAGE: [list of dirs]
# @DESCRIPTION:
@ -38,3 +49,5 @@ egit_clean() {
[[ $# -eq 0 ]] && set -- .
find "$@" -type d -name '.git*' -prune -exec rm -rf '{}' +
}
fi

View File

@ -1,30 +1,25 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 4 and 5.
# @ECLASS: virtualx.eclass
# @MAINTAINER:
# x11@gentoo.org
# @AUTHOR:
# Original author: Martin Schlemmer <azarah@gentoo.org>
# @SUPPORTED_EAPIS: 4 5 6 7
# @BLURB: This eclass can be used for packages that needs a working X environment to build.
if [[ ! ${_VIRTUAL_X} ]]; then
case "${EAPI:-0}" in
0|1|2|3)
die "virtualx.eclass: EAPI ${EAPI} is too old."
;;
4|5|6|7)
;;
*)
die "virtualx.eclass: EAPI ${EAPI} is not supported yet."
;;
# @SUPPORTED_EAPIS: 4 5 6 7 8
# @BLURB: This eclass can be used for packages that need a working X environment to build.
case ${EAPI} in
4|5|6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} is not supported." ;;
esac
[[ ${EAPI} == [45] ]] && inherit eutils
if [[ ! ${_VIRTUALX_ECLASS} ]]; then
_VIRTUALX_ECLASS=1
# @ECLASS-VARIABLE: VIRTUALX_REQUIRED
# @PRE_INHERIT
# @DESCRIPTION:
# Variable specifying the dependency on xorg-server and xhost.
# Possible special values are "always" and "manual", which specify
@ -35,83 +30,36 @@ esac
: ${VIRTUALX_REQUIRED:=test}
# @ECLASS-VARIABLE: VIRTUALX_DEPEND
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# Dep string available for use outside of eclass, in case a more
# complicated dep is needed.
# You can specify the variable BEFORE inherit to add more dependencies.
VIRTUALX_DEPEND="${VIRTUALX_DEPEND}
!prefix? ( x11-base/xorg-server[xvfb] )
# Standard dependencies string that is automatically added to BDEPEND
# (in EAPI-6: DEPEND) unless VIRTUALX_REQUIRED is set to "manual".
# DEPRECATED: Pre-EAPI-8 you can specify the variable BEFORE inherit
# to add more dependencies.
[[ ${EAPI} != [4567] ]] && VIRTUALX_DEPEND=""
VIRTUALX_DEPEND+="
x11-base/xorg-server[xvfb]
x11-apps/xhost
"
[[ ${EAPI} != [4567] ]] && readonly VIRTUALX_DEPEND
# @ECLASS-VARIABLE: VIRTUALX_COMMAND
# @DESCRIPTION:
# Command (or eclass function call) to be run in the X11 environment
# (within virtualmake function).
: ${VIRTUALX_COMMAND:="emake"}
[[ ${VIRTUALX_COMMAND} ]] && die "VIRTUALX_COMMAND has been removed and is a no-op"
case ${VIRTUALX_REQUIRED} in
manual)
;;
always)
if [[ ${EAPI:-0} != [0123456] ]]; then
BDEPEND="${VIRTUALX_DEPEND}"
else
DEPEND="${VIRTUALX_DEPEND}"
fi
RDEPEND=""
;;
optional|tests)
[[ ${EAPI} == [45] ]] \
|| die 'Values "optional" and "tests" for VIRTUALX_REQUIRED are banned in EAPI > 5'
# deprecated section YAY.
eqawarn "VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are deprecated."
eqawarn "You can drop the variable definition completely from ebuild,"
eqawarn "because it is default behaviour."
if [[ -n ${VIRTUALX_USE} ]]; then
# so they like to specify the useflag
eqawarn "VIRTUALX_USE variable is deprecated."
eqawarn "Please read eclass manpage to find out how to use VIRTUALX_REQUIRED"
eqawarn "to achieve the same behaviour."
fi
[[ -z ${VIRTUALX_USE} ]] && VIRTUALX_USE="test"
DEPEND="${VIRTUALX_USE}? ( ${VIRTUALX_DEPEND} )"
RDEPEND=""
IUSE="${VIRTUALX_USE}"
BDEPEND="${VIRTUALX_DEPEND}"
;;
*)
if [[ ${EAPI:-0} != [0123456] ]]; then
BDEPEND="${VIRTUALX_REQUIRED}? ( ${VIRTUALX_DEPEND} )"
else
DEPEND="${VIRTUALX_REQUIRED}? ( ${VIRTUALX_DEPEND} )"
fi
RDEPEND=""
BDEPEND="${VIRTUALX_REQUIRED}? ( ${VIRTUALX_DEPEND} )"
IUSE="${VIRTUALX_REQUIRED}"
[[ ${VIRTUALX_REQUIRED} == test ]] &&
RESTRICT+=" !test? ( test )"
;;
esac
# @FUNCTION: virtualmake
# @DESCRIPTION:
# Function which start new Xvfb session
# where the VIRTUALX_COMMAND variable content gets executed.
virtualmake() {
debug-print-function ${FUNCNAME} "$@"
[[ ${EAPI} == [45] ]] \
|| die "${FUNCNAME} is unsupported in EAPI > 5, please use virtx"
# backcompat for maketype
if [[ -n ${maketype} ]]; then
[[ ${EAPI} == [45] ]] || die "maketype is banned in EAPI > 5"
eqawarn "ebuild is exporting \$maketype=${maketype}"
eqawarn "Ebuild should be migrated to use 'virtx command' instead."
VIRTUALX_COMMAND=${maketype}
fi
virtx "${VIRTUALX_COMMAND}" "${@}"
}
[[ ${EAPI} == [456] ]] && DEPEND="${BDEPEND}"
# @FUNCTION: virtx
@ -178,7 +126,10 @@ virtx() {
# Xvfb is started, else bump the display number
#
# Azarah - 5 May 2002
XDISPLAY=$(i=0; while [[ -f /tmp/.X${i}-lock ]] ; do ((i++));done; echo ${i})
# GNOME GDM may have started X on DISPLAY :0 with a
# lock file /tmp/.X1024-lock, therefore start the search at 1.
# Else a leftover /tmp/.X1-lock will prevent finding an available display.
XDISPLAY=$(i=1; while [[ -f /tmp/.X${i}-lock ]] ; do ((i++));done; echo ${i})
debug-print "${FUNCNAME}: XDISPLAY=${XDISPLAY}"
# We really do not want SANDBOX enabled here
@ -226,44 +177,4 @@ virtx() {
return 0 # always return 0, it can be altered by failed kill for Xvfb
}
# @FUNCTION: Xmake
# @DESCRIPTION:
# Same as "make", but set up the Xvfb hack if needed.
# Deprecated call.
Xmake() {
debug-print-function ${FUNCNAME} "$@"
[[ ${EAPI} == [45] ]] \
|| die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake -j1 ....'"
eqawarn "you should not execute make directly"
eqawarn "rather execute Xemake -j1 if you have issues with parallel make"
VIRTUALX_COMMAND="emake -j1" virtualmake "$@"
}
# @FUNCTION: Xemake
# @DESCRIPTION:
# Same as "emake", but set up the Xvfb hack if needed.
Xemake() {
debug-print-function ${FUNCNAME} "$@"
[[ ${EAPI} == [45] ]] \
|| die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake ....'"
VIRTUALX_COMMAND="emake" virtualmake "$@"
}
# @FUNCTION: Xeconf
# @DESCRIPTION:
# Same as "econf", but set up the Xvfb hack if needed.
Xeconf() {
debug-print-function ${FUNCNAME} "$@"
[[ ${EAPI} == [45] ]] \
|| die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx econf ....'"
VIRTUALX_COMMAND="econf" virtualmake "$@"
}
_VIRTUAL_X=1
fi

View File

@ -0,0 +1,59 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: wrapper.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @BLURB: create a shell wrapper script
if [[ -z ${_WRAPPER_ECLASS} ]]; then
_WRAPPER_ECLASS=1
# @FUNCTION: make_wrapper
# @USAGE: <wrapper> <target> [chdir] [libpaths] [installpath]
# @DESCRIPTION:
# Create a shell wrapper script named wrapper in installpath
# (defaults to the bindir) to execute target (default of wrapper)
# by first optionally setting LD_LIBRARY_PATH to the colon-delimited
# libpaths followed by optionally changing directory to chdir.
make_wrapper() {
local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5
local tmpwrapper="${T}/tmp.wrapper.${wrapper##*/}"
has "${EAPI:-0}" 0 1 2 && local EPREFIX=""
(
echo '#!/bin/sh'
if [[ -n ${libdir} ]] ; then
local var
if [[ ${CHOST} == *-darwin* ]] ; then
var=DYLD_LIBRARY_PATH
else
var=LD_LIBRARY_PATH
fi
cat <<-EOF
if [ "\${${var}+set}" = "set" ] ; then
export ${var}="\${${var}}:${EPREFIX}${libdir}"
else
export ${var}="${EPREFIX}${libdir}"
fi
EOF
fi
[[ -n ${chdir} ]] && printf 'cd "%s" &&\n' "${EPREFIX}${chdir}"
# We don't want to quote ${bin} so that people can pass complex
# things as ${bin} ... "./someprog --args"
printf 'exec %s "$@"\n' "${bin/#\//${EPREFIX}/}"
) > "${tmpwrapper}"
chmod go+rx "${tmpwrapper}"
if [[ -n ${path} ]] ; then
(
exeopts -m 0755
exeinto "${path}"
newexe "${tmpwrapper}" "${wrapper}"
) || die
else
newbin "${tmpwrapper}" "${wrapper}" || die
fi
}
fi

View File

@ -1,12 +1,15 @@
# Copyright 1999-2019 Gentoo Authors
# Copyright 2004-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 0 and 4.
# @ECLASS: xdg-utils.eclass
# @MAINTAINER:
# gnome@gentoo.org
# freedesktop-bugs@gentoo.org
# @AUTHOR:
# Original author: Gilles Dartiguelongue <eva@gentoo.org>
# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
# @SUPPORTED_EAPIS: 0 4 5 6 7 8
# @BLURB: Auxiliary functions commonly used by XDG compliant packages.
# @DESCRIPTION:
# This eclass provides a set of auxiliary functions needed by most XDG
@ -16,9 +19,9 @@
# * XDG .desktop files cache management
# * XDG mime information database management
case "${EAPI:-0}" in
0|1|2|3|4|5|6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
case ${EAPI:-0} in
0|4|5|6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
# @ECLASS-VARIABLE: DESKTOP_DATABASE_DIR
@ -56,7 +59,7 @@ xdg_environment_reset() {
# Updates the .desktop files database.
# Generates a list of mimetypes linked to applications that can handle them
xdg_desktop_database_update() {
if [[ ${EBUILD_PHASE} != post* ]] ; then
if [[ ${EBUILD_PHASE} != post* ]]; then
die "xdg_desktop_database_update must be used in pkg_post* phases."
fi
@ -75,7 +78,7 @@ xdg_desktop_database_update() {
# Updates icon theme cache files under /usr/share/icons.
# This function should be called from pkg_postinst and pkg_postrm.
xdg_icon_cache_update() {
if [[ ${EBUILD_PHASE} != post* ]] ; then
if [[ ${EBUILD_PHASE} != post* ]]; then
die "xdg_icon_cache_update must be used in pkg_post* phases."
fi
@ -85,21 +88,17 @@ xdg_icon_cache_update() {
fi
ebegin "Updating icons cache"
local retval=0
local fails=( )
for dir in "${EROOT%/}"/usr/share/icons/*
do
if [[ -f "${dir}/index.theme" ]] ; then
local rv=0
gtk-update-icon-cache -qf "${dir}"
rv=$?
if [[ ! $rv -eq 0 ]] ; then
local dir retval=0
local fails=()
for dir in "${EROOT%/}"/usr/share/icons/*; do
if [[ -f ${dir}/index.theme ]]; then
if ! gtk-update-icon-cache -qf "${dir}"; then
debug-print "Updating cache failed on ${dir}"
# Add to the list of failures
fails+=( "${dir}" )
fails+=("${dir}")
retval=2
fi
elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then
elif [[ $(ls "${dir}") = icon-theme.cache ]]; then
# Clear stale cache files after theme uninstallation
rm "${dir}/icon-theme.cache"
fi
@ -109,8 +108,8 @@ xdg_icon_cache_update() {
fi
done
eend ${retval}
for f in "${fails[@]}" ; do
eerror "Failed to update cache with icon $f"
for dir in "${fails[@]}"; do
eerror "Failed to update cache with icon ${dir}"
done
}
@ -119,7 +118,7 @@ xdg_icon_cache_update() {
# Update the mime database.
# Creates a general list of mime types from several sources
xdg_mimeinfo_database_update() {
if [[ ${EBUILD_PHASE} != post* ]] ; then
if [[ ${EBUILD_PHASE} != post* ]]; then
die "xdg_mimeinfo_database_update must be used in pkg_post* phases."
fi
@ -128,6 +127,9 @@ xdg_mimeinfo_database_update() {
return
fi
# https://bugs.gentoo.org/819783
local -x PKGSYSTEM_ENABLE_FSYNC=0
ebegin "Updating shared mime info database"
update-mime-database "${EROOT%/}${MIMEINFO_DATABASE_DIR}"
eend $?

View File

@ -1,3 +1,2 @@
DIST parted-3.2.tar.xz 1655244 BLAKE2B 56608590b26a9b5266dacf3698d990b730bdb35d9374d1da57103fbef3ef5037e40dd2fe0f523ca8e0e75401a3b25cf543e5ca5c94cf410bbaa62ea15d6f0ba3 SHA512 4e37dbdd6f5032c9ebfec43704f6882379597d038167b9c4d04053efa083c68a705196713864451fa9e11d32777e16c68982877945c5efd9ea5f8252cb20e1c4
DIST parted_3.2-19.debian.tar.xz 87288 BLAKE2B f0cef2978ead9edca3e952849deb36526eea0a050d45ab480b2aa62d02ba0a1750c28e93c28a714df6629f02ccf5a1e4fbb33a6e42b82bf6685c05aeaad1756c SHA512 de3e55545d7d94668eb608c8c31440f550baaf7b664836d199f73f7a8c75bba4ff59b4c06a23459c7d522250d7c03d29fa7f727f7d1a2b1e5a0366e83a2d871a
DIST parted_3.2-20.debian.tar.xz 87496 BLAKE2B 4409826b35b42093f16f80b1ab2f41b4caf2264c9dcfe9572fa1ddf5f51eeffa2208fc187bd7a98290ee2df92604928eae84fd2fdee78d688ec19e81f8b9efac SHA512 83f14befdd7d048976572b3e2eebfaa42649458cbcfd659db704737dce991980ddb2bc65013c5b31b04a17fc17fb756da0dda76edbcba93708afca34c56e0d22
DIST parted-3.4.tar.xz 1860300 BLAKE2B c724d3d1490c62d440b9e5dc359fef7ff623bc77ae5f867d8905245cb279ec391fa07a1a774488ad3bf7a2c477007264d7bab2635a544be8f94dc706a654a711 SHA512 e69bd1b610778e980d4595d04892f2ea1faf4ae9bfc98cd62abfc70066423f08ddaa396f9461c7beb1330d023232274606b6b26091a0458aeedd0f3f57536690
DIST parted-3.4.tar.xz.sig 508 BLAKE2B 112ad0158b1100bd9150a7c87e8f93e67d42870b82a17d4d0aa8bb5e46306f837f3f99feabaf301f8cd640c299174e5f5acf152dd1f20ea2b7ace73d57d31f14 SHA512 6b11812267e66470ba2908ee1cc78b232b0bc2519787f5a17b92cd5f8ba904b1a836833f19c5244b23d4c7810437eeb26fbbd68fac819391b342709682345472

View File

@ -1,60 +0,0 @@
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -2304,6 +2304,7 @@
return r < 0 ? NULL : resultp;
}
+#ifdef ENABLE_DEVICE_MAPPER
static char *
dm_canonical_path (PedDevice const *dev)
{
@@ -2326,12 +2327,22 @@
err:
return NULL;
}
+#endif /* ENABLE_DEVICE_MAPPER */
static char*
_device_get_part_path (PedDevice const *dev, int num)
{
- char *devpath = (dev->type == PED_DEVICE_DM
- ? dm_canonical_path (dev) : dev->path);
+ char *devpath =
+#ifdef ENABLE_DEVICE_MAPPER
+ (
+ dev->type == PED_DEVICE_DM
+ ? dm_canonical_path (dev) :
+#endif /* ENABLE_DEVICE_MAPPER */
+ dev->path
+#ifdef ENABLE_DEVICE_MAPPER
+ )
+#endif /* ENABLE_DEVICE_MAPPER */
+ ;
size_t path_len = strlen (devpath);
char *result;
/* Check for devfs-style /disc => /partN transformation
@@ -2945,12 +2956,14 @@
unsigned long long *length);
+#ifdef ENABLE_DEVICE_MAPPER
if (disk->dev->type == PED_DEVICE_DM) {
add_partition = _dm_add_partition;
remove_partition = _dm_remove_partition;
resize_partition = _dm_resize_partition;
get_partition_start_and_length = _dm_get_partition_start_and_length;
} else {
+#endif /* ENABLE_DEVICE_MAPPER */
add_partition = _blkpg_add_partition;
remove_partition = _blkpg_remove_partition;
#ifdef BLKPG_RESIZE_PARTITION
@@ -2959,7 +2972,9 @@
resize_partition = NULL;
#endif
get_partition_start_and_length = _kernel_get_partition_start_and_length;
+#ifdef ENABLE_DEVICE_MAPPER
}
+#endif /* ENABLE_DEVICE_MAPPER */
/* lpn = largest partition number.
* for remove pass, use greater of device or label limit */

View File

@ -1,64 +0,0 @@
From 1e9e770f4bc7f3d80e09ecd1df58575fad064163 Mon Sep 17 00:00:00 2001
From: Mike Fleetwood <mike.fleetwood@googlemail.com>
Date: Sun, 28 Sep 2014 15:15:48 +0000
Subject: lib-fs-resize: Prevent crash resizing FAT16 file systems
Resizing FAT16 file system crashes in libparted/fs/r/fat/resize.c
create_resize_context() because it was dereferencing NULL pointer
fs_info->info_sector to copy the info_sector.
Only FAT32 file systems have info_sector populated by fat_open() ->
fat_info_sector_read(). FAT12 and FAT16 file systems don't have an
info_sector so pointer fs_info->info_sector remains assigned NULL from
fat_alloc(). When resizing a FAT file system create_resize_context()
was always dereferencing fs_info->info_sector to memory copy the
info_sector, hence it crashed for FAT12 and FAT16.
Make create_resize_context() only copy the info_sector for FAT32 file
systems.
Reported by Christian Hesse in
https://bugzilla.gnome.org/show_bug.cgi?id=735669
---
diff --git a/NEWS b/NEWS
index 297b0a5..da7db50 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ GNU parted NEWS -*- outline -*-
* Noteworthy changes in release ?.? (????-??-??) [?]
+** Bug Fixes
+
+ libparted-fs-resize: Prevent crash resizing FAT16 file systems.
+
* Noteworthy changes in release 3.2 (2014-07-28) [stable]
diff --git a/libparted/fs/r/fat/resize.c b/libparted/fs/r/fat/resize.c
index 919acf0..bfe60a0 100644
--- a/libparted/fs/r/fat/resize.c
+++ b/libparted/fs/r/fat/resize.c
@@ -668,11 +668,17 @@ create_resize_context (PedFileSystem* fs, const PedGeometry* new_geom)
/* preserve boot code, etc. */
new_fs_info->boot_sector = ped_malloc (new_geom->dev->sector_size);
- new_fs_info->info_sector = ped_malloc (new_geom->dev->sector_size);
memcpy (new_fs_info->boot_sector, fs_info->boot_sector,
new_geom->dev->sector_size);
- memcpy (new_fs_info->info_sector, fs_info->info_sector,
- new_geom->dev->sector_size);
+ new_fs_info->info_sector = NULL;
+ if (fs_info->fat_type == FAT_TYPE_FAT32)
+ {
+ PED_ASSERT (fs_info->info_sector != NULL);
+ new_fs_info->info_sector =
+ ped_malloc (new_geom->dev->sector_size);
+ memcpy (new_fs_info->info_sector, fs_info->info_sector,
+ new_geom->dev->sector_size);
+ }
new_fs_info->logical_sector_size = fs_info->logical_sector_size;
new_fs_info->sector_count = new_geom->length;
--
cgit v0.9.0.2

View File

@ -1,28 +0,0 @@
https://bugs.gentoo.org/580022
From dec8995fe80508374beba6356f6ecbba8ef6b18b Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Tue, 21 Jun 2016 15:01:08 -0400
Subject: [PATCH] include sysmacros.h for major/minor/makedev
Linux C libs are moving away from including this header implicitly via
sys/types.h, so include it explicitly.
---
libparted/arch/linux.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 326b95619d31..e5c168be3c68 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -37,6 +37,7 @@
#include <dirent.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
#include <sys/types.h>
#include <sys/utsname.h> /* for uname() */
#include <scsi/scsi.h>
--
2.8.2

View File

@ -0,0 +1,11 @@
--- a/libparted/labels/atari.c
+++ b/libparted/labels/atari.c
@@ -1957,7 +1957,7 @@
PED_ASSERT (sizeof (AtariRawPartition) == 12);
PED_ASSERT (sizeof (AtariRawTable) == 512);
/* GNU Libc doesn't support NULL instead of the locale name */
- PED_ASSERT ((atr_c_locale = newlocale(LC_ALL_MASK, "C", NULL)) != NULL);
+ atr_c_locale = newlocale(LC_ALL_MASK, "C", NULL);
ped_disk_type_register (&atari_disk_type);
}

View File

@ -1,20 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>mgorny@gentoo.org</email>
<name>Michał Górny</name>
</maintainer>
<maintainer type="project">
<email>livecd@gentoo.org</email>
<name>Gentoo LiveCD Project</name>
<email>base-system@gentoo.org</email>
<name>Base System Project</name>
</maintainer>
<use>
<flag name="device-mapper">
Enable device-mapper support from <pkg>sys-fs/lvm2</pkg> in parted
</flag>
Enable device-mapper support from <pkg>sys-fs/lvm2</pkg>
in parted
</flag>
<flag name="debug">
Enable debugging as encouraged by upstream: [The default configuration]
includes --enable-debug (by default), which contains many assertions.
Obviously, these "waste" space, but in the past, they have caught
potentially dangerous bugs before they would have done damage, so we think
it's worth it. Also, it means we get more bug reports ;)
</flag>
Enable debugging as encouraged by upstream: [The default
configuration] includes --enable-debug (by default), which
contains many assertions. Obviously, these "waste" space,
but in the past, they have caught potentially dangerous bugs
before they would have done damage, so we think it's worth
it. Also, it means we get more bug reports ;)
</flag>
</use>
</pkgmetadata>

View File

@ -1,60 +0,0 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=5
inherit autotools eutils flag-o-matic
DESCRIPTION="Create, destroy, resize, check, copy partitions and file systems"
HOMEPAGE="https://www.gnu.org/software/parted"
SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86"
IUSE="+debug device-mapper nls readline selinux static-libs"
RESTRICT="test"
# specific version for gettext needed
# to fix bug 85999
RDEPEND="
>=sys-fs/e2fsprogs-1.27
device-mapper? ( >=sys-fs/lvm2-2.02.45 )
readline? ( >=sys-libs/readline-5.2:0= >=sys-libs/ncurses-5.7-r7:0= )
selinux? ( sys-libs/libselinux )
elibc_uclibc? ( dev-libs/libiconv )
"
DEPEND="
${RDEPEND}
nls? ( >=sys-devel/gettext-0.12.1-r2 )
virtual/pkgconfig
"
src_prepare() {
epatch \
"${FILESDIR}"/${PN}-3.2-devmapper.patch \
"${FILESDIR}"/${PN}-3.2-po4a-mandir.patch \
"${FILESDIR}"/${PN}-3.2-fix-resizing-FAT16.patch \
"${FILESDIR}"/${PN}-3.2-sysmacros.patch
eautoreconf
}
src_configure() {
use elibc_uclibc && append-libs -liconv
econf \
$(use_enable debug) \
$(use_enable device-mapper) \
$(use_enable nls) \
$(use_enable selinux) \
$(use_enable static-libs static) \
$(use_with readline) \
--disable-rpath \
--disable-silent-rules
}
DOCS=( AUTHORS BUGS ChangeLog NEWS README THANKS TODO doc/{API,FAT,USER.jp} )
src_install() {
default
prune_libtool_files
}

View File

@ -1,63 +0,0 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit autotools eutils flag-o-matic
DESCRIPTION="Create, destroy, resize, check, copy partitions and file systems"
HOMEPAGE="https://www.gnu.org/software/parted"
SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
IUSE="+debug device-mapper nls readline selinux static-libs"
RESTRICT="test"
# specific version for gettext needed
# to fix bug 85999
RDEPEND="
>=sys-fs/e2fsprogs-1.27
device-mapper? ( >=sys-fs/lvm2-2.02.45 )
readline? ( >=sys-libs/readline-5.2:0= >=sys-libs/ncurses-5.7-r7:0= )
selinux? ( sys-libs/libselinux )
elibc_uclibc? ( dev-libs/libiconv )
"
DEPEND="
${RDEPEND}
nls? ( >=sys-devel/gettext-0.12.1-r2 )
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}"/${PN}-3.2-devmapper.patch
"${FILESDIR}"/${PN}-3.2-po4a-mandir.patch
"${FILESDIR}"/${PN}-3.2-fix-resizing-FAT16.patch
"${FILESDIR}"/${PN}-3.2-sysmacros.patch
)
src_prepare() {
default
eautoreconf
}
src_configure() {
use elibc_uclibc && append-libs -liconv
econf \
$(use_enable debug) \
$(use_enable device-mapper) \
$(use_enable nls) \
$(use_enable selinux) \
$(use_enable static-libs static) \
$(use_with readline) \
--disable-rpath \
--disable-silent-rules
}
DOCS=( AUTHORS BUGS ChangeLog NEWS README THANKS TODO doc/{API,FAT,USER.jp} )
src_install() {
default
prune_libtool_files
}

View File

@ -1,70 +0,0 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit autotools eutils flag-o-matic
DESCRIPTION="Create, destroy, resize, check, copy partitions and file systems"
HOMEPAGE="https://www.gnu.org/software/parted"
SRC_URI="
mirror://gnu/${PN}/${P/_p*/}.tar.xz
mirror://debian/pool/main/p/${PN}/${PN}_${PV/_p/-}.debian.tar.xz
"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
IUSE="+debug device-mapper nls readline selinux static-libs"
RESTRICT="test"
# specific version for gettext needed
# to fix bug 85999
RDEPEND="
>=sys-fs/e2fsprogs-1.27
device-mapper? ( >=sys-fs/lvm2-2.02.45 )
readline? ( >=sys-libs/readline-5.2:0= >=sys-libs/ncurses-5.7-r7:0= )
selinux? ( sys-libs/libselinux )
elibc_uclibc? ( dev-libs/libiconv )
"
DEPEND="
${RDEPEND}
nls? ( >=sys-devel/gettext-0.12.1-r2 )
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}"/${PN}-3.2-devmapper.patch
"${FILESDIR}"/${PN}-3.2-po4a-mandir.patch
"${FILESDIR}"/${PN}-3.2-sysmacros.patch
)
S=${WORKDIR}/${P/_p*/}
src_prepare() {
default
sed -i -e '/atari\.patch/d' "${WORKDIR}"/debian/patches/series || die
for patch in $(< "${WORKDIR}"/debian/patches/series); do
eapply "${WORKDIR}/debian/patches/$patch"
done
eautoreconf
}
src_configure() {
use elibc_uclibc && append-libs -liconv
econf \
$(use_enable debug) \
$(use_enable device-mapper) \
$(use_enable nls) \
$(use_enable selinux) \
$(use_enable static-libs static) \
$(use_with readline) \
--disable-rpath \
--disable-silent-rules
}
DOCS=( AUTHORS BUGS ChangeLog NEWS README THANKS TODO doc/{API,FAT,USER.jp} )
src_install() {
default
prune_libtool_files
}

View File

@ -1,70 +0,0 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit autotools eutils flag-o-matic
DESCRIPTION="Create, destroy, resize, check, copy partitions and file systems"
HOMEPAGE="https://www.gnu.org/software/parted"
SRC_URI="
mirror://gnu/${PN}/${P/_p*/}.tar.xz
mirror://debian/pool/main/p/${PN}/${PN}_${PV/_p/-}.debian.tar.xz
"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
IUSE="+debug device-mapper nls readline selinux static-libs"
RESTRICT="test"
# specific version for gettext needed
# to fix bug 85999
RDEPEND="
>=sys-fs/e2fsprogs-1.27
device-mapper? ( >=sys-fs/lvm2-2.02.45 )
readline? ( >=sys-libs/readline-5.2:0= >=sys-libs/ncurses-5.7-r7:0= )
selinux? ( sys-libs/libselinux )
elibc_uclibc? ( dev-libs/libiconv )
"
DEPEND="
${RDEPEND}
nls? ( >=sys-devel/gettext-0.12.1-r2 )
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}"/${PN}-3.2-devmapper.patch
"${FILESDIR}"/${PN}-3.2-po4a-mandir.patch
"${FILESDIR}"/${PN}-3.2-sysmacros.patch
)
S=${WORKDIR}/${P/_p*/}
src_prepare() {
default
sed -i -e '/atari\.patch/d' "${WORKDIR}"/debian/patches/series || die
for patch in $(< "${WORKDIR}"/debian/patches/series); do
eapply "${WORKDIR}/debian/patches/$patch"
done
eautoreconf
}
src_configure() {
use elibc_uclibc && append-libs -liconv
econf \
$(use_enable debug) \
$(use_enable device-mapper) \
$(use_enable nls) \
$(use_enable selinux) \
$(use_enable static-libs static) \
$(use_with readline) \
--disable-rpath \
--disable-silent-rules
}
DOCS=( AUTHORS BUGS ChangeLog NEWS README THANKS TODO doc/{API,FAT,USER.jp} )
src_install() {
default
prune_libtool_files
}

View File

@ -0,0 +1,66 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit verify-sig
DESCRIPTION="Create, destroy, resize, check, copy partitions and file systems"
HOMEPAGE="https://www.gnu.org/software/parted/"
SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="+debug device-mapper nls readline"
# util-linux for libuuid
RDEPEND="
>=sys-fs/e2fsprogs-1.27
sys-apps/util-linux
device-mapper? ( >=sys-fs/lvm2-2.02.45 )
readline? (
>=sys-libs/ncurses-5.7-r7:0=
>=sys-libs/readline-5.2:0=
)
"
DEPEND="${RDEPEND}"
BDEPEND="
nls? ( >=sys-devel/gettext-0.12.1-r2 )
verify-sig? ( sec-keys/openpgp-keys-bcl )
virtual/pkgconfig
"
VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/bcl.asc
PATCHES=(
"${FILESDIR}"/${PN}-3.2-po4a-mandir.patch
"${FILESDIR}"/${PN}-3.3-atari.patch
)
src_prepare() {
default
touch doc/pt_BR/Makefile.in || die
}
src_configure() {
local myconf=(
$(use_enable debug)
$(use_enable device-mapper)
$(use_enable nls)
$(use_with readline)
--disable-rpath
--disable-static
)
econf "${myconf[@]}"
}
DOCS=(
AUTHORS BUGS ChangeLog NEWS README THANKS TODO doc/{API,FAT,USER.jp}
)
src_install() {
default
find "${ED}" -type f -name '*.la' -delete || die
}

View File

@ -41,6 +41,7 @@ RDEPEND="${DEPEND}
git? ( dev-vcs/git )
java? ( >=virtual/jre-1.8 )"
BDEPEND="
!git? ( cvs? ( dev-vcs/cvs ) )
git? ( dev-vcs/git )
"
PDEPEND="emacs? ( app-emacs/po-mode )"

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>base-system@gentoo.org</email>