libcbor/libcbor-0.5.0-fix-lib.patch
2024-02-09 18:58:32 +08:00

44 lines
1.5 KiB
Diff

https://github.com/PJK/libcbor/pull/72
From 965d41b53d47d1bde4a4902c512ce64462fb920f Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Sun, 7 Oct 2018 05:23:07 +0200
Subject: [PATCH] Do not build two shared libraries
Without this patch, when building with make -j1
cmake would create and install two shared libraries
libcbor.so and libcbor.so.0.0.0
instead of creating libcbor.so as a symlink.
This broke verification of reproducible builds.
See https://reproducible-builds.org/ for why this matters.
Also, (like before) do not install libcbor.a
because static linking is bad for maintainability
(all programs have to be re-built with fixed libraries)
---
src/CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: libcbor-0.5.0/src/CMakeLists.txt
===================================================================
--- libcbor-0.5.0.orig/src/CMakeLists.txt
+++ libcbor-0.5.0/src/CMakeLists.txt
@@ -11,7 +11,7 @@ if (NOT DEFINED CMAKE_MACOSX_RPATH)
set(CMAKE_MACOSX_RPATH 0)
endif()
-add_library(cbor ${SOURCES})
+add_library(cbor STATIC ${SOURCES})
add_library(cbor_shared SHARED ${SOURCES})
set_target_properties(cbor_shared PROPERTIES OUTPUT_NAME cbor VERSION "0.0.0" SOVERSION 0)
@@ -20,7 +20,7 @@ configure_file(libcbor.pc.in libcbor.pc
#http://www.cmake.org/Wiki/CMake:Install_Commands
-install(TARGETS cbor cbor_shared
+install(TARGETS cbor_shared
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION bin)