app-emulation/containers-storage: add btrfs dep (bug 664574)
authorZac Medico <zmedico@gentoo.org>
Sat, 25 Aug 2018 23:42:07 +0000 (16:42 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 26 Aug 2018 00:06:42 +0000 (17:06 -0700)
Add btrfs USE flag, and also a device-mapper USE flag.
Use GOCACHE=off to hopefully avoid the reported /root/cache
sandbox violation.

Reported-by: Toralf Förster <toralf@gentoo.org>
Closes: https://bugs.gentoo.org/664574
Package-Manager: Portage-2.3.48, Repoman-2.3.10

app-emulation/containers-storage/containers-storage-0_pre20180730.ebuild
app-emulation/containers-storage/metadata.xml

index ab4de85d15b662221b89c5aac599e1e0bae53be3..cd2ef64ffa54729a4298302b0cd23b03fc534ba7 100644 (file)
@@ -14,19 +14,25 @@ DESCRIPTION="containers/storage library"
 HOMEPAGE="https://github.com/containers/storage"
 LICENSE="Apache-2.0"
 SLOT="0"
-IUSE="ostree test"
+IUSE="btrfs +device-mapper ostree test"
 EGO_PN="${HOMEPAGE#*//}"
 EGIT_COMMIT="17c7d1fee5603ccf6dd97edc14162fc1510e7e23"
 SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz
        ${EGO_VENDOR_URI}"
-RDEPEND="sys-fs/lvm2:=
+RDEPEND="
+       btrfs? ( sys-fs/btrfs-progs )
+       device-mapper? ( sys-fs/lvm2:= )
        ostree? (
                dev-libs/glib:=
                dev-util/ostree:=
        )"
 DEPEND="${RDEPEND}
        dev-go/go-md2man
-       test? ( sys-apps/util-linux )"
+       test? (
+               sys-fs/btrfs-progs
+               sys-fs/lvm2
+               sys-apps/util-linux
+       )"
 RESTRICT="test? ( userpriv ) !test? ( test )"
 
 src_unpack() {
@@ -36,6 +42,14 @@ src_unpack() {
 src_prepare() {
        default
 
+       [[ -f ${S}/src/${EGO_PN}/hack/btrfs_tag.sh ]] || die
+       use btrfs || { echo -e "#!/bin/sh\necho btrfs_noversion exclude_graphdriver_btrfs" > \
+               "${S}/src/${EGO_PN}/hack/btrfs_tag.sh" || die; }
+
+       [[ -f ${S}/src/${EGO_PN}/hack/libdm_tag.sh ]] || die
+       use device-mapper || { echo -e "#!/bin/sh\necho btrfs_noversion exclude_graphdriver_devicemapper" > \
+               "${S}/src/${EGO_PN}/hack/libdm_tag.sh" || die; }
+
        [[ -f ${S}/src/${EGO_PN}/hack/ostree_tag.sh ]] || die
        use ostree || { echo -e "#!/bin/sh\ntrue" > \
                "${S}/src/${EGO_PN}/hack/ostree_tag.sh" || die; }
@@ -65,8 +79,6 @@ src_prepare() {
                -e 's:TestCopyCaseH(:_\0:' \
                -e 's:TestCopyCaseHFSym(:_\0:' \
                -e 's:TestCopyCaseJ(:_\0:' \
-               -e 's:TestCopyCaseEFSym(:_\0:' \
-               -e 's:TestCopyCaseG(:_\0:' \
                -e 's:TestCopyCaseJFSym(:_\0:' \
                -i "${S}/src/${EGO_PN}/pkg/archive/copy_unix_test.go" || die
        sed -e 's:TestMount(:_\0:' \
@@ -78,9 +90,9 @@ src_compile() {
        ln -s "${S}/src/${EGO_PN}/vendor/github.com/pquerna/ffjson" "${WORKDIR}/${P}/src/github.com/pquerna/ffjson" || die
        mkdir -p "${S}/bin" || die
        cd "${S}/bin" || die
-       GOPATH="${S}" GOBIN="${S}/bin" \
+       GOPATH="${S}" GOBIN="${S}/bin" GOCACHE=off \
                go build -v -work -x ${EGO_BUILD_FLAGS} "${S}/src/github.com/pquerna/ffjson/ffjson.go" || die
-       GOPATH="${S}" GOBIN="${S}/bin" PATH="${S}/bin:${PATH}" \
+       GOPATH="${S}" GOBIN="${S}/bin" PATH="${S}/bin:${PATH}" GOCACHE=off \
                emake -C "${S}/src/${EGO_PN}" containers-storage docs
 }
 
@@ -93,5 +105,5 @@ src_install() {
 }
 
 src_test() {
-       GOPATH="${S}" unshare -m emake -C "${S}/src/${EGO_PN}" local-test-unit
+       GOPATH="${S}" GOCACHE=off unshare -m emake -C "${S}/src/${EGO_PN}" local-test-unit
 }
index 5bf567e579a9c873de33a818e3567f281134be9d..17371971e525144a29d18683d4556ff579fb3544 100644 (file)
@@ -6,6 +6,14 @@
                <name>Zac Medico</name>
        </maintainer>
        <use>
+               <flag name="btrfs">
+                       Enables dependencies for the "btrfs" graph driver, including
+                       necessary kernel flags.
+               </flag>
+               <flag name="device-mapper">
+                       Enables dependencies for the "devicemapper" graph driver, including
+                       necessary kernel flags.
+               </flag>
                <flag name="ostree">
                        Enables dependencies for handling of OSTree images.
                </flag>