Browse Source

Merge pull request #14370 from garikello3d/libpqxx-new-package

libpqxx: adding Makefile, Config.in and patch
lilik-openwrt-22.03
Rosen Penev 4 years ago
committed by GitHub
parent
commit
2fe26ac30a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 86 additions and 0 deletions
  1. +26
    -0
      libs/libpqxx/Config.in
  2. +50
    -0
      libs/libpqxx/Makefile
  3. +10
    -0
      libs/libpqxx/patches/100-install-test-executor.patch

+ 26
- 0
libs/libpqxx/Config.in View File

@ -0,0 +1,26 @@
menu "Options"
depends on PACKAGE_libpqxx
config LIBPQXX_STATIC
bool "Build static library"
default y
help
Build static (.a) library
config LIBPQXX_SHARED
bool "Build and install shared library"
default n
help
Build and install shared (.so) library
config LIBPQXX_INSTALL_TEST
bool "Build and install test suite"
default n
depends on LIBPQXX_STATIC || LIBPQXX_SHARED
help
Build and install a test suite against a real server.
One can run this suite on a target platform to ensure
that the library is built the way it should and operating
correctly.
endmenu

+ 50
- 0
libs/libpqxx/Makefile View File

@ -0,0 +1,50 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libpqxx
PKG_VERSION:=7.3.0
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/jtv/libpqxx
PKG_SOURCE_VERSION:=$(PKG_VERSION)
PKG_MIRROR_HASH:=c176771dbbf02e38b84a8f9bf986a83587e2d86d9e0d2238e2a17a036e865951
CMAKE_INSTALL:=1
PKG_MAINTAINER:=Igor Bezzubchenko <garikello@gmail.com>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/libpqxx
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=+libpq +libstdcpp
TITLE:=PostgreSQL client library (C++ interface)
URL:=http://pqxx.org/development/libpqxx
SUBMENU:=Database
endef
define Package/libpqxx/config
source "$(SOURCE)/Config.in"
endef
CMAKE_OPTIONS += \
-DBUILD_DOC=OFF \
-DBUILD_STATIC_LIBS=O$(if $(CONFIG_LIBPQXX_STATIC),N,FF) \
-DBUILD_SHARED_LIBS=O$(if $(CONFIG_LIBPQXX_SHARED),N,FF) \
$(if $(CONFIG_LIBPQXX_INSTALL_TEST),\
-DINSTALL_TEST=ON -DSKIP_BUILD_TEST=OFF, \
-DINSTALL_TEST=OFF -DSKIP_BUILD_TEST=ON \
)
define Package/libpqxx/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/bin
$(if $(CONFIG_LIBPQXX_SHARED), \
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpqxx*.so $(1)/usr/lib/)
$(if $(CONFIG_LIBPQXX_INSTALL_TEST), \
$(CP) $(PKG_INSTALL_DIR)/usr/bin/libpqxx* $(1)/usr/bin/)
endef
$(eval $(call BuildPackage,libpqxx))

+ 10
- 0
libs/libpqxx/patches/100-install-test-executor.patch View File

@ -0,0 +1,10 @@
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -14,3 +14,7 @@ add_test(
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
COMMAND runner
)
+
+if(INSTALL_TEST)
+ install(PROGRAMS runner TYPE BIN RENAME libpqxx-test-runner)
+endif()

Loading…
Cancel
Save