Description: Use system libsnappy for retracers
 The tracers run LD_PRELOADed into arbitrary, often closed-source binaries,
 so statically-link libsnappy to minimise the possibility of symbol conflicts,
 but the retracers don't have that constraint and are used to process untrusted
 data.
Forwarded: not-needed
Author: Christopher James Halse Rogers <raof@ubuntu.com>

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -476,10 +476,10 @@ if (NOT ENABLE_STATIC_SNAPPY)
     find_package (SNAPPY)
 endif ()
 if (ENABLE_STATIC_SNAPPY OR NOT SNAPPY_FOUND)
-    message (STATUS "Using bundled SNAPPY")
-    set (SNAPPY_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/snappy)
-    set (SNAPPY_LIBRARIES snappy_bundled)
-    add_subdirectory (thirdparty/snappy)
+    message (STATUS "Using static SNAPPY")
+    find_package(SNAPPY REQUIRED)
+    # Our libsnappy package builds a PIC libsnappy-shared.a archive.
+    find_library(SNAPPY_STATIC_LIBRARIES libsnappy-shared.a)
 endif ()
 include_directories (${SNAPPY_INCLUDE_DIRS})
 
--- a/wrappers/CMakeLists.txt
+++ b/wrappers/CMakeLists.txt
@@ -79,7 +79,7 @@ target_link_libraries (trace
     common
     guids
     crc32c
-    ${SNAPPY_LIBRARIES}
+    ${SNAPPY_STATIC_LIBRARIES}
 )
 
 # Code shared across all OpenGL variants
