robinhood: enable for 64 bits, build without dependencies, add docs. (#11456)

* robinhood: enable for 64 bits. Build without dependencies.

Also, addded the docs, and a small patch so you can actually open them from RHConsole's
"Help" menu.

* libhttp: drop recipe.

Only user on-tree, RobinHood, now includes it.
(HaikuArchive/libHTTP even says: "DO NOT USE FOR NEW PROJECTS").
This commit is contained in:
OscarL
2024-12-18 03:35:14 -03:00
committed by GitHub
parent b11ebf5afa
commit c263d500de
4 changed files with 192 additions and 122 deletions

View File

@@ -1,60 +0,0 @@
SUMMARY="An HTTP protocol handler"
DESCRIPTION="libHTTP is a helper library used by RobinHood to simplify \
HTTP and other protocols. It is a legacy library and shouldn't be used in new \
code anymore."
HOMEPAGE="https://github.com/HaikuArchives/libHTTP"
COPYRIGHT="1999 Joe Kloss
2015 Puck Meerburg"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://github.com/HaikuArchives/libHTTP/archive/4a94696b445d88bc48c070ca3e9276e2e942059a.tar.gz"
CHECKSUM_SHA256="34185c19a76d4c35730795e1b5c115bee749508f3fd2bded25bba69a7ad68c62"
SOURCE_DIR="libHTTP-4a94696b445d88bc48c070ca3e9276e2e942059a"
ARCHITECTURES="?all x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
libhttp$secondaryArchSuffix = $portVersion
lib:libHTTP$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
"
PROVIDES_devel="
libhttp${secondaryArchSuffix}_devel = $portVersion
devel:libHTTP$secondaryArchSuffix = $portVersion
"
REQUIRES_devel="
haiku${secondaryArchSuffix}_devel
libhttp$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
makefile_engine
cmd:gcc$secondaryArchSuffix
cmd:make
"
BUILD()
{
make $jobArgs OBJ_DIR=objects
}
INSTALL()
{
mkdir -p $libDir
mkdir -p $includeDir/libHTTP
cp -a objects/libHTTP.so $libDir
cp -R headers/* $includeDir/libHTTP
prepareInstalledDevelLibs \
libHTTP
packageEntries devel \
$developDir
}

View File

@@ -0,0 +1,110 @@
From 4c47f5a5576f5154d3bb5064b46d48fd436cbcd7 Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Sun, 15 Dec 2024 19:52:37 -0300
Subject: Use the find_path API to locate the documentation.
diff --git a/source/RHConsole/source/RHCWindow.cpp b/source/RHConsole/source/RHCWindow.cpp
index 8cdfc5c..8fa6072 100644
--- a/source/RHConsole/source/RHCWindow.cpp
+++ b/source/RHConsole/source/RHCWindow.cpp
@@ -30,8 +30,10 @@
#include <Entry.h>
#include <Alert.h>
#include <Path.h>
+#include <PathFinder.h>
#include <Roster.h>
#include <StringView.h>
+#include <Url.h>
#include <stdarg.h>
#include "RHCWindow.h"
#include "RHMessages.h"
@@ -161,19 +163,20 @@ void RHCWindow::MessageReceived( BMessage *message )
case MSG_RH_DOCUMENTATION:
{
// Open browser window with documentation index page
+ BPath path;
+ BPathFinder finder;
+ status_t status = finder.FindPath(B_FIND_PATH_DOCUMENTATION_DIRECTORY,
+ "packages/robinhood/index.html", B_FIND_PATH_EXISTING_ONLY, path);
+
+ if ((status != B_OK) || path.InitCheck()) {
+ ConsolePrintf("Failed to find the documentation: %s\n", strerror(status));
+ break;
+ }
- app_info info;
- BEntry entry;
- BPath path;
-
- be_app->GetAppInfo( &info );
- entry.SetTo( &info.ref );
- entry.GetParent( &entry );
- entry.GetPath(&path);
- path.Append( "Robin Hood Docs" );
- const char *url = path.Path();
- be_roster->Launch("text/html", 1, (char**) &url);
-
+ BString url("file://");
+ url += path.Path();
+ if (BUrl(url).OpenWithPreferredApplication() != B_OK)
+ ConsolePrintf("Failed to open the documentation: %s\n", strerror(status));
break;
}
--
2.45.2
From f09c4543ffb36988d96bc40d26656aeb9edaf4f8 Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Sun, 15 Dec 2024 19:52:46 -0300
Subject: Tell the user to use HaikuDepot/pkgman to install PHP.
diff --git a/source/RHConsole/source/RHCWindow.cpp b/source/RHConsole/source/RHCWindow.cpp
index 8fa6072..b363e47 100644
--- a/source/RHConsole/source/RHCWindow.cpp
+++ b/source/RHConsole/source/RHCWindow.cpp
@@ -182,9 +182,7 @@ void RHCWindow::MessageReceived( BMessage *message )
case MSG_DOWNLOAD_PHP:
{
- // Open browser window with URL to PHP page at BeBits
- const char * url = "http://www.bebits.com/app/566/";
- be_roster->Launch("text/html", 1, (char**) &url);
+ (new BAlert("RobinHood", "You can use HaikuDepot, or pkgman, to install PHP.", "OK" ))->Go();
break;
}
--
2.45.2
From a7306684e5b98362bf569f0d9202af66f5fe2454 Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Sun, 15 Dec 2024 19:52:50 -0300
Subject: RHConsole: do not switch workspaces at start up.
It is very confusing seeing RHConsole on Deskbar (but no visible
window) if you start it from a different workspace than where it
was the last time you closed it.
diff --git a/source/RHConsole/source/RHCWindow.cpp b/source/RHConsole/source/RHCWindow.cpp
index b363e47..1b3c3c0 100644
--- a/source/RHConsole/source/RHCWindow.cpp
+++ b/source/RHConsole/source/RHCWindow.cpp
@@ -81,7 +81,10 @@ RHCWindow::RHCWindow( BPoint where, uint32 workspace )
prefs.Read( &typeFilter, sizeof(typeFilter) );
prefs.Read( &headerFilter, sizeof(headerFilter) );
prefs.Read( &workspace, sizeof(workspace) );
+
+#ifdef START_ON_LAST_WORKSPACE
SetWorkspaces( workspace );
+#endif
}
}
--
2.45.2

View File

@@ -1,62 +0,0 @@
SUMMARY="A Haiku-native HTTP/1.1 server"
DESCRIPTION="RobinHood is a native web server containing many features like \
authentication, virtual hosts, virtual folders, CGI, SSI, Ranges, and much more\
!"
HOMEPAGE="https://haikuarchives.github.io/RobinHood/"
COPYRIGHT="1999-2001 The Robin Hood Development Team
2015 Puck Meerburg"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://github.com/HaikuArchives/RobinHood/archive/a1a81cddf007bd81d53c3b9d5fc23197c0da554d.tar.gz"
CHECKSUM_SHA256="37e297cf2c73907ec7694fa697c7ac765f6c068aac2effc24e4b89a7e770c556"
SOURCE_DIR="RobinHood-a1a81cddf007bd81d53c3b9d5fc23197c0da554d"
ARCHITECTURES="?all x86_gcc2"
PROVIDES="
robinhood = $portVersion
app:RHConsole = $portVersion
app:RobinHoudini = $portVersion
cmd:rhdaemon = $portVersion
cmd:rhlog = $portVersion
"
REQUIRES="
haiku
libhttp
"
BUILD_REQUIRES="
haiku_devel
libhttp_devel
"
BUILD_PREREQUIRES="
makefile_engine
cmd:gcc
cmd:make
"
BUILD()
{
cd source
make $jobArgs
cd ../RobinHoudini
make $jobArgs OBJ_DIR=objects
}
INSTALL()
{
cd source
make install
cd server
mkdir -p $binDir $appsDir $addOnsDir
cp rhdaemon $binDir
cp RHLog $binDir/rhlog
cp RHConsole $appsDir
cp -r robin_hood_modules $addOnsDir
addAppDeskbarSymlink $appsDir/RHConsole Robin\ Hood
cd ../../RobinHoudini
cp objects/RHoudini $appsDir/RobinHoudini
mkdir -p $dataDir/deskbar/menu/Desktop\ applets
symlinkRelative -s $appsDir/RobinHoudini \
$dataDir/deskbar/menu/Desktop\ applets/Robin\ Houdini
}

View File

@@ -0,0 +1,82 @@
SUMMARY="A Haiku-native HTTP/1.1 server"
DESCRIPTION="RobinHood is a native web server containing many features like \
authentication, virtual hosts, virtual folders, CGI, SSI, Ranges, and much more\
!"
HOMEPAGE="https://haikuarchives.github.io/RobinHood/"
COPYRIGHT="1999-2001 The Robin Hood Development Team
2015 Puck Meerburg"
LICENSE="GNU GPL v2"
REVISION="1"
srcGitRev="1eca72d80d79414a7988ab17259030c64172577f"
SOURCE_URI="https://github.com/HaikuArchives/RobinHood/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="599ed4c777ffd849ae169a514e7a52f78e85ca73a92355fbceb8ddeffca92406"
SOURCE_DIR="RobinHood-$srcGitRev"
srcGitRev2="4a94696b445d88bc48c070ca3e9276e2e942059a"
SOURCE_URI_2="https://github.com/HaikuArchives/libHTTP/archive/$srcGitRev2.tar.gz"
CHECKSUM_SHA256_2="34185c19a76d4c35730795e1b5c115bee749508f3fd2bded25bba69a7ad68c62"
SOURCE_DIR_2="libHTTP-$srcGitRev2"
SOURCE_URI_3="https://github.com/HaikuArchives/RobinHood/archive/refs/heads/gh-pages.zip"
CHECKSUM_SHA256_3="904d9f6b737c1788d1866086d5387f8c7f2f2c39f46146cab79a781c14375385"
SOURCE_DIR_3="RobinHood-gh-pages"
PATCHES="robinhood-$portVersion.patchset"
ARCHITECTURES="all"
PROVIDES="
robinhood = $portVersion
app:RHConsole = $portVersion
app:RobinHoudini = $portVersion
cmd:rhdaemon = $portVersion
cmd:rhlog = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
BUILD_PREREQUIRES="
makefile_engine
cmd:gcc
cmd:make
"
BUILD()
{
# setup local copy of libHTTP, and build it as a static library.
cp -r $sourceDir2/* $sourceDir/source/libHTTP
sed -i -E 's,NAME = libHTTP.so,NAME = libHTTP,' $sourceDir/source/libHTTP/Makefile
sed -i -E 's,TYPE = SHARED,TYPE = STATIC,' $sourceDir/source/libHTTP/Makefile
# Setting it to FALSE still builds in debug mode :-/
sed -i -E 's,DEBUGGER := TRUE,DEBUGGER := ,' $sourceDir/source/libHTTP/Makefile
cd source
make $jobArgs
cd ../RobinHoudini
make $jobArgs OBJ_DIR=objects
}
INSTALL()
{
cd source
make install
cd server
mkdir -p $binDir $appsDir $addOnsDir $docDir
cp rhdaemon $binDir
cp RHLog $binDir/rhlog
cp RHConsole $appsDir
cp -r robin_hood_modules $addOnsDir
addAppDeskbarSymlink $appsDir/RHConsole Robin\ Hood
cd ../../RobinHoudini
cp objects/RHoudini $appsDir/RobinHoudini
cp -r $sourceDir3/* $docDir
mkdir -p $dataDir/deskbar/menu/Desktop\ applets
symlinkRelative -s $appsDir/RobinHoudini \
$dataDir/deskbar/menu/Desktop\ applets/Robin\ Houdini
}