Skip to content

Commit

Permalink
snappy: Update to 1.2.1 version (#6116)
Browse files Browse the repository at this point in the history
* snappy: update to 1.2.1

* snappy: switch the language standard for testing under windows to c++14

*MSVC does not support c++11, and an error will occur if clang is used to test.

* snappy: fix build under arm-gnueabihf

* snappy: update patch.

* snappy: update patch.

* snappy: apply patch to 1.2.0

* snappy: fix build under android ndk r27.

* snappy: fix build.
  • Loading branch information
Redbeanw44602 authored Jan 3, 2025
1 parent f5026b8 commit 738c3c8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
33 changes: 33 additions & 0 deletions packages/s/snappy/patches/1.2.1/update-neon-flag-aarch64.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 32ded457c0b1fe78ceb8397632c416568d6714a0 Mon Sep 17 00:00:00 2001
From: Danila Kutenin <[email protected]>
Date: Sat, 17 Aug 2024 19:03:10 -0700
Subject: [PATCH] Update CMakeLists NEON flag to reflect only AArch64 NEON
optimizations

---
CMakeLists.txt | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 644df24..b1d072c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -206,10 +206,13 @@ int main() {

check_cxx_source_compiles("
#include <arm_neon.h>
+#include <stdint.h>
int main() {
uint8_t val = 3, dup[8];
- uint8x16_t v = vld1q_dup_u8(&val);
- vst1q_u8(dup, v);
+ uint8x16_t v1 = vld1q_dup_u8(&val);
+ uint8x16_t v2 = vqtbl1q_u8(v1, v1);
+ vst1q_u8(dup, v1);
+ vst1q_u8(dup, v2);
return 0;
}" SNAPPY_HAVE_NEON)

--
2.47.1

6 changes: 5 additions & 1 deletion packages/s/snappy/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ package("snappy")
add_versions("1.1.8", "16b677f07832a612b0836178db7f374e414f94657c138e6993cbfc5dcc58651f")
add_versions("1.1.9", "75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7")
add_versions("1.1.10", "49d831bffcc5f3d01482340fe5af59852ca2fe76c3e05df0e67203ebbe0f1d90")
add_versions("1.2.0", "9b8f10fbb5e3bc112f2e5e64f813cb73faea42ec9c533a5023b5ae08aedef42e")
add_versions("1.2.1", "736aeb64d86566d2236ddffa2865ee5d7a82d26c9016b36218fcc27ea4f09f86")

add_patches("1.1.9", "patches/1.1.9/inline.patch", "ed6b247d19486ab3f08f268269133193d7cdadd779523c5e69b5e653f82d535b")
add_patches("1.1.10", "patches/1.1.10/cmake.patch", "d4883111dcfab81ea35ac1e4e157e55105cec02a0ba804458405be25cbf7b6bb")
add_patches(">=1.2.0 <=1.2.1", "patches/1.2.1/update-neon-flag-aarch64.patch", "13100aa56de71a11bb3704bd7507613fd53caa3ab6e7dbec3de74875deb46ba5")

add_deps("cmake")

Expand All @@ -19,6 +22,7 @@ package("snappy")
add_configs("bmi2", {description = "Use the BMI2 instruction set", default = false, type = "boolean"})

on_install(function (package)
io.replace("CMakeLists.txt", "cmake_minimum_required(VERSION 3.1)", "cmake_minimum_required(VERSION 3.3)", {plain = true})
io.replace("CMakeLists.txt", "-Werror", "", {plain = true})

if package:version():eq("1.1.10") then
Expand All @@ -41,5 +45,5 @@ package("snappy")
void test(int args, char** argv) {
snappy::Compress(nullptr, nullptr);
}
]]}, {configs = {languages = "c++11"}, includes = "snappy.h"}))
]]}, {configs = {languages = package:is_plat("windows") and "c++14" or "c++11"}, includes = "snappy.h"}))
end)

0 comments on commit 738c3c8

Please sign in to comment.