1 |
commit: 0b9e1a113f834824b89ecdadf6ecef29ab31689e |
2 |
Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
3 |
AuthorDate: Wed Apr 28 21:06:34 2021 +0000 |
4 |
Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
5 |
CommitDate: Wed Apr 28 21:15:06 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=0b9e1a11 |
7 |
|
8 |
sys-fs/dwarfs: unbundling WIP |
9 |
|
10 |
doesn't build but it's a start |
11 |
hope I didn't mess up while rebasing |
12 |
|
13 |
Package-Manager: Portage-3.0.18, Repoman-3.0.3 |
14 |
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com> |
15 |
|
16 |
sys-fs/dwarfs/dwarfs-0.5.4-r3.ebuild | 106 +++++++++++++++ |
17 |
sys-fs/dwarfs/files/unbundle-folly-fbthrift.patch | 153 ++++++++++++++++++++++ |
18 |
2 files changed, 259 insertions(+) |
19 |
|
20 |
diff --git a/sys-fs/dwarfs/dwarfs-0.5.4-r3.ebuild b/sys-fs/dwarfs/dwarfs-0.5.4-r3.ebuild |
21 |
new file mode 100644 |
22 |
index 000000000..f45a47b0b |
23 |
--- /dev/null |
24 |
+++ b/sys-fs/dwarfs/dwarfs-0.5.4-r3.ebuild |
25 |
@@ -0,0 +1,106 @@ |
26 |
+# Copyright 1999-2021 Gentoo Authors |
27 |
+# Distributed under the terms of the GNU General Public License v2 |
28 |
+ |
29 |
+EAPI=7 |
30 |
+ |
31 |
+PYTHON_COMPAT=( python3_{7,8,9} ) |
32 |
+ |
33 |
+inherit check-reqs cmake flag-o-matic python-single-r1 |
34 |
+ |
35 |
+DESCRIPTION="A fast very high compression read-only FUSE file system" |
36 |
+HOMEPAGE="https://github.com/mhx/dwarfs" |
37 |
+ |
38 |
+SRC_URI="https://github.com/mhx/dwarfs/releases/download/v${PV}/${P}.tar.bz2" |
39 |
+ |
40 |
+LICENSE="GPL-3" |
41 |
+SLOT="0" |
42 |
+KEYWORDS="" |
43 |
+ |
44 |
+IUSE="python +jemalloc test" |
45 |
+RESTRICT="!test? ( test )" |
46 |
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
47 |
+ |
48 |
+PATCHES=( "${WORKDIR}/unbundle-folly-fbthrift.patch" ) |
49 |
+ |
50 |
+RDEPEND=" |
51 |
+ ${PYTHON_DEPS} |
52 |
+ app-arch/libarchive |
53 |
+ app-arch/lz4 |
54 |
+ app-arch/snappy |
55 |
+ app-arch/xz-utils |
56 |
+ app-arch/zstd |
57 |
+ dev-cpp/fbthrift:= |
58 |
+ dev-cpp/folly:= |
59 |
+ dev-cpp/gflags |
60 |
+ dev-cpp/glog[gflags] |
61 |
+ dev-cpp/sparsehash |
62 |
+ dev-libs/boost[context,threads,python?] |
63 |
+ dev-libs/double-conversion |
64 |
+ dev-libs/libevent |
65 |
+ dev-libs/libfmt |
66 |
+ dev-libs/xxhash |
67 |
+ sys-fs/fuse:3 |
68 |
+ sys-libs/binutils-libs |
69 |
+ sys-libs/libunwind |
70 |
+ sys-libs/zlib |
71 |
+ |
72 |
+ jemalloc? ( >=dev-libs/jemalloc-5.2.1 ) |
73 |
+" |
74 |
+DEPEND=" |
75 |
+ ${RDEPEND} |
76 |
+ sys-devel/flex |
77 |
+" |
78 |
+BDEPEND=" |
79 |
+ app-text/ronn |
80 |
+ sys-devel/bison |
81 |
+ virtual/pkgconfig |
82 |
+ |
83 |
+ test? ( dev-cpp/gtest ) |
84 |
+" |
85 |
+>>>>>>> f29f4045 (sys-fs/dwarfs: unbundling WIP):sys-fs/dwarfs/dwarfs-0.5.4-r1.ebuild |
86 |
+ |
87 |
+CHECKREQS_DISK_BUILD="1300M" |
88 |
+ |
89 |
+DOCS=( "README.md" "CHANGES.md" "TODO" ) |
90 |
+ |
91 |
+CMAKE_IN_SOURCE_BUILD=1 |
92 |
+CMAKE_WARN_UNUSED_CLI=0 |
93 |
+ |
94 |
+src_prepare(){ |
95 |
+ cmake_src_prepare |
96 |
+ einfo "setting library path to $(get_libdir)" |
97 |
+ sed "s/DESTINATION lib/DESTINATION $(get_libdir)/" -i CMakeLists.txt || die |
98 |
+} |
99 |
+ |
100 |
+src_configure(){ |
101 |
+ append-cxxflag "-I/usr/include/folly" |
102 |
+ |
103 |
+ einfo "setting configuration flags to:" |
104 |
+ mycmakeargs=( |
105 |
+ -DUSE_JEMALLOC=$(usex jemalloc ON OFF) |
106 |
+ -DWITH_PYTHON=$(usex python ON OFF) |
107 |
+ -DWITH_TESTS=$(usex test ON OFF) |
108 |
+ -DPREFER_SYSTEM_ZSTD=1 |
109 |
+ -DPREFER_SYSTEM_XXHASH=1 |
110 |
+ -DPREFER_SYSTEM_GTEST=1 |
111 |
+ -DWITH_LEGACY_FUSE=0 |
112 |
+ ) |
113 |
+ if use python; then mycmakeargs+=( -DWITH_PYTHON_VERSION=${EPYTHON#python} ); fi |
114 |
+ einfo ${mycmakeargs} |
115 |
+ cmake_src_configure |
116 |
+} |
117 |
+ |
118 |
+src_install(){ |
119 |
+ cmake_src_install |
120 |
+ #TODO: unbundle libfsst |
121 |
+ dolib.so libdwarfs.so libfsst.so |
122 |
+} |
123 |
+ |
124 |
+pkg_postinst(){ |
125 |
+ elog "Suggest to enable USE 'threads' globally if you have multicore machine" |
126 |
+ elog "Since version 0.4.1 GGC builds has been fixed. Now both Clang and GCC are working very well" |
127 |
+ elog "You may find more information in the" |
128 |
+ elog "${HOMEPAGE}" |
129 |
+ elog "About creating: ${HOMEPAGE}/blob/main/doc/mkdwarfs.md" |
130 |
+ elog "About mounting: ${HOMEPAGE}/blob/main/doc/dwarfs.md" |
131 |
+} |
132 |
|
133 |
diff --git a/sys-fs/dwarfs/files/unbundle-folly-fbthrift.patch b/sys-fs/dwarfs/files/unbundle-folly-fbthrift.patch |
134 |
new file mode 100644 |
135 |
index 000000000..62f4ee1f9 |
136 |
--- /dev/null |
137 |
+++ b/sys-fs/dwarfs/files/unbundle-folly-fbthrift.patch |
138 |
@@ -0,0 +1,153 @@ |
139 |
+--- CMakeLists.txt 2021-04-28 16:56:24.432666631 +0200 |
140 |
++++ CMakeLists.txt2 2021-04-28 17:00:04.622812742 +0200 |
141 |
+@@ -298,7 +298,7 @@ |
142 |
+ if(WITH_TESTS OR WITH_BENCHMARKS) |
143 |
+ add_library(test_helpers test/test_helpers.cpp test/test_strings.cpp |
144 |
+ test/loremipsum.cpp) |
145 |
+- target_link_libraries(test_helpers dwarfs folly) |
146 |
++ target_link_libraries(test_helpers dwarfs) |
147 |
+ set_property(TARGET test_helpers PROPERTY CXX_STANDARD 17) |
148 |
+ endif() |
149 |
+ |
150 |
+@@ -364,70 +364,7 @@ |
151 |
+ |
152 |
+ list( |
153 |
+ APPEND |
154 |
+- FROZEN_THRIFT_SRC |
155 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_data.h |
156 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_data.cpp |
157 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_types.h |
158 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_types.tcc |
159 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_types.cpp |
160 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_types_custom_protocol.h |
161 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_constants.h |
162 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_constants.cpp |
163 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_metadata.h |
164 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_metadata.cpp |
165 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_visitation.h |
166 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_for_each_field.h |
167 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_visit_union.h) |
168 |
+- |
169 |
+-list( |
170 |
+- APPEND |
171 |
+- METADATA_THRIFT_SRC |
172 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_constants.cpp |
173 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_constants.h |
174 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_data.cpp |
175 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_data.h |
176 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_for_each_field.h |
177 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_layouts.cpp |
178 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_layouts.h |
179 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_metadata.cpp |
180 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_metadata.h |
181 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_types.cpp |
182 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_types.h |
183 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_types.tcc |
184 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_types_custom_protocol.h |
185 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_visit_union.h |
186 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_visitation.h) |
187 |
+- |
188 |
+-add_custom_command( |
189 |
+- OUTPUT ${FROZEN_THRIFT_SRC} |
190 |
+- COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift |
191 |
+- COMMAND |
192 |
+- cp ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/thrift/frozen.thrift |
193 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/ |
194 |
+- COMMAND cd ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift && |
195 |
+- ${CMAKE_CURRENT_BINARY_DIR}/bin/thrift1 --gen mstch_cpp2 frozen.thrift |
196 |
+- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bin/thrift1 |
197 |
+- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/thrift/frozen.thrift) |
198 |
+- |
199 |
+-add_custom_command( |
200 |
+- OUTPUT ${METADATA_THRIFT_SRC} |
201 |
+- COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs |
202 |
+- COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/thrift/metadata.thrift |
203 |
+- thrift/dwarfs/metadata.thrift |
204 |
+- COMMAND |
205 |
+- cd ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs && |
206 |
+- ${CMAKE_CURRENT_BINARY_DIR}/bin/thrift1 --gen mstch_cpp2:frozen2 |
207 |
+- metadata.thrift |
208 |
+- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bin/thrift1 |
209 |
+- ${CMAKE_CURRENT_SOURCE_DIR}/thrift/metadata.thrift) |
210 |
+- |
211 |
+-list( |
212 |
+- APPEND |
213 |
+ INCLUDE_DIRS |
214 |
+- ${CMAKE_CURRENT_BINARY_DIR}/folly |
215 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift |
216 |
+- ${CMAKE_CURRENT_SOURCE_DIR}/folly |
217 |
+- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift |
218 |
+ ${CMAKE_CURRENT_BINARY_DIR}) |
219 |
+ |
220 |
+ if(NOT (ZSTD_FOUND AND PREFER_SYSTEM_ZSTD)) |
221 |
+@@ -445,39 +382,6 @@ |
222 |
+ list(APPEND INCLUDE_DIRS ${Jemalloc_INCLUDE_DIRS}) |
223 |
+ endif() |
224 |
+ |
225 |
+-add_library( |
226 |
+- thrift_light |
227 |
+- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/FieldRef.cpp |
228 |
+- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/protocol/CompactProtocol.cpp |
229 |
+- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/protocol/BinaryProtocol.cpp |
230 |
+- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/protocol/DebugProtocol.cpp |
231 |
+- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/protocol/JSONProtocolCommon.cpp |
232 |
+- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/protocol/JSONProtocol.cpp |
233 |
+- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp/protocol/TProtocolException.cpp |
234 |
+- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp/util/VarintUtils.cpp |
235 |
+- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/gen/module_types_cpp.cpp |
236 |
+- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/frozen/Frozen.cpp |
237 |
+- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/frozen/FrozenUtil.cpp |
238 |
+- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/frozen/schema/MemorySchema.cpp |
239 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_data.cpp |
240 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_types.cpp) |
241 |
+- |
242 |
+-set_property(TARGET thrift_light PROPERTY CXX_STANDARD 17) |
243 |
+- |
244 |
+-target_include_directories(thrift_light PRIVATE ${INCLUDE_DIRS}) |
245 |
+- |
246 |
+-add_library( |
247 |
+- metadata_thrift |
248 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_layouts.cpp |
249 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_types.cpp |
250 |
+- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_data.cpp) |
251 |
+- |
252 |
+-set_property(TARGET metadata_thrift PROPERTY CXX_STANDARD 17) |
253 |
+- |
254 |
+-target_include_directories(metadata_thrift PRIVATE ${INCLUDE_DIRS}) |
255 |
+- |
256 |
+-add_dependencies(metadata_thrift thrift_light) |
257 |
+- |
258 |
+ foreach(tgt dwarfs ${BINARY_TARGETS}) |
259 |
+ target_include_directories( |
260 |
+ ${tgt} SYSTEM |
261 |
+@@ -501,8 +405,6 @@ |
262 |
+ set_property(TARGET ${tgt} PROPERTY CXX_STANDARD_REQUIRED ON) |
263 |
+ set_property(TARGET ${tgt} PROPERTY CXX_EXTENSIONS OFF) |
264 |
+ |
265 |
+- add_dependencies(${tgt} metadata_thrift) |
266 |
+- |
267 |
+ if(ENABLE_ASAN) |
268 |
+ target_compile_options(${tgt} PRIVATE -fsanitize=address |
269 |
+ -fno-omit-frame-pointer) |
270 |
+@@ -550,9 +452,6 @@ |
271 |
+ |
272 |
+ target_link_libraries( |
273 |
+ dwarfs |
274 |
+- metadata_thrift |
275 |
+- thrift_light |
276 |
+- folly |
277 |
+ fsst |
278 |
+ ${Boost_LIBRARIES} |
279 |
+ PkgConfig::LIBARCHIVE |
280 |
+@@ -582,11 +481,6 @@ |
281 |
+ if(USE_JEMALLOC) |
282 |
+ target_link_libraries(${tgt} ${Jemalloc_LIBRARIES}) |
283 |
+ endif() |
284 |
+- if(TARGET folly_exception_tracer) |
285 |
+- target_link_libraries( |
286 |
+- ${tgt} -Wl,--whole-archive folly_exception_tracer_base |
287 |
+- folly_exception_tracer -Wl,--no-whole-archive) |
288 |
+- endif() |
289 |
+ endforeach() |
290 |
+ |
291 |
+ if(STATIC_BUILD_DO_NOT_USE) |