From 75a62d9a11743c95f1573ab8eae6e3cbeae7e7a3 Mon Sep 17 00:00:00 2001 From: MarkusVolk Date: Sat, 1 Jan 2022 07:00:26 +0100 Subject: [PATCH] date: cleanup replace the pkgconfig hack with a proper patch --- recipes-extended/date/date_git.bb | 8 +-- recipes-extended/date/files/date.pc | 10 ---- recipes-extended/date/files/pkgconfig.patch | 61 +++++++++++++++++++++ 3 files changed, 62 insertions(+), 17 deletions(-) delete mode 100644 recipes-extended/date/files/date.pc create mode 100644 recipes-extended/date/files/pkgconfig.patch diff --git a/recipes-extended/date/date_git.bb b/recipes-extended/date/date_git.bb index f16246c..15b91f9 100644 --- a/recipes-extended/date/date_git.bb +++ b/recipes-extended/date/date_git.bb @@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=b5d973344b3c7bbf7535f0e6e002d017" SRC_URI = " \ git://github.com/HowardHinnant/date.git;protocol=https;branch=master \ - file://date.pc \ + file://pkgconfig.patch \ " S = "${WORKDIR}/git" @@ -23,10 +23,4 @@ EXTRA_OECMAKE += " \ -DBUILD_SHARED_LIBS=ON \ -DUSE_SYSTEM_TZ_DB=ON \ " - -do_install:append() { - # source lacks pkgconfig support. Include a pc file, so 'date' can be found using pkgconfig - install -d ${D}${libdir}/pkgconfig - install -m 0644 ${WORKDIR}/date.pc ${D}${libdir}/pkgconfig -} diff --git a/recipes-extended/date/files/date.pc b/recipes-extended/date/files/date.pc deleted file mode 100644 index 3d47fa5..0000000 --- a/recipes-extended/date/files/date.pc +++ /dev/null @@ -1,10 +0,0 @@ -prefix=/usr -exec_prefix=/usr -libdir=/usr/lib -includedir=/usr/include - -Name: date -Description: date library -Version: 3.0.0 -Cflags: -I${includedir}/date -Libs: -L${libdir} -ldate-tz -lpthread diff --git a/recipes-extended/date/files/pkgconfig.patch b/recipes-extended/date/files/pkgconfig.patch new file mode 100644 index 0000000..d38607a --- /dev/null +++ b/recipes-extended/date/files/pkgconfig.patch @@ -0,0 +1,61 @@ +From e56b2dce7e89a92e1b9b35caa13b3e938c4cedea Mon Sep 17 00:00:00 2001 +From: Cole Mickens +Date: Sun, 26 Jan 2020 01:27:08 -0800 +Subject: [PATCH] CMakeLists.txt: output date.pc for pkg-config + +--- + CMakeLists.txt | 15 +++++++++++++++ + date.pc.in | 10 ++++++++++ + 2 files changed, 25 insertions(+) + create mode 100644 date.pc.in + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f30c473..fe778e8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -128,6 +128,15 @@ if( BUILD_TZ_LIB ) + endif( ) + endif( ) + ++if ( BUILD_TZ_LIB ) ++ # Cflags: -I${includedir} @TZ_COMPILE_DEFINITIONS@ ++ set( TZ_COMPILE_DEFINITIONS "$,-D$, -D>,>" ) ++ configure_file(date.pc.in date.pc.cf @ONLY) ++ file( GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/date.pc" ++ INPUT "${CMAKE_CURRENT_BINARY_DIR}/date.pc.cf" ) ++ ++endif( ) ++ + #[===================================================================[ + installation + #]===================================================================] +@@ -171,6 +180,12 @@ install ( + FILES cmake/dateConfig.cmake "${version_config}" + DESTINATION ${CONFIG_LOC}) + ++if ( BUILD_TZ_LIB ) ++ install( ++ FILES ${CMAKE_BINARY_DIR}/date.pc ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ++endif( ) ++ + #[===================================================================[ + testing + #]===================================================================] +diff --git a/date.pc.in b/date.pc.in +new file mode 100644 +index 0000000..b9c4623 +--- /dev/null ++++ b/date.pc.in +@@ -0,0 +1,10 @@ ++prefix=@CMAKE_INSTALL_PREFIX@ ++exec_prefix=@CMAKE_INSTALL_BINDIR@ ++libdir=@CMAKE_INSTALL_LIB@ ++includedir=@CMAKE_INSTALL_INCLUDE@ ++ ++Name: date ++Description: A date and time library based on the C++11/14/17 header ++Version: @PACKAGE_VERSION@ ++Libs: -L${libdir} -ldate-tz ++Cflags: -I${includedir} @TZ_COMPILE_DEFINITIONS@ +