Gentoo Archives: gentoo-commits

From: Alessandro Barbieri <lssndrbarbieri@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: sys-fs/dwarfs/, sys-fs/dwarfs/files/
Date: Sun, 02 May 2021 01:51:11
Message-Id: 1619920265.7f85b03b40d50a70620210159852030bb82eb3de.Alessandro-Barbieri@gentoo
1 commit: 7f85b03b40d50a70620210159852030bb82eb3de
2 Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
3 AuthorDate: Sun May 2 01:49:27 2021 +0000
4 Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
5 CommitDate: Sun May 2 01:51:05 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=7f85b03b
7
8 sys-fs/dwarfs: unbundling WIP
9
10 Package-Manager: Portage-3.0.18, Repoman-3.0.3
11 Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>
12
13 sys-fs/dwarfs/dwarfs-0.5.4-r3.ebuild | 8 +-
14 sys-fs/dwarfs/files/unbundle.patch | 177 +++++++++++++++++++++++++++++++++++
15 2 files changed, 182 insertions(+), 3 deletions(-)
16
17 diff --git a/sys-fs/dwarfs/dwarfs-0.5.4-r3.ebuild b/sys-fs/dwarfs/dwarfs-0.5.4-r3.ebuild
18 index 8c35e1298..0de8a6544 100644
19 --- a/sys-fs/dwarfs/dwarfs-0.5.4-r3.ebuild
20 +++ b/sys-fs/dwarfs/dwarfs-0.5.4-r3.ebuild
21 @@ -14,13 +14,13 @@ SRC_URI="https://github.com/mhx/dwarfs/releases/download/v${PV}/${P}.tar.bz2"
22
23 LICENSE="GPL-3"
24 SLOT="0"
25 -KEYWORDS=""
26 +KEYWORDS="~amd64"
27
28 IUSE="python +jemalloc test"
29 RESTRICT="!test? ( test )"
30 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
31
32 -PATCHES=( "${WORKDIR}/unbundle-folly-fbthrift.patch" )
33 +PATCHES=( "${FILESDIR}/unbundle.patch" )
34 #TODO: unbundle libfsst
35
36 RDEPEND="
37 @@ -34,6 +34,7 @@ RDEPEND="
38 dev-cpp/folly:=
39 dev-cpp/gflags
40 dev-cpp/glog[gflags]
41 + dev-cpp/parallel-hashmap:=
42 dev-cpp/sparsehash
43 dev-libs/boost[context,threads,python?]
44 dev-libs/double-conversion
45 @@ -68,13 +69,14 @@ CMAKE_IN_SOURCE_BUILD=1
46 CMAKE_WARN_UNUSED_CLI=0
47
48 src_prepare(){
49 + rm -r fsst zstd fbthrift folly xxHash parallel-hashmap || die
50 cmake_src_prepare
51 einfo "setting library path to $(get_libdir)"
52 sed "s/DESTINATION lib/DESTINATION $(get_libdir)/" -i CMakeLists.txt || die
53 }
54
55 src_configure(){
56 - append-cxxflag "-I/usr/include/folly"
57 + append-cxxflags "-I/usr/include"
58
59 einfo "setting configuration flags to:"
60 mycmakeargs=(
61
62 diff --git a/sys-fs/dwarfs/files/unbundle.patch b/sys-fs/dwarfs/files/unbundle.patch
63 new file mode 100644
64 index 000000000..ad9588c54
65 --- /dev/null
66 +++ b/sys-fs/dwarfs/files/unbundle.patch
67 @@ -0,0 +1,177 @@
68 +--- a/CMakeLists.txt
69 ++++ b/CMakeLists.txt
70 +@@ -142,8 +142,6 @@
71 + ON
72 + CACHE BOOL "only build thrift compiler")
73 +
74 +-add_subdirectory(folly EXCLUDE_FROM_ALL)
75 +-add_subdirectory(fbthrift EXCLUDE_FROM_ALL)
76 + if(NOT (ZSTD_FOUND AND PREFER_SYSTEM_ZSTD))
77 + add_subdirectory(zstd/build/cmake EXCLUDE_FROM_ALL)
78 + endif()
79 +@@ -298,7 +296,6 @@
80 + if(WITH_TESTS OR WITH_BENCHMARKS)
81 + add_library(test_helpers test/test_helpers.cpp test/test_strings.cpp
82 + test/loremipsum.cpp)
83 +- target_link_libraries(test_helpers dwarfs folly)
84 + set_property(TARGET test_helpers PROPERTY CXX_STANDARD 17)
85 + endif()
86 +
87 +@@ -364,70 +361,7 @@
88 +
89 + list(
90 + APPEND
91 +- FROZEN_THRIFT_SRC
92 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_data.h
93 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_data.cpp
94 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_types.h
95 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_types.tcc
96 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_types.cpp
97 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_types_custom_protocol.h
98 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_constants.h
99 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_constants.cpp
100 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_metadata.h
101 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_metadata.cpp
102 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_visitation.h
103 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_for_each_field.h
104 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_visit_union.h)
105 +-
106 +-list(
107 +- APPEND
108 +- METADATA_THRIFT_SRC
109 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_constants.cpp
110 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_constants.h
111 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_data.cpp
112 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_data.h
113 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_for_each_field.h
114 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_layouts.cpp
115 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_layouts.h
116 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_metadata.cpp
117 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_metadata.h
118 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_types.cpp
119 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_types.h
120 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_types.tcc
121 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_types_custom_protocol.h
122 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_visit_union.h
123 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_visitation.h)
124 +-
125 +-add_custom_command(
126 +- OUTPUT ${FROZEN_THRIFT_SRC}
127 +- COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift
128 +- COMMAND
129 +- cp ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/thrift/frozen.thrift
130 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/
131 +- COMMAND cd ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift &&
132 +- ${CMAKE_CURRENT_BINARY_DIR}/bin/thrift1 --gen mstch_cpp2 frozen.thrift
133 +- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bin/thrift1
134 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/thrift/frozen.thrift)
135 +-
136 +-add_custom_command(
137 +- OUTPUT ${METADATA_THRIFT_SRC}
138 +- COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs
139 +- COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/thrift/metadata.thrift
140 +- thrift/dwarfs/metadata.thrift
141 +- COMMAND
142 +- cd ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs &&
143 +- ${CMAKE_CURRENT_BINARY_DIR}/bin/thrift1 --gen mstch_cpp2:frozen2
144 +- metadata.thrift
145 +- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bin/thrift1
146 +- ${CMAKE_CURRENT_SOURCE_DIR}/thrift/metadata.thrift)
147 +-
148 +-list(
149 +- APPEND
150 + INCLUDE_DIRS
151 +- ${CMAKE_CURRENT_BINARY_DIR}/folly
152 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift
153 +- ${CMAKE_CURRENT_SOURCE_DIR}/folly
154 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift
155 + ${CMAKE_CURRENT_BINARY_DIR})
156 +
157 + if(NOT (ZSTD_FOUND AND PREFER_SYSTEM_ZSTD))
158 +@@ -445,39 +379,6 @@
159 + list(APPEND INCLUDE_DIRS ${Jemalloc_INCLUDE_DIRS})
160 + endif()
161 +
162 +-add_library(
163 +- thrift_light
164 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/FieldRef.cpp
165 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/protocol/CompactProtocol.cpp
166 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/protocol/BinaryProtocol.cpp
167 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/protocol/DebugProtocol.cpp
168 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/protocol/JSONProtocolCommon.cpp
169 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/protocol/JSONProtocol.cpp
170 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp/protocol/TProtocolException.cpp
171 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp/util/VarintUtils.cpp
172 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/gen/module_types_cpp.cpp
173 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/frozen/Frozen.cpp
174 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/frozen/FrozenUtil.cpp
175 +- ${CMAKE_CURRENT_SOURCE_DIR}/fbthrift/thrift/lib/cpp2/frozen/schema/MemorySchema.cpp
176 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_data.cpp
177 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/thrift/gen-cpp2/frozen_types.cpp)
178 +-
179 +-set_property(TARGET thrift_light PROPERTY CXX_STANDARD 17)
180 +-
181 +-target_include_directories(thrift_light PRIVATE ${INCLUDE_DIRS})
182 +-
183 +-add_library(
184 +- metadata_thrift
185 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_layouts.cpp
186 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_types.cpp
187 +- ${CMAKE_CURRENT_BINARY_DIR}/thrift/dwarfs/gen-cpp2/metadata_data.cpp)
188 +-
189 +-set_property(TARGET metadata_thrift PROPERTY CXX_STANDARD 17)
190 +-
191 +-target_include_directories(metadata_thrift PRIVATE ${INCLUDE_DIRS})
192 +-
193 +-add_dependencies(metadata_thrift thrift_light)
194 +-
195 + foreach(tgt dwarfs ${BINARY_TARGETS})
196 + target_include_directories(
197 + ${tgt} SYSTEM
198 +@@ -501,8 +402,6 @@
199 + set_property(TARGET ${tgt} PROPERTY CXX_STANDARD_REQUIRED ON)
200 + set_property(TARGET ${tgt} PROPERTY CXX_EXTENSIONS OFF)
201 +
202 +- add_dependencies(${tgt} metadata_thrift)
203 +-
204 + if(ENABLE_ASAN)
205 + target_compile_options(${tgt} PRIVATE -fsanitize=address
206 + -fno-omit-frame-pointer)
207 +@@ -535,25 +434,8 @@
208 + endif()
209 + endforeach()
210 +
211 +-# not sure why exactly, copied from fsst/CMakeLists.txt
212 +-if(CMAKE_BUILD_TYPE STREQUAL Release)
213 +- set_source_files_properties(fsst/fsst_avx512.cpp PROPERTIES COMPILE_FLAGS -O1)
214 +-endif()
215 +-
216 +-add_library(
217 +- fsst
218 +- fsst/libfsst.cpp fsst/fsst_avx512.cpp fsst/fsst_avx512_unroll1.inc
219 +- fsst/fsst_avx512_unroll2.inc fsst/fsst_avx512_unroll3.inc
220 +- fsst/fsst_avx512_unroll4.inc)
221 +-
222 +-target_include_directories(dwarfs PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/fsst)
223 +-
224 + target_link_libraries(
225 + dwarfs
226 +- metadata_thrift
227 +- thrift_light
228 +- folly
229 +- fsst
230 + ${Boost_LIBRARIES}
231 + PkgConfig::LIBARCHIVE
232 + PkgConfig::LIBLZ4
233 +@@ -582,11 +464,6 @@
234 + if(USE_JEMALLOC)
235 + target_link_libraries(${tgt} ${Jemalloc_LIBRARIES})
236 + endif()
237 +- if(TARGET folly_exception_tracer)
238 +- target_link_libraries(
239 +- ${tgt} -Wl,--whole-archive folly_exception_tracer_base
240 +- folly_exception_tracer -Wl,--no-whole-archive)
241 +- endif()
242 + endforeach()
243 +
244 + if(STATIC_BUILD_DO_NOT_USE)