From 9dea735590ebfff278710148fa8743777a18c4bd Mon Sep 17 00:00:00 2001 From: Thomas Deutschmann Date: Fri, 30 Aug 2019 18:26:34 +0200 Subject: Add support for LVM thin provisioning Signed-off-by: Thomas Deutschmann --- gkbuilds/boost-build.gkbuild | 68 +++++++++++++++++++++++++++ gkbuilds/boost.gkbuild | 80 ++++++++++++++++++++++++++++++++ gkbuilds/expat.gkbuild | 18 +++++++ gkbuilds/lvm.gkbuild | 7 +++ gkbuilds/thin-provisioning-tools.gkbuild | 33 +++++++++++++ 5 files changed, 206 insertions(+) create mode 100644 gkbuilds/boost-build.gkbuild create mode 100644 gkbuilds/boost.gkbuild create mode 100644 gkbuilds/expat.gkbuild create mode 100644 gkbuilds/thin-provisioning-tools.gkbuild (limited to 'gkbuilds') diff --git a/gkbuilds/boost-build.gkbuild b/gkbuilds/boost-build.gkbuild new file mode 100644 index 0000000..17673c1 --- /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 : none none 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 0000000..8b1012b --- /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}" "${CXXFLAGS}" "${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 0000000..e280846 --- /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 05fd087..9cedead 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 0000000..64500c9 --- /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 +} -- cgit v1.2.3-65-gdbad