Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/csnappy/, app-arch/csnappy/files/
Date: Sat, 04 Jun 2022 00:06:16
Message-Id: 1654301140.398e57296b87407d2587a5237d3b8fd2ed7b2565.sam@gentoo
1 commit: 398e57296b87407d2587a5237d3b8fd2ed7b2565
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jun 3 23:08:50 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Jun 4 00:05:40 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=398e5729
7
8 app-arch/csnappy: new package, add 0_pre20220804
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 app-arch/csnappy/Manifest | 1 +
13 app-arch/csnappy/csnappy-0_pre20220804.ebuild | 44 ++++++++++++++++++++++
14 .../files/csnappy-0_pre20220804-fix-tests.patch | 41 ++++++++++++++++++++
15 app-arch/csnappy/metadata.xml | 11 ++++++
16 4 files changed, 97 insertions(+)
17
18 diff --git a/app-arch/csnappy/Manifest b/app-arch/csnappy/Manifest
19 new file mode 100644
20 index 000000000000..c2e159458d59
21 --- /dev/null
22 +++ b/app-arch/csnappy/Manifest
23 @@ -0,0 +1 @@
24 +DIST csnappy-0_pre20220804.tar.gz 594988 BLAKE2B ce82ef7945ba3110d0d2878d4fcd3d48631f260dad94c1b40f7811de17e60568b2934d33e43966f559b0d840f5eed659bde84eab46954679754e9de5306508a1 SHA512 53f602c58a3a9932ac580412d90f3aa7f820cb9bbc9e2dec240dd28de55210fd17ac61a5f8e4a2cebffe2914837c7cabba1061536abd96e35da57c799e8ee7b7
25
26 diff --git a/app-arch/csnappy/csnappy-0_pre20220804.ebuild b/app-arch/csnappy/csnappy-0_pre20220804.ebuild
27 new file mode 100644
28 index 000000000000..447ace6deab0
29 --- /dev/null
30 +++ b/app-arch/csnappy/csnappy-0_pre20220804.ebuild
31 @@ -0,0 +1,44 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +inherit toolchain-funcs
38 +
39 +MY_COMMIT="6c10c305e8dde193546e6b33cf8a785d5dc123e2"
40 +
41 +DESCRIPTION="Google snappy in C for Linux Kernel"
42 +HOMEPAGE="https://github.com/zeevt/csnappy"
43 +SRC_URI="https://github.com/zeevt/csnappy/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz"
44 +S="${WORKDIR}"/${PN}-${MY_COMMIT}
45 +
46 +# https://github.com/zeevt/csnappy/issues/21
47 +LICENSE="BSD"
48 +# 0/${PV} b/c of the SONAME situation (see below).
49 +SLOT="0/${PV}"
50 +KEYWORDS="~amd64"
51 +
52 +# https://github.com/zeevt/csnappy/issues/33
53 +# No SONAME yet.
54 +QA_SONAME="usr/lib.*/libcsnappy.so"
55 +
56 +PATCHES=(
57 + "${FILESDIR}"/${PN}-0_pre20220804-fix-tests.patch
58 +)
59 +
60 +src_compile() {
61 + emake CC="$(tc-getCC)" OPT_FLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
62 + libcsnappy.so
63 +}
64 +
65 +src_test() {
66 + # We don't want to run the Valgrind tests as it's fragile in sandbox
67 + # and makes life harder for some arches.
68 + emake CC="$(tc-getCC)" OPT_FLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
69 + check_unaligned_uint64 \
70 + cl_test
71 +}
72 +
73 +src_install() {
74 + emake DESTDIR="${ED}" LIBDIR="/usr/$(get_libdir)" install
75 +}
76
77 diff --git a/app-arch/csnappy/files/csnappy-0_pre20220804-fix-tests.patch b/app-arch/csnappy/files/csnappy-0_pre20220804-fix-tests.patch
78 new file mode 100644
79 index 000000000000..e4d11f7d9021
80 --- /dev/null
81 +++ b/app-arch/csnappy/files/csnappy-0_pre20220804-fix-tests.patch
82 @@ -0,0 +1,41 @@
83 +https://github.com/zeevt/csnappy/pull/40
84 +
85 +From 60ac30054eae4bbc50f90f8228ac53d014400619 Mon Sep 17 00:00:00 2001
86 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@××××××.com>
87 +Date: Thu, 16 Dec 2021 14:24:26 +0100
88 +Subject: [PATCH] Fix parallel tests by only testing the current optimization
89 + level
90 +
91 +https://github.com/zeevt/csnappy/issues/39
92 +--- a/Makefile
93 ++++ b/Makefile
94 +@@ -34,25 +34,14 @@ check_leaks: cl_tester
95 + LD_LIBRARY_PATH=. valgrind --leak-check=full --show-reachable=yes ./cl_tester -c <testdata/urls.10K >/dev/null
96 + LD_LIBRARY_PATH=. valgrind --leak-check=full --show-reachable=yes ./cl_tester -S d
97 +
98 +-check_unaligned_uint64:
99 ++check_unaligned_uint64: cl_tester
100 + gzip -dc <testdata/unaligned_uint64_test.snappy.gz >testdata/unaligned_uint64_test.snappy
101 + gzip -dc <testdata/unaligned_uint64_test.bin.gz >testdata/unaligned_uint64_test.bin
102 +- EXTRA_TEST_CFLAGS="-O0" make check_unaligned_uint64_extra_cflags
103 +- EXTRA_TEST_CFLAGS="-O1" make check_unaligned_uint64_extra_cflags
104 +- EXTRA_TEST_CFLAGS="-O2" make check_unaligned_uint64_extra_cflags
105 +- EXTRA_TEST_CFLAGS="-O3" make check_unaligned_uint64_extra_cflags
106 +- EXTRA_TEST_CFLAGS="-O2 -march=native" make check_unaligned_uint64_extra_cflags
107 +- EXTRA_TEST_CFLAGS="-O3 -march=native" make check_unaligned_uint64_extra_cflags
108 +- rm -f testdata/unaligned_uint64_test.snappy testdata/unaligned_uint64_test.bin
109 +-
110 +-check_unaligned_uint64_extra_cflags:
111 +- make clean
112 +- make cl_tester
113 + rm -f tmp
114 + LD_LIBRARY_PATH=. ./cl_tester -d testdata/unaligned_uint64_test.snappy tmp
115 +- diff testdata/unaligned_uint64_test.bin tmp >/dev/null && echo "${EXTRA_TEST_CFLAGS} ok"
116 +- make clean
117 ++ diff testdata/unaligned_uint64_test.bin tmp >/dev/null && echo "Unaligned test is ok"
118 + rm -f tmp
119 ++ rm -f testdata/unaligned_uint64_test.snappy testdata/unaligned_uint64_test.bin
120 +
121 + libcsnappy.so: csnappy_compress.c csnappy_decompress.c csnappy_internal.h csnappy_internal_userspace.h
122 + $(CC) $(CFLAGS) $(EXTRA_TEST_CFLAGS) -fPIC -DPIC -c -o csnappy_compress.o csnappy_compress.c
123 +
124
125 diff --git a/app-arch/csnappy/metadata.xml b/app-arch/csnappy/metadata.xml
126 new file mode 100644
127 index 000000000000..d377f25e89c3
128 --- /dev/null
129 +++ b/app-arch/csnappy/metadata.xml
130 @@ -0,0 +1,11 @@
131 +<?xml version="1.0" encoding="UTF-8"?>
132 +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
133 +<pkgmetadata>
134 + <maintainer type="person">
135 + <email>sam@g.o</email>
136 + <name>Sam James</name>
137 + </maintainer>
138 + <upstream>
139 + <remote-id type="github">zeevt/csnappy</remote-id>
140 + </upstream>
141 +</pkgmetadata>