Skip to content

Commit

Permalink
dev-db/percona-xtrabackup: add 8.3.0.1
Browse files Browse the repository at this point in the history
Bump to latest upstream release. This is years out of date,
maintainer-needed, and patched for build errors that are fixed upstream.

I'm relying on the fact that other distros package this update without
issue. On which note: other distros also package some files we don't! So
go ahead and package those.

The root cause is probably this rather hackish src_install. The upstream
install routine is quite bad as it installs loads of stuff nobody wants
-- some distros just run cmake install and then delete the lot instead.
The software comes with especially interesting gems such as attempting
to install the manpages we do include, to ${ED}/var/tmp/portage/.....

I figure that globbing the plugins for manual installation is probably
the safest move, all things considered.

Signed-off-by: Eli Schwartz <[email protected]>
  • Loading branch information
eli-schwartz committed Aug 8, 2024
1 parent cccb407 commit 68a12cd
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 0 deletions.
1 change: 1 addition & 0 deletions dev-db/percona-xtrabackup/Manifest
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
DIST boost_1_77_0.tar.bz2 110361537 BLAKE2B 106aeb09ec7705b595f2ca966a76c53c649eac6fac50d88c156862e0991c33c89a2f3a09edcbcb453fa44bf71cdde030b35d0a0889ad97b65f3a868cb877a532 SHA512 39b45c9b60bc5a2a4c669a4463d1272c1e093376b2fb374d7f20a84ea10a3e23bb04b335a735a83a04575731f874d9bff77e89acd947524b3fbbae1b26ae1f2f
DIST percona-xtrabackup-8.0.30-23.tar.gz 338259133 BLAKE2B 3b73731497013aea6abae7d83cd96914cb5300dd867f6066514c71d68f8a1420227e33512a5f2faf082029ccd2c871394acbf43fb58c029472cbeb5605f354fc SHA512 acada88f3509526259281b7f9805fcabb31c5924eb50c5ed761b0813f89adda046b060a57825b6a49178171daec8b4388e99202ef9c9def4b2b0932e73b4d535
DIST percona-xtrabackup-8.3.0-1.tar.gz 460238502 BLAKE2B 9c0857c40f5df26ab279e355cbbb37f36c89e2c78197e348d35b903cb337d4c06c0efcc27e9ec3d6254c0314db50a4ef786f19bbd3fd1060d107cff2c301648d SHA512 85351d3e13a4da7394052ac9725fc7793a8fbcafd11f1232669c32ecad2349d9f57a86dc8437359a7db9a0de8bab8d6b0d40942e9e5dff67b5ab143902750c30
114 changes: 114 additions & 0 deletions dev-db/percona-xtrabackup/percona-xtrabackup-8.3.0.1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

CMAKE_MAKEFILE_GENERATOR="emake"

inherit cmake flag-o-matic

# TODO: just keep it unbundled...?
MY_BOOST_VERSION="1.77.0"
MY_PV=$(ver_rs 3 '-')
MY_PV="${MY_PV//_pre*}"
MY_PN="Percona-XtraBackup"
MY_P="${PN}-${MY_PV}"
MY_MAJOR_PV=$(ver_cut 1-2)

DESCRIPTION="Hot backup utility for MySQL based servers"
HOMEPAGE="https://www.percona.com/software/mysql-database/percona-xtrabackup"
SRC_URI="
https://downloads.percona.com/downloads/${MY_PN}-innovative-release/${MY_PN}-${MY_PV}/source/tarball/${PN}-${MY_PV}.tar.gz
https://boostorg.jfrog.io/artifactory/main/release/${MY_BOOST_VERSION}/source/boost_$(ver_rs 1- _ ${MY_BOOST_VERSION}).tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"

DEPEND="
app-arch/lz4:0=
app-arch/zstd:=
app-editors/vim-core
dev-libs/icu:=
dev-libs/libaio
dev-libs/libedit
dev-libs/libev
dev-libs/libevent:0=
dev-libs/libfido2:=
dev-libs/libgcrypt:0=
dev-libs/libgpg-error
dev-libs/openssl:0=
dev-libs/protobuf:=
dev-libs/re2:=
dev-python/sphinx
net-misc/curl
sys-libs/zlib:=
sys-process/procps:=
"

RDEPEND="
${DEPEND}
!dev-db/percona-xtrabackup-bin
dev-perl/DBD-mysql"

PATCHES=(
"${FILESDIR}"/${PN}-8.0.26-remove-rpm.patch
)

S="${WORKDIR}/percona-xtrabackup-${MY_PV}"

src_prepare() {
cmake_src_prepare

local bundled_boost_version=$(sed -En '/^SET\(BOOST_PACKAGE_NAME /{s/[^0-9.]//gp}' cmake/boost.cmake)
if [[ ${MY_BOOST_VERSION//./} != ${bundled_boost_version} ]] ; then
eerror "Source Boost version: ${bundled_boost_version}"
eerror "Ebuild Boost version: ${MY_BOOST_VERSION}"
die "Ebuild needs to fix MY_BOOST_VERSION!"
fi

local extra
# rapidjson: last released in 2016 and totally unviable to devendor
# lz4: in storage/innobase/xtrabackup/src/CMakeLists.txt it is used even when =system
for extra in curl icu libcbor libedit libevent libfido2 zlib zstd; do
rm -r "extra/${extra}/" || die "failed to remove bundled libs"
done
}

src_configure() {
# -Werror=odr
# https://bugs.gentoo.org/855245
# https://perconadev.atlassian.net/browse/PXB-3345
filter-lto

CMAKE_BUILD_TYPE="RelWithDebInfo"

local mycmakeargs=(
-DCMAKE_C_FLAGS_RELWITHDEBINFO=-DNDEBUG
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-DNDEBUG
-DBUILD_SHARED_LIBS=OFF
-DCOMPILATION_COMMENT="Gentoo Linux ${PF}"
-DINSTALL_PLUGINDIR=$(get_libdir)/${PN}/plugin
-DWITH_BOOST="${WORKDIR}/boost_$(ver_rs 1- _ ${MY_BOOST_VERSION})"
-DWITH_MAN_PAGES=ON
-DWITH_SYSTEM_LIBS=ON
# not handled via SYSTEM_LIBS
-DWITH_ZLIB=system
)

cmake_src_configure
}

src_install() {
local p="${BUILD_DIR}/storage/innobase/xtrabackup"

dobin "${p}"/xbcloud_osenv
dobin "${BUILD_DIR}"/runtime_output_directory/{xbcloud,xbcrypt,xbstream,xtrabackup}

# cannot use dolib.so because helper would append libdir to target dir
insinto /usr/$(get_libdir)/${PN}/plugin
insopts -m 0755
doins "${BUILD_DIR}"/plugin_output_directory/*

doman "${p}"/doc/source/build/man/*
}

0 comments on commit 68a12cd

Please sign in to comment.