mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
Added the latest version of less.
Contains a patch to move settings/history into B_USER_SETTINGS_DIRECTORY.
This commit is contained in:
18
sys-apps/less/less-436.bep
Normal file
18
sys-apps/less/less-436.bep
Normal file
@@ -0,0 +1,18 @@
|
||||
DESCRIPTION="Less is a free, open-source file pager."
|
||||
HOMEPAGE="http://www.greenwoodsoftware.com/less/"
|
||||
SRC_URI="http://www.greenwoodsoftware.com/less/less-436.tar.gz"
|
||||
CHECKSUM_MD5="817bf051953ad2dea825a1cdf460caa4"
|
||||
REVISION="1"
|
||||
STATUS_HAIKU="stable"
|
||||
DEPEND=""
|
||||
BUILD {
|
||||
cd less-436
|
||||
autoreconf -fvi
|
||||
./configure --prefix=/boot/common
|
||||
make
|
||||
}
|
||||
|
||||
INSTALL {
|
||||
cd less-436
|
||||
make install
|
||||
}
|
||||
5
sys-apps/less/less.OptionalPackageDescription
Normal file
5
sys-apps/less/less.OptionalPackageDescription
Normal file
@@ -0,0 +1,5 @@
|
||||
Package: less
|
||||
Version: 436
|
||||
Copyright: 1984-2009 Mark Nudelman
|
||||
License: GPL v3
|
||||
URL: http://www.greenwoodsoftware.com/less/
|
||||
128
sys-apps/less/patches/less-436.patch
Normal file
128
sys-apps/less/patches/less-436.patch
Normal file
@@ -0,0 +1,128 @@
|
||||
diff -up less-436/cmdbuf.c.orig less-436/cmdbuf.c
|
||||
--- less-436/cmdbuf.c.orig 2010-01-01 16:33:39.000000000 -0700
|
||||
+++ less-436/cmdbuf.c 2010-01-01 16:39:46.000000000 -0700
|
||||
@@ -1325,7 +1325,11 @@ cmd_lastpattern()
|
||||
static char *
|
||||
histfile_name()
|
||||
{
|
||||
+#ifdef __HAIKU__
|
||||
+ char home[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
|
||||
+#else
|
||||
char *home;
|
||||
+#endif
|
||||
char *name;
|
||||
int len;
|
||||
|
||||
@@ -1339,6 +1343,13 @@ histfile_name()
|
||||
return (save(name));
|
||||
}
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+ {
|
||||
+ dev_t volume = dev_for_path("/boot");
|
||||
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, true, home, sizeof(home)) != B_OK)
|
||||
+ return (NULL);
|
||||
+ }
|
||||
+#else
|
||||
/* Otherwise, file is in $HOME. */
|
||||
home = lgetenv("HOME");
|
||||
if (home == NULL || *home == '\0')
|
||||
@@ -1349,6 +1360,8 @@ histfile_name()
|
||||
#endif
|
||||
return (NULL);
|
||||
}
|
||||
+#endif
|
||||
+
|
||||
len = strlen(home) + strlen(LESSHISTFILE) + 2;
|
||||
name = (char *) ecalloc(len, sizeof(char));
|
||||
SNPRINTF2(name, len, "%s/%s", home, LESSHISTFILE);
|
||||
diff -up less-436/configure.ac.orig less-436/configure.ac
|
||||
--- less-436/configure.ac.orig 2010-01-01 16:06:56.000000000 -0700
|
||||
+++ less-436/configure.ac 2010-01-01 16:16:09.000000000 -0700
|
||||
@@ -562,10 +562,17 @@ AH_TOP([
|
||||
* LESSHISTFILE is the filename of the history file
|
||||
* (in the HOME directory).
|
||||
*/
|
||||
-#define LESSKEYFILE ".less"
|
||||
-#define LESSKEYFILE_SYS SYSDIR "/sysless"
|
||||
-#define DEF_LESSKEYINFILE ".lesskey"
|
||||
-#define LESSHISTFILE ".lesshst"
|
||||
+#ifdef __HAIKU__
|
||||
+# define LESSKEYFILE "less"
|
||||
+# define LESSKEYFILE_SYS SYSDIR "/sysless"
|
||||
+# define DEF_LESSKEYINFILE "lesskey"
|
||||
+# define LESSHISTFILE "lesshst"
|
||||
+#else
|
||||
+# define LESSKEYFILE ".less"
|
||||
+# define LESSKEYFILE_SYS SYSDIR "/sysless"
|
||||
+# define DEF_LESSKEYINFILE ".lesskey"
|
||||
+# define LESSHISTFILE ".lesshst"
|
||||
+#endif
|
||||
|
||||
|
||||
/* Settings always true on Unix. */
|
||||
diff -up less-436/filename.c.orig less-436/filename.c
|
||||
--- less-436/filename.c.orig 2010-01-01 16:25:25.000000000 -0700
|
||||
+++ less-436/filename.c 2010-01-01 16:23:03.000000000 -0700
|
||||
@@ -267,12 +267,23 @@ homefile(filename)
|
||||
{
|
||||
register char *pathname;
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+ char path[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
|
||||
+ dev_t volume = dev_for_path("/boot");
|
||||
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, true, path, sizeof(path)) != B_OK)
|
||||
+ return (NULL);
|
||||
+
|
||||
+ pathname = dirfile(&path, filename);
|
||||
+ if (pathname != NULL)
|
||||
+ return (pathname);
|
||||
+#else
|
||||
/*
|
||||
* Try $HOME/filename.
|
||||
*/
|
||||
pathname = dirfile(lgetenv("HOME"), filename);
|
||||
if (pathname != NULL)
|
||||
return (pathname);
|
||||
+#endif
|
||||
#if OS2
|
||||
/*
|
||||
* Try $INIT/filename.
|
||||
diff -up less-436/less.h.orig less-436/less.h
|
||||
--- less-436/less.h.orig 2010-01-01 16:27:31.000000000 -0700
|
||||
+++ less-436/less.h 2010-01-01 16:28:33.000000000 -0700
|
||||
@@ -94,6 +94,11 @@
|
||||
#include <floss.h>
|
||||
#endif
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <FindDirectory.h>
|
||||
+#include <StorageDefs.h>
|
||||
+#endif
|
||||
+
|
||||
#if MSDOS_COMPILER==WIN32C || OS2
|
||||
#include <io.h>
|
||||
#endif
|
||||
diff -up less-436/lesskey.c.orig less-436/lesskey.c
|
||||
--- less-436/lesskey.c.orig 2010-01-01 16:25:42.000000000 -0700
|
||||
+++ less-436/lesskey.c 2010-01-01 16:24:17.000000000 -0700
|
||||
@@ -244,8 +244,19 @@ homefile(filename)
|
||||
char *p;
|
||||
char *pathname;
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+ char path[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
|
||||
+ dev_t volume = dev_for_path("/boot");
|
||||
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, true, path, sizeof(path)) != B_OK)
|
||||
+ return (NULL);
|
||||
+
|
||||
+ pathname = mkpathname(&path, filename);
|
||||
+ if (pathname != NULL)
|
||||
+ return (pathname);
|
||||
+#else
|
||||
if ((p = getenv("HOME")) != NULL && *p != '\0')
|
||||
pathname = mkpathname(p, filename);
|
||||
+#endif
|
||||
#if OS2
|
||||
else if ((p = getenv("INIT")) != NULL && *p != '\0')
|
||||
pathname = mkpathname(p, filename);
|
||||
Reference in New Issue
Block a user