-
-
Notifications
You must be signed in to change notification settings - Fork 470
witty: add package #7028
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
witty: add package #7028
Changes from all commits
e1ea19c
bfd27bd
05a920a
512fddd
2334c3f
9b2da38
12ee493
2d04dae
c3085f2
588d6f8
51a7873
a6afff2
9dc706b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package("witty") | ||
set_homepage("http://www.webtoolkit.eu/wt") | ||
set_description("Wt, C++ Web Toolkit") | ||
set_license("GPL-2.0") | ||
|
||
add_urls("https://github.com/emweb/wt/archive/refs/tags/$(version).tar.gz", | ||
"https://github.com/emweb/wt.git") | ||
|
||
add_versions("4.11.4", "b42b9818e4c8ab8af835b0c88bda5c4f71ccfb38fd8baf90648064b0544eb564") | ||
|
||
add_deps("cmake") | ||
add_deps("boost", { | ||
configs = { | ||
all = true, | ||
shared = true | ||
} -- include\boost\filesystem\config.hpp(96,1): error C1189: #error: Must not define both BOOST_FILESYSTEM_DYN_LINK and BOOST_FILESYSTEM_STATIC_LINK | ||
Comment on lines
+15
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I build |
||
}) | ||
add_deps("glew", "libharu", "libpng", "openssl", "zlib") | ||
if not is_plat("windows") then | ||
add_deps("harfbuzz", "pango") | ||
end | ||
|
||
if is_plat("windows") then | ||
add_syslinks("d2d1", "dwrite", "windowscodecs", "shlwapi") | ||
end | ||
|
||
on_install("windows", "linux", "macosx", function (package) | ||
local zlib = package:dep("zlib") | ||
local zlib_prefix = ""; | ||
if zlib and not zlib:is_system() then | ||
zlib_prefix = zlib:installdir() | ||
end | ||
local configs = { | ||
"-DBUILD_EXAMPLES=OFF", "-DBUILD_TESTS=OFF", "-DCONNECTOR_HTTP=ON", "-DENABLE_HARU=ON", | ||
"-DENABLE_MYSQL=OFF", "-DENABLE_FIREBIRD=OFF", "-DENABLE_QT4=OFF", "-DENABLE_QT5=OFF", | ||
"-DENABLE_LIBWTTEST=ON", "-DENABLE_OPENGL=ON", "-DCMAKE_INSTALL_DIR=share" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This will install |
||
} | ||
table.insert(configs, "-DZLIB_PREFIX=" .. zlib_prefix) | ||
if package:is_plat("windows") then | ||
table.join2(configs, {"-DWT_WRASTERIMAGE_IMPLEMENTATION=Direct2D", "-DCONNECTOR_ISAPI=ON", "-DENABLE_PANGO=OFF"}) | ||
else | ||
table.join2(configs, {"-DCONNECTOR_FCGI=OFF", "-DENABLE_PANGO=ON"}) | ||
table.insert(configs, "-DWT_WRASTERIMAGE_IMPLEMENTATION=" .. (package:config("graphicsmagick") and "GraphicsMagick" or "none")) | ||
end | ||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) | ||
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) | ||
table.insert(configs, "-DSHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) | ||
table.insert(configs, "-DBOOST_DYNAMIC=" .. (package:dep("boost"):config("shared") and "ON" or "OFF")) | ||
table.insert(configs, "-DHARU_DYNAMIC=" .. (package:dep("libharu"):config("shared") and "ON" or "OFF")) | ||
import("package.tools.cmake").install(package, configs) | ||
io.replace(path.join(package:installdir("include"), "Wt", "WConfig.h"), [[#define RUNDIR]], [[//#define RUNDIR]], {plain = true}) | ||
end) | ||
|
||
on_test(function (package) | ||
assert(package:check_cxxsnippets({test = [[ | ||
#include <Wt/WApplication.h> | ||
#include <Wt/WBreak.h> | ||
#include <Wt/WContainerWidget.h> | ||
#include <Wt/WLineEdit.h> | ||
#include <Wt/WPushButton.h> | ||
#include <Wt/WText.h> | ||
class HelloApplication : public Wt::WApplication { | ||
public: | ||
HelloApplication(const Wt::WEnvironment& env); | ||
private: | ||
Wt::WLineEdit *nameEdit_; | ||
Wt::WText *greeting_; | ||
void greet(); | ||
}; | ||
HelloApplication::HelloApplication(const Wt::WEnvironment& env) : WApplication(env) { | ||
setTitle("Hello world"); | ||
root()->addWidget(std::make_unique<Wt::WText>("Your name, please ? ")); | ||
nameEdit_ = root()->addWidget(std::make_unique<Wt::WLineEdit>()); | ||
nameEdit_->setFocus(); | ||
auto button = root()->addWidget(std::make_unique<Wt::WPushButton>("Greet me.")); | ||
button->setMargin(5, Wt::Side::Left); | ||
root()->addWidget(std::make_unique<Wt::WBreak>()); | ||
greeting_ = root()->addWidget(std::make_unique<Wt::WText>()); | ||
button->clicked().connect(this, &HelloApplication::greet); | ||
nameEdit_->enterPressed().connect(std::bind(&HelloApplication::greet, this)); | ||
button->clicked().connect([=]() { std::cerr << "Hello there, " << nameEdit_->text() << std::endl; }); | ||
} | ||
void HelloApplication::greet() { greeting_->setText("Hello there, " + nameEdit_->text()); } | ||
int main(int argc, char **argv) { | ||
return Wt::WRun(argc, argv, [](const Wt::WEnvironment &env) { return std::make_unique<HelloApplication>(env); }); | ||
} | ||
]]}, {configs = {languages = "c++20"}})) | ||
end) |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name as
wt
?https://launchpad.net/ubuntu/+source/witty
https://archlinux.org/packages/extra/x86_64/wt