diff options
author | danfe <danfe@FreeBSD.org> | 2019-07-04 19:18:42 +0800 |
---|---|---|
committer | danfe <danfe@FreeBSD.org> | 2019-07-04 19:18:42 +0800 |
commit | 8e9aecd386239d708bb1e37250f5f8ed75639ffd (patch) | |
tree | 4fc652789677ce9d4c4973ae89f380eeadd0ed31 | |
parent | b140448439898d7a84df4eeef8a46d40ed62a330 (diff) | |
download | freebsd-ports-gnome-8e9aecd386239d708bb1e37250f5f8ed75639ffd.tar.gz freebsd-ports-gnome-8e9aecd386239d708bb1e37250f5f8ed75639ffd.tar.zst freebsd-ports-gnome-8e9aecd386239d708bb1e37250f5f8ed75639ffd.zip |
- Install preferences file as sample and annotate accordingly
- Teach the code to expand tilde (~) to $(HOME) to prevent
spamming every current directory with `.apl.history' file
- Fix some minor C[XX]FLAGS pollution while I'm here
-rw-r--r-- | lang/gnu-apl/Makefile | 9 | ||||
-rw-r--r-- | lang/gnu-apl/files/patch-gnu-apl.d_preferences.in | 16 | ||||
-rw-r--r-- | lang/gnu-apl/files/patch-src_UserPreferences.cc | 29 | ||||
-rw-r--r-- | lang/gnu-apl/pkg-plist | 2 |
4 files changed, 55 insertions, 1 deletions
diff --git a/lang/gnu-apl/Makefile b/lang/gnu-apl/Makefile index acc5c8104444..56fbdae6518f 100644 --- a/lang/gnu-apl/Makefile +++ b/lang/gnu-apl/Makefile @@ -3,6 +3,7 @@ PORTNAME= apl PORTVERSION= 1.8 +PORTREVISION= 1 CATEGORIES= lang MASTER_SITES= GNU PKGNAMEPREFIX= gnu- @@ -46,10 +47,18 @@ post-patch: ${WRKSRC}/src/emacs_mode/UnixSocketListener.cc @${REINPLACE_CMD} -e 's,POLLRDHUP,POLLHUP,' \ ${WRKSRC}/src/Quad_GTK.cc +# Prevent needless C[XX]FLAGS pollution + @${REINPLACE_CMD} -e 's,-g -O. ,,' \ + ${WRKSRC}/src/APs/Makefile.in \ + ${WRKSRC}/src/native/Makefile.in # Fixes below are for GCC-based builds @${REINPLACE_CMD} -e '28s,^,#include <cstring>,' \ ${WRKSRC}/src/Error.hh @${REINPLACE_CMD} -E '/(total|used)_memory/s,uint64_t,int64_t,' \ ${WRKSRC}/src/Quad_WA.?? ${WRKSRC}/src/Value.cc +post-install: + @${MV} ${STAGEDIR}${PREFIX}/etc/gnu-apl.d/preferences \ + ${STAGEDIR}${PREFIX}/etc/gnu-apl.d/preferences.sample + .include <bsd.port.mk> diff --git a/lang/gnu-apl/files/patch-gnu-apl.d_preferences.in b/lang/gnu-apl/files/patch-gnu-apl.d_preferences.in new file mode 100644 index 000000000000..1f29b51f5d3a --- /dev/null +++ b/lang/gnu-apl/files/patch-gnu-apl.d_preferences.in @@ -0,0 +1,16 @@ +--- gnu-apl.d/preferences.in.orig 2019-06-23 12:39:20 UTC ++++ gnu-apl.d/preferences.in +@@ -301,10 +301,11 @@ + # execution mode and ∇-edit mode. + # + # Below the number of history lines and the location of the history file +-# can be configured. ++# can be configured. If the file path starts with "~/", tilde (~) would ++# be expanded to the value of the 'HOME' environment variable. + # + READLINE_HISTORY_LEN 500 +-READLINE_HISTORY_PATH .apl.history ++READLINE_HISTORY_PATH ~/.apl.history + + # The history can serve two purposes: to recall lines that were previously + # and to list what was done (with command )HISTORY). For the latter purpose diff --git a/lang/gnu-apl/files/patch-src_UserPreferences.cc b/lang/gnu-apl/files/patch-src_UserPreferences.cc new file mode 100644 index 000000000000..5ae5b42b7d2c --- /dev/null +++ b/lang/gnu-apl/files/patch-src_UserPreferences.cc @@ -0,0 +1,29 @@ +--- src/UserPreferences.cc.orig 2019-06-23 12:39:20 UTC ++++ src/UserPreferences.cc +@@ -1299,7 +1299,25 @@ int file_profile = 0; // the current profile in the + } + else if (!strcasecmp(opt, "READLINE_HISTORY_PATH")) + { +- line_history_path = UTF8_string(arg); ++ // If 'arg' starts with "~/", expand ~ -> $HOME ++ if (arg[0] == '~' && arg[1] == '/') ++ { ++ const char * HOME = getenv("HOME"); ++ if (HOME == 0) ++ { ++ if (log_startup) ++ CERR << "environment variable 'HOME' is not " ++ "defined for '~' expansion, will use " ++ << (arg + 2) << endl; ++ line_history_path = UTF8_string(arg + 2); ++ } ++ else ++ { ++ line_history_path = UTF8_string(HOME); ++ line_history_path.append_ASCII(arg + 1); ++ } ++ } ++ else line_history_path = UTF8_string(arg); + } + else if (!strcasecmp(opt, "NABLA-TO-HISTORY")) + { diff --git a/lang/gnu-apl/pkg-plist b/lang/gnu-apl/pkg-plist index 8bf1221d5eeb..c88c3b12ff7e 100644 --- a/lang/gnu-apl/pkg-plist +++ b/lang/gnu-apl/pkg-plist @@ -5,7 +5,7 @@ bin/APserver %%GTK3%%bin/Gtk_server etc/gnu-apl.d/keyboard1.txt etc/gnu-apl.d/parallel_thresholds -etc/gnu-apl.d/preferences +@sample etc/gnu-apl.d/preferences.sample %%LIBAPL%%include/apl/libapl.h %%LIBAPL%%lib/apl/libapl.a %%LIBAPL%%lib/apl/libapl.so |