mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 03:30:05 +02:00
wayland-server: add recipe
This commit is contained in:
@@ -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 <new>
|
||||
|
||||
#include <Application.h>
|
||||
+#include <String.h>
|
||||
+#include <File.h>
|
||||
#include <OS.h>
|
||||
+#include <AppFileInfo.h>
|
||||
+#include <kernel/image.h>
|
||||
+
|
||||
#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
|
||||
|
||||
61
dev-libs/wayland-server/wayland_server-0.1.20221112.recipe
Normal file
61
dev-libs/wayland-server/wayland_server-0.1.20221112.recipe
Normal file
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user