summaryrefslogtreecommitdiff
path: root/app-arch/csnappy
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
commit0f558761aa2dee1017b4751e4017205e015a9560 (patch)
tree037df795519468a25d9362b4e95cdaeb84eb1cf9 /app-arch/csnappy
parent752d6256e5204b958b0ef7905675a940b5e9172f (diff)
gentoo resync : 29.12.2022
Diffstat (limited to 'app-arch/csnappy')
-rw-r--r--app-arch/csnappy/Manifest4
-rw-r--r--app-arch/csnappy/csnappy-0_pre20220804.ebuild44
-rw-r--r--app-arch/csnappy/files/csnappy-0_pre20220804-fix-tests.patch41
-rw-r--r--app-arch/csnappy/metadata.xml11
4 files changed, 100 insertions, 0 deletions
diff --git a/app-arch/csnappy/Manifest b/app-arch/csnappy/Manifest
new file mode 100644
index 000000000000..2b5983a45357
--- /dev/null
+++ b/app-arch/csnappy/Manifest
@@ -0,0 +1,4 @@
+AUX csnappy-0_pre20220804-fix-tests.patch 2008 BLAKE2B 4d6715a5f22018635cf9d4ab59b059b62c5be9643ac7613cb1de4bacb85039072f53a989b2c7e39ec6733bf9e30fedf59544b1ba5a27c9025ec18eb6251e3aa8 SHA512 e6bd51d21ca9a8feb9ea128289572c1ccc35dc32ef13c36248337ca031685874dd76aff180ea7a8bd01869a5235c6ce2ec744aa54e4dd8c6c6fd09df6b668861
+DIST csnappy-0_pre20220804.tar.gz 594988 BLAKE2B ce82ef7945ba3110d0d2878d4fcd3d48631f260dad94c1b40f7811de17e60568b2934d33e43966f559b0d840f5eed659bde84eab46954679754e9de5306508a1 SHA512 53f602c58a3a9932ac580412d90f3aa7f820cb9bbc9e2dec240dd28de55210fd17ac61a5f8e4a2cebffe2914837c7cabba1061536abd96e35da57c799e8ee7b7
+EBUILD csnappy-0_pre20220804.ebuild 1180 BLAKE2B dbc41a8d23053f4149d183e373046845e49746da562de45624c972ba5f52e9c39ccb3d754d1fdf7e4af4ae723988dba04de4325a69e33fae672aa67173ec3935 SHA512 3e41debf9a0f8689d172a7010a1112c18a020a5b0e74873ea540dba159ea82cad0291abcedfd7c24bf48cf6d95a764a298af0e5571f49f6133fa0d6e593ef7fc
+MISC metadata.xml 318 BLAKE2B ea1a70433187f4d4b5c9d7d66e7c7360bb4b509bbc2dc4dc0d619b7e84bf7ed68384093b8beb85b8ce5199a6193009d1c4b61a9e5c9141a1908c10ef616fe8ea SHA512 cb8eae4d09adf7837f423c8eb7fee010b2287bd3b4a798d1322f9f69ea538e662ab3bd3ca70603316410728ba3626a9e97ae5b73c61789d466aa2a0ebc9853bf
diff --git a/app-arch/csnappy/csnappy-0_pre20220804.ebuild b/app-arch/csnappy/csnappy-0_pre20220804.ebuild
new file mode 100644
index 000000000000..9c7545bb5cb6
--- /dev/null
+++ b/app-arch/csnappy/csnappy-0_pre20220804.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+MY_COMMIT="6c10c305e8dde193546e6b33cf8a785d5dc123e2"
+
+DESCRIPTION="Google's snappy compression library for the Linux Kernel"
+HOMEPAGE="https://github.com/zeevt/csnappy"
+SRC_URI="https://github.com/zeevt/csnappy/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}"/${PN}-${MY_COMMIT}
+
+# https://github.com/zeevt/csnappy/issues/21
+LICENSE="BSD"
+# 0/${PV} b/c of the SONAME situation (see below).
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+
+# https://github.com/zeevt/csnappy/issues/33
+# No SONAME yet.
+QA_SONAME="usr/lib.*/libcsnappy.so"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0_pre20220804-fix-tests.patch
+)
+
+src_compile() {
+ emake CC="$(tc-getCC)" OPT_FLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
+ libcsnappy.so
+}
+
+src_test() {
+ # We don't want to run the Valgrind tests as it's fragile in sandbox
+ # and makes life harder for some arches.
+ emake CC="$(tc-getCC)" OPT_FLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
+ check_unaligned_uint64 \
+ cl_test
+}
+
+src_install() {
+ emake DESTDIR="${ED}" LIBDIR="/usr/$(get_libdir)" install
+}
diff --git a/app-arch/csnappy/files/csnappy-0_pre20220804-fix-tests.patch b/app-arch/csnappy/files/csnappy-0_pre20220804-fix-tests.patch
new file mode 100644
index 000000000000..e4d11f7d9021
--- /dev/null
+++ b/app-arch/csnappy/files/csnappy-0_pre20220804-fix-tests.patch
@@ -0,0 +1,41 @@
+https://github.com/zeevt/csnappy/pull/40
+
+From 60ac30054eae4bbc50f90f8228ac53d014400619 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Thu, 16 Dec 2021 14:24:26 +0100
+Subject: [PATCH] Fix parallel tests by only testing the current optimization
+ level
+
+https://github.com/zeevt/csnappy/issues/39
+--- a/Makefile
++++ b/Makefile
+@@ -34,25 +34,14 @@ check_leaks: cl_tester
+ LD_LIBRARY_PATH=. valgrind --leak-check=full --show-reachable=yes ./cl_tester -c <testdata/urls.10K >/dev/null
+ LD_LIBRARY_PATH=. valgrind --leak-check=full --show-reachable=yes ./cl_tester -S d
+
+-check_unaligned_uint64:
++check_unaligned_uint64: cl_tester
+ gzip -dc <testdata/unaligned_uint64_test.snappy.gz >testdata/unaligned_uint64_test.snappy
+ gzip -dc <testdata/unaligned_uint64_test.bin.gz >testdata/unaligned_uint64_test.bin
+- EXTRA_TEST_CFLAGS="-O0" make check_unaligned_uint64_extra_cflags
+- EXTRA_TEST_CFLAGS="-O1" make check_unaligned_uint64_extra_cflags
+- EXTRA_TEST_CFLAGS="-O2" make check_unaligned_uint64_extra_cflags
+- EXTRA_TEST_CFLAGS="-O3" make check_unaligned_uint64_extra_cflags
+- EXTRA_TEST_CFLAGS="-O2 -march=native" make check_unaligned_uint64_extra_cflags
+- EXTRA_TEST_CFLAGS="-O3 -march=native" make check_unaligned_uint64_extra_cflags
+- rm -f testdata/unaligned_uint64_test.snappy testdata/unaligned_uint64_test.bin
+-
+-check_unaligned_uint64_extra_cflags:
+- make clean
+- make cl_tester
+ rm -f tmp
+ LD_LIBRARY_PATH=. ./cl_tester -d testdata/unaligned_uint64_test.snappy tmp
+- diff testdata/unaligned_uint64_test.bin tmp >/dev/null && echo "${EXTRA_TEST_CFLAGS} ok"
+- make clean
++ diff testdata/unaligned_uint64_test.bin tmp >/dev/null && echo "Unaligned test is ok"
+ rm -f tmp
++ rm -f testdata/unaligned_uint64_test.snappy testdata/unaligned_uint64_test.bin
+
+ libcsnappy.so: csnappy_compress.c csnappy_decompress.c csnappy_internal.h csnappy_internal_userspace.h
+ $(CC) $(CFLAGS) $(EXTRA_TEST_CFLAGS) -fPIC -DPIC -c -o csnappy_compress.o csnappy_compress.c
+
diff --git a/app-arch/csnappy/metadata.xml b/app-arch/csnappy/metadata.xml
new file mode 100644
index 000000000000..d377f25e89c3
--- /dev/null
+++ b/app-arch/csnappy/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>sam@gentoo.org</email>
+ <name>Sam James</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">zeevt/csnappy</remote-id>
+ </upstream>
+</pkgmetadata>