Gentoo Archives: gentoo-commits

From: Denis Reva <denis7774@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: sys-fs/dwarfs/files/, sys-fs/dwarfs/
Date: Tue, 28 Feb 2023 12:58:05
Message-Id: 1677589076.253b9fd4d798d3f817b4d9f735cff0580202375a.RarogCmex@gentoo
1 commit: 253b9fd4d798d3f817b4d9f735cff0580202375a
2 Author: Denis Reva <denis7774 <AT> gmail <DOT> com>
3 AuthorDate: Tue Feb 28 12:53:52 2023 +0000
4 Commit: Denis Reva <denis7774 <AT> gmail <DOT> com>
5 CommitDate: Tue Feb 28 12:57:56 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=253b9fd4
7
8 dwarfs: unorphaned, work in progress
9
10 Signed-off-by: Denis Reva <denis7774 <AT> gmail.com>
11
12 sys-fs/dwarfs/Manifest | 1 +
13 sys-fs/dwarfs/dwarfs-0.7.0_rc4.ebuild | 103 +++++++++++++
14 .../dwarfs/files/dwarfs-0.7.0_rc4-unbundle.patch | 161 +++++++++++++++++++++
15 sys-fs/dwarfs/metadata.xml | 24 +++
16 4 files changed, 289 insertions(+)
17
18 diff --git a/sys-fs/dwarfs/Manifest b/sys-fs/dwarfs/Manifest
19 new file mode 100644
20 index 000000000..f6a1d88fe
21 --- /dev/null
22 +++ b/sys-fs/dwarfs/Manifest
23 @@ -0,0 +1 @@
24 +DIST dwarfs-0.7.0-RC4.tar.xz 14425176 BLAKE2B fdb2852da81f8d567c19dc83e3f7dd74e0de35e56579d50b6ce9ee6adda2d540bbbc7d5655a499f19ee340a2f904bfe9b2b977b9539e8e99dc9e8667b9b7435e SHA512 1e0d603507f93b6bcb79050877de0ac64eed931b192b43466d3b5e1ee55a759261ad937d33f24d145a61e8b3d431405a35bbd8ff95ead10ccdabe14ba4d840a5
25
26 diff --git a/sys-fs/dwarfs/dwarfs-0.7.0_rc4.ebuild b/sys-fs/dwarfs/dwarfs-0.7.0_rc4.ebuild
27 new file mode 100644
28 index 000000000..d1a86ea98
29 --- /dev/null
30 +++ b/sys-fs/dwarfs/dwarfs-0.7.0_rc4.ebuild
31 @@ -0,0 +1,103 @@
32 +# Copyright 1999-2021 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +PYTHON_COMPAT=( python3_{10..11} )
38 +
39 +inherit check-reqs cmake flag-o-matic python-single-r1
40 +
41 +MY_P="${P/_rc/-RC}"
42 +
43 +DESCRIPTION="A fast very high compression read-only FUSE file system"
44 +HOMEPAGE="https://github.com/mhx/dwarfs"
45 +SRC_URI="https://github.com/mhx/dwarfs/releases/download/v0.7.0-RC4/dwarfs-0.7.0-RC4.tar.xz" #TODO: change to ${PV}
46 +
47 +LICENSE="GPL-3"
48 +SLOT="0"
49 +KEYWORDS=""
50 +IUSE="python +jemalloc test man"
51 +S="${WORKDIR}/${MY_P}"
52 +
53 +RDEPEND="
54 + ${PYTHON_DEPS}
55 + app-arch/libarchive
56 + app-arch/lz4
57 + app-arch/snappy
58 + app-arch/xz-utils
59 + app-arch/zstd
60 + dev-cpp/fbthrift:=
61 + dev-cpp/folly:=
62 + dev-cpp/gflags
63 + dev-cpp/glog[gflags]
64 + dev-cpp/parallel-hashmap:=
65 + dev-cpp/sparsehash
66 + dev-libs/boost[context,threads(+),python?]
67 + dev-libs/double-conversion
68 + dev-libs/fsst:=
69 + dev-libs/libevent
70 + dev-libs/libfmt
71 + dev-libs/xxhash
72 + sys-fs/fuse:3
73 + sys-libs/binutils-libs
74 + sys-libs/libunwind
75 + sys-libs/zlib
76 +
77 + jemalloc? ( >=dev-libs/jemalloc-5.3.0-r1 )
78 +"
79 +DEPEND="
80 + ${RDEPEND}
81 + sys-devel/flex
82 + !sys-fs/dwarfs-bin
83 +"
84 +BDEPEND="
85 + man? ( || ( app-text/ronn app-text/ronn-ng ) )
86 + sys-devel/bison
87 + virtual/pkgconfig
88 +
89 + test? ( dev-cpp/gtest )
90 +"
91 +
92 +DOCS=( "README.md" "CHANGES.md" "TODO" )
93 +RESTRICT="!test? ( test )"
94 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
95 +PATCHES=( "${FILESDIR}/${P}-unbundle.patch" )
96 +
97 +CHECKREQS_DISK_BUILD="1300M"
98 +CMAKE_IN_SOURCE_BUILD=1
99 +CMAKE_WARN_UNUSED_CLI=0
100 +
101 +src_prepare(){
102 + rm -r fsst zstd fbthrift/* folly xxHash parallel-hashmap || die
103 + cmake_src_prepare
104 + sed "s/DESTINATION lib/DESTINATION $(get_libdir)/" -i CMakeLists.txt || die
105 +}
106 +
107 +src_configure(){
108 + append-cxxflags "-I/usr/include"
109 +
110 + mycmakeargs=(
111 + -DUSE_JEMALLOC=$(usex jemalloc ON OFF)
112 + -DWITH_PYTHON=$(usex python ON OFF)
113 + -DWITH_TESTS=$(usex test ON OFF)
114 + -WITH_MAN_PAGES=$(usex man ON OFF)
115 + -DPREFER_SYSTEM_ZSTD=1
116 + -DPREFER_SYSTEM_XXHASH=1
117 + -DPREFER_SYSTEM_GTEST=1
118 + -DWITH_LEGACY_FUSE=0
119 + )
120 + use python && mycmakeargs+=( "-DWITH_PYTHON_VERSION=${EPYTHON#python}" )
121 + cmake_src_configure
122 +}
123 +
124 +src_install(){
125 + cmake_src_install
126 + dolib.so libdwarfs.so
127 +}
128 +
129 +pkg_postinst(){
130 + elog "You may find more information in the"
131 + elog "${HOMEPAGE}"
132 + elog "About creating: ${HOMEPAGE}/blob/main/doc/mkdwarfs.md"
133 + elog "About mounting: ${HOMEPAGE}/blob/main/doc/dwarfs.md"
134 +}
135
136 diff --git a/sys-fs/dwarfs/files/dwarfs-0.7.0_rc4-unbundle.patch b/sys-fs/dwarfs/files/dwarfs-0.7.0_rc4-unbundle.patch
137 new file mode 100644
138 index 000000000..101af0dc6
139 --- /dev/null
140 +++ b/sys-fs/dwarfs/files/dwarfs-0.7.0_rc4-unbundle.patch
141 @@ -0,0 +1,161 @@
142 +--- a/CMakeLists.txt
143 ++++ b/CMakeLists.txt
144 +@@ -151,8 +151,6 @@
145 + ON
146 + CACHE BOOL "only build thrift compiler")
147 +
148 +-add_subdirectory(folly EXCLUDE_FROM_ALL)
149 +-add_subdirectory(fbthrift EXCLUDE_FROM_ALL)
150 + if(NOT (ZSTD_FOUND AND PREFER_SYSTEM_ZSTD))
151 + add_subdirectory(zstd/build/cmake EXCLUDE_FROM_ALL)
152 + endif()
153 +@@ -383,23 +381,6 @@
154 +
155 + list(
156 + APPEND
157 +- FROZEN_THRIFT_SRC
158 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_data.h
159 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_data.cpp
160 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_types.h
161 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_types.tcc
162 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_types.cpp
163 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_types_custom_protocol.h
164 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_constants.h
165 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_constants.cpp
166 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_metadata.h
167 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_metadata.cpp
168 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_visitation.h
169 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_for_each_field.h
170 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_visit_union.h)
171 +-
172 +-list(
173 +- APPEND
174 + METADATA_THRIFT_SRC
175 + ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_constants.cpp
176 + ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_constants.h
177 +@@ -418,35 +399,20 @@
178 + ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_visitation.h)
179 +
180 + add_custom_command(
181 +- OUTPUT ${FROZEN_THRIFT_SRC}
182 +- COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift
183 +- COMMAND
184 +- cp ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/thrift/frozen.thrift
185 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/
186 +- COMMAND cd ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift &&
187 +- ${CMAKE_CURRENT_BINARY_DIR}/bin/thrift1 --gen mstch_cpp2 frozen.thrift
188 +- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bin/thrift1
189 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/thrift/frozen.thrift)
190 +-
191 +-add_custom_command(
192 + OUTPUT ${METADATA_THRIFT_SRC}
193 + COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs
194 + COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/thrift/metadata.thrift
195 + thrift/dwarfs/metadata.thrift
196 + COMMAND
197 + cd ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs &&
198 +- ${CMAKE_CURRENT_BINARY_DIR}/bin/thrift1 --gen mstch_cpp2:frozen2
199 ++ thrift1 --gen mstch_cpp2:frozen2
200 + metadata.thrift
201 +- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bin/thrift1
202 +- ${CMAKE_CURRENT_SOURCE_DIR}/thrift/metadata.thrift)
203 ++ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/thrift/metadata.thrift)
204 +
205 + list(
206 + APPEND
207 + INCLUDE_DIRS
208 +- ${CMAKE_CURRENT_BINARY_DIR}/folly
209 + ${CMAKE_CURRENT_BINARY_DIR}/thrift
210 +- ${CMAKE_CURRENT_SOURCE_DIR}/folly
211 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift
212 + ${CMAKE_CURRENT_BINARY_DIR})
213 +
214 + if(NOT (ZSTD_FOUND AND PREFER_SYSTEM_ZSTD))
215 +@@ -472,43 +438,24 @@
216 + endif()
217 +
218 + add_library(
219 +- thrift_light
220 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/FieldRef.cpp
221 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/protocol/CompactProtocol.cpp
222 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/protocol/BinaryProtocol.cpp
223 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/protocol/DebugProtocol.cpp
224 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/protocol/JSONProtocolCommon.cpp
225 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/protocol/JSONProtocol.cpp
226 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp/protocol/TProtocolException.cpp
227 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp/util/VarintUtils.cpp
228 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/gen/module_types_cpp.cpp
229 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/frozen/Frozen.cpp
230 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/frozen/FrozenUtil.cpp
231 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/frozen/schema/MemorySchema.cpp
232 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_data.cpp
233 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_types.cpp)
234 +-
235 +-set_property(TARGET thrift_light PROPERTY CXX_STANDARD 17)
236 +-
237 +-target_include_directories(thrift_light PRIVATE ${INCLUDE_DIRS})
238 +-
239 +-add_library(
240 + metadata_thrift
241 ++ STATIC
242 + ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_layouts.cpp
243 + ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_types.cpp
244 + ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_data.cpp)
245 +
246 + set_property(TARGET metadata_thrift PROPERTY CXX_STANDARD 17)
247 +-
248 ++set_property(TARGET metadata_thrift PROPERTY POSITION_INDEPENDENT_CODE ON)
249 ++set_property(TARGET metadata_thrift PROPERTY CXX_VISIBILITY_PRESET hidden)
250 ++set_property(TARGET metadata_thrift PROPERTY VISIBILITY_INLINES_HIDDEN 1)
251 + target_include_directories(metadata_thrift PRIVATE ${INCLUDE_DIRS})
252 +-
253 +-add_dependencies(metadata_thrift thrift_light)
254 ++target_link_libraries(metadata_thrift fmt glog folly)
255 +
256 + foreach(tgt dwarfs ${BINARY_TARGETS})
257 + target_include_directories(
258 + ${tgt} SYSTEM
259 + PRIVATE ${Boost_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS} ${INCLUDE_DIRS}
260 +- ${CMAKE_CURRENT_SOURCE_DIR}/parallel-hashmap)
261 ++ )
262 +
263 + target_include_directories(${tgt} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
264 +
265 +@@ -565,23 +512,11 @@
266 + endif()
267 + endforeach()
268 +
269 +-# not sure why exactly, copied from fsst/CMakeLists.txt
270 +-if(CMAKE_BUILD_TYPE STREQUAL Release)
271 +- set_source_files_properties(fsst/fsst_avx512.cpp PROPERTIES COMPILE_FLAGS -O1)
272 +-endif()
273 +-
274 +-add_library(
275 +- fsst
276 +- fsst/libfsst.cpp fsst/fsst_avx512.cpp fsst/fsst_avx512_unroll1.inc
277 +- fsst/fsst_avx512_unroll2.inc fsst/fsst_avx512_unroll3.inc
278 +- fsst/fsst_avx512_unroll4.inc)
279 +-
280 +-target_include_directories(dwarfs PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/fsst)
281 +-
282 + target_link_libraries(
283 + dwarfs
284 ++ thriftprotocol
285 ++ thriftfrozen2
286 + metadata_thrift
287 +- thrift_light
288 + folly
289 + fsst
290 + ${Boost_LIBRARIES}
291 +@@ -612,11 +547,6 @@
292 + if(USE_JEMALLOC)
293 + target_link_libraries(${tgt} ${Jemalloc_LIBRARIES})
294 + endif()
295 +- if(DWARFS_USE_EXCEPTION_TRACER)
296 +- target_link_libraries(
297 +- ${tgt} -Wl,--whole-archive folly_exception_tracer_base
298 +- folly_exception_tracer -Wl,--no-whole-archive)
299 +- endif()
300 + endforeach()
301 +
302 + if(STATIC_BUILD_DO_NOT_USE)
303
304 diff --git a/sys-fs/dwarfs/metadata.xml b/sys-fs/dwarfs/metadata.xml
305 new file mode 100644
306 index 000000000..7d948c451
307 --- /dev/null
308 +++ b/sys-fs/dwarfs/metadata.xml
309 @@ -0,0 +1,24 @@
310 +<?xml version="1.0" encoding="UTF-8"?>
311 +<!DOCTYPE pkgmetadata SYSTEM 'http://www.gentoo.org/dtd/metadata.dtd'>
312 +<pkgmetadata>
313 + <maintainer type="person">
314 + <email>denis7774@×××××.com</email>
315 + <name>Denis Reva</name>
316 + <description>rarogcmex</description>
317 + </maintainer>
318 + <longdescription lang="en">
319 + DwarFS is a read-only file system with a focus on achieving very high compression ratios in particular for very redundant data.
320 + This probably doesn't sound very exciting, because if it's redundant, it should compress well. However, I found that other read-only, compressed file systems don't do a very good job at making use of this redundancy. See here for a comparison with other compressed file systems.
321 + DwarFS also doesn't compromise on speed and for my use cases I've found it to be on par with or perform better than SquashFS. For my primary use case, DwarFS compression is an order of magnitude better than SquashFS compression, it's 4 times faster to build the file system, it's typically faster to access files on DwarFS and it uses less CPU resources.
322 + Distinct features of DwarFS are:
323 + * Clustering of files by similarity using a similarity hash function. This makes it easier to exploit the redundancy across file boundaries.
324 + * Segmentation analysis across file system blocks in order to reduce the size of the uncompressed file system. This saves memory when using the compressed file system and thus potentially allows for higher cache hit rates as more data can be kept in the cache.
325 + * Highly multi-threaded implementation. Both the file system creation tool as well as the FUSE driver are able to make good use of the many cores of your system.
326 + * Optional experimental Lua support to provide custom filtering and ordering functionality.
327 + </longdescription>
328 + <upstream>
329 + <bugs-to>https://github.com/mhx/dwarfs/issues</bugs-to>
330 + <remote-id type="github">mhx/dwarfs</remote-id>
331 + </upstream>
332 +
333 +</pkgmetadata>