diff --git a/.gitmodules b/.gitmodules index 7d7b2151..303de399 100644 --- a/.gitmodules +++ b/.gitmodules @@ -54,11 +54,6 @@ path = regex/regex url = https://github.com/BRL-CAD/regex ignore = dirty -[submodule "linenoise/linenoise"] - path = linenoise/linenoise - url = https://github.com/BRL-CAD/linenoise - branch = RELEASE - ignore = dirty [submodule "lmdb/lmdb"] path = lmdb/lmdb url = https://github.com/BRL-CAD/lmdb diff --git a/dependencies.cmake b/dependencies.cmake index 16f2e5f7..5e9b5c32 100644 --- a/dependencies.cmake +++ b/dependencies.cmake @@ -169,10 +169,6 @@ add_project(openimageio GROUPS "APPLESEED") # https://invisible-island.net/ncurses/ add_project(ncurses GROUPS "OSPRAY") -# Linenoise - line editing library -# https://github.com/msteveb/linenoise -add_project(linenoise GROUPS "BRLCAD") - # Lightning Memory-Mapped Database # https://github.com/LMDB/lmdb add_project(lmdb GROUPS "BRLCAD") diff --git a/linenoise/CMakeLists.txt b/linenoise/CMakeLists.txt deleted file mode 100644 index b5061739..00000000 --- a/linenoise/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -# Decide if we're using linenoise -cad_enable(LINENOISE "gtools;nirt") - -bext_enable(LINENOISE) - -# Decision made - -if (ENABLE_LINENOISE) - - git_submodule_init(linenoise linenoise.c) - - RegisterDeps(LINENOISE) - - ExternalProject_Add(LINENOISE_BLD - URL "${CMAKE_CURRENT_SOURCE_DIR}/linenoise" - BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS} - PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/linenoise.patch - CMAKE_ARGS - ${BUILD_TYPE_SPECIFIER} - -DBIN_DIR=${BIN_DIR} - -DLIB_DIR=${LIB_DIR} - -DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS} - -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -DCMAKE_INSTALL_PREFIX=${CMAKE_BUNDLE_INSTALL_PREFIX} - -DCMAKE_INSTALL_LIBDIR:PATH=${LIB_DIR} - -DCMAKE_INSTALL_RPATH=${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR} - LOG_CONFIGURE ${EXT_BUILD_QUIET} - LOG_BUILD ${EXT_BUILD_QUIET} - LOG_INSTALL ${EXT_BUILD_QUIET} - LOG_OUTPUT_ON_FAILURE ${EXT_BUILD_QUIET} - STEP_TARGETS install - ) - - TargetInstallDeps(LINENOISE LINENOISE_DEPENDS) - - # Copy the license into position in CMAKE_BUNDLE_INSTALL_PREFIX - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/license.txt - ${DOC_LICENSE_DIR}/linenoise.txt - COPYONLY - ) - -endif (ENABLE_LINENOISE) - -# tab-width: 8 -# mode: cmake -# indent-tabs-mode: t -# End: -# ex: shiftwidth=2 tabstop=8 - diff --git a/linenoise/license.txt b/linenoise/license.txt deleted file mode 100644 index de10b19a..00000000 --- a/linenoise/license.txt +++ /dev/null @@ -1,63 +0,0 @@ -https://github.com/msteveb/linenoise - - -Copyright (c) 2010, Salvatore Sanfilippo -Copyright (c) 2010, Pieter Noordhuis - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -utf8 files in msteveb fork from jimtcl (https://github.com/msteveb/jimtcl) - -(c) 2010-2016 Steve Bennett - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE JIM TCL PROJECT ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -JIM TCL PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation -are those of the authors and should not be interpreted as representing -official policies, either expressed or implied, of the Jim Tcl Project. - diff --git a/linenoise/linenoise b/linenoise/linenoise deleted file mode 160000 index 4a12be85..00000000 --- a/linenoise/linenoise +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4a12be854d950e89fe943d1c6f0504527004d250 diff --git a/linenoise/linenoise.deps b/linenoise/linenoise.deps deleted file mode 100644 index ecdeab5f..00000000 --- a/linenoise/linenoise.deps +++ /dev/null @@ -1,2 +0,0 @@ -PATCH - diff --git a/linenoise/linenoise.patch b/linenoise/linenoise.patch deleted file mode 100644 index a154805f..00000000 --- a/linenoise/linenoise.patch +++ /dev/null @@ -1,261 +0,0 @@ -diff -Naur linenoise.orig/CMakeLists.txt linenoise/CMakeLists.txt ---- linenoise.orig/CMakeLists.txt 1969-12-31 19:00:00.000000000 -0500 -+++ linenoise/CMakeLists.txt 2023-09-11 16:45:41.218955886 -0400 -@@ -0,0 +1,88 @@ -+# C M A K E L I S T S . T X T -+# BRL-CAD -+# -+# Copyright (c) 2022 United States Government as represented by -+# the U.S. Army Research Laboratory. -+# -+# Redistribution and use in source and binary forms, with or without -+# modification, are permitted provided that the following conditions -+# are met: -+# -+# 1. Redistributions of source code must retain the above copyright -+# notice, this list of conditions and the following disclaimer. -+# -+# 2. Redistributions in binary form must reproduce the above -+# copyright notice, this list of conditions and the following -+# disclaimer in the documentation and/or other materials provided -+# with the distribution. -+# -+# 3. The name of the author may not be used to endorse or promote -+# products derived from this software without specific prior written -+# permission. -+# -+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -+# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -+# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+# -+# Build file for linenoise (above license applies to only this file - linenoise -+# is covered by its own license.) -+# -+# linenoise fork from https://github.com/msteveb/linenoise -+### -+ -+# Minimum required version of CMake -+cmake_minimum_required(VERSION 3.18) -+ -+# Set CMake project name -+project(LN) -+ -+include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -+ -+if (NOT DEFINED BIN_DIR) -+ set (BIN_DIR bin) -+endif (NOT DEFINED BIN_DIR) -+ -+if (NOT DEFINED LIB_DIR) -+ set (LIB_DIR lib) -+endif (NOT DEFINED LIB_DIR) -+ -+if (NOT DEFINED INCLUDE_DIR) -+ set (INCLUDE_DIR include) -+endif (NOT DEFINED INCLUDE_DIR) -+ -+set(LN_SRCS -+ utf8.c -+ linenoise.c -+ stringbuf.c -+ ) -+ -+add_library(linenoise SHARED ${LN_SRCS}) -+set_property(TARGET linenoise APPEND PROPERTY COMPILE_DEFINITIONS "LINENOISE_DLL_EXPORTS") -+set_property(TARGET linenoise APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS "LINENOISE_DLL_IMPORTS") -+install(TARGETS linenoise -+ RUNTIME DESTINATION ${BIN_DIR} -+ LIBRARY DESTINATION ${LIB_DIR} -+ ARCHIVE DESTINATION ${LIB_DIR} -+ ) -+ -+set(LN_HDRS -+ linenoise.h -+ stringbuf.h -+ utf8.h -+ ) -+install(FILES ${LN_HDRS} DESTINATION ${INCLUDE_DIR}/linenoise) -+ -+# Local Variables: -+# tab-width: 8 -+# mode: cmake -+# indent-tabs-mode: t -+# End: -+# ex: shiftwidth=2 tabstop=8 -diff -Naur linenoise.orig/linenoise.c linenoise/linenoise.c ---- linenoise.orig/linenoise.c 2023-09-11 16:47:20.613229986 -0400 -+++ linenoise/linenoise.c 2023-09-11 16:50:06.434355370 -0400 -@@ -223,6 +223,7 @@ - static void setOutputHighlight(struct current *current, const int *props, int nprops); - static void set_current(struct current *current, const char *str); - -+#if 0 - static int fd_isatty(struct current *current) - { - #ifdef USE_TERMIOS -@@ -232,6 +233,7 @@ - return 0; - #endif - } -+#endif - - void linenoiseHistoryFree(void) { - if (history) { -@@ -1907,10 +1909,10 @@ - printf("%s", prompt); - fflush(stdout); - sb = sb_getline(stdin); -- if (sb && !fd_isatty(¤t)) { -+ /*if (sb && !fd_isatty(¤t)) { - printf("%s\n", sb_str(sb)); - fflush(stdout); -- } -+ }*/ - } - else { - current.buf = sb_alloc(); -diff -Naur linenoise.orig/linenoise.h linenoise/linenoise.h ---- linenoise.orig/linenoise.h 2023-09-11 16:47:20.613229986 -0400 -+++ linenoise/linenoise.h 2023-09-11 16:45:41.218955886 -0400 -@@ -41,6 +41,28 @@ - extern "C" { - #endif - -+#ifndef COMPILER_DLLEXPORT -+# if defined(_WIN32) -+# define COMPILER_DLLEXPORT __declspec(dllexport) -+# define COMPILER_DLLIMPORT __declspec(dllimport) -+# else -+# define COMPILER_DLLEXPORT __attribute__ ((visibility ("default"))) -+# define COMPILER_DLLIMPORT __attribute__ ((visibility ("default"))) -+# endif -+#endif -+ -+#ifndef LINENOISE_EXPORT -+# if defined(LINENOISE_DLL_EXPORTS) && defined(LINENOISE_DLL_IMPORTS) -+# error "Only LINENOISE_DLL_EXPORTS or LINENOISE_DLL_IMPORTS can be defined, not both." -+# elif defined(LINENOISE_DLL_EXPORTS) -+# define LINENOISE_EXPORT COMPILER_DLLEXPORT -+# elif defined(LINENOISE_DLL_IMPORTS) -+# define LINENOISE_EXPORT COMPILER_DLLIMPORT -+# else -+# define LINENOISE_EXPORT -+# endif -+#endif -+ - #ifndef NO_COMPLETION - typedef struct linenoiseCompletions { - size_t len; -@@ -56,18 +78,18 @@ - * Sets the current tab completion handler and returns the previous one, or NULL - * if no prior one has been set. - */ --linenoiseCompletionCallback * linenoiseSetCompletionCallback(linenoiseCompletionCallback *comp, void *userdata); -+LINENOISE_EXPORT linenoiseCompletionCallback * linenoiseSetCompletionCallback(linenoiseCompletionCallback *comp, void *userdata); - - /* - * Adds a copy of the given string to the given completion list. The copy is owned - * by the linenoiseCompletions object. - */ --void linenoiseAddCompletion(linenoiseCompletions *comp, const char *str); -+LINENOISE_EXPORT void linenoiseAddCompletion(linenoiseCompletions *comp, const char *str); - - typedef char*(linenoiseHintsCallback)(const char *, int *color, int *bold, void *userdata); - typedef void(linenoiseFreeHintsCallback)(void *hint, void *userdata); --void linenoiseSetHintsCallback(linenoiseHintsCallback *callback, void *userdata); --void linenoiseSetFreeHintsCallback(linenoiseFreeHintsCallback *callback); -+LINENOISE_EXPORT void linenoiseSetHintsCallback(linenoiseHintsCallback *callback, void *userdata); -+LINENOISE_EXPORT void linenoiseSetFreeHintsCallback(linenoiseFreeHintsCallback *callback); - - #endif - -@@ -78,22 +100,22 @@ - * a copy of the entered string (for ENTER) or NULL (on EOF). The - * caller owns the returned string and must eventually free() it. - */ --char *linenoise(const char *prompt); -+LINENOISE_EXPORT char *linenoise(const char *prompt); - - /** - * Like linenoise() but starts with an initial buffer. - */ --char *linenoiseWithInitial(const char *prompt, const char *initial); -+LINENOISE_EXPORT char *linenoiseWithInitial(const char *prompt, const char *initial); - - /** - * Clear the screen. - */ --void linenoiseClearScreen(void); -+LINENOISE_EXPORT void linenoiseClearScreen(void); - - /* - * Adds a copy of the given line of the command history. - */ --int linenoiseHistoryAdd(const char *line); -+LINENOISE_EXPORT int linenoiseHistoryAdd(const char *line); - - /* - * Sets the maximum length of the command history, in lines. -@@ -101,46 +123,46 @@ - * retaining only the most recent entries. If len is 0 or less - * then this function does nothing. - */ --int linenoiseHistorySetMaxLen(int len); -+LINENOISE_EXPORT int linenoiseHistorySetMaxLen(int len); - - /* - * Returns the current maximum length of the history, in lines. - */ --int linenoiseHistoryGetMaxLen(void); -+LINENOISE_EXPORT int linenoiseHistoryGetMaxLen(void); - - /* - * Saves the current contents of the history to the given file. - * Returns 0 on success. - */ --int linenoiseHistorySave(const char *filename); -+LINENOISE_EXPORT int linenoiseHistorySave(const char *filename); - - /* - * Replaces the current history with the contents - * of the given file. Returns 0 on success. - */ --int linenoiseHistoryLoad(const char *filename); -+LINENOISE_EXPORT int linenoiseHistoryLoad(const char *filename); - - /* - * Frees all history entries, clearing the history. - */ --void linenoiseHistoryFree(void); -+LINENOISE_EXPORT void linenoiseHistoryFree(void); - - /* - * Returns a pointer to the list of history entries, writing its - * length to *len if len is not NULL. The memory is owned by linenoise - * and must not be freed. - */ --char **linenoiseHistory(int *len); -+LINENOISE_EXPORT char **linenoiseHistory(int *len); - - /* - * Returns the number of display columns in the current terminal. - */ --int linenoiseColumns(void); -+LINENOISE_EXPORT int linenoiseColumns(void); - - /** - * Enable or disable multiline mode (disabled by default) - */ --void linenoiseSetMultiLine(int enableml); -+LINENOISE_EXPORT void linenoiseSetMultiLine(int enableml); - - #ifdef __cplusplus - }