summaryrefslogtreecommitdiff
path: root/sys-fs/xfsprogs
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-fs/xfsprogs
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-fs/xfsprogs')
-rw-r--r--sys-fs/xfsprogs/Manifest20
-rw-r--r--sys-fs/xfsprogs/files/xfsprogs-4.12.0-fix_musl.patch117
-rw-r--r--sys-fs/xfsprogs/files/xfsprogs-4.12.0-sharedlibs.patch81
-rw-r--r--sys-fs/xfsprogs/files/xfsprogs-4.3.0-cross-compile.patch181
-rw-r--r--sys-fs/xfsprogs/files/xfsprogs-4.3.0-sharedlibs.patch80
-rw-r--r--sys-fs/xfsprogs/files/xfsprogs-4.5.0-linguas.patch32
-rw-r--r--sys-fs/xfsprogs/files/xfsprogs-4.7.0-libxcmd-link.patch30
-rw-r--r--sys-fs/xfsprogs/files/xfsprogs-4.7.0-sharedlibs.patch81
-rw-r--r--sys-fs/xfsprogs/files/xfsprogs-4.9.0-cross-compile.patch143
-rw-r--r--sys-fs/xfsprogs/files/xfsprogs-4.9.0-underlinking.patch30
-rw-r--r--sys-fs/xfsprogs/metadata.xml8
-rw-r--r--sys-fs/xfsprogs/xfsprogs-4.12.0.ebuild95
-rw-r--r--sys-fs/xfsprogs/xfsprogs-4.13.1.ebuild94
-rw-r--r--sys-fs/xfsprogs/xfsprogs-4.5.0.ebuild102
-rw-r--r--sys-fs/xfsprogs/xfsprogs-4.9.0.ebuild95
15 files changed, 1189 insertions, 0 deletions
diff --git a/sys-fs/xfsprogs/Manifest b/sys-fs/xfsprogs/Manifest
new file mode 100644
index 000000000000..624208f76765
--- /dev/null
+++ b/sys-fs/xfsprogs/Manifest
@@ -0,0 +1,20 @@
+AUX xfsprogs-4.12.0-fix_musl.patch 3133 SHA256 5dcd271717eebe2d301f2df4c439a359f26c3bad23a7d99c0d01bcec693b057b SHA512 882de116f5cfe71fb5d3ac81db50eca6a1b666ea40041ab1e922507bc17906055ac02335bce94c64dcb3ad8938a48064f5b364e8867a72ac19077cc92a93a249 WHIRLPOOL 9a40274f0971ee29bd5999eb4ffaea0d7a74c33a430e125152f0e7c569c002303187ad69630161a58b48c40bee2b4b6c382ea4379ae200bd23af0d09d71d43e3
+AUX xfsprogs-4.12.0-sharedlibs.patch 2361 SHA256 4f10b622e8b7c8654a5dc79356343515ef203742ba4781b97a6f02f23e99555a SHA512 bbf802c54d2c8a2a524a9d4ae0ca66a18bf6b099a00fcc248abee04f84371bd35fc07a2dcc0c1d99c297b474c1f98d92927aa5ca16df5e6caef3abe386f31eba WHIRLPOOL 72e00337e46700ee2a16597bb8188fff229c019c46a39f60598a6d802b8ba094c6e5da8377aad60fee6afd9f491c577d2c84ace3f78a00438268ccbc1832368a
+AUX xfsprogs-4.3.0-cross-compile.patch 5112 SHA256 5654447555115bce22e443623f6fc17b767681741f043a9dc5e6887967a27db9 SHA512 2d6303b7c89b3e1ca2ba1d95a4477d0d1c2360ed68bf9c9d3630f990081be98ace9b9c164729635fa582cc5c8bd418e1824e35f613512d43cc6116fcda379582 WHIRLPOOL 1fee9f56739d13c1b04b2d0d190b193c97a846902fce8ccba0210cbce6a61bcd2cab118a2c59fb66cd89a957e32e714c3f1dc534697819165a505a8eb8f225b6
+AUX xfsprogs-4.3.0-sharedlibs.patch 2310 SHA256 23bf3127cd1eab6e96055d2a5f3ae61f417a8d4ae52d5c421be2bbb05576bb46 SHA512 6d7ad2bc8b74390f81ecfa3774c837d083dc7e3332bd2e5450c4d67805d54f9727afeace39755e5d1185a230abcc9644bf2eb1544708d81b4f93a419aad8fdf4 WHIRLPOOL 5adb3dbffcd788e27e228d9d04a5991a20fd4ae9b8c7e32996b33fe71451ce2a468299f5abb40ff416b8abff399a7c0f7b4d3102b10f4e6bd830b3d0b57768c8
+AUX xfsprogs-4.5.0-linguas.patch 967 SHA256 79c3b0b1faacd8ec52d060f05dcf0e72b83d5892e96ab01c4e6821394e2344de SHA512 6d812dce622a3d38fe2b23e47c8f188012522dee3eaa6f002080f2b2ba8e50dc31ed8fc56d9e10b13d4f0dc54d6377b77d8a3823494176e843480e5226e79679 WHIRLPOOL 2a3de6cf5ed3463bc8299600c6c1a00dfe995d089034ae15a0a07c46e7f24507a3a98cb28641bb29a4e5193338deca1c18fa11c0bc9084b97786938ec2c19778
+AUX xfsprogs-4.7.0-libxcmd-link.patch 880 SHA256 06cced4aeeb9a2d8c90e6d6fd1ff6571020122dbfe62140513f52bd82bf9abe8 SHA512 4484570c4bb387b6dfde5f31d8527f2222d33e120c365e3cbc6f488403b9e9d969d3f2a883ffcb145a11d57ace70c76fb1ba4a8ed75533f2089a197d463c8dd9 WHIRLPOOL c975535bbf431b86ee82806ce6dbfc0196d7c175d13b00aeccd747820a817169aa1d4958b62f97fb4c36a24f964692ef3ea1d3e0ff11c5cfbd04ba60ce2317df
+AUX xfsprogs-4.7.0-sharedlibs.patch 2355 SHA256 983b08b2a4a4ee91be21f14063167a3752554b41fd78aead6dfd6ac38702a5a7 SHA512 f0006ec0a987e44a1e60d642f9938d35c14ccb765c6a040c80e483a0e073e54608571b53793b7d4c2b9eb1f5c4e2f077fb713dfab9abaa99022d24d8a17443fe WHIRLPOOL 939841084292f598c32aa3be784d6235b6803abd86062790191b7959be73d9f8afc31cbb0d330abaee253c141dcbe0d4a4e20ae76ba64146d41acfbf7f3e0fa4
+AUX xfsprogs-4.9.0-cross-compile.patch 3663 SHA256 0ed4d1d7cb43de579fe343c6b6e63d181f66c797e549ef1ceeabd6886a080b97 SHA512 150ebcc26b21eb3e52575dd6b4bf2f451abb4906071b66e79df3697a56345e178f6b9bb11a7bd19283adb47a6b5e9c1dd807775ac2c814f0e2db795788fd1159 WHIRLPOOL 191462575cfb9a0e7fc6d996d0e2819e92f0b63f552f503070485af8de6ccc410b468113c1f9cba0f18b476545a192aea326300423f14b0df9649973b482af5e
+AUX xfsprogs-4.9.0-underlinking.patch 731 SHA256 644713208fcce550cbe66de8aa3fc366449a838baaba2db030bfc6111f4de7b5 SHA512 2fcbaab48ca33cd2e8724cdc55d814a970beb5127c861f4b829ede9f501516733c6dabbfe0bfb1d23df01bb69538af5ca31eb403030e3d2ad9efd8643c509ac7 WHIRLPOOL 00a06a89374682e09379e98176990436cd716f4d2cab3f1801097dfd228a92562fc521ff0a6441dc080e26a2087034e8572cd72b836ed575c75ba972079c9c29
+DIST xfsprogs-4.12.0.tar.xz 1128400 SHA256 b330ad8d737f4152ae511580102e2fc49212bb51dfb4b614084344abae46d0df SHA512 1dc4a0a5f40baf1d6398c8f07b4cb3ab796cf052c34b811d60b08c60a4700c2ced8d4d1adb878f8b85ba58cf3e1276db1477109de538fd427d3e359a52f59d4a WHIRLPOOL c18d3c9dfab8ccb877eb6fa9fa05be3c614a587c6cb616a9f18b52debb8ecacbd22056cb397ff9e69407c66e105d034458b41f0ba4275352f31398e64d303c02
+DIST xfsprogs-4.13.1.tar.xz 1133556 SHA256 8c64d349d191e24c84eeb1611be767e4a11b81016bd5b73f3a20a0bf39dd3536 SHA512 6c234a6c22aa3cabe0ea698c11175dca6c19d803989127ccb13b526ff6d34dcef9dd6e19ff0c4fb3903078f24210a8cfcd0508dac29d52fbee4dfed37d5888f3 WHIRLPOOL 89a84ce7b59fa52cd245493a28c6ad7f6e114dfe8044b2dad57b2cc626308ad1187ef812ace618085a083745acd3c37538903a6e2f935d9cd351c923559d9732
+DIST xfsprogs-4.5.0.tar.gz 1524382 SHA256 e49beb314984efbd0d758abb5c6137db3bb60a88e59e1e94c00defb536cf89f8 SHA512 19c95551dc91ec46916f9a7e3d7976907664d32dd5fdc26af0ca62ca74c4b3c10f9e843aac8214ea9d1c0bf140c9f4e321d059808af01a623abedd5067011314 WHIRLPOOL 54d742635df024a63181da76c3220671610068363af85be2677521f20342595a5cebb2fd169945572351901ee2c9384f79f54a381ab3620dde22d863aa66d469
+DIST xfsprogs-4.9.0.tar.xz 1087940 SHA256 f1e60a9a54583dba82fa506dd9b59bdec110a968f80f507bf5f93b263af7a4df SHA512 990946f0a34381f57afb39bcda0ff539e18af4de2ecc19c833ffd4fb7c22c25b501091c1f0953db103a62204d952c9eecba21f22f3c5910286456da65fb09fa7 WHIRLPOOL a9b582a42967ce1e314cd0ac3518792c2e10f7bb1370151a68a09a8e21e40cc6818b9778dfdd248961c3a1a08a70424f0150219488a18bc5d60e5669702c472f
+EBUILD xfsprogs-4.12.0.ebuild 2733 SHA256 7c701daa83b8f2f9f7dd476969d5db08246d0cc160783ac52de79a88e78e80f5 SHA512 b163f664b954fd6ace1e3ce1ad352deab0a10050c8b0b96dba8446cd4d9cbddb31c6c043ce7bffe86975606682e6e268f0efedda544c107284c92e7b4014d63d WHIRLPOOL 9facf37ae886e70d1adcc9492fe693db353b3e4db0c308507c8746b840826bda6418803dca1aa5fedc5b860993b69a1746822d7c6369f26e21e007cbc2a3cb61
+EBUILD xfsprogs-4.13.1.ebuild 2670 SHA256 43ac0c677dd12f316b14d973232c1efe0d4f2d860c9cdd5879c9513d4521ac11 SHA512 ab45b35a6805c8b55437ae5606f99dcae5edae90c2957c15653095d5efe16a13350d99b9117e13e55df9ea95b94119adb6d24b35e6f12635f2a17189f402f35c WHIRLPOOL 9b8f29d42301f0e4e4d5603fa1ca7e9abfd3037db2efb975d671ff72a6b4801a8ea714d46a568371cbbcf6cbc544ea30122e9a321d8f730ce42fb948975d36da
+EBUILD xfsprogs-4.5.0.ebuild 2876 SHA256 bb4164dfffe41f3285d538cc4987904c1484070fec87e13225c551a0b20a30cb SHA512 2b40573bc0cb60c3b2d6e77c1b1b064856cee0e394b371622da66e12c11792b1b48e6ab8615679b18afef3f17a7264680c9787d1fbb243c012ea837c3463a946 WHIRLPOOL e2e719965f35ca69f7df416362097217d59c581d11ae1444ebd650592226f71b9a1ddc9f391b2d88c2f8add073d81ccf4434b1cfc3282db2c6c72afcd1ab8f9d
+EBUILD xfsprogs-4.9.0.ebuild 2718 SHA256 669932798f56cda66c32b6895ce4de352a1267658b356c118d42688e5dc917f1 SHA512 bfdc9019fbc598723a821989d786a9b16babd6fddb79f981513ecdd811ef1200528c4de98eb146eba3cbc394cdad2ab1bea5239d9de1089014bd2d8acc602381 WHIRLPOOL a4a062bd690fe233e207433150222d2940c7c9b7442b301c6adf3d9f3404fbe942b237cab520c8d4c7d82ad006eeab683c856ae7596df2f69003dc2a3f9868d5
+MISC ChangeLog 7808 SHA256 2394e793a2c85a4c800ab3548fed0aec55247485f31c61385994365b0be76a26 SHA512 043b5ff15b946707fbbe84471d5daada8630ac7338afacd5f0eab75618c8fb3a052f8c8696caefaad45f6597880c701ec961048cc1f6a1afa9e6f9a0c90f0809 WHIRLPOOL 6d80d2202148bdc8288acc75c7e0d60c94ce1a7e635083790c0f442c1e208c0386dfbdd81b5064c7b93b28e8afde47b6f985cf4694141f03e8d488a04d651969
+MISC ChangeLog-2015 28799 SHA256 dd1a390d3e1f144f1a84f7261aa84fd4bf9840e63c486e50e438777f8c4cc21f SHA512 8c0afd13653f5aad5a76d431a0940d7c84d6ec6a5783c8ed9905a67dec474264981a9b66aa500ad66886e2a09cdbfcc13b6ae86c92d49e349e06716ba5a401c6 WHIRLPOOL c765b8c79e1e006978c2ee663c024a31063f395cccceb063f01e5bec98e74bb1352dc2f213970e3fadcbb63db03b6c6c2856580c7b5fc422c0f4441655ef48c0
+MISC metadata.xml 257 SHA256 c1d4bdabe699c6d9fcdf3b7794a13b45f69e3826b814b422e4ca7e6893b99012 SHA512 9c7759d33e1bbc8be0da5b4f59fc720266e40f4116d7db0c17c5ad800a7bb638f33a1308e1554092af781f06df6f6cb55db41fc22207cd3edc2e159840e3a3b1 WHIRLPOOL 4afcbc79dd61237c778735b39060b3e294fdc07da5b0da6f7b40db92649ac71febddd7a0265502e102d8eec9664fd5af2071fff9428bfcb0a6bf06cf70c68a3d
diff --git a/sys-fs/xfsprogs/files/xfsprogs-4.12.0-fix_musl.patch b/sys-fs/xfsprogs/files/xfsprogs-4.12.0-fix_musl.patch
new file mode 100644
index 000000000000..efc57e4f693d
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-4.12.0-fix_musl.patch
@@ -0,0 +1,117 @@
+From 21253610f9ef87db8e2a75b863b7fcfbd0cdb421 Mon Sep 17 00:00:00 2001
+From: "Darrick J. Wong" <darrick.wong@oracle.com>
+Date: Tue, 25 Jul 2017 13:45:01 -0500
+Subject: [PATCH] In patch 4944defad4 ("xfs_db: redirect printfs when
+ metadumping to stdout"), we solved the problem of xfs_db printfs ending up in
+ the metadump stream by reassigning stdout for the duration of a stdout
+ metadump. Unfortunately, musl doesn't allow stdout to be reassigned (in
+ their view "extern FILE *stdout" means "extern FILE * const stdout"), so we
+ abandon the old approach in favor of playing games with dup() to switch the
+ raw file descriptors.
+
+While we're at it, fix a regression where an unconverted outf test
+allows progress info to end up in the metadump stream.
+
+Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
+---
+ db/metadump.c | 47 ++++++++++++++++++++++++++++++++++++-----------
+ 1 file changed, 36 insertions(+), 11 deletions(-)
+
+diff --git a/db/metadump.c b/db/metadump.c
+index 96641e0..4e2f648 100644
+--- a/db/metadump.c
++++ b/db/metadump.c
+@@ -78,6 +78,7 @@ static int obfuscate = 1;
+ static int zero_stale_data = 1;
+ static int show_warnings = 0;
+ static int progress_since_warning = 0;
++static bool stdout_metadump;
+
+ void
+ metadump_init(void)
+@@ -137,7 +138,7 @@ print_progress(const char *fmt, ...)
+ va_end(ap);
+ buf[sizeof(buf)-1] = '\0';
+
+- f = (outf == stdout) ? stderr : stdout;
++ f = stdout_metadump ? stderr : stdout;
+ fprintf(f, "\r%-59s", buf);
+ fflush(f);
+ progress_since_warning = 1;
+@@ -2750,7 +2751,8 @@ metadump_f(
+ xfs_agnumber_t agno;
+ int c;
+ int start_iocur_sp;
+- bool stdout_metadump = false;
++ int outfd = -1;
++ int ret;
+ char *p;
+
+ exitcode = 1;
+@@ -2870,16 +2872,35 @@ metadump_f(
+ * metadump operation so that dbprintf and other messages
+ * are sent to the console instead of polluting the
+ * metadump stream.
++ *
++ * We get to do this the hard way because musl doesn't
++ * allow reassignment of stdout.
+ */
+- outf = stdout;
+- stdout = stderr;
++ fflush(stdout);
++ outfd = dup(STDOUT_FILENO);
++ if (outfd < 0) {
++ perror("opening dump stream");
++ goto out;
++ }
++ ret = dup2(STDERR_FILENO, STDOUT_FILENO);
++ if (ret < 0) {
++ perror("redirecting stdout");
++ close(outfd);
++ goto out;
++ }
++ outf = fdopen(outfd, "a");
++ if (outf == NULL) {
++ fprintf(stderr, "cannot create dump stream\n");
++ dup2(outfd, 1);
++ close(outfd);
++ goto out;
++ }
+ stdout_metadump = true;
+ } else {
+ outf = fopen(argv[optind], "wb");
+ if (outf == NULL) {
+ print_warning("cannot create dump file");
+- free(metablock);
+- return 0;
++ goto out;
+ }
+ }
+
+@@ -2907,15 +2928,19 @@ metadump_f(
+ if (progress_since_warning)
+ fputc('\n', stdout_metadump ? stderr : stdout);
+
+- if (stdout_metadump)
+- stdout = outf;
+- else
+- fclose(outf);
++ if (stdout_metadump) {
++ fflush(outf);
++ fflush(stdout);
++ ret = dup2(outfd, STDOUT_FILENO);
++ if (ret < 0)
++ perror("un-redirecting stdout");
++ }
++ fclose(outf);
+
+ /* cleanup iocur stack */
+ while (iocur_sp > start_iocur_sp)
+ pop_cur();
+-
++out:
+ free(metablock);
+
+ return 0;
+--
+2.13.3
diff --git a/sys-fs/xfsprogs/files/xfsprogs-4.12.0-sharedlibs.patch b/sys-fs/xfsprogs/files/xfsprogs-4.12.0-sharedlibs.patch
new file mode 100644
index 000000000000..cb59d44a46b7
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-4.12.0-sharedlibs.patch
@@ -0,0 +1,81 @@
+--- xfsprogs-4.12.0/include/buildmacros
++++ xfsprogs-4.12.0/include/buildmacros
+@@ -70,18 +70,9 @@
+ # /usr/lib.
+ ifeq ($(ENABLE_SHARED),yes)
+ INSTALL_LTLIB_DEV = \
+- cd $(TOPDIR)/$(LIBNAME)/.libs; \
+- ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
+- ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_LIB_DIR); \
+- ../$(INSTALL) -m 644 $(LIBNAME).lai $(PKG_LIB_DIR)/$(LIBNAME).la ; \
+- ../$(INSTALL) -m 755 -d $(PKG_ROOT_LIB_DIR); \
+- ../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_ROOT_LIB_DIR); \
+- if [ "x$(shell readlink -f $(PKG_LIB_DIR))" != \
+- "x$(shell readlink -f $(PKG_ROOT_LIB_DIR))" ]; then \
+- ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).a $(PKG_ROOT_LIB_DIR)/$(LIBNAME).a; \
+- ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).la $(PKG_ROOT_LIB_DIR)/$(LIBNAME).la; \
+- ../$(INSTALL) -S $(PKG_ROOT_LIB_DIR)/$(LIBNAME).so $(PKG_LIB_DIR)/$(LIBNAME).so; \
+- fi
++ set -e; cd $(TOPDIR)/$(LIBNAME); \
++ $(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
++ env -uDIST_ROOT $(LTINSTALL) $(TOPDIR)/$(LIBNAME)/$(LIBNAME).la $(DIST_ROOT)$(PKG_LIB_DIR)/$(LIBNAME).la
+ else
+ INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC)
+ endif
+--- xfsprogs-4.12.0/libhandle/Makefile
++++ xfsprogs-4.12.0/libhandle/Makefile
+@@ -24,7 +24,6 @@
+ include $(BUILDRULES)
+
+ install: default
+- $(INSTALL_LTLIB)
+
+ install-dev: default
+ $(INSTALL_LTLIB_DEV)
+--- xfsprogs-4.12.0/libxcmd/Makefile
++++ xfsprogs-4.12.0/libxcmd/Makefile
+@@ -34,6 +34,9 @@
+
+ include $(BUILDRULES)
+
+-install install-dev: default
++install: default
++
++install-dev: default
++ $(INSTALL_LTLIB_DEV)
+
+ -include .ltdep
+--- xfsprogs-4.12.0/libxfs/Makefile
++++ xfsprogs-4.12.0/libxfs/Makefile
+@@ -151,6 +151,7 @@
+
+ install-dev: install
+ $(INSTALL) -m 644 $(PKGHFILES) $(PKG_INC_DIR)
++ $(INSTALL_LTLIB_DEV)
+
+ # We need to install the headers before building the dependencies. If we
+ # include the .ltdep file, the makefile decides that it needs to build the
+--- xfsprogs-4.12.0/libxlog/Makefile
++++ xfsprogs-4.12.0/libxlog/Makefile
+@@ -19,6 +19,9 @@
+
+ include $(BUILDRULES)
+
+-install install-dev: default
++install: default
++
++install-dev: default
++ $(INSTALL_LTLIB_DEV)
+
+ -include .ltdep
+--- xfsprogs-4.12.0/Makefile
++++ xfsprogs-4.12.0/Makefile
+@@ -89,6 +89,8 @@
+ copy: libxlog
+ mkfs: libxcmd
+ spaceman: libxcmd
++libxlog: libxfs
++libxlog-install-dev: libxfs-install-dev
+
+ ifeq ($(HAVE_BUILDDEFS), yes)
+ include $(BUILDRULES)
diff --git a/sys-fs/xfsprogs/files/xfsprogs-4.3.0-cross-compile.patch b/sys-fs/xfsprogs/files/xfsprogs-4.3.0-cross-compile.patch
new file mode 100644
index 000000000000..c54566451a9e
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-4.3.0-cross-compile.patch
@@ -0,0 +1,181 @@
+From 1a366eedc0eb4da46da48e9f6e2da27c7b5d2076 Mon Sep 17 00:00:00 2001
+From: Gwendal Grignou <gwendal@chromium.org>
+Date: Fri, 3 Jun 2016 09:17:28 -0700
+Subject: [PATCH] Allow compiling xfsprogs in a cross compile environment.
+
+Without this patch, we are using the same compiler and options for the host
+compiler (BUILD_CC) and the target compiler (CC), and we would get error
+messages at compilation:
+x86_64-pc-linux-gnu-gcc -O2 -O2 -pipe -march=armv7-a -mtune=cortex-a15 ...
+x86_64-pc-linux-gnu-gcc.real: error: unrecognized command line option
+'-mfpu=neon'
+'-mfloat-abi=hard'
+'-clang-syntax'
+'-mfpu=neon'
+'-mfloat-abi=hard'
+'-clang-syntax'
+
+Add BUILD_CC and BUILD_CFLAGS as precious variables to allow setting it up
+from the ebuild.
+
+Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
+---
+ configure | 26 +++++++++++++++++++++-----
+ configure.ac | 20 +++++++++++++++-----
+ include/builddefs.in | 6 ++++--
+ libxfs/Makefile | 4 ++--
+ 4 files changed, 42 insertions(+), 14 deletions(-)
+
+diff --git a/configure b/configure
+index 325081f..863a447 100755
+--- a/configure
++++ b/configure
+@@ -700,6 +700,7 @@ libreadline
+ enable_blkid
+ enable_gettext
+ enable_shared
++BUILD_CFLAGS
+ BUILD_CC
+ CPP
+ LT_SYS_LIBRARY_PATH
+@@ -806,7 +807,9 @@ LDFLAGS
+ LIBS
+ CPPFLAGS
+ LT_SYS_LIBRARY_PATH
+-CPP'
++CPP
++BUILD_CC
++BUILD_CFLAGS'
+
+
+ # Initialize some variables set by options.
+@@ -1456,6 +1459,9 @@ Some influential environment variables:
+ LT_SYS_LIBRARY_PATH
+ User-defined run-time library search path.
+ CPP C preprocessor
++ BUILD_CC C compiler for build tools
++ BUILD_CFLAGS
++ C compiler flags for build tools
+
+ Use these variables to override the choices made by `configure' or to help
+ it to find libraries and programs with nonstandard names/locations.
+@@ -11957,11 +11963,12 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+-if test $cross_compiling = no; then
+- BUILD_CC="$CC"
+
+-else
+- for ac_prog in gcc cc
++if test "${BUILD_CC+set}" != "set"; then
++ if test $cross_compiling = no; then
++ BUILD_CC="$CC"
++ else
++ for ac_prog in gcc cc
+ do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+ set dummy $ac_prog; ac_word=$2
+@@ -12003,6 +12010,15 @@ fi
+ test -n "$BUILD_CC" && break
+ done
+
++ fi
++fi
++
++if test "${BUILD_CFLAGS+set}" != "set"; then
++ if test $cross_compiling = no; then
++ BUILD_CFLAGS="$CFLAGS"
++ else
++ BUILD_CFLAGS="-g -O2"
++ fi
+ fi
+
+ # Check whether --enable-shared was given.
+diff --git a/configure.ac b/configure.ac
+index d44438f..fc286b3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -9,11 +9,21 @@ AC_PREFIX_DEFAULT(/usr)
+ AC_PROG_LIBTOOL
+
+ AC_PROG_CC
+-if test $cross_compiling = no; then
+- BUILD_CC="$CC"
+- AC_SUBST(BUILD_CC)
+-else
+- AC_CHECK_PROGS(BUILD_CC, gcc cc)
++AC_ARG_VAR(BUILD_CC, [C compiler for build tools])
++if test "${BUILD_CC+set}" != "set"; then
++ if test $cross_compiling = no; then
++ BUILD_CC="$CC"
++ else
++ AC_CHECK_PROGS(BUILD_CC, gcc cc)
++ fi
++fi
++AC_ARG_VAR(BUILD_CFLAGS, [C compiler flags for build tools])
++if test "${BUILD_CFLAGS+set}" != "set"; then
++ if test $cross_compiling = no; then
++ BUILD_CFLAGS="$CFLAGS"
++ else
++ BUILD_CFLAGS="-g -O2"
++ fi
+ fi
+
+ AC_ARG_ENABLE(shared,
+diff --git a/include/builddefs.in b/include/builddefs.in
+index c2ca4cb..9ca57a6 100644
+--- a/include/builddefs.in
++++ b/include/builddefs.in
+@@ -27,6 +27,7 @@ MALLOCLIB = @malloc_lib@
+ LOADERFLAGS = @LDFLAGS@
+ LTLDFLAGS = @LDFLAGS@
+ CFLAGS = @CFLAGS@
++BUILD_CFLAGS = @BUILD_CFLAGS@
+
+ LIBRT = @librt@
+ LIBUUID = @libuuid@
+@@ -150,7 +151,7 @@ PCFLAGS+= -DENABLE_BLKID
+ endif
+
+
+-GCFLAGS = $(OPTIMIZER) $(DEBUG) \
++GCFLAGS = $(DEBUG) \
+ -DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\" \
+ -DPACKAGE=\"$(PKG_NAME)\" -I$(TOPDIR)/include -I$(TOPDIR)/libxfs
+
+@@ -158,8 +159,9 @@ ifeq ($(ENABLE_GETTEXT),yes)
+ GCFLAGS += -DENABLE_GETTEXT
+ endif
+
++BUILD_CFLAGS += $(GCFLAGS) $(PCFLAGS)
+ # First, Global, Platform, Local CFLAGS
+-CFLAGS += $(FCFLAGS) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS)
++CFLAGS += $(FCFLAGS) $(OPTIMIZER) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS)
+
+ include $(TOPDIR)/include/buildmacros
+
+diff --git a/libxfs/Makefile b/libxfs/Makefile
+index 873d4ec..8d728c0 100644
+--- a/libxfs/Makefile
++++ b/libxfs/Makefile
+@@ -111,7 +111,7 @@ default: crc32selftest ltdepend $(LTLIBRARY)
+
+ crc32table.h: gen_crc32table.c
+ @echo " [CC] gen_crc32table"
+- $(Q) $(BUILD_CC) $(CFLAGS) -o gen_crc32table $<
++ $(Q) $(BUILD_CC) $(BUILD_CFLAGS) -o gen_crc32table $<
+ @echo " [GENERATE] $@"
+ $(Q) ./gen_crc32table > crc32table.h
+
+@@ -122,7 +122,7 @@ crc32table.h: gen_crc32table.c
+ # disk.
+ crc32selftest: gen_crc32table.c crc32table.h crc32.c
+ @echo " [TEST] CRC32"
+- $(Q) $(BUILD_CC) $(CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@
++ $(Q) $(BUILD_CC) $(BUILD_CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@
+ $(Q) ./$@
+
+ # set up include/xfs header directory
+--
+2.8.0.rc3.226.g39d4020
diff --git a/sys-fs/xfsprogs/files/xfsprogs-4.3.0-sharedlibs.patch b/sys-fs/xfsprogs/files/xfsprogs-4.3.0-sharedlibs.patch
new file mode 100644
index 000000000000..a39af0d8cb43
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-4.3.0-sharedlibs.patch
@@ -0,0 +1,80 @@
+--- xfsprogs-4.3.0/include/buildmacros
++++ xfsprogs-4.3.0/include/buildmacros
+@@ -70,18 +70,9 @@
+ # /usr/lib.
+ ifeq ($(ENABLE_SHARED),yes)
+ INSTALL_LTLIB_DEV = \
+- cd $(TOPDIR)/$(LIBNAME)/.libs; \
+- ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
+- ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_LIB_DIR); \
+- ../$(INSTALL) -m 644 $(LIBNAME).lai $(PKG_LIB_DIR)/$(LIBNAME).la ; \
+- ../$(INSTALL) -m 755 -d $(PKG_ROOT_LIB_DIR); \
+- ../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_ROOT_LIB_DIR); \
+- if [ "x$(shell readlink -f $(PKG_LIB_DIR))" != \
+- "x$(shell readlink -f $(PKG_ROOT_LIB_DIR))" ]; then \
+- ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).a $(PKG_ROOT_LIB_DIR)/$(LIBNAME).a; \
+- ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).la $(PKG_ROOT_LIB_DIR)/$(LIBNAME).la; \
+- ../$(INSTALL) -S $(PKG_ROOT_LIB_DIR)/$(LIBNAME).so $(PKG_LIB_DIR)/$(LIBNAME).so; \
+- fi
++ set -e; cd $(TOPDIR)/$(LIBNAME); \
++ $(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
++ env -uDIST_ROOT $(LTINSTALL) $(TOPDIR)/$(LIBNAME)/$(LIBNAME).la $(DIST_ROOT)$(PKG_LIB_DIR)/$(LIBNAME).la
+ else
+ INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC)
+ endif
+--- xfsprogs-4.3.0/libxcmd/Makefile
++++ xfsprogs-4.3.0/libxcmd/Makefile
+@@ -34,6 +34,9 @@
+
+ include $(BUILDRULES)
+
+-install install-dev: default
++install: default
++
++install-dev: default
++ $(INSTALL_LTLIB_DEV)
+
+ -include .ltdep
+--- xfsprogs-4.3.0/libxfs/Makefile
++++ xfsprogs-4.3.0/libxfs/Makefile
+@@ -138,6 +138,7 @@
+
+ install-dev: install
+ $(INSTALL) -m 644 $(PKGHFILES) $(PKG_INC_DIR)
++ $(INSTALL_LTLIB_DEV)
+
+ # We need to install the headers before building the dependencies. If we
+ # include the .ltdep file, the makefile decides that it needs to build the
+--- xfsprogs-4.3.0/libxlog/Makefile
++++ xfsprogs-4.3.0/libxlog/Makefile
+@@ -12,6 +12,8 @@
+
+ CFILES = xfs_log_recover.c util.c
+
++LTLIBS = $(LIBUUID) $(LIBXFS)
++
+ # don't want to link xfs_repair with a debug libxlog.
+ DEBUG = -DNDEBUG
+
+@@ -19,6 +21,9 @@
+
+ include $(BUILDRULES)
+
+-install install-dev: default
++install: default
++
++install-dev: default
++ $(INSTALL_LTLIB_DEV)
+
+ -include .ltdep
+--- xfsprogs-4.3.0/Makefile
++++ xfsprogs-4.3.0/Makefile
+@@ -82,6 +82,8 @@
+ quota: libxcmd
+ repair: libxlog
+ copy: libxlog
++libxlog: libxfs
++libxlog-install-dev: libxfs-install-dev
+
+ ifeq ($(HAVE_BUILDDEFS), yes)
+ include $(BUILDRULES)
diff --git a/sys-fs/xfsprogs/files/xfsprogs-4.5.0-linguas.patch b/sys-fs/xfsprogs/files/xfsprogs-4.5.0-linguas.patch
new file mode 100644
index 000000000000..9912e49ebf84
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-4.5.0-linguas.patch
@@ -0,0 +1,32 @@
+From 2212e8bb59e7c3930d49da2ec5f4f0a9ceb086c7 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Fri, 8 Apr 2016 16:41:31 -0400
+Subject: [PATCH] po: respect LINGUAS build setting
+
+It is common gettext practice to limit the translations a particular
+package will include by setting the LINGUAS environment variable.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ po/Makefile | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/po/Makefile b/po/Makefile
+index edf92ad..a5250b3 100644
+--- a/po/Makefile
++++ b/po/Makefile
+@@ -6,7 +6,10 @@ TOPDIR = ..
+ include $(TOPDIR)/include/builddefs
+
+ POTHEAD = $(PKG_NAME).pot
+-LINGUAS = de pl
++# If the user has requested a specific set of translations, only build those.
++SUPPORTED_LINGUAS = $(patsubst %.po,%,$(wildcard *.po))
++LINGUAS ?= $(SUPPORTED_LINGUAS)
++LINGUAS := $(filter $(SUPPORTED_LINGUAS),$(LINGUAS))
+ LSRCFILES = $(LINGUAS:%=%.po)
+ LDIRT = $(POTHEAD)
+
+--
+2.7.4
+
diff --git a/sys-fs/xfsprogs/files/xfsprogs-4.7.0-libxcmd-link.patch b/sys-fs/xfsprogs/files/xfsprogs-4.7.0-libxcmd-link.patch
new file mode 100644
index 000000000000..77ded5393d52
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-4.7.0-libxcmd-link.patch
@@ -0,0 +1,30 @@
+From d01d3689fd512811b9d860598ddf26089bb5955c Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 9 Aug 2016 22:37:45 +0800
+Subject: [PATCH xfsprogs] libxcmd: link against used libs
+
+Since this lib uses symbols from libxfs (platform_findsizes) and many
+symbols from libblkid, link against both. Otherwise, the resulting
+shared lib has missing symbols which makes linking against annoying.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ libxcmd/Makefile | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libxcmd/Makefile b/libxcmd/Makefile
+index aab8d6d63624..46ba138a37e2 100644
+--- a/libxcmd/Makefile
++++ b/libxcmd/Makefile
+@@ -12,6 +12,8 @@ LT_AGE = 0
+
+ CFILES = command.c input.c paths.c projects.c help.c quit.c topology.c
+
++LTLIBS = $(LIBXFS) $(LIBBLKID)
++
+ ifeq ($(HAVE_GETMNTENT),yes)
+ LCFLAGS += -DHAVE_GETMNTENT
+ endif
+--
+2.9.0
+
diff --git a/sys-fs/xfsprogs/files/xfsprogs-4.7.0-sharedlibs.patch b/sys-fs/xfsprogs/files/xfsprogs-4.7.0-sharedlibs.patch
new file mode 100644
index 000000000000..b5395ffaed6c
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-4.7.0-sharedlibs.patch
@@ -0,0 +1,81 @@
+--- xfsprogs-4.7.0/include/buildmacros
++++ xfsprogs-4.7.0/include/buildmacros
+@@ -70,18 +70,9 @@
+ # /usr/lib.
+ ifeq ($(ENABLE_SHARED),yes)
+ INSTALL_LTLIB_DEV = \
+- cd $(TOPDIR)/$(LIBNAME)/.libs; \
+- ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
+- ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_LIB_DIR); \
+- ../$(INSTALL) -m 644 $(LIBNAME).lai $(PKG_LIB_DIR)/$(LIBNAME).la ; \
+- ../$(INSTALL) -m 755 -d $(PKG_ROOT_LIB_DIR); \
+- ../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_ROOT_LIB_DIR); \
+- if [ "x$(shell readlink -f $(PKG_LIB_DIR))" != \
+- "x$(shell readlink -f $(PKG_ROOT_LIB_DIR))" ]; then \
+- ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).a $(PKG_ROOT_LIB_DIR)/$(LIBNAME).a; \
+- ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).la $(PKG_ROOT_LIB_DIR)/$(LIBNAME).la; \
+- ../$(INSTALL) -S $(PKG_ROOT_LIB_DIR)/$(LIBNAME).so $(PKG_LIB_DIR)/$(LIBNAME).so; \
+- fi
++ set -e; cd $(TOPDIR)/$(LIBNAME); \
++ $(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
++ env -uDIST_ROOT $(LTINSTALL) $(TOPDIR)/$(LIBNAME)/$(LIBNAME).la $(DIST_ROOT)$(PKG_LIB_DIR)/$(LIBNAME).la
+ else
+ INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC)
+ endif
+--- xfsprogs-4.7.0/libhandle/Makefile
++++ xfsprogs-4.7.0/libhandle/Makefile
+@@ -24,7 +24,6 @@
+ include $(BUILDRULES)
+
+ install: default
+- $(INSTALL_LTLIB)
+
+ install-dev: default
+ $(INSTALL_LTLIB_DEV)
+--- xfsprogs-4.7.0/libxcmd/Makefile
++++ xfsprogs-4.7.0/libxcmd/Makefile
+@@ -34,6 +34,9 @@
+
+ include $(BUILDRULES)
+
+-install install-dev: default
++install: default
++
++install-dev: default
++ $(INSTALL_LTLIB_DEV)
+
+ -include .ltdep
+--- xfsprogs-4.7.0/libxfs/Makefile
++++ xfsprogs-4.7.0/libxfs/Makefile
+@@ -138,6 +138,7 @@
+
+ install-dev: install
+ $(INSTALL) -m 644 $(PKGHFILES) $(PKG_INC_DIR)
++ $(INSTALL_LTLIB_DEV)
+
+ # We need to install the headers before building the dependencies. If we
+ # include the .ltdep file, the makefile decides that it needs to build the
+--- xfsprogs-4.7.0/libxlog/Makefile
++++ xfsprogs-4.7.0/libxlog/Makefile
+@@ -19,6 +21,9 @@
+
+ include $(BUILDRULES)
+
+-install install-dev: default
++install: default
++
++install-dev: default
++ $(INSTALL_LTLIB_DEV)
+
+ -include .ltdep
+--- xfsprogs-4.7.0/Makefile
++++ xfsprogs-4.7.0/Makefile
+@@ -83,6 +83,8 @@
+ repair: libxlog libxcmd
+ copy: libxlog
+ mkfs: libxcmd
++libxlog: libxfs
++libxlog-install-dev: libxfs-install-dev
+
+ ifeq ($(HAVE_BUILDDEFS), yes)
+ include $(BUILDRULES)
diff --git a/sys-fs/xfsprogs/files/xfsprogs-4.9.0-cross-compile.patch b/sys-fs/xfsprogs/files/xfsprogs-4.9.0-cross-compile.patch
new file mode 100644
index 000000000000..fade1028301d
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-4.9.0-cross-compile.patch
@@ -0,0 +1,143 @@
+--- xfsprogs-4.9.0/configure
++++ xfsprogs-4.9.0/configure
+@@ -861,6 +861,7 @@
+ enable_blkid
+ enable_gettext
+ enable_shared
++BUILD_CFLAGS
+ BUILD_CC
+ CPP
+ OTOOL64
+@@ -960,7 +961,9 @@
+ LDFLAGS
+ LIBS
+ CPPFLAGS
+-CPP'
++CPP
++BUILD_CC
++BUILD_CFLAGS'
+
+
+ # Initialize some variables set by options.
+@@ -1616,6 +1619,9 @@
+ CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
++ BUILD_CC C compiler for build tools
++ BUILD_CFLAGS
++ C compiler flags for build tools
+
+ Use these variables to override the choices made by `configure' or to help
+ it to find libraries and programs with nonstandard names/locations.
+@@ -11116,11 +11122,12 @@
+ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+-if test $cross_compiling = no; then
+- BUILD_CC="$CC"
+
+-else
+- for ac_prog in gcc cc
++if test "${BUILD_CC+set}" != "set"; then
++ if test $cross_compiling = no; then
++ BUILD_CC="$CC"
++ else
++ for ac_prog in gcc cc
+ do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+ set dummy $ac_prog; ac_word=$2
+@@ -11162,6 +11169,15 @@
+ test -n "$BUILD_CC" && break
+ done
+
++ fi
++fi
++
++if test "${BUILD_CFLAGS+set}" != "set"; then
++ if test $cross_compiling = no; then
++ BUILD_CFLAGS="$CFLAGS"
++ else
++ BUILD_CFLAGS="-g -O2"
++ fi
+ fi
+
+ # Check whether --enable-shared was given.
+--- xfsprogs-4.9.0/configure.ac
++++ xfsprogs-4.9.0/configure.ac
+@@ -9,11 +9,21 @@
+ AC_PROG_LIBTOOL
+
+ AC_PROG_CC
+-if test $cross_compiling = no; then
+- BUILD_CC="$CC"
+- AC_SUBST(BUILD_CC)
+-else
+- AC_CHECK_PROGS(BUILD_CC, gcc cc)
++AC_ARG_VAR(BUILD_CC, [C compiler for build tools])
++if test "${BUILD_CC+set}" != "set"; then
++ if test $cross_compiling = no; then
++ BUILD_CC="$CC"
++ else
++ AC_CHECK_PROGS(BUILD_CC, gcc cc)
++ fi
++fi
++AC_ARG_VAR(BUILD_CFLAGS, [C compiler flags for build tools])
++if test "${BUILD_CFLAGS+set}" != "set"; then
++ if test $cross_compiling = no; then
++ BUILD_CFLAGS="$CFLAGS"
++ else
++ BUILD_CFLAGS="-g -O2"
++ fi
+ fi
+
+ AC_ARG_ENABLE(shared,
+--- xfsprogs-4.9.0/include/builddefs.in
++++ xfsprogs-4.9.0/include/builddefs.in
+@@ -26,6 +26,7 @@
+ LOADERFLAGS = @LDFLAGS@
+ LTLDFLAGS = @LDFLAGS@
+ CFLAGS = @CFLAGS@ -D_FILE_OFFSET_BITS=64
++BUILD_CFLAGS = @BUILD_CFLAGS@ -D_FILE_OFFSET_BITS=64
+
+ LIBRT = @librt@
+ LIBUUID = @libuuid@
+@@ -154,7 +155,7 @@
+ endif
+
+
+-GCFLAGS = $(OPTIMIZER) $(DEBUG) \
++GCFLAGS = $(DEBUG) \
+ -DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\" \
+ -DPACKAGE=\"$(PKG_NAME)\" -I$(TOPDIR)/include -I$(TOPDIR)/libxfs
+
+@@ -162,8 +163,9 @@
+ GCFLAGS += -DENABLE_GETTEXT
+ endif
+
++BUILD_CFLAGS += $(GCFLAGS) $(PCFLAGS)
+ # First, Global, Platform, Local CFLAGS
+-CFLAGS += $(FCFLAGS) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS)
++CFLAGS += $(FCFLAGS) $(OPTIMIZER) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS)
+
+ include $(TOPDIR)/include/buildmacros
+
+--- xfsprogs-4.9.0/libxfs/Makefile
++++ xfsprogs-4.9.0/libxfs/Makefile
+@@ -124,7 +124,7 @@
+
+ crc32table.h: gen_crc32table.c
+ @echo " [CC] gen_crc32table"
+- $(Q) $(BUILD_CC) $(CFLAGS) -o gen_crc32table $<
++ $(Q) $(BUILD_CC) $(BUILD_CFLAGS) -o gen_crc32table $<
+ @echo " [GENERATE] $@"
+ $(Q) ./gen_crc32table > crc32table.h
+
+@@ -135,7 +135,7 @@
+ # disk.
+ crc32selftest: gen_crc32table.c crc32table.h crc32.c
+ @echo " [TEST] CRC32"
+- $(Q) $(BUILD_CC) $(CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@
++ $(Q) $(BUILD_CC) $(BUILD_CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@
+ $(Q) ./$@
+
+ # set up include/xfs header directory
diff --git a/sys-fs/xfsprogs/files/xfsprogs-4.9.0-underlinking.patch b/sys-fs/xfsprogs/files/xfsprogs-4.9.0-underlinking.patch
new file mode 100644
index 000000000000..e6904a53bc2a
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-4.9.0-underlinking.patch
@@ -0,0 +1,30 @@
+ libxfs/Makefile | 2 +-
+ libxlog/Makefile | 2 ++
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/libxfs/Makefile b/libxfs/Makefile
+index 6499731..00447c4 100644
+--- a/libxfs/Makefile
++++ b/libxfs/Makefile
+@@ -113,7 +113,7 @@ LSRCFILES += gen_crc32table.c
+
+ FCFLAGS = -I.
+
+-LTLIBS = $(LIBPTHREAD) $(LIBRT)
++LTLIBS = $(LIBPTHREAD) $(LIBRT) $(LIBUUID)
+
+ # don't try linking xfs_repair with a debug libxfs.
+ DEBUG = -DNDEBUG
+diff --git a/libxlog/Makefile b/libxlog/Makefile
+index 3417eed..fda1343 100644
+--- a/libxlog/Makefile
++++ b/libxlog/Makefile
+@@ -12,6 +12,8 @@ LT_AGE = 0
+
+ CFILES = xfs_log_recover.c util.c
+
++LTLIBS = $(LIBUUID)
++
+ # don't want to link xfs_repair with a debug libxlog.
+ DEBUG = -DNDEBUG
+
diff --git a/sys-fs/xfsprogs/metadata.xml b/sys-fs/xfsprogs/metadata.xml
new file mode 100644
index 000000000000..4eb20a048df2
--- /dev/null
+++ b/sys-fs/xfsprogs/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-fs/xfsprogs/xfsprogs-4.12.0.ebuild b/sys-fs/xfsprogs/xfsprogs-4.12.0.ebuild
new file mode 100644
index 000000000000..4736e0b82b64
--- /dev/null
+++ b/sys-fs/xfsprogs/xfsprogs-4.12.0.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="xfs filesystem utilities"
+HOMEPAGE="http://oss.sgi.com/projects/xfs/"
+SRC_URI="https://www.kernel.org/pub/linux/utils/fs/xfs/${PN}/${P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="libedit nls readline static static-libs"
+REQUIRED_USE="static? ( static-libs )"
+
+LIB_DEPEND=">=sys-apps/util-linux-2.17.2[static-libs(+)]
+ readline? ( sys-libs/readline:0=[static-libs(+)] )
+ !readline? ( libedit? ( dev-libs/libedit[static-libs(+)] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ !<sys-fs/xfsdump-3"
+DEPEND="${RDEPEND}
+ static? (
+ ${LIB_DEPEND}
+ readline? ( sys-libs/ncurses:0=[static-libs] )
+ )
+ nls? ( sys-devel/gettext )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.12.0-sharedlibs.patch
+ "${FILESDIR}"/${PN}-4.7.0-libxcmd-link.patch
+ "${FILESDIR}"/${PN}-4.9.0-underlinking.patch
+ "${FILESDIR}"/${PN}-4.12.0-fix_musl.patch
+)
+
+pkg_setup() {
+ if use readline && use libedit ; then
+ ewarn "You have USE='readline libedit' but these are exclusive."
+ ewarn "Defaulting to readline; please disable this USE flag if you want libedit."
+ fi
+}
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+
+ # LLDFLAGS is used for programs, so apply -all-static when USE=static is enabled.
+ # Clear out -static from all flags since we want to link against dynamic xfs libs.
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ -e "1iLLDFLAGS += $(usex static '-all-static' '')" \
+ include/builddefs.in || die
+ find -name Makefile -exec \
+ sed -i -r -e '/^LLDFLAGS [+]?= -static(-libtool-libs)?$/d' {} +
+
+ # TODO: Write a patch for configure.ac to use pkg-config for the uuid-part.
+ if use static && use readline ; then
+ sed -i \
+ -e 's|-lreadline|& -lncurses|' \
+ -e 's|-lblkid|& -luuid|' \
+ configure || die
+ fi
+}
+
+src_configure() {
+ export DEBUG=-DNDEBUG
+ export OPTIMIZER=${CFLAGS}
+ unset PLATFORM # if set in user env, this breaks configure
+
+ local myconf
+ if use static || use static-libs ; then
+ myconf+=" --enable-static"
+ else
+ myconf+=" --disable-static"
+ fi
+
+ econf \
+ $(use_enable nls gettext) \
+ $(use_enable readline) \
+ $(usex readline --disable-editline $(use_enable libedit editline)) \
+ ${myconf}
+
+ MAKEOPTS+=" V=1"
+}
+
+src_install() {
+ emake DIST_ROOT="${ED}" install
+ # parallel install fails on this target for >=xfsprogs-3.2.0
+ emake -j1 DIST_ROOT="${ED}" install-dev
+
+ # handle is for xfsdump, the rest for xfsprogs
+ gen_usr_ldscript -a handle xcmd xfs xlog
+ # removing unnecessary .la files if not needed
+ use static-libs || find "${ED}" -name '*.la' -delete
+}
diff --git a/sys-fs/xfsprogs/xfsprogs-4.13.1.ebuild b/sys-fs/xfsprogs/xfsprogs-4.13.1.ebuild
new file mode 100644
index 000000000000..a77ca48cb15d
--- /dev/null
+++ b/sys-fs/xfsprogs/xfsprogs-4.13.1.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs multilib
+
+DESCRIPTION="xfs filesystem utilities"
+HOMEPAGE="http://oss.sgi.com/projects/xfs/"
+SRC_URI="https://www.kernel.org/pub/linux/utils/fs/xfs/${PN}/${P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="libedit nls readline static static-libs"
+REQUIRED_USE="static? ( static-libs )"
+
+LIB_DEPEND=">=sys-apps/util-linux-2.17.2[static-libs(+)]
+ readline? ( sys-libs/readline:0=[static-libs(+)] )
+ !readline? ( libedit? ( dev-libs/libedit[static-libs(+)] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ !<sys-fs/xfsdump-3"
+DEPEND="${RDEPEND}
+ static? (
+ ${LIB_DEPEND}
+ readline? ( sys-libs/ncurses:0=[static-libs] )
+ )
+ nls? ( sys-devel/gettext )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.12.0-sharedlibs.patch
+ "${FILESDIR}"/${PN}-4.7.0-libxcmd-link.patch
+ "${FILESDIR}"/${PN}-4.9.0-underlinking.patch
+)
+
+pkg_setup() {
+ if use readline && use libedit ; then
+ ewarn "You have USE='readline libedit' but these are exclusive."
+ ewarn "Defaulting to readline; please disable this USE flag if you want libedit."
+ fi
+}
+
+src_prepare() {
+ default
+
+ # LLDFLAGS is used for programs, so apply -all-static when USE=static is enabled.
+ # Clear out -static from all flags since we want to link against dynamic xfs libs.
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ -e "1iLLDFLAGS += $(usex static '-all-static' '')" \
+ include/builddefs.in || die
+ find -name Makefile -exec \
+ sed -i -r -e '/^LLDFLAGS [+]?= -static(-libtool-libs)?$/d' {} +
+
+ # TODO: Write a patch for configure.ac to use pkg-config for the uuid-part.
+ if use static && use readline ; then
+ sed -i \
+ -e 's|-lreadline|& -lncurses|' \
+ -e 's|-lblkid|& -luuid|' \
+ configure || die
+ fi
+}
+
+src_configure() {
+ export DEBUG=-DNDEBUG
+ export OPTIMIZER=${CFLAGS}
+ unset PLATFORM # if set in user env, this breaks configure
+
+ local myconf=(
+ $(use_enable nls gettext)
+ $(use_enable readline)
+ $(usex readline --disable-editline $(use_enable libedit editline))
+ )
+ if use static || use static-libs ; then
+ myconf+=( --enable-static )
+ else
+ myconf+=( --disable-static )
+ fi
+
+ econf "${myconf[@]}"
+
+ MAKEOPTS+=" V=1"
+}
+
+src_install() {
+ emake DIST_ROOT="${ED}" install
+ # parallel install fails on this target for >=xfsprogs-3.2.0
+ emake -j1 DIST_ROOT="${ED}" install-dev
+
+ # handle is for xfsdump, the rest for xfsprogs
+ gen_usr_ldscript -a handle xcmd xfs xlog
+ # removing unnecessary .la files if not needed
+ use static-libs || find "${ED}" -name '*.la' -delete
+}
diff --git a/sys-fs/xfsprogs/xfsprogs-4.5.0.ebuild b/sys-fs/xfsprogs/xfsprogs-4.5.0.ebuild
new file mode 100644
index 000000000000..3f9a00c49a14
--- /dev/null
+++ b/sys-fs/xfsprogs/xfsprogs-4.5.0.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="xfs filesystem utilities"
+HOMEPAGE="http://oss.sgi.com/projects/xfs/"
+SRC_URI="ftp://oss.sgi.com/projects/xfs/cmd_tars/${P}.tar.gz
+ ftp://oss.sgi.com/projects/xfs/previous/cmd_tars/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="libedit nls readline static static-libs"
+REQUIRED_USE="static? ( static-libs )"
+
+LIB_DEPEND=">=sys-apps/util-linux-2.17.2[static-libs(+)]
+ readline? ( sys-libs/readline:0=[static-libs(+)] )
+ !readline? ( libedit? ( dev-libs/libedit[static-libs(+)] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ !<sys-fs/xfsdump-3"
+DEPEND="${RDEPEND}
+ static? (
+ ${LIB_DEPEND}
+ readline? ( sys-libs/ncurses:0=[static-libs] )
+ )
+ nls? ( sys-devel/gettext )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.3.0-sharedlibs.patch
+ "${FILESDIR}"/${PN}-4.5.0-linguas.patch
+ "${FILESDIR}"/${PN}-4.3.0-cross-compile.patch
+)
+
+pkg_setup() {
+ if use readline && use libedit ; then
+ ewarn "You have USE='readline libedit' but these are exclusive."
+ ewarn "Defaulting to readline; please disable this USE flag if you want libedit."
+ fi
+}
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+
+ # LLDFLAGS is used for programs, so apply -all-static when USE=static is enabled.
+ # Clear out -static from all flags since we want to link against dynamic xfs libs.
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ -e "1iLLDFLAGS += $(usex static '-all-static' '')" \
+ include/builddefs.in || die
+ find -name Makefile -exec \
+ sed -i -r -e '/^LLDFLAGS [+]?= -static(-libtool-libs)?$/d' {} +
+
+ # libdisk has broken blkid conditional checking
+ sed -i \
+ -e '/LIB_SUBDIRS/s:libdisk::' \
+ Makefile || die
+
+ # TODO: write a patch for configure.in to use pkg-config for the uuid-part
+ if use static && use readline ; then
+ sed -i \
+ -e 's|-lreadline|\0 -lncurses|' \
+ -e 's|-lblkid|\0 -luuid|' \
+ configure || die
+ fi
+}
+
+src_configure() {
+ export DEBUG=-DNDEBUG
+ export OPTIMIZER=${CFLAGS}
+ unset PLATFORM # if set in user env, this breaks configure
+
+ local myconf
+ if use static || use static-libs ; then
+ myconf+=" --enable-static"
+ else
+ myconf+=" --disable-static"
+ fi
+
+ econf \
+ --bindir=/usr/bin \
+ --libexecdir=/usr/$(get_libdir) \
+ $(use_enable nls gettext) \
+ $(use_enable readline) \
+ $(usex readline --disable-editline $(use_enable libedit editline)) \
+ ${myconf}
+
+ MAKEOPTS+=" V=1"
+}
+
+src_install() {
+ emake DIST_ROOT="${ED}" install
+ # parallel install fails on this target for >=xfsprogs-3.2.0
+ emake -j1 DIST_ROOT="${ED}" install-dev
+
+ # handle is for xfsdump, the rest for xfsprogs
+ gen_usr_ldscript -a xfs xlog
+ # removing unnecessary .la files if not needed
+ use static-libs || find "${ED}" -name '*.la' -delete
+}
diff --git a/sys-fs/xfsprogs/xfsprogs-4.9.0.ebuild b/sys-fs/xfsprogs/xfsprogs-4.9.0.ebuild
new file mode 100644
index 000000000000..601ce847e160
--- /dev/null
+++ b/sys-fs/xfsprogs/xfsprogs-4.9.0.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="xfs filesystem utilities"
+HOMEPAGE="http://oss.sgi.com/projects/xfs/"
+SRC_URI="ftp://ftp.kernel.org/pub/linux/utils/fs/xfs/${PN}/${P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 ~hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86"
+IUSE="libedit nls readline static static-libs"
+REQUIRED_USE="static? ( static-libs )"
+
+LIB_DEPEND=">=sys-apps/util-linux-2.17.2[static-libs(+)]
+ readline? ( sys-libs/readline:0=[static-libs(+)] )
+ !readline? ( libedit? ( dev-libs/libedit[static-libs(+)] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ !<sys-fs/xfsdump-3"
+DEPEND="${RDEPEND}
+ static? (
+ ${LIB_DEPEND}
+ readline? ( sys-libs/ncurses:0=[static-libs] )
+ )
+ nls? ( sys-devel/gettext )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.7.0-sharedlibs.patch
+ "${FILESDIR}"/${PN}-4.7.0-libxcmd-link.patch
+ "${FILESDIR}"/${PN}-4.9.0-cross-compile.patch
+ "${FILESDIR}"/${P}-underlinking.patch
+)
+
+pkg_setup() {
+ if use readline && use libedit ; then
+ ewarn "You have USE='readline libedit' but these are exclusive."
+ ewarn "Defaulting to readline; please disable this USE flag if you want libedit."
+ fi
+}
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+
+ # LLDFLAGS is used for programs, so apply -all-static when USE=static is enabled.
+ # Clear out -static from all flags since we want to link against dynamic xfs libs.
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ -e "1iLLDFLAGS += $(usex static '-all-static' '')" \
+ include/builddefs.in || die
+ find -name Makefile -exec \
+ sed -i -r -e '/^LLDFLAGS [+]?= -static(-libtool-libs)?$/d' {} +
+
+ # TODO: Write a patch for configure.ac to use pkg-config for the uuid-part.
+ if use static && use readline ; then
+ sed -i \
+ -e 's|-lreadline|& -lncurses|' \
+ -e 's|-lblkid|& -luuid|' \
+ configure || die
+ fi
+}
+
+src_configure() {
+ export DEBUG=-DNDEBUG
+ export OPTIMIZER=${CFLAGS}
+ unset PLATFORM # if set in user env, this breaks configure
+
+ local myconf
+ if use static || use static-libs ; then
+ myconf+=" --enable-static"
+ else
+ myconf+=" --disable-static"
+ fi
+
+ econf \
+ $(use_enable nls gettext) \
+ $(use_enable readline) \
+ $(usex readline --disable-editline $(use_enable libedit editline)) \
+ ${myconf}
+
+ MAKEOPTS+=" V=1"
+}
+
+src_install() {
+ emake DIST_ROOT="${ED}" install
+ # parallel install fails on this target for >=xfsprogs-3.2.0
+ emake -j1 DIST_ROOT="${ED}" install-dev
+
+ # handle is for xfsdump, the rest for xfsprogs
+ gen_usr_ldscript -a handle xcmd xfs xlog
+ # removing unnecessary .la files if not needed
+ use static-libs || find "${ED}" -name '*.la' -delete
+}