From 09d4e7afdd933f7d83ebc305704a2075ba41005b Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Thu, 17 Nov 2022 19:02:01 +1000 Subject: [PATCH] wayland-server: add recipe --- .../wayland_server-0.1.20221112.patchset | 70 +++++++++++++++++++ .../wayland_server-0.1.20221112.recipe | 61 ++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 dev-libs/wayland-server/patches/wayland_server-0.1.20221112.patchset create mode 100644 dev-libs/wayland-server/wayland_server-0.1.20221112.recipe diff --git a/dev-libs/wayland-server/patches/wayland_server-0.1.20221112.patchset b/dev-libs/wayland-server/patches/wayland_server-0.1.20221112.patchset new file mode 100644 index 000000000..fa11d7990 --- /dev/null +++ b/dev-libs/wayland-server/patches/wayland_server-0.1.20221112.patchset @@ -0,0 +1,70 @@ +From 320864b75abcc3e58284d3b087791823dd6bc17e Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 17 Nov 2022 18:57:13 +1000 +Subject: Get application signature from resources + + +diff --git a/WaylandServer.cpp b/WaylandServer.cpp +index 1c34137..0df10d2 100644 +--- a/WaylandServer.cpp ++++ b/WaylandServer.cpp +@@ -18,7 +18,12 @@ + #include + + #include ++#include ++#include + #include ++#include ++#include ++ + #include "AppKitPtrs.h" + + +@@ -73,7 +78,7 @@ private: + struct wl_client *fClient{}; + + public: +- Application(); ++ Application(const char *signature); + virtual ~Application() = default; + + void AddClient(struct wl_client *client); +@@ -83,7 +88,7 @@ public: + void MessageReceived(BMessage *msg) override; + }; + +-Application::Application(): BApplication("application/x-vnd.Wayland-App") ++Application::Application(const char *signature): BApplication(signature) + { + } + +@@ -123,7 +128,24 @@ void Application::MessageReceived(BMessage *msg) + extern "C" _EXPORT int wl_ips_client_connected(void **clientOut, void *clientDisplay, client_enqueue_proc display_enqueue) + { + if (be_app == NULL) { +- new Application(); ++ BString signature = "application/x-vnd.Wayland-App"; ++ int32 cookie = 0; ++ image_info info; ++ while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) { ++ if (info.type != B_APP_IMAGE) ++ continue; ++ BFile appFile(info.name, B_READ_ONLY); ++ if (appFile.InitCheck() == B_OK) { ++ BAppFileInfo info(&appFile); ++ if (info.InitCheck() == B_OK) { ++ char file_signature[B_MIME_TYPE_LENGTH]; ++ if (info.GetSignature(file_signature) == B_OK) ++ signature.SetTo(file_signature); ++ } ++ } ++ break; ++ } ++ new Application(signature.String()); + be_app->Run(); + } + if (gServerHandler.Looper() == NULL) { +-- +2.37.3 + diff --git a/dev-libs/wayland-server/wayland_server-0.1.20221112.recipe b/dev-libs/wayland-server/wayland_server-0.1.20221112.recipe new file mode 100644 index 000000000..241c993b9 --- /dev/null +++ b/dev-libs/wayland-server/wayland_server-0.1.20221112.recipe @@ -0,0 +1,61 @@ +SUMMARY="In-process Wayland server" +DESCRIPTION="Implementation of the Wayland protocols over the Haiku API. Unlike regular Wayland \ +server implementations, Haiku in-process Wayland server does not run as a separate server process \ +but loads as an add-on into each Wayland client instead. It doesn't do compositing by itself, but \ +uses existing Haiku capabilities such as native Haiku windows and bitmap drawing API." +HOMEPAGE="https://github.com/X547/wayland-server" +COPYRIGHT="2022 X512" +LICENSE="GNU LGPL v2.1 + MIT" +REVISION="1" +srcGitRev="f798d8f2e5efd93d0781f28da640788e26391261" +SOURCE_URI="https://github.com/X547/wayland-server/archive/$srcGitRev.tar.gz" +CHECKSUM_SHA256="37570267a3c1da03d6392827d9a96634218345ee1a3808abcf27c1628038e266" +PATCHES="wayland_server-$portVersion.patchset" +SOURCE_DIR="wayland-server-$srcGitRev" + +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + wayland_server$secondaryArchSuffix = $portVersion + lib:wayland_server_inproc$secondaryArchSuffix = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libwayland_client$secondaryArchSuffix + lib:libwayland_server$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + wayland_protocols$secondaryArchSuffix + devel:libwayland_client$secondaryArchSuffix + devel:libwayland_server$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:cmake + cmd:gcc$secondaryArchSuffix + cmd:meson + cmd:ninja + cmd:pkg_config$secondaryArchSuffix + cmd:wayland_scanner + " + +BUILD() +{ + meson build --buildtype=release \ + --prefix=$prefix \ + --libdir=$libDir + ninja -C build +} + +INSTALL() +{ + ninja -C build install +} + +TEST() +{ + ninja -C build test +}