Skip to contentSkip to conversation

package/snappy: add snappy.pc

PATCH New Fabrice Fontaine 2 participants 6 messages May 29, 2019 – Dec 20, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/snappy: add snappy.pc

---
 .../snappy/0001-Readd-pkgconfig-support.patch | 56 +++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 package/snappy/0001-Readd-pkgconfig-support.patch
package/snappy/0001-Readd-pkgconfig-support.patch new file +56 -0
new file mode 100644
index 0000000000..f27df9c8e8
@@ -0,0 +1,56 @@
+From e2c4ae93c6f57a80a71bdcff309006efccd30f42 Mon Sep 17 00:00:00 2001
+From: Niclas Rosenvik <[email protected]>
+Date: Fri, 4 Aug 2017 12:33:18 +0200
+Subject: [PATCH] Readd pkgconfig support.
+
+Readd pkgconfig support to support usage of snappy with other build systems.
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Retrieved (and updated to add Libs.private) from:
+https://github.com/google/snappy/pull/51/commits/e2c4ae93c6f57a80a71bdcff309006efccd30f42]
+---
+ CMakeLists.txt     |  6 ++++++
+ cmake/snappy.pc.in | 10 ++++++++++
+ 2 files changed, 16 insertions(+)
+ create mode 100644 cmake/snappy.pc.in
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e9e70c8..7a8dab4 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -54,6 +54,11 @@ configure_file(
+   "${PROJECT_SOURCE_DIR}/cmake/config.h.in"
+   "${PROJECT_BINARY_DIR}/config.h"
+ )
++configure_file(
++  "${PROJECT_SOURCE_DIR}/cmake/snappy.pc.in"
++  "${PROJECT_BINARY_DIR}/snappy.pc"
++  @ONLY
++)
+ 
+ # We don't want to define HAVE_ macros in public headers. Instead, we use
+ # CMake's variable substitution with 0/1 variables, which will be seen by the
+@@ -165,3 +170,4 @@ install(
+     "${PROJECT_BINARY_DIR}/SnappyConfigVersion.cmake"
+   DESTINATION lib/cmake/Snappy
+ )
++install(FILES "${PROJECT_BINARY_DIR}/snappy.pc" DESTINATION lib/pkgconfig)
+\ No newline at end of file
+diff --git a/cmake/snappy.pc.in b/cmake/snappy.pc.in
+new file mode 100644
+index 0000000..6c43545
+--- /dev/null
++++ b/cmake/snappy.pc.in
+@@ -0,0 +1,10 @@
++prefix=@CMAKE_INSTALL_PREFIX@
++exec_prefix=${prefix}
++libdir=${exec_prefix}/lib
++includedir=${prefix}/include
++
++Name: @PROJECT_NAME@
++Description: A fast compression/decompression library
++Version: @PROJECT_VERSION@
++Libs: -L${libdir} -lsnappy
++Libs.private: -lstdc++
++Cflags: -I${includedir}
+\ No newline at end of file
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/2 package/wireshark: fix static build with snappy

Fixes:
- http://autobuild.buildroot.org/results/419468f0d7d3c2b64d420513aa9505c6de097ed2

---
 .../0005-FindSNAPPY-fix-static-build.patch    | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 package/wireshark/0005-FindSNAPPY-fix-static-build.patch
package/wireshark/0005-FindSNAPPY-fix-static-build.patch new file +46 -0
new file mode 100644
index 0000000000..ba528cf01a
@@ -0,0 +1,46 @@
+From 4abe51deee1ed3daffa9042ab41ed0622856c69c Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Tue, 28 May 2019 21:18:09 +0200
+Subject: [PATCH] FindSNAPPY: fix static build
+
+On UNIX, when statically built, snappy can depends on stdc++. This
+dependency can be retrieved through pkg-config, see:
+https://github.com/google/snappy/pull/51
+
+Fixes:
+ - http://autobuild.buildroot.org/results/faa65da84ace974426e220205f4665fc0a73bdfe
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ cmake/modules/FindSNAPPY.cmake | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/cmake/modules/FindSNAPPY.cmake b/cmake/modules/FindSNAPPY.cmake
+index 7964c9d145..93fdb2bc33 100644
+--- a/cmake/modules/FindSNAPPY.cmake
++++ b/cmake/modules/FindSNAPPY.cmake
+@@ -13,7 +13,7 @@ FindWSWinLibs( "snappy-.*" "SNAPPY_HINTS" )
+ 
+ if( NOT WIN32)
+   find_package(PkgConfig)
+-  pkg_search_module(SNAPPY libsnappy)
++  pkg_search_module(SNAPPY libsnappy snappy)
+ endif()
+ 
+ find_path(SNAPPY_INCLUDE_DIR
+@@ -36,7 +36,11 @@ find_package_handle_standard_args( SNAPPY DEFAULT_MSG SNAPPY_LIBRARY SNAPPY_INCL
+ 
+ if( SNAPPY_FOUND )
+   set( SNAPPY_INCLUDE_DIRS ${SNAPPY_INCLUDE_DIR} )
+-  set( SNAPPY_LIBRARIES ${SNAPPY_LIBRARY} )
++  # If pkg-config is available on the system and snappy .pc files are installed,
++  # SNAPPY_LIBRARIES will already contain transitive dependencies such as
++  # -lstdc++ for static linking
++  list( APPEND SNAPPY_LIBRARIES ${SNAPPY_LIBRARY} )
++
+   if (WIN32)
+     set ( SNAPPY_DLL_DIR "${SNAPPY_HINTS}/bin"
+       CACHE PATH "Path to Snappy DLL"
+-- 
+2.20.1
+
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/2 package/wireshark: fix static build with snappy

Hi Fabrice,

Quoted 52 lines · Fabrice Fontaine

Fixes:
- http://autobuild.buildroot.org/results/419468f0d7d3c2b64d420513aa9505c6de097ed2

---
  .../0005-FindSNAPPY-fix-static-build.patch    | 46 +++++++++++++++++++
  1 file changed, 46 insertions(+)

create mode 100644 package/wireshark/0005-FindSNAPPY-fix-static-build.patch

package/wireshark/0005-FindSNAPPY-fix-static-build.patch new file +36 -0
new file mode 100644
index 0000000000..ba528cf01a
@@ -0,0 +1,46 @@
+From 4abe51deee1ed3daffa9042ab41ed0622856c69c Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Tue, 28 May 2019 21:18:09 +0200
+Subject: [PATCH] FindSNAPPY: fix static build
+
+On UNIX, when statically built, snappy can depends on stdc++. This
+dependency can be retrieved through pkg-config, see:
+https://github.com/google/snappy/pull/51
+
+Fixes:
+ - http://autobuild.buildroot.org/results/faa65da84ace974426e220205f4665fc0a73bdfe
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ cmake/modules/FindSNAPPY.cmake | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/cmake/modules/FindSNAPPY.cmake b/cmake/modules/FindSNAPPY.cmake
+index 7964c9d145..93fdb2bc33 100644
+--- a/cmake/modules/FindSNAPPY.cmake
++++ b/cmake/modules/FindSNAPPY.cmake
+@@ -13,7 +13,7 @@ FindWSWinLibs( "snappy-.*" "SNAPPY_HINTS" )
+
+ if( NOT WIN32)
+   find_package(PkgConfig)
+-  pkg_search_module(SNAPPY libsnappy)
++  pkg_search_module(SNAPPY libsnappy snappy)
+ endif()
+
+ find_path(SNAPPY_INCLUDE_DIR
+@@ -36,7 +36,11 @@ find_package_handle_standard_args( SNAPPY DEFAULT_MSG SNAPPY_LIBRARY SNAPPY_INCL
+
+ if( SNAPPY_FOUND )
+   set( SNAPPY_INCLUDE_DIRS ${SNAPPY_INCLUDE_DIR} )
+-  set( SNAPPY_LIBRARIES ${SNAPPY_LIBRARY} )
++  # If pkg-config is available on the system and snappy .pc files are installed,

package/wireshark/0005-FindSNAPPY-fix-static-build.patch line 46

Quoted 10 lines
package/wireshark/0005-FindSNAPPY-fix-static-build.patch new file +10 -0
++  # SNAPPY_LIBRARIES will already contain transitive dependencies such as
++  # -lstdc++ for static linking
++  list( APPEND SNAPPY_LIBRARIES ${SNAPPY_LIBRARY} )
++
+   if (WIN32)
+     set ( SNAPPY_DLL_DIR "${SNAPPY_HINTS}/bin"
+       CACHE PATH "Path to Snappy DLL"
+--
+2.20.1
+

Best regards

Signature · 2 lines
Giulio Benetti
Benetti Engineering sas
#3 lore raw

PATCH 1/2 package/snappy: add snappy.pc

In reply to Fabrice Fontaine

Hi Fabrice,

Quoted 40 lines · Fabrice Fontaine
---
  .../snappy/0001-Readd-pkgconfig-support.patch | 56 +++++++++++++++++++
  1 file changed, 56 insertions(+)

create mode 100644 package/snappy/0001-Readd-pkgconfig-support.patch

package/snappy/0001-Readd-pkgconfig-support.patch new file +28 -0
new file mode 100644
index 0000000000..f27df9c8e8
@@ -0,0 +1,56 @@
+From e2c4ae93c6f57a80a71bdcff309006efccd30f42 Mon Sep 17 00:00:00 2001
+From: Niclas Rosenvik <[email protected]>
+Date: Fri, 4 Aug 2017 12:33:18 +0200
+Subject: [PATCH] Readd pkgconfig support.
+
+Readd pkgconfig support to support usage of snappy with other build systems.
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Retrieved (and updated to add Libs.private) from:
+https://github.com/google/snappy/pull/51/commits/e2c4ae93c6f57a80a71bdcff309006efccd30f42]
+---
+ CMakeLists.txt     |  6 ++++++
+ cmake/snappy.pc.in | 10 ++++++++++
+ 2 files changed, 16 insertions(+)
+ create mode 100644 cmake/snappy.pc.in
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e9e70c8..7a8dab4 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -54,6 +54,11 @@ configure_file(
+   "${PROJECT_SOURCE_DIR}/cmake/config.h.in"
+   "${PROJECT_BINARY_DIR}/config.h"
+ )
++configure_file(
++  "${PROJECT_SOURCE_DIR}/cmake/snappy.pc.in"
++  "${PROJECT_BINARY_DIR}/snappy.pc"
++  @ONLY

package/snappy/0001-Readd-pkgconfig-support.patch line 38

Quoted 10 lines
package/snappy/0001-Readd-pkgconfig-support.patch new file +10 -0
++)
+
+ # We don't want to define HAVE_ macros in public headers. Instead, we use
+ # CMake's variable substitution with 0/1 variables, which will be seen by the
+@@ -165,3 +170,4 @@ install(
+     "${PROJECT_BINARY_DIR}/SnappyConfigVersion.cmake"
+   DESTINATION lib/cmake/Snappy
+ )
++install(FILES "${PROJECT_BINARY_DIR}/snappy.pc" DESTINATION lib/pkgconfig)
+\ No newline at end of file

No newline,

Quoted 8 lines
package/snappy/0001-Readd-pkgconfig-support.patch new file +8 -0
+diff --git a/cmake/snappy.pc.in b/cmake/snappy.pc.in
+new file mode 100644
+index 0000000..6c43545
+--- /dev/null
++++ b/cmake/snappy.pc.in
+@@ -0,0 +1,10 @@
++prefix=@CMAKE_INSTALL_PREFIX@
++exec_prefix=${prefix}

package/snappy/0001-Readd-pkgconfig-support.patch line 56

Quoted 10 lines
package/snappy/0001-Readd-pkgconfig-support.patch new file +10 -0
++libdir=${exec_prefix}/lib
++includedir=${prefix}/include
++
++Name: @PROJECT_NAME@
++Description: A fast compression/decompression library
++Version: @PROJECT_VERSION@
++Libs: -L${libdir} -lsnappy
++Libs.private: -lstdc++
++Cflags: -I${includedir}
+\ No newline at end of file

No newline

And, what is the goal of this patch? Does it fix a bug? I see that only few packages provide a .pc file that is useful for pkgconfig to retrieve libs/incs paths for shared/static libs deps, but can you please provide a commit log about this? If it's not needed by any other package as dependency or there is not a specific reason I would avoid it.

Best regards

Signature · 2 lines
Giulio Benetti
Benetti Engineering sas
#4 lore raw

PATCH 1/2 package/snappy: add snappy.pc

Hi Fabrice,

Quoted 77 lines · Giulio Benetti

Hi Fabrice,

Quoted 40 lines · Fabrice Fontaine
---
   .../snappy/0001-Readd-pkgconfig-support.patch | 56 +++++++++++++++++++
   1 file changed, 56 insertions(+)

create mode 100644 package/snappy/0001-Readd-pkgconfig-support.patch

package/snappy/0001-Readd-pkgconfig-support.patch new file +28 -0
new file mode 100644
index 0000000000..f27df9c8e8
@@ -0,0 +1,56 @@
+From e2c4ae93c6f57a80a71bdcff309006efccd30f42 Mon Sep 17 00:00:00 2001
+From: Niclas Rosenvik <[email protected]>
+Date: Fri, 4 Aug 2017 12:33:18 +0200
+Subject: [PATCH] Readd pkgconfig support.
+
+Readd pkgconfig support to support usage of snappy with other build systems.
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Retrieved (and updated to add Libs.private) from:
+https://github.com/google/snappy/pull/51/commits/e2c4ae93c6f57a80a71bdcff309006efccd30f42]
+---
+ CMakeLists.txt     |  6 ++++++
+ cmake/snappy.pc.in | 10 ++++++++++
+ 2 files changed, 16 insertions(+)
+ create mode 100644 cmake/snappy.pc.in
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e9e70c8..7a8dab4 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -54,6 +54,11 @@ configure_file(
+   "${PROJECT_SOURCE_DIR}/cmake/config.h.in"
+   "${PROJECT_BINARY_DIR}/config.h"
+ )
++configure_file(
++  "${PROJECT_SOURCE_DIR}/cmake/snappy.pc.in"
++  "${PROJECT_BINARY_DIR}/snappy.pc"
++  @ONLY

package/snappy/0001-Readd-pkgconfig-support.patch line 38

Quoted 10 lines
package/snappy/0001-Readd-pkgconfig-support.patch new file +10 -0
++)
+
+ # We don't want to define HAVE_ macros in public headers. Instead, we use
+ # CMake's variable substitution with 0/1 variables, which will be seen by the
+@@ -165,3 +170,4 @@ install(
+     "${PROJECT_BINARY_DIR}/SnappyConfigVersion.cmake"
+   DESTINATION lib/cmake/Snappy
+ )
++install(FILES "${PROJECT_BINARY_DIR}/snappy.pc" DESTINATION lib/pkgconfig)
+\ No newline at end of file

No newline,

Quoted 8 lines
package/snappy/0001-Readd-pkgconfig-support.patch new file +8 -0
+diff --git a/cmake/snappy.pc.in b/cmake/snappy.pc.in
+new file mode 100644
+index 0000000..6c43545
+--- /dev/null
++++ b/cmake/snappy.pc.in
+@@ -0,0 +1,10 @@
++prefix=@CMAKE_INSTALL_PREFIX@
++exec_prefix=${prefix}

package/snappy/0001-Readd-pkgconfig-support.patch line 56

Quoted 10 lines
package/snappy/0001-Readd-pkgconfig-support.patch new file +10 -0
++libdir=${exec_prefix}/lib
++includedir=${prefix}/include
++
++Name: @PROJECT_NAME@
++Description: A fast compression/decompression library
++Version: @PROJECT_VERSION@
++Libs: -L${libdir} -lsnappy
++Libs.private: -lstdc++
++Cflags: -I${includedir}
+\ No newline at end of file

No newline

Quoted 5 lines

And, what is the goal of this patch? Does it fix a bug? I see that only few packages provide a .pc file that is useful for pkgconfig to retrieve libs/incs paths for shared/static libs deps, but can you please provide a commit log about this? If it's not needed by any other package as dependency or there is not a specific reason I would avoid it.

I've realized only now that this is part of a patchset and is needed to fix wireshark build failure. Sorry.

Signature · 2 lines
Giulio Benetti
Benetti Engineering sas
#5 lore raw

PATCH 1/2 package/snappy: add snappy.pc

Hi Fabrice,

Quoted 80 lines · Giulio Benetti

Hi Fabrice,

Quoted 77 lines · Giulio Benetti

Hi Fabrice,

Quoted 40 lines · Fabrice Fontaine
---
    .../snappy/0001-Readd-pkgconfig-support.patch | 56 +++++++++++++++++++
    1 file changed, 56 insertions(+)

create mode 100644 package/snappy/0001-Readd-pkgconfig-support.patch

package/snappy/0001-Readd-pkgconfig-support.patch new file +28 -0
new file mode 100644
index 0000000000..f27df9c8e8
@@ -0,0 +1,56 @@
+From e2c4ae93c6f57a80a71bdcff309006efccd30f42 Mon Sep 17 00:00:00 2001
+From: Niclas Rosenvik <[email protected]>
+Date: Fri, 4 Aug 2017 12:33:18 +0200
+Subject: [PATCH] Readd pkgconfig support.
+
+Readd pkgconfig support to support usage of snappy with other build systems.
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Retrieved (and updated to add Libs.private) from:
+https://github.com/google/snappy/pull/51/commits/e2c4ae93c6f57a80a71bdcff309006efccd30f42]
+---
+ CMakeLists.txt     |  6 ++++++
+ cmake/snappy.pc.in | 10 ++++++++++
+ 2 files changed, 16 insertions(+)
+ create mode 100644 cmake/snappy.pc.in
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e9e70c8..7a8dab4 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -54,6 +54,11 @@ configure_file(
+   "${PROJECT_SOURCE_DIR}/cmake/config.h.in"
+   "${PROJECT_BINARY_DIR}/config.h"
+ )
++configure_file(
++  "${PROJECT_SOURCE_DIR}/cmake/snappy.pc.in"
++  "${PROJECT_BINARY_DIR}/snappy.pc"
++  @ONLY

package/snappy/0001-Readd-pkgconfig-support.patch line 38

Quoted 10 lines
package/snappy/0001-Readd-pkgconfig-support.patch new file +10 -0
++)
+
+ # We don't want to define HAVE_ macros in public headers. Instead, we use
+ # CMake's variable substitution with 0/1 variables, which will be seen by the
+@@ -165,3 +170,4 @@ install(
+     "${PROJECT_BINARY_DIR}/SnappyConfigVersion.cmake"
+   DESTINATION lib/cmake/Snappy
+ )
++install(FILES "${PROJECT_BINARY_DIR}/snappy.pc" DESTINATION lib/pkgconfig)
+\ No newline at end of file

No newline,

Quoted 8 lines
package/snappy/0001-Readd-pkgconfig-support.patch new file +8 -0
+diff --git a/cmake/snappy.pc.in b/cmake/snappy.pc.in
+new file mode 100644
+index 0000000..6c43545
+--- /dev/null
++++ b/cmake/snappy.pc.in
+@@ -0,0 +1,10 @@
++prefix=@CMAKE_INSTALL_PREFIX@
++exec_prefix=${prefix}

package/snappy/0001-Readd-pkgconfig-support.patch line 56

Quoted 10 lines
package/snappy/0001-Readd-pkgconfig-support.patch new file +10 -0
++libdir=${exec_prefix}/lib
++includedir=${prefix}/include
++
++Name: @PROJECT_NAME@
++Description: A fast compression/decompression library
++Version: @PROJECT_VERSION@
++Libs: -L${libdir} -lsnappy
++Libs.private: -lstdc++
++Cflags: -I${includedir}
+\ No newline at end of file

No newline

Quoted 8 lines
Quoted 5 lines

And, what is the goal of this patch? Does it fix a bug? I see that only few packages provide a .pc file that is useful for pkgconfig to retrieve libs/incs paths for shared/static libs deps, but can you please provide a commit log about this? If it's not needed by any other package as dependency or there is not a specific reason I would avoid it.

I've realized only now that this is part of a patchset and is needed to fix wireshark build failure. Sorry.

I've tested it with wireshark's 2/2 patch on its build failure and it builds correctly, so:

Best regards

Signature · 2 lines
Giulio Benetti
Benetti Engineering sas