summaryrefslogtreecommitdiff
path: root/sys-fs/btrfs-progs
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-09-02 22:17:17 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-09-02 22:17:17 +0100
commitf247b36fc6df2694a347f5305eeb7f927d7c0ffe (patch)
treec80963b87f0b1c0c5019d9259ccda86498c7edcd /sys-fs/btrfs-progs
parente5206efa6e88d32e3819685adee35c49124ccf0e (diff)
gentoo auto-resync : 02:09:2023 - 22:17:17
Diffstat (limited to 'sys-fs/btrfs-progs')
-rw-r--r--sys-fs/btrfs-progs/Manifest3
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-6.5.ebuild167
-rw-r--r--sys-fs/btrfs-progs/files/btrfs-progs-6.5-avoid-textrel-crc32c-pcl-intel-asm_64.patch44
3 files changed, 214 insertions, 0 deletions
diff --git a/sys-fs/btrfs-progs/Manifest b/sys-fs/btrfs-progs/Manifest
index bcb28d32c3e6..f0bbe2b83d85 100644
--- a/sys-fs/btrfs-progs/Manifest
+++ b/sys-fs/btrfs-progs/Manifest
@@ -1,8 +1,11 @@
+AUX btrfs-progs-6.5-avoid-textrel-crc32c-pcl-intel-asm_64.patch 1482 BLAKE2B 478a48bfb8f416e09ee23e53bf35989eb5381a52aadb39be5724350b7c4ed844417ebe34eecf4509cdeffec67c9daa5a778b2ea1a43d73e16faf067a19d62170 SHA512 a4f8c89685808d87bdd51157a24aa8582524c7e8281f6ae933f892871207fdf4ced8f4902b82cfd330a40fac85d45c869094efbd7e87e0f7acc170753532b3b6
DIST btrfs-progs-v6.3.1.tar.xz 3155540 BLAKE2B 5f8ec51f11d705bb4ada2e000143933484bae2f3a5dedb5c1abac37950de44fa0fa762cc09012ca6702b96591264027b28c17392303db414a5651657cb086c7c SHA512 a567a02f565a44dd06f54b3fd03187d259235eedf8033457368add217c87b2304e8c80ca5e2a35bdffc14e43b6889361183c6dcd5e2f4ad6fe7bfc5eb4127e65
DIST btrfs-progs-v6.3.2.tar.xz 3160148 BLAKE2B e6815eeb90c1dbf9a6c4a5aa72262c18b2031a9305efc9024b1fe7b770a256e1d4cb3b01646a0a523f0e26af2d499382bf42420385c56593ace515a6c225f54d SHA512 d8580250994b3e399babec4478515686f1e3cc2e4fc01ccbc7b00a51b6131452d209cb7f43dbbac5375286546d182fcdf7884bbc1a8ad6889c3f15d85ba8f8d5
DIST btrfs-progs-v6.3.3.tar.xz 3163112 BLAKE2B 76714da94e1cd733df4198b736c31b32d4cfb6779985036610651a267fcf92299c140f99f2372278cafcb02f651413c069314195b7bd44d56ddf60eb60e5532d SHA512 e72791fd91cc9a93aaab72bf8c36f9d7e2608315ccb3b0474ca0c1e1893465b2c7145ce523216accb0d02c4dd0fd13597702ce6a8b9c2ac137cd9bce3c5a4347
+DIST btrfs-progs-v6.5.tar.xz 3178048 BLAKE2B 502d8cebab1d35d8d69eb76212476e323d9f19a9d32eb304acaeb1fc27bfff3ca801fcebc4c19ce7db16ed0114b3c794814157075872c2fd1d8b1d32d740e346 SHA512 7e1578b1f82549f77b55341c20a973da52018b1539da46f92e4a9d9804906ce5e00312c8a02a6047373e4435e661b2e5fc18f5dfbf2d0563cdf62c40de6a4436
EBUILD btrfs-progs-6.3.1.ebuild 3547 BLAKE2B dbc2f3076b4162ca8f14f2226aa775d0e3ded2b5bf35c2e3e1cde8934b03ae6a21aacfcabad01f4178fa7f9df9cccbd8109fe23bfb3920e30d39c20a8307861a SHA512 62e0e184aee370bed2f67bc7c4263bf5f15983978d20862047d0db50fece0aeb69569e4b082e2cb13681454e22c9fbad0cabff4b050219e3d4193c5a1c838898
EBUILD btrfs-progs-6.3.2.ebuild 3548 BLAKE2B bdfb2571f3adecb4705993b2f0fb144ff75e8711e8369adb20d98666c3be6328f1c144adfb32f9ec21eb7e84f6343b468018a099d94516d4725e396ced29872c SHA512 904ba037a89a919293632720d38499a5b4893b488d8ce68ea2cc2c27b73943b70b3d1a05ddc1d425a517839f95fee52bd0b3fbe5067da065d9ded10d9ca106fa
EBUILD btrfs-progs-6.3.3.ebuild 3542 BLAKE2B c605b2c5d9935de5706ff8e8f021a1418ba0e3bfcac0ed65585796d6248aafb1827e56369049c110d3c076053a759485eecf242a3387c7748b2b02e91954d338 SHA512 5f146f5cb46ffc441da004970d4cf8beadabcaf099422f07249f175bcf359752d1c52f352e23e470cc4257e6e34a5478a564f107b3c36cdd3033eee5f51e36f3
+EBUILD btrfs-progs-6.5.ebuild 3630 BLAKE2B 2495a2039c4e23b97971a223c392e5a62f3ce38d3020d6cecc1a0281cf28147ef593984054fcbe84335d69b32c13062e4177fc96ef02cb842460a7575de7979e SHA512 0e9fed4ca5583c64a992b05b68c24e6fe68046a85f5c44cf507833d1cb1d483d0e10e9274f767906822ca680e5edd41d4a0d6e67c478620c6a0d5bd0acb4e042
EBUILD btrfs-progs-9999.ebuild 3548 BLAKE2B bdfb2571f3adecb4705993b2f0fb144ff75e8711e8369adb20d98666c3be6328f1c144adfb32f9ec21eb7e84f6343b468018a099d94516d4725e396ced29872c SHA512 904ba037a89a919293632720d38499a5b4893b488d8ce68ea2cc2c27b73943b70b3d1a05ddc1d425a517839f95fee52bd0b3fbe5067da065d9ded10d9ca106fa
MISC metadata.xml 610 BLAKE2B 70361c4d5434a98f73a3d38ed47d7be830783529db6217396f2235cdedd58744fc6e52e4de1994d28184fe9d8aa5d2982c433d47eda1868cfdb79edf0769a620 SHA512 8958c02574adb1395a9d21d9e9ad5db38570b82a1c7211752eb007eecbd0e541e880a060649641f40be877f167e14f278f14d5ef8775766ef9a6fa5d3843dc53
diff --git a/sys-fs/btrfs-progs/btrfs-progs-6.5.ebuild b/sys-fs/btrfs-progs/btrfs-progs-6.5.ebuild
new file mode 100644
index 000000000000..483d5e5b5feb
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-6.5.ebuild
@@ -0,0 +1,167 @@
+# Copyright 2008-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..11} )
+inherit bash-completion-r1 python-single-r1 udev
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV="v${PV/_/-}"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+
+ if [[ ${PV} != *_rc* ]] ; then
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
+ fi
+
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ EGIT_REPO_URI="https://github.com/kdave/btrfs-progs.git"
+ EGIT_BRANCH="devel"
+ WANT_LIBTOOL="none"
+ inherit autotools git-r3
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.readthedocs.io/en/latest/"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE="+convert python +man reiserfs static static-libs udev +zstd"
+# Could support it with just !systemd => eudev, see mdadm, but let's
+# see if someone asks for it first.
+REQUIRED_USE="static? ( !udev )"
+
+# Tries to mount repaired filesystems
+RESTRICT="test"
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-apps/util-linux:=[static-libs(+)?]
+ sys-libs/zlib:=
+ convert? (
+ sys-fs/e2fsprogs:=
+ reiserfs? (
+ >=sys-fs/reiserfsprogs-3.6.27
+ )
+ )
+ python? ( ${PYTHON_DEPS} )
+ udev? ( virtual/libudev:= )
+ zstd? ( app-arch/zstd:= )
+"
+DEPEND="
+ ${RDEPEND}
+ >=sys-kernel/linux-headers-5.10
+ convert? ( sys-apps/acl )
+ python? (
+ $(python_gen_cond_dep '
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ ')
+ )
+ static? (
+ dev-libs/lzo:2[static-libs(+)]
+ sys-apps/util-linux:0[static-libs(+)]
+ sys-libs/zlib:0[static-libs(+)]
+ convert? (
+ sys-fs/e2fsprogs[static-libs(+)]
+ reiserfs? (
+ >=sys-fs/reiserfsprogs-3.6.27[static-libs(+)]
+ )
+ )
+ zstd? ( app-arch/zstd[static-libs(+)] )
+ )
+"
+BDEPEND="
+ virtual/pkgconfig
+ man? ( dev-python/sphinx )
+"
+
+if [[ ${PV} == 9999 ]]; then
+ BDEPEND+=" sys-devel/gnuconfig"
+fi
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-6.5-avoid-textrel-crc32c-pcl-intel-asm_64.patch
+)
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ if [[ ${PV} == 9999 ]]; then
+ AT_M4DIR="m4" eautoreconf
+
+ mkdir config || die
+ local automakedir="$(autotools_run_tool --at-output automake --print-libdir)"
+ [[ -e ${automakedir} ]] || die "Could not locate automake directory"
+
+ ln -s "${automakedir}"/install-sh config/install-sh || die
+ ln -s "${BROOT}"/usr/share/gnuconfig/config.guess config/config.guess || die
+ ln -s "${BROOT}"/usr/share/gnuconfig/config.sub config/config.sub || die
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}"/sbin
+
+ --enable-lzo
+ --disable-experimental
+ $(use_enable convert)
+ $(use_enable man documentation)
+ $(use_enable elibc_glibc backtrace)
+ $(use_enable python)
+ $(use_enable static-libs static)
+ $(use_enable udev libudev)
+ $(use_enable zstd)
+
+ # Could support libgcrypt, libsodium, libkcapi
+ --with-crypto=builtin
+ --with-convert=ext2$(usex reiserfs ',reiserfs' '')
+ )
+
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ emake V=1 all $(usev static)
+}
+
+src_test() {
+ emake -j1 -C tests V=1 test
+
+ if use python ; then
+ cd libbtrfsutil/python || die
+
+ local -x LD_LIBRARY_PATH="${S}:libbtrfsutil/python:${LD_LIBRARY_PATH}"
+ ${EPYTHON} -m unittest tests/test_*.py || die "Tests failed with ${EPYTHON}"
+ fi
+}
+
+src_install() {
+ local makeargs=(
+ $(usev python install_python)
+ $(usev static install-static)
+ )
+
+ emake V=1 DESTDIR="${D}" install "${makeargs[@]}"
+
+ newbashcomp btrfs-completion btrfs
+
+ use python && python_optimize
+}
+
+pkg_postinst() {
+ udev_reload
+}
+
+pkg_postrm() {
+ udev_reload
+}
diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-6.5-avoid-textrel-crc32c-pcl-intel-asm_64.patch b/sys-fs/btrfs-progs/files/btrfs-progs-6.5-avoid-textrel-crc32c-pcl-intel-asm_64.patch
new file mode 100644
index 000000000000..40a9bbeff8f6
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-6.5-avoid-textrel-crc32c-pcl-intel-asm_64.patch
@@ -0,0 +1,44 @@
+See https://github.com/kdave/btrfs-progs/commit/992be8b50a65974e52a484911e72bc5a5e1b412c.
+
+With binutils-2.41[hardened], one gets:
+```
+/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: crypto/crc32c-pcl-intel-asm_64.o: warning: relocation in read-only section `.rodata'
+/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: read-only segment has dynamic relocations
+collect2: error: ld returned 1 exit status
+make: *** [Makefile:660: btrfs-map-logical] Error 1
+```
+
+But it's a textrel and a warning anyway even without hardened.
+
+Disable it for now until it gets fixed properly upstream.
+--- a/Makefile
++++ b/Makefile
+@@ -387,7 +387,7 @@ endif
+
+ ifeq ($(TARGET_CPU),x86_64)
+ # FIXME: linkage is broken on musl for some reason
+-ifeq ($(HAVE_GLIBC),1)
++ifeq (0,1)
+ CRYPTO_OBJECTS += crypto/crc32c-pcl-intel-asm_64.o
+ ASFLAGS += -fPIC
+ endif
+--- a/crypto/crc32c.c
++++ b/crypto/crc32c.c
+@@ -18,7 +18,7 @@ static uint32_t (*crc_function)(uint32_t crc, unsigned char const *data, uint32_
+
+ #ifdef __x86_64__
+
+-#ifdef __GLIBC__
++#if 0
+
+ /* asmlinkage */ unsigned int crc_pcl(const unsigned char *buffer, int len, unsigned int crc_init);
+ static unsigned int crc32c_pcl(uint32_t crc, unsigned char const *data, uint32_t len) {
+@@ -95,7 +95,7 @@ void crc32c_init_accel(void)
+ * now.
+ */
+ if (0) {
+-#ifdef __GLIBC__
++#if 0
+ } else if (cpu_has_feature(CPU_FLAG_SSE42)) {
+ /* printf("CRC32C: pcl\n"); */
+ crc_function = crc32c_pcl;