diff options
Diffstat (limited to 'sys-fs')
-rw-r--r-- | sys-fs/btrfs-progs/Manifest | 1 | ||||
-rw-r--r-- | sys-fs/btrfs-progs/btrfs-progs-4.14.ebuild | 107 | ||||
-rw-r--r-- | sys-fs/btrfs-progs/files/musl-compat.patch | 24 | ||||
-rw-r--r-- | sys-fs/btrfs-progs/metadata.xml | 22 |
4 files changed, 154 insertions, 0 deletions
diff --git a/sys-fs/btrfs-progs/Manifest b/sys-fs/btrfs-progs/Manifest new file mode 100644 index 00000000..14fed4ed --- /dev/null +++ b/sys-fs/btrfs-progs/Manifest @@ -0,0 +1 @@ +DIST btrfs-progs-v4.14.tar.xz 1697584 SHA256 09095cbc3bc2b6aa9d09c93146fb4d7437c51d2572f6918b74fe990fcdcb91af SHA512 11171e6730f4aa102bdb4cd405da2d4c55e2c102fec4cc6d3135df516c78af1c34fede722a1677bd9c638b47e77085e005b29333ae70b98771501e32628890f7 WHIRLPOOL 70584ed3dd537bea34d07fdb5597365326d826799c9ee70d6b64faec536e2eedee3feb32a0bcc487e962d90a8f075443d3adfaecd5410fc7780b7af296a53f5c diff --git a/sys-fs/btrfs-progs/btrfs-progs-4.14.ebuild b/sys-fs/btrfs-progs/btrfs-progs-4.14.ebuild new file mode 100644 index 00000000..79b512d2 --- /dev/null +++ b/sys-fs/btrfs-progs/btrfs-progs-4.14.ebuild @@ -0,0 +1,107 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit bash-completion-r1 + +libbtrfs_soname=0 + +if [[ ${PV} != 9999 ]]; then + MY_PV=v${PV} + KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" + SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz" + S="${WORKDIR}"/${PN}-${MY_PV} +else + WANT_LIBTOOL=none + inherit autotools git-r3 + EGIT_REPO_URI="https://github.com/kdave/btrfs-progs.git" + EGIT_BRANCH="devel" +fi + +DESCRIPTION="Btrfs filesystem utilities" +HOMEPAGE="https://btrfs.wiki.kernel.org" + +LICENSE="GPL-2" +SLOT="0/${libbtrfs_soname}" +IUSE="+convert reiserfs static static-libs +zstd" + +RESTRICT=test # tries to mount repared filesystems + +RDEPEND=" + dev-libs/lzo:2= + sys-apps/util-linux:0=[static-libs(+)?] + sys-libs/zlib:0= + convert? ( + sys-fs/e2fsprogs:0= + sys-libs/e2fsprogs-libs:0= + reiserfs? ( + >=sys-fs/reiserfsprogs-3.6.27 + ) + ) + zstd? ( app-arch/zstd:0= ) +" +DEPEND="${RDEPEND} + convert? ( sys-apps/acl ) + >=app-text/asciidoc-8.6.0 + app-text/docbook-xml-dtd:4.5 + app-text/xmlto + static? ( + dev-libs/lzo:2[static-libs(+)] + sys-apps/util-linux:0[static-libs(+)] + sys-libs/zlib:0[static-libs(+)] + convert? ( + sys-fs/e2fsprogs:0[static-libs(+)] + sys-libs/e2fsprogs-libs:0[static-libs(+)] + reiserfs? ( + >=sys-fs/reiserfsprogs-3.6.27[static-libs(+)] + ) + ) + zstd? ( app-arch/zstd:0[static-libs(+)] ) + ) +" + +PATCHES=( + "${FILESDIR}/musl-compat.patch" +) + +if [[ ${PV} == 9999 ]]; then + DEPEND+=" sys-devel/gnuconfig" +fi + +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 "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die + ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die + fi +} + +src_configure() { + local myeconfargs=( + --bindir="${EPREFIX}"/sbin + $(use_enable convert) + $(use_enable elibc_glibc backtrace) + $(use_enable zstd) + --with-convert=ext2$(usex reiserfs ',reiserfs' '') + ) + econf "${myeconfargs[@]}" +} + +src_compile() { + emake V=1 all $(usev static) +} + +src_install() { + local makeargs=( + $(usex static-libs '' 'libs_static=') + $(usex static install-static '') + ) + emake V=1 DESTDIR="${D}" install "${makeargs[@]}" + newbashcomp btrfs-completion btrfs +} diff --git a/sys-fs/btrfs-progs/files/musl-compat.patch b/sys-fs/btrfs-progs/files/musl-compat.patch new file mode 100644 index 00000000..424c59d9 --- /dev/null +++ b/sys-fs/btrfs-progs/files/musl-compat.patch @@ -0,0 +1,24 @@ +diff -upr btrfs-progs-v4.3.1.orig/utils.c btrfs-progs-v4.3.1/utils.c +--- btrfs-progs-v4.3.1.orig/utils.c 2015-11-20 01:15:32.227019383 +0100 ++++ btrfs-progs-v4.3.1/utils.c 2015-11-20 01:16:59.419971215 +0100 +@@ -1208,13 +1208,19 @@ static int resolve_loop_device(const cha + { + int ret; + FILE *f; ++ struct stat stat_buf; + char fmt[20]; + char p[PATH_MAX]; + char real_loop_dev[PATH_MAX]; + + if (!realpath(loop_dev, real_loop_dev)) + return -errno; +- snprintf(p, PATH_MAX, "/sys/block/%s/loop/backing_file", strrchr(real_loop_dev, '/')); ++ ++ if (stat(real_loop_dev, &stat_buf) || !S_ISBLK(stat_buf.st_mode)) ++ return -errno; ++ ++ snprintf(p, PATH_MAX, "/sys/dev/block/%d:%d/loop/backing_file", ++ major(stat_buf.st_rdev), minor(stat_buf.st_rdev)); + if (!(f = fopen(p, "r"))) { + if (errno == ENOENT) + /* diff --git a/sys-fs/btrfs-progs/metadata.xml b/sys-fs/btrfs-progs/metadata.xml new file mode 100644 index 00000000..d131bb2e --- /dev/null +++ b/sys-fs/btrfs-progs/metadata.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>floppym@gentoo.org</email> + <name>Mike Gilbert</name> + </maintainer> + <maintainer type="person"> + <email>slyfox@gentoo.org</email> + <name>Sergei Trofimovich</name> + </maintainer> + <maintainer type="person"> + <email>polynomial-c@gentoo.org</email> + <name>Lars Wendler</name> + </maintainer> + <use> + <flag name="convert">Build ext2 conversion utility (btrfs-convert)</flag> + <flag name="reiserfs">Enable reiserfs support in btrfs-convert tool.</flag> + <flag name="static">Build static binaries in addition to the dynamic ones</flag> + <flag name="zstd">Enable zstd compression support.</flag> + </use> +</pkgmetadata> |