diff options
Diffstat (limited to 'px/packages/cpp.scm')
-rw-r--r-- | px/packages/cpp.scm | 59 |
1 files changed, 57 insertions, 2 deletions
diff --git a/px/packages/cpp.scm b/px/packages/cpp.scm index 223519a..b74a871 100644 --- a/px/packages/cpp.scm +++ b/px/packages/cpp.scm @@ -74,7 +74,7 @@ in multiple languages.") (source (origin (method url-fetch) - (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (uri (string-append "https://source.pantherx.org/webrtc-cpp_v" version ".tgz")) (sha256 (base32 "12k910nq20crkghvzb1pwil7iph2brqf94cfcc31px1nrzqv359w")))) (build-system qt-build-system) @@ -199,7 +199,62 @@ install(TARGETS webrtc-cpp-demo (build-system cmake-build-system) (arguments `(#:tests? #f - #:configure-flags '("-DCMAKE_BUILD_TYPE=Release"))) + #:configure-flags '("-DCMAKE_BUILD_TYPE=Release" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DCMAKE_INSTALL_LIBDIR=lib") + #:phases + (modify-phases %standard-phases + (add-after 'install 'install-cmake-config + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib")) + (cmake-dir (string-append lib "/cmake/sioclient"))) + (mkdir-p cmake-dir) + ;; Create sioclientConfig.cmake + (call-with-output-file (string-append cmake-dir "/sioclientConfig.cmake") + (lambda (port) + (display "# sioclient CMake configuration file +include(CMakeFindDependencyMacro) + +# Find dependencies +find_dependency(Boost REQUIRED) +find_dependency(OpenSSL REQUIRED) + +# Define the library targets +add_library(sioclient::sioclient STATIC IMPORTED) +set_target_properties(sioclient::sioclient PROPERTIES + IMPORTED_LOCATION \"${CMAKE_CURRENT_LIST_DIR}/../../libsioclient.a\" + INTERFACE_INCLUDE_DIRECTORIES \"${CMAKE_CURRENT_LIST_DIR}/../../include\" + INTERFACE_COMPILE_DEFINITIONS \"ASIO_STANDALONE;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;_WEBSOCKETPP_CPP11_FUNCTIONAL_;_WEBSOCKETPP_CPP11_STL_\" +) + +add_library(sioclient::sioclient_tls STATIC IMPORTED) +set_target_properties(sioclient::sioclient_tls PROPERTIES + IMPORTED_LOCATION \"${CMAKE_CURRENT_LIST_DIR}/../../libsioclient_tls.a\" + INTERFACE_INCLUDE_DIRECTORIES \"${CMAKE_CURRENT_LIST_DIR}/../../include\" + INTERFACE_COMPILE_DEFINITIONS \"ASIO_STANDALONE;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;SIO_TLS;_WEBSOCKETPP_CPP11_FUNCTIONAL_;_WEBSOCKETPP_CPP11_STL_\" + INTERFACE_LINK_LIBRARIES \"OpenSSL::SSL;OpenSSL::Crypto\" +) + +# For compatibility, also provide the bare target names +add_library(sioclient ALIAS sioclient::sioclient) +add_library(sioclient_tls ALIAS sioclient::sioclient_tls) +" port))) + ;; Create sioclientConfigVersion.cmake + (call-with-output-file (string-append cmake-dir "/sioclientConfigVersion.cmake") + (lambda (port) + (display "set(PACKAGE_VERSION \"3.1.0\") + +if(\"${PACKAGE_VERSION}\" VERSION_LESS \"${PACKAGE_FIND_VERSION}\") + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if(\"${PACKAGE_VERSION}\" VERSION_EQUAL \"${PACKAGE_FIND_VERSION}\") + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() +" port))) + #t)))))) (inputs (list boost rapidjson openssl |