aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2019-08-30 18:26:34 +0200
committerThomas Deutschmann <whissi@gentoo.org>2019-08-30 22:41:34 +0200
commit9dea735590ebfff278710148fa8743777a18c4bd (patch)
tree08aced58089525f70feef1381bc70dd7d752c241 /gkbuilds
parentgen_funcs.sh: Import makeopts_jobs function from multiprocessing eclass (diff)
downloadgenkernel-9dea735590ebfff278710148fa8743777a18c4bd.tar.gz
genkernel-9dea735590ebfff278710148fa8743777a18c4bd.tar.bz2
genkernel-9dea735590ebfff278710148fa8743777a18c4bd.zip
Add support for LVM thin provisioning
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'gkbuilds')
-rw-r--r--gkbuilds/boost-build.gkbuild68
-rw-r--r--gkbuilds/boost.gkbuild80
-rw-r--r--gkbuilds/expat.gkbuild18
-rw-r--r--gkbuilds/lvm.gkbuild7
-rw-r--r--gkbuilds/thin-provisioning-tools.gkbuild33
5 files changed, 206 insertions, 0 deletions
diff --git a/gkbuilds/boost-build.gkbuild b/gkbuilds/boost-build.gkbuild
new file mode 100644
index 00000000..17673c12
--- /dev/null
+++ b/gkbuilds/boost-build.gkbuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+MY_PV="${PV//./_}"
+S="${WORKDIR}/boost_${MY_PV}/tools/build/src"
+QA_IGNORE_DYNAMICALLY_LINKED_PROGRAM='(bjam|b2)$'
+
+src_prepare() {
+ default
+
+ # Force regeneration
+ rm engine/jambase.c \
+ || die "Failed to remove 'engine/jambase.c'!"
+
+ # This patch allows us to fully control optimization
+ # and stripping flags when bjam is used as build-system
+ # We simply extend the optimization and debug-symbols feature
+ # with empty dummies called 'none'
+ sed -i \
+ -e 's/\(off speed space\)/\1 none/' \
+ -e 's/\(debug-symbols : on off\)/\1 none/' \
+ tools/builtin.jam \
+ || die "sed failed"
+}
+
+src_compile() {
+ cd engine || die "Failed to chdir to '${S}/engine'!"
+
+ local myargs=(
+ ./build.sh
+ cc
+ -d+2
+ --without-python
+ )
+
+ CC=$(tc-getBUILD_CC) gkexec "${myargs[*]}"
+}
+
+src_install() {
+ mkdir -p "${D}"/usr/bin \
+ || die "Failed to create '${D}/usr/bin'!"
+
+ cp --target-directory="${D}/usr/bin" engine/bin.*/{bjam,b2} \
+ || die "Failed to install 'engine/bin.*/{bjam,b2}' to '${D}/usr/bin'!"
+
+ mkdir -p "${D}"/usr/share/boost-build \
+ || die "Failed to create '${D}/usr/share/boost-build'!"
+
+ cp \
+ --recursive \
+ --target-directory="${D}/usr/share/boost-build" \
+ ../boost-build.jam \
+ bootstrap.jam \
+ build-system.jam \
+ ../example/user-config.jam \
+ build \
+ kernel \
+ options \
+ tools \
+ util \
+ || die "Failed to copy *.jam files to '${D}/usr/share/boost-build'!"
+
+ find "${D}/usr/share/boost-build" -iname "*.py" -delete \
+ || die "Failed to remove python files"
+
+ echo 'variant gentoorelease : release : <optimization>none <debug-symbols>none <runtime-link>shared ;' > "${D}/usr/share/boost-build/site-config.jam" \
+ || die "Failed to create '${D}/usr/share/boost-build/site-config.jam'!"
+}
diff --git a/gkbuilds/boost.gkbuild b/gkbuilds/boost.gkbuild
new file mode 100644
index 00000000..8b1012bf
--- /dev/null
+++ b/gkbuilds/boost.gkbuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+create_user-config.jam() {
+ local user_config_jam="${S}"/user-config.jam
+ if [[ -s ${user_config_jam} ]]; then
+ return
+ fi
+
+ local compiler compiler_version compiler_executable="$(tc-getCXX)"
+ compiler="gcc"
+ compiler_version="$(gcc-version)"
+
+ cat > "${user_config_jam}" <<- __EOF__ || die
+ using ${compiler} : ${compiler_version} : ${compiler_executable} : <cflags>"${CFLAGS}" <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;
+ __EOF__
+}
+
+ejam() {
+ create_user-config.jam
+
+ local myargs=(
+ b2
+ "--user-config=${S}/user-config.jam"
+ --without-python
+ "$@"
+ )
+
+ gkexec "${myargs[*]}"
+}
+
+src_configure() {
+ # Workaround for too many parallel processes requested, bug #506064
+ [[ "$(makeopts_jobs)" -gt 64 ]] && MAKEOPTS="${MAKEOPTS} -j64"
+
+ OPTIONS=(
+ gentoorelease
+ "-j$(makeopts_jobs)"
+ -q
+ -d+2
+ pch=off
+ --disable-icu boost.locale.icu=off
+ --without-mpi
+ --without-locale
+ --without-context --without-coroutine --without-fiber
+ --without-stacktrace
+ --boost-build="${BROOT}"/usr/share/boost-build
+ --prefix="/usr"
+ --layout=system
+ --no-cmake-config
+ threading=multi
+ link=shared,static
+ # this seems to be the only way to disable compression algorithms
+ # https://www.boost.org/doc/libs/1_70_0/libs/iostreams/doc/installation.html#boost-build
+ -sNO_BZIP2=1
+ -sNO_LZMA=1
+ -sNO_ZLIB=1
+ -sNO_ZSTD=1
+ )
+
+ # bug 298489
+ if [[ "${CHOST}" == powerpc* ]]; then
+ [[ $(gcc-version) > 4.3 ]] && append-flags -mno-altivec
+ fi
+
+ # Use C++14 globally as of 1.62
+ append-cxxflags -std=c++14
+}
+
+src_compile() {
+ ejam "${OPTIONS[@]}" || die "Compilation of Boot libraries failed!"
+}
+
+src_install() {
+ ejam \
+ "${OPTIONS[@]}" \
+ --includedir="${D}/usr/include" \
+ --libdir="${D}/usr/lib" \
+ install || die "Installation of Boost libraries failed!"
+}
diff --git a/gkbuilds/expat.gkbuild b/gkbuilds/expat.gkbuild
new file mode 100644
index 00000000..e2808461
--- /dev/null
+++ b/gkbuilds/expat.gkbuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+src_configure() {
+ local myconf=(
+ --enable-static
+ )
+
+ gkconf "${myconf[@]}"
+}
+
+src_install() {
+ default
+
+ rm -rf \
+ "${D}"/usr/bin \
+ "${D}"/usr/share
+}
diff --git a/gkbuilds/lvm.gkbuild b/gkbuilds/lvm.gkbuild
index 05fd0876..9cedeade 100644
--- a/gkbuilds/lvm.gkbuild
+++ b/gkbuilds/lvm.gkbuild
@@ -27,6 +27,13 @@ src_configure() {
--disable-udev_rules
)
+ local texec
+ for texec in check dump repair restore
+ do
+ myconf+=( --with-thin-${texec}=/usr/sbin/thin_${texec} )
+ myconf+=( --with-cache-${texec}=/usr/sbin/cache_${texec} )
+ done
+
gkconf "${myconf[@]}"
}
diff --git a/gkbuilds/thin-provisioning-tools.gkbuild b/gkbuilds/thin-provisioning-tools.gkbuild
new file mode 100644
index 00000000..64500c96
--- /dev/null
+++ b/gkbuilds/thin-provisioning-tools.gkbuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+src_prepare() {
+ default
+ gkautoreconf
+}
+
+src_configure() {
+ append-ldflags -static
+
+ local myconf=(
+ --with-optimisation=''
+ --disable-testing
+ )
+
+ gkconf "${myconf[@]}"
+}
+
+src_compile() {
+ gkmake
+}
+
+src_install() {
+ local MYMAKEOPTS=( "DESTDIR=${D}" )
+ MYMAKEOPTS+=( "DATADIR=${D}/usr/share" )
+ MYMAKEOPTS+=( "install" )
+
+ gkmake "${MYMAKEOPTS[@]}"
+
+ rm -rf \
+ "${D}"/usr/share
+}