summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/7zip/bit7z_4.0.9.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-extended/7zip/bit7z_4.0.9.bb')
-rw-r--r--meta-oe/recipes-extended/7zip/bit7z_4.0.9.bb88
1 files changed, 88 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/7zip/bit7z_4.0.9.bb b/meta-oe/recipes-extended/7zip/bit7z_4.0.9.bb
new file mode 100644
index 0000000000..033461d614
--- /dev/null
+++ b/meta-oe/recipes-extended/7zip/bit7z_4.0.9.bb
@@ -0,0 +1,88 @@
1SUMMARY = "A C++ static library offering a clean and simple interface to the 7-Zip shared libraries"
2HOMEPAGE = "https://github.com/rikyoz/bit7z"
3LICENSE = "MPL-2.0"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=48a3fe23ed1353e0995dadfda05ffdb6"
5
6SRC_URI = " \
7 git://github.com/rikyoz/bit7z.git;protocol=https;branch=master \
8 ${@bb.utils.contains('PTEST_ENABLED', '1', d.getVar('SRC_URI_PTEST'), 'file://0001-cmake-disable-dependency-inclusion.patch', d)} \
9 file://0001-Fix-reinterpret-cast-compiler-errors.patch \
10 file://0001-Fix-int8_t-storage-in-BitPropVariant-on-Arm-architec.patch \
11 file://0001-Allow-running-tests-on-target-when-cross-compiling.patch \
12 file://0001-Allow-specifying-path-to-7z-library-in-tests.patch \
13 file://0001-Fix-tests-with-musl.patch \
14"
15
16SRCREV = "386e00ad3286e7a10e5bb6d05a5b41b523fce623"
17
18# ptest dependencies and their revisions
19SRC_URI_PTEST = " \
20 git://github.com/rikyoz/filesystem.git;protocol=https;branch=glibcxx_wchar_streams_workaround;name=filesystem;destsuffix=filesystem \
21 git://github.com/rikyoz/bit7z-test-data.git;protocol=https;branch=main;name=testdata;destsuffix=testdata \
22 git://github.com/catchorg/Catch2.git;protocol=https;branch=v2.x;name=catch2;destsuffix=catch2;tag=${TAG_catch2} \
23 https://github.com/cpm-cmake/CPM.cmake/releases/download/v${TAG_CPM}/CPM.cmake;downloadfilename=CPM_${TAG_CPM}.cmake \
24 file://run-ptest \
25"
26SRCREV_FORMAT = "${@bb.utils.contains('PTEST_ENABLED', '1', 'default_filesystem_testdata_catch2', 'default', d)}"
27SRCREV_filesystem = "983650f374699e3979f9cdefe13ddff60bd4ac68"
28SRCREV_testdata = "077e407b1c07b7443626b5902eeb4819388bf656"
29SRCREV_catch2 = "182c910b4b63ff587a3440e08f84f70497e49a81"
30TAG_catch2 = "v2.13.10"
31SRCHASH_CPM = "c8cdc32c03816538ce22781ed72964dc864b2a34a310d3b7104812a5ca2d835d"
32TAG_CPM = "0.40.2"
33SRC_URI[sha256sum] = "${SRCHASH_CPM}"
34
35
36inherit cmake ptest
37
38DEPENDS = "7zip"
39
40EXTRA_OECMAKE += "-DBIT7Z_CUSTOM_7ZIP_PATH=${STAGING_INCDIR}/7zip"
41
42PACKAGECONFIG ??= "${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}"
43PACKAGECONFIG[tests] = " \
44 -DBIT7Z_BUILD_TESTS=ON -DBIT7Z_DISABLE_USE_STD_FILESYSTEM=ON \
45 -DBIT7Z_TESTS_USE_SYSTEM_7ZIP=OFF -DBIT7Z_TESTS_7Z_LIBRARY_PATH=${libdir}/lib7z.so \
46 -DBIT7Z_TESTS_DATA_DIR_TARGET=${PTEST_PATH}/data \
47 -DCPM_SOURCE_CACHE=${B}/cpm_cache -DFETCHCONTENT_SOURCE_DIR_BIT7Z-TEST-DATA=${UNPACKDIR}/testdata -DFETCHCONTENT_SOURCE_DIR_CATCH2=${B}/catch2 \
48"
49
50do_configure:prepend() {
51 # verify that all dependencies have correct version
52 grep -q ${SRCREV_filesystem} ${S}/cmake/Dependencies.cmake || bbfatal "ERROR: dependency version mismatch, please update 'SRCREV_filesystem'!"
53 grep -q ${SRCREV_testdata} ${S}/tests/CMakeLists.txt || bbfatal "ERROR: dependency version mismatch, please update 'SRCREV_testdata'!"
54 grep -q ${TAG_catch2} ${S}/tests/cmake/Catch2.cmake || bbfatal "ERROR: dependency version mismatch, please update 'SRCREV_catch2'!"
55 grep -q ${SRCHASH_CPM} ${S}/cmake/Dependencies.cmake || bbfatal "ERROR: dependency version mismatch, please update 'SRCHASH_CPM'!"
56
57 if ${@bb.utils.contains('PTEST_ENABLED', '1', 'true', 'false', d)}; then
58 # use cache instead of download for CPM (CMake's missing package manager)
59 mkdir -p ${B}/cmake
60 cp ${UNPACKDIR}/CPM_${TAG_CPM}.cmake ${B}/cmake
61 mkdir -p ${B}/cpm_cache/ghc_filesystem
62 cp -r ${UNPACKDIR}/filesystem ${B}/cpm_cache/ghc_filesystem/fbcc9a9e94e6365273cf51294173f21ff5efdb4f
63 # avoid buildpaths issue as unpackdir is not in prefix maps
64 cp -r ${UNPACKDIR}/catch2 ${B}
65 fi
66}
67do_configure[cleandirs] += "${B}"
68
69do_install() {
70 install -d ${D}${libdir}
71 install -m 0644 ${S}/lib/*/*.a ${D}${libdir}
72
73 install -d ${D}${includedir}/${BPN}
74 install -m 0644 ${S}/include/${BPN}/*.hpp ${D}${includedir}/${BPN}
75}
76
77do_install_ptest() {
78 install -m 0755 ${S}/bin/*/* ${D}${PTEST_PATH}
79 install -d ${D}${PTEST_PATH}/data
80 cp -r ${UNPACKDIR}/testdata/test_archives ${UNPACKDIR}/testdata/test_filesystem ${B}/tests/data/test_filesystem ${D}${PTEST_PATH}/data
81}
82
83# this package contains static library so main package is empty, but ptest package rdepends on it
84ALLOW_EMPTY:${PN} = "1"
85# these are loaded via dlopen, so need explicit rdepends
86RDEPENDS:${PN}-ptest += "libstdc++ 7zip"
87# test data contains various file types with different architectures
88INSANE_SKIP:${PN}-ptest += "arch"