HSTR: bump version (#3284)

This commit is contained in:
miqlas
2018-10-29 07:37:05 +01:00
committed by Jérôme Duval
parent e29df19d5d
commit 352b82f5f6
3 changed files with 119 additions and 90 deletions

View File

@@ -2,12 +2,11 @@ SUMMARY="Shell history suggest box"
DESCRIPTION="Easily view, navigate, search and use your command history with \
shell history suggest box for Bash and ZSH."
HOMEPAGE="http://me.mindforger.com/projects/hh.html"
COPYRIGHT="2014 Martin Dvorak"
COPYRIGHT="2014-2018 Martin Dvorak"
LICENSE="Apache v2"
REVISION="1"
SOURCE_URI="https://github.com/dvorka/hstr/releases/download/$portVersion/hh-$portVersion-src.tgz"
CHECKSUM_SHA256="1dc07cf0bdbb5ff36ee85a45f929b56a1f9776e63d51f84fc8067377ced11171"
SOURCE_DIR="hstr"
SOURCE_URI="https://github.com/dvorka/hstr/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="8d93ed8bfee1a979e8d06646e162b70316e2097e16243636d81011ba1000627a"
PATCHES="hstr-$portVersion.patchset"
ARCHITECTURES="?x86_gcc2 x86 x86_64"

View File

@@ -1,86 +0,0 @@
From 419c19184f486d849f845e8485fd552d4c83b51b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Sun, 29 Apr 2018 12:58:42 +0200
Subject: Haiku supporting patches
diff --git a/src/Makefile.am b/src/Makefile.am
index c3e0823..20f8e44 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -34,6 +34,6 @@ hh_SOURCES = \
# create hh > hstr hard link on installation
install-exec-hook:
- ln $(DESTDIR)$(bindir)/hh$(EXEEXT) $(DESTDIR)$(bindir)/hstr$(EXEEXT)
+ ln -s $(DESTDIR)$(bindir)/hh$(EXEEXT) $(DESTDIR)$(bindir)/hstr$(EXEEXT)
hh_LDADD = $(NCURSES_LIBS)
diff --git a/src/hstr.c b/src/hstr.c
index 80b18d2..5141663 100644
--- a/src/hstr.c
+++ b/src/hstr.c
@@ -22,6 +22,8 @@
#include <locale.h>
#ifdef __APPLE__
#include <curses.h>
+#elif defined(__HAIKU__)
+#include <ncurses.h>
#elif defined(__FreeBSD__)
#include <ncurses.h>
#else
diff --git a/src/hstr_history.c b/src/hstr_history.c
index 1e01f35..fff0549 100644
--- a/src/hstr_history.c
+++ b/src/hstr_history.c
@@ -55,7 +55,11 @@ char *get_history_file_name()
if(!historyFile || strlen(historyFile)==0) {
char *home = getenv(ENV_VAR_HOME);
historyFile = malloc(strlen(home) + 1 + strlen(FILE_DEFAULT_HISTORY) + 1);
- strcat(strcat(strcpy(historyFile, home), "/"), FILE_DEFAULT_HISTORY);
+ #ifndef __HAIKU__
+ strcat(strcat(strcpy(historyFile, home), "/"), FILE_DEFAULT_HISTORY);
+ #else
+ strcat(strcat(strcpy(historyFile, home), "/config/settings/"), FILE_DEFAULT_HISTORY);
+ #endif
}
return historyFile;
}
diff --git a/src/hstr_utils.c b/src/hstr_utils.c
index bd1e1cc..87a91e1 100644
--- a/src/hstr_utils.c
+++ b/src/hstr_utils.c
@@ -73,7 +73,7 @@ void hstr_chop(char *s)
}
}
-#if !defined(__MS_WSL__) && !defined(__CYGWIN__)
+#if !defined(__MS_WSL__) && !defined(__CYGWIN__) && !defined(__HAIKU__)
void tiocsti()
{
char buf[] = DEFAULT_COMMAND;
@@ -87,7 +87,7 @@ void tiocsti()
void fill_terminal_input(char *cmd, bool padding)
{
if(cmd && strlen(cmd)>0) {
-#if defined(__MS_WSL__) || defined(__CYGWIN__)
+#if defined(__MS_WSL__) || defined(__CYGWIN__) || defined(__HAIKU__)
fprintf(stderr, "%s", cmd);
if(padding) fprintf(stderr, "%s", "\n");
#else
diff --git a/src/include/hstr_curses.h b/src/include/hstr_curses.h
index ad6fade..8159f80 100644
--- a/src/include/hstr_curses.h
+++ b/src/include/hstr_curses.h
@@ -21,6 +21,8 @@
#ifdef __APPLE__
#include <curses.h>
+#elif defined(__HAIKU__)
+#include <ncurses.h>
#elif defined(__FreeBSD__)
#include <ncurses.h>
#else
--
2.16.2

View File

@@ -0,0 +1,116 @@
From 705c5d4aa39bf8f71eb155730858c480bef9c268 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Sat, 27 Oct 2018 12:51:57 +0200
Subject: Haiku supporting patches
diff --git a/src/Makefile.am b/src/Makefile.am
index 7640d21..328353c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -35,6 +35,6 @@ hstr_SOURCES = \
# create hstr > hh hard link on installation
install-exec-hook:
- ln $(DESTDIR)$(bindir)/hstr$(EXEEXT) $(DESTDIR)$(bindir)/hh$(EXEEXT)
+ ln -s $(DESTDIR)$(bindir)/hstr$(EXEEXT) $(DESTDIR)$(bindir)/hh$(EXEEXT)
hstr_LDADD = $(NCURSES_LIBS)
diff --git a/src/hstr_history.c b/src/hstr_history.c
index c4353ca..e2f8891 100644
--- a/src/hstr_history.c
+++ b/src/hstr_history.c
@@ -51,7 +51,11 @@ char* get_history_file_name(void)
if(!historyFile || strlen(historyFile)==0) {
char* home = getenv(ENV_VAR_HOME);
historyFile = malloc(strlen(home) + 1 + strlen(FILE_DEFAULT_HISTORY) + 1);
- strcat(strcat(strcpy(historyFile, home), "/"), FILE_DEFAULT_HISTORY);
+ #ifndef __HAIKU__
+ strcat(strcat(strcpy(historyFile, home), "/"), FILE_DEFAULT_HISTORY);
+ #else
+ strcat(strcat(strcpy(historyFile, home), "/config/settings/"), FILE_DEFAULT_HISTORY);
+ #endif
} else {
// allocate so that this function always returns string to be freed
// (getenv() returns pointer (no need to free), home is allocated (must be freed)
diff --git a/src/hstr_utils.c b/src/hstr_utils.c
index 2c0742c..ab48a05 100644
--- a/src/hstr_utils.c
+++ b/src/hstr_utils.c
@@ -106,7 +106,7 @@ void hstr_chop(char *s)
}
}
-#if !defined(__MS_WSL__) && !defined(__CYGWIN__) && !defined(DEBUG_NO_TIOCSTI)
+#if !defined(__MS_WSL__) && !defined(__CYGWIN__) && !defined(DEBUG_NO_TIOCSTI) && !defined(__HAIKU__)
void tiocsti()
{
char buf[] = DEFAULT_COMMAND;
@@ -120,7 +120,7 @@ void tiocsti()
void fill_terminal_input(char* cmd, bool padding)
{
if(cmd && strlen(cmd)>0) {
-#if defined(__MS_WSL__) || defined(__CYGWIN__) || defined(DEBUG_NO_TIOCSTI)
+#if defined(__MS_WSL__) || defined(__CYGWIN__) || defined(DEBUG_NO_TIOCSTI) || defined(__HAIKU__)
fprintf(stderr, "%s", cmd);
if(padding) fprintf(stderr, "%s", "\n");
#else
diff --git a/src/include/hstr.h b/src/include/hstr.h
index 6376b47..3ea4443 100644
--- a/src/include/hstr.h
+++ b/src/include/hstr.h
@@ -25,6 +25,8 @@
#include <curses.h>
#elif defined(__FreeBSD__)
#include <ncurses.h>
+#elif defined(__HAIKU__)
+ #include <ncurses.h>
#else
#include <ncursesw/curses.h>
#endif
diff --git a/src/include/hstr_curses.h b/src/include/hstr_curses.h
index 045673e..ef3ef46 100644
--- a/src/include/hstr_curses.h
+++ b/src/include/hstr_curses.h
@@ -21,6 +21,8 @@
#ifdef __APPLE__
#include <curses.h>
+#elif defined(__HAIKU__)
+#include <ncurses.h>
#elif defined(__FreeBSD__)
#include <ncurses.h>
#else
--
2.19.1
From 1393e5f2234634e8430072684cce36be83fd4fca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Sat, 27 Oct 2018 12:54:48 +0200
Subject: No dotfiles on Haiku
diff --git a/src/include/hstr_history.h b/src/include/hstr_history.h
index 80ca7d1..bf65cdc 100644
--- a/src/include/hstr_history.h
+++ b/src/include/hstr_history.h
@@ -31,8 +31,13 @@
#define ENV_VAR_HISTFILE "HISTFILE"
-#define FILE_DEFAULT_HISTORY ".bash_history"
-#define FILE_ZSH_HISTORY ".zsh_history"
+#ifndef __HAIKU__
+ #define FILE_DEFAULT_HISTORY ".bash_history"
+ #define FILE_ZSH_HISTORY ".zsh_history"
+#else
+ #define FILE_DEFAULT_HISTORY "bash_history"
+ #define FILE_ZSH_HISTORY "zsh_history"
+#endif
#define ZSH_HISTORY_ITEM_OFFSET 15
#define BASH_HISTORY_ITEM_OFFSET 0
--
2.19.1