Skip to content

Commit

Permalink
archivers/snappy: update to 1.1.9, also build static library.
Browse files Browse the repository at this point in the history
PR:		246592
Reported by:	Mitchell Holland <mitchell.holland@akips.com>
  • Loading branch information
vanillahsu committed May 6, 2021
1 parent 59ee310 commit 35c6c84
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 5 deletions.
4 changes: 2 additions & 2 deletions archivers/snappy/Makefile
@@ -1,7 +1,7 @@
# Created by: Vanilla I. Shu <vanilla@FreeBSD.org>

PORTNAME= snappy
PORTVERSION= 1.1.8
PORTVERSION= 1.1.9
CATEGORIES= archivers

MAINTAINER= vanilla@FreeBSD.org
Expand All @@ -12,7 +12,7 @@ LICENSE= BSD3CLAUSE
USES= cmake compiler:c++11-lang
USE_LDCONFIG= yes
CMAKE_ON= BUILD_SHARED_LIBS
CMAKE_OFF= SNAPPY_BUILD_TESTS
CMAKE_OFF= SNAPPY_BUILD_TESTS SNAPPY_BUILD_BENCHMARKS
CMAKE_BUILD_TYPE= Release
USE_GITHUB= yes
GH_ACCOUNT= google
Expand Down
6 changes: 3 additions & 3 deletions archivers/snappy/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1579651155
SHA256 (google-snappy-1.1.8_GH0.tar.gz) = 16b677f07832a612b0836178db7f374e414f94657c138e6993cbfc5dcc58651f
SIZE (google-snappy-1.1.8_GH0.tar.gz) = 1096137
TIMESTAMP = 1620309917
SHA256 (google-snappy-1.1.9_GH0.tar.gz) = 75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7
SIZE (google-snappy-1.1.9_GH0.tar.gz) = 1102382
61 changes: 61 additions & 0 deletions archivers/snappy/files/patch-CMakeLists.txt
@@ -0,0 +1,61 @@
--- CMakeLists.txt.orig 2021-05-04 22:53:34 UTC
+++ CMakeLists.txt
@@ -213,8 +213,7 @@ configure_file(
"snappy-stubs-public.h.in"
"${PROJECT_BINARY_DIR}/snappy-stubs-public.h")

-add_library(snappy "")
-target_sources(snappy
+set(SNAPPY_SRCS
PRIVATE
"snappy-internal.h"
"snappy-stubs-internal.h"
@@ -235,20 +234,35 @@ target_sources(snappy
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/snappy-stubs-public.h>
$<INSTALL_INTERFACE:include/snappy-stubs-public.h>
)
-target_include_directories(snappy
+set(SNAPPY_INCS
PUBLIC
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
)
+add_library(snappy SHARED)
+target_sources(snappy ${SNAPPY_SRCS})
+target_include_directories(snappy ${SNAPPY_INCS})
set_target_properties(snappy
PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})

target_compile_definitions(snappy PRIVATE -DHAVE_CONFIG_H)
-if(BUILD_SHARED_LIBS)
- set_target_properties(snappy PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
-endif(BUILD_SHARED_LIBS)
+set_target_properties(snappy PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)

+add_library(snappy-static STATIC)
+target_sources(snappy-static ${SNAPPY_SRCS})
+target_include_directories(snappy-static ${SNAPPY_INCS})
+set_target_properties(snappy-static
+ PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
+
+target_compile_definitions(snappy-static PRIVATE -DHAVE_CONFIG_H)
+
+if (MSVC)
+ set_target_properties(snappy-static PROPERTIES OUTPUT_NAME snappy-static)
+else()
+ set_target_properties(snappy-static PROPERTIES OUTPUT_NAME snappy)
+endif()
+
if(SNAPPY_BUILD_TESTS OR SNAPPY_BUILD_BENCHMARKS)
add_library(snappy_test_support "")
target_sources(snappy_test_support
@@ -359,7 +373,7 @@ endif(SNAPPY_FUZZING_BUILD)
include(GNUInstallDirs)

if(SNAPPY_INSTALL)
- install(TARGETS snappy
+ install(TARGETS snappy snappy-static
EXPORT SnappyTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
1 change: 1 addition & 0 deletions archivers/snappy/pkg-plist
Expand Up @@ -6,6 +6,7 @@ lib/cmake/Snappy/SnappyConfig.cmake
lib/cmake/Snappy/SnappyConfigVersion.cmake
lib/cmake/Snappy/SnappyTargets-%%CMAKE_BUILD_TYPE%%.cmake
lib/cmake/Snappy/SnappyTargets.cmake
lib/libsnappy.a
lib/libsnappy.so
lib/libsnappy.so.1
lib/libsnappy.so.%%PORTVERSION%%
Expand Down

0 comments on commit 35c6c84

Please sign in to comment.