commit:     c7c56b215991373b1402bb6a6f137aac81591e21
Author:     Travis Tilley <ttilley <AT> gmail <DOT> com>
AuthorDate: Sat Mar 21 15:46:26 2015 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Wed May 13 17:47:10 2015 +0000
URL:        https://gitweb.gentoo.org/proj/hardened-dev.git/commit/?id=c7c56b21

sys-block/parted: fix includes to allow compiling against musl

 sys-block/parted/files/parted-3.2-devmapper.patch  | 60 ++++++++++++++++++++++
 .../parted/files/parted-3.2-fix-includes.patch     | 10 ++++
 .../parted/files/parted-3.2-po4a-mandir.patch      | 11 ++++
 sys-block/parted/parted-3.2.ebuild                 | 57 ++++++++++++++++++++
 4 files changed, 138 insertions(+)

diff --git a/sys-block/parted/files/parted-3.2-devmapper.patch 
b/sys-block/parted/files/parted-3.2-devmapper.patch
new file mode 100644
index 0000000..0cd3e0e
--- /dev/null
+++ b/sys-block/parted/files/parted-3.2-devmapper.patch
@@ -0,0 +1,60 @@
+--- a/libparted/arch/linux.c
++++ b/libparted/arch/linux.c
+@@ -2304,6 +2304,7 @@
+   return r < 0 ? NULL : resultp;
+ }
+ 
++#ifdef ENABLE_DEVICE_MAPPER
+ static char *
+ dm_canonical_path (PedDevice const *dev)
+ {
+@@ -2326,12 +2327,22 @@
+ err:
+         return NULL;
+ }
++#endif /* ENABLE_DEVICE_MAPPER */
+ 
+ static char*
+ _device_get_part_path (PedDevice const *dev, int num)
+ {
+-        char *devpath = (dev->type == PED_DEVICE_DM
+-                         ? dm_canonical_path (dev) : dev->path);
++        char *devpath =
++#ifdef ENABLE_DEVICE_MAPPER
++                        (
++                         dev->type == PED_DEVICE_DM
++                         ? dm_canonical_path (dev) :
++#endif /* ENABLE_DEVICE_MAPPER */
++                                               dev->path
++#ifdef ENABLE_DEVICE_MAPPER
++                        )
++#endif /* ENABLE_DEVICE_MAPPER */
++                        ;
+         size_t path_len = strlen (devpath);
+         char *result;
+         /* Check for devfs-style /disc => /partN transformation
+@@ -2945,12 +2956,14 @@
+                                                unsigned long long *length);
+ 
+ 
++#ifdef ENABLE_DEVICE_MAPPER
+         if (disk->dev->type == PED_DEVICE_DM) {
+                 add_partition = _dm_add_partition;
+                 remove_partition = _dm_remove_partition;
+                 resize_partition = _dm_resize_partition;
+                 get_partition_start_and_length = 
_dm_get_partition_start_and_length;
+         } else {
++#endif /* ENABLE_DEVICE_MAPPER */
+                 add_partition = _blkpg_add_partition;
+                 remove_partition = _blkpg_remove_partition;
+ #ifdef BLKPG_RESIZE_PARTITION
+@@ -2959,7 +2972,9 @@
+                 resize_partition = NULL;
+ #endif
+                 get_partition_start_and_length = 
_kernel_get_partition_start_and_length;
++#ifdef ENABLE_DEVICE_MAPPER
+         }
++#endif /* ENABLE_DEVICE_MAPPER */
+ 
+         /* lpn = largest partition number.
+          * for remove pass, use greater of device or label limit */

diff --git a/sys-block/parted/files/parted-3.2-fix-includes.patch 
b/sys-block/parted/files/parted-3.2-fix-includes.patch
new file mode 100644
index 0000000..c6eff0e
--- /dev/null
+++ b/sys-block/parted/files/parted-3.2-fix-includes.patch
@@ -0,0 +1,10 @@
+--- parted-3.1.orig/libparted/fs/xfs/platform_defs.h
++++ parted-3.1/libparted/fs/xfs/platform_defs.h
+@@ -35,6 +35,7 @@
+ #define __XFS_PLATFORM_DEFS_H__
+ 
+ #include <stdio.h>
++#include <fcntl.h>
+ #include <stdarg.h>
+ #include <assert.h>
+ #include <endian.h>

diff --git a/sys-block/parted/files/parted-3.2-po4a-mandir.patch 
b/sys-block/parted/files/parted-3.2-po4a-mandir.patch
new file mode 100644
index 0000000..be0a9c6
--- /dev/null
+++ b/sys-block/parted/files/parted-3.2-po4a-mandir.patch
@@ -0,0 +1,11 @@
+--- a/doc/po4a.mk
++++ b/doc/po4a.mk
+@@ -23,7 +23,7 @@
+ # threshold is 80%), it won't be distributed, and the build won't fail.
+ #
+ 
+-mandir = $(mandir)/$(lang)
++mandir := $(mandir)/$(lang)
+ 
+ # Inform automake that we want to install some man pages in section 1, 5
+ # and 8.

diff --git a/sys-block/parted/parted-3.2.ebuild 
b/sys-block/parted/parted-3.2.ebuild
new file mode 100644
index 0000000..2cb5c19
--- /dev/null
+++ b/sys-block/parted/parted-3.2.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-block/parted/parted-3.2.ebuild,v 1.14 
2015/03/03 09:57:56 dlan Exp $
+
+EAPI=5
+inherit autotools eutils
+
+DESCRIPTION="Create, destroy, resize, check, copy partitions and file systems"
+HOMEPAGE="http://www.gnu.org/software/parted";
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86"
+IUSE="+debug device-mapper nls readline selinux static-libs"
+RESTRICT="test"
+
+# specific version for gettext needed
+# to fix bug 85999
+RDEPEND="
+       >=sys-fs/e2fsprogs-1.27
+       >=sys-libs/ncurses-5.7-r7
+       device-mapper? ( >=sys-fs/lvm2-2.02.45 )
+       readline? ( >=sys-libs/readline-5.2 )
+       selinux? ( sys-libs/libselinux )
+"
+DEPEND="
+       ${RDEPEND}
+       nls? ( >=sys-devel/gettext-0.12.1-r2 )
+       virtual/pkgconfig
+"
+
+src_prepare() {
+       epatch "${FILESDIR}"/${PN}-3.2-devmapper.patch
+       epatch "${FILESDIR}"/${PN}-3.2-po4a-mandir.patch
+       epatch "${FILESDIR}"/${PN}-3.2-fix-includes.patch
+       eautoreconf
+}
+
+src_configure() {
+       econf \
+               $(use_enable debug) \
+               $(use_enable device-mapper) \
+               $(use_enable nls) \
+               $(use_enable selinux) \
+               $(use_enable static-libs static) \
+               $(use_with readline) \
+               --disable-rpath \
+               --disable-silent-rules
+}
+
+DOCS=( AUTHORS BUGS ChangeLog NEWS README THANKS TODO doc/{API,FAT,USER.jp} )
+
+src_install() {
+       default
+       prune_libtool_files
+}

Reply via email to