webdriverxx: add package (#3954)

* webdriverxx: add package

* webdriverxx: use fork instead & exclude wasm

* webdriverxx: rename patch

* webdriverxx: set headeronly

* webdriverxx: exclude bsd

* webdriverxx: fix patch date

* libcurl: run buildconf before install

* libcurl: fix calling buildconf

* libcurl: add package:

* libcurl: use autoreconf

* libcurl: only use buildconf.bat if windows

* libcurl: add issue link

* libcurl: better format

* libcurl: add spacing

* libcurl: check if `buildconf.bat` exists

* webdriverxx: fix os.rm picojson

* libcurl: use os.isfile

* libcurl: test print

* libcurl: remove requirement to be windows to run `buildconf.bat`

* libcurl: add `plain = true`

* libcurl: test print

* libcurl: manually run contents of buildconf as lua

* libcurl: fix formatting

* libcurl: use `io.writefile`

* webdriverxx: add `accept_insecure_certs`

* webdriverxx: shorten `accept_insecure_certs` patch

* libcurl: copy to build dir

* libcurl: test print

* libcurl: copy tool_hugehelp

* libcurl: copy tool_hugehelp

* libcurl: comment

* libcurl: disable manual

* libcurl: remove commented

* webdriverxx: use later fork

* webdriverxx: exclude bsd

* webdriverxx: remove external libraries

* webdriverxx: only copy necessary files

* webdriverxx: add patch to fix cxx23

* libcurl: disable curl manual

* webdriverxx: Use chrome for test
pull/4001/head
Chi Huu Huynh 7 months ago committed by GitHub
parent 34a6050e24
commit cae46e86d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      packages/l/libcurl/xmake.lua
  2. 13
      packages/w/webdriverxx/patches/2023.04.22/fix_cxx23.patch
  3. 91
      packages/w/webdriverxx/patches/2023.04.22/picojson.patch
  4. 29
      packages/w/webdriverxx/xmake.lua

@ -80,7 +80,7 @@ package("libcurl")
on_install("windows", "mingw", "linux", "macosx", "iphoneos", "cross", "android", function (package)
local version = package:version()
local configs = {"-DBUILD_TESTING=OFF", "-DENABLE_MANUAL=OFF"}
local configs = {"-DBUILD_TESTING=OFF", "-DENABLE_MANUAL=OFF", "-DENABLE_CURL_MANUAL=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
@ -158,7 +158,7 @@ package("libcurl")
handledependency("mbedtls", "mbedtls", "MBEDTLS_INCLUDE_DIRS", {MBEDTLS_LIBRARY = "mbedtls", MBEDX509_LIBRARY = "mbedx509", MBEDCRYPTO_LIBRARY = "mbedcrypto"})
handledependency("zlib", "zlib", "ZLIB_INCLUDE_DIR", "ZLIB_LIBRARY")
handledependency("zstd", "zstd", "Zstd_INCLUDE_DIR", "Zstd_LIBRARY")
import("package.tools.cmake").install(package, configs, opt)
import("package.tools.cmake").install(package, configs, {buildir = "build"})
end)
on_test(function (package)

@ -0,0 +1,13 @@
diff --git a/include/webdriverxx/by.h b/include/webdriverxx/by.h
index 0ee2a1b..3f5b44e 100644
--- a/include/webdriverxx/by.h
+++ b/include/webdriverxx/by.h
@@ -8,7 +8,7 @@ namespace webdriverxx {
class By { // copyable
public:
- By() : strategy_("css selector"), value_(nullptr) {}
+ By() : strategy_("css selector"), value_("") {}
By(const std::string& strategy, const std::string& value)
: strategy_(strategy)

@ -0,0 +1,91 @@
diff --git a/include/webdriverxx/capabilities.h b/include/webdriverxx/capabilities.h
index ca5cb64..052ad27 100644
--- a/include/webdriverxx/capabilities.h
+++ b/include/webdriverxx/capabilities.h
@@ -2,7 +2,7 @@
#define WEBDRIVERXX_CAPABILITIES_H
#include "conversions.h"
-#include "picojson.h"
+#include <picojson.h>
#include <string>
namespace webdriverxx {
diff --git a/include/webdriverxx/client.h b/include/webdriverxx/client.h
index 5548438..d4b6a3e 100644
--- a/include/webdriverxx/client.h
+++ b/include/webdriverxx/client.h
@@ -5,7 +5,7 @@
#include "capabilities.h"
#include "detail/resource.h"
#include "detail/http_connection.h"
-#include "picojson.h"
+#include <picojson.h>
#include <string>
#include <vector>
diff --git a/include/webdriverxx/conversions.h b/include/webdriverxx/conversions.h
index 8374073..510b5a0 100644
--- a/include/webdriverxx/conversions.h
+++ b/include/webdriverxx/conversions.h
@@ -4,7 +4,7 @@
#include "types.h"
#include "detail/error_handling.h"
#include "detail/meta_tools.h"
-#include "picojson.h"
+#include <picojson.h>
#include <algorithm>
namespace webdriverxx {
diff --git a/include/webdriverxx/detail/resource.h b/include/webdriverxx/detail/resource.h
index 26e3ed6..185c5e0 100644
--- a/include/webdriverxx/detail/resource.h
+++ b/include/webdriverxx/detail/resource.h
@@ -6,7 +6,7 @@
#include "shared.h"
#include "../conversions.h"
#include "../response_status_code.h"
-#include "../picojson.h"
+#include <picojson.h>
namespace webdriverxx {
namespace detail {
diff --git a/include/webdriverxx/detail/types.h b/include/webdriverxx/detail/types.h
index f218900..fcbe4e9 100644
--- a/include/webdriverxx/detail/types.h
+++ b/include/webdriverxx/detail/types.h
@@ -3,7 +3,7 @@
#include "../conversions.h"
#include "../capabilities.h"
-#include "../picojson.h"
+#include <picojson.h>
#include <string>
#define CXX17_2X ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
diff --git a/include/webdriverxx/js_args.h b/include/webdriverxx/js_args.h
index 0944f28..6e90c94 100644
--- a/include/webdriverxx/js_args.h
+++ b/include/webdriverxx/js_args.h
@@ -2,7 +2,7 @@
#define WEBDRIVERXX_JS_ARGS_H
#include "conversions.h"
-#include "picojson.h"
+#include <picojson.h>
namespace webdriverxx {
diff --git a/include/webdriverxx/session.h b/include/webdriverxx/session.h
index ee5410d..24f4cd5 100644
--- a/include/webdriverxx/session.h
+++ b/include/webdriverxx/session.h
@@ -12,7 +12,7 @@
#include "detail/keyboard.h"
#include "detail/shared.h"
#include "detail/factories_impl.h"
-#include "picojson.h"
+#include <picojson.h>
#include "utils/picobase64.h"
#include <string>
#include <fstream>

@ -0,0 +1,29 @@
package("webdriverxx")
set_kind("library", {headeronly = true})
set_homepage("https://GermanAizek.github.io/webdriverxx")
set_description("A C++ client library for Selenium Webdriver")
set_license("MIT")
add_urls("https://github.com/GermanAizek/webdriverxx.git", {submodules = false})
add_versions("2023.04.22", "b8c9ac36360021daca7b0fd006a092b605b19e29")
add_patches("2023.04.22", "patches/2023.04.22/picojson.patch", "11e23fe37c7e3b8ec174642542567c9d6bae3657892f5d7ac8203cbb89c9112c")
add_patches("2023.04.22", "patches/2023.04.22/fix_cxx23.patch", "da63a9b134ba78cb17b099486b83d2bc846c9786590265eb4e31f88a9911aeab")
add_deps("libcurl", "picojson")
on_install("!bsd and !wasm", function (package)
os.rm("include/webdriverxx/picojson.h")
os.cp("include/webdriverxx.h", package:installdir("include"))
os.cp("include/webdriverxx", package:installdir("include"))
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <webdriverxx.h>
using namespace webdriverxx;
void test() {
WebDriver chrome = Start(Chrome());
}
]]}, {configs = {languages = "c++17"}}))
end)
Loading…
Cancel
Save