Skip to content

Commit

Permalink
Remove NXJSON and allow distros to build as seperate package. Add cre…
Browse files Browse the repository at this point in the history
…dits for third party in --version. Add convenience environment variables description for YCM-Generator in --help. Add verify hmac checksum checks to prevent code injection or to detect connection is compromised before sending sensitive source code. Fix /ready and /healthy but /healthy still needs verification. Let libgcrypt-config tool use the host triplet.
  • Loading branch information
orsonteodoro committed Feb 6, 2017
1 parent 6858636 commit 052b486
Show file tree
Hide file tree
Showing 7 changed files with 256 additions and 530 deletions.
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ if test "x$enable_ycmd" = xyes; then
GLIB_LIB_NAME=glib-2.0
], [:])

AC_SEARCH_LIBS([nx_json_get], [nxjson], [], [
AC_MSG_ERROR([unable to find the nx_json_get() function])
])

if test "x$with_openssl" = xyes; then
PKG_CHECK_MODULES([OPENSSL], [openssl], [
OPENSSL_LIB=$OPENSSL_LIBS
Expand Down
8 changes: 4 additions & 4 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if HAVE_YCMD
AM_CPPFLAGS += -DENABLE_YCMD -DYCMD_PATH=\"@YCMD_PATH@\" @GLIB_CFLAGS@
AM_CFLAGS =
AM_CPPFLAGS += -DPYTHON_PATH=\"@PYTHON_PATH@\"
AM_LDFLAGS =
AM_LDFLAGS = -lnxjson
if HAVE_NETTLE
AM_CFLAGS += @NETTLE_CFLAGS@
AM_CPPFLAGS += -DUSE_NETTLE
Expand All @@ -14,9 +14,9 @@ AM_CFLAGS += @OPENSSL_CFLAGS@
AM_CPPFLAGS += -DUSE_OPENSSL
endif
if HAVE_LIBGCRYPT
AM_CFLAGS += $(x86_64-pc-linux-gnu-libgcrypt-config --cflags)
AM_CFLAGS += $(shell $(host)-libgcrypt-config --cflags)
AM_CPPFLAGS += -DUSE_LIBGCRYPT
AM_LDFLAGS += $(x86_64-pc-linux-gnu-libgcrypt-config --libs)
LIBGCRYPT_LIBS = $(shell $(host)-libgcrypt-config --libs)
endif

endif
Expand Down Expand Up @@ -70,7 +70,6 @@ nano_SOURCES = browser.c \
move.c \
nano.c \
nano.h \
nxjson.c \
prompt.c \
proto.h \
rcfile.c \
Expand All @@ -89,6 +88,7 @@ nano_LDADD += @OPENSSL_LIBS@
endif
if HAVE_LIBGCRYPT
nano_LDADD += @GLIB_LIBS@
nano_LDFLAGS = $(LIBGCRYPT_LIBS)
endif
if HAVE_YCMD
nano_LDADD += @GLIB_LIBS@
Expand Down
94 changes: 93 additions & 1 deletion src/nano.c
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,14 @@ void usage(void)
#ifndef NANO_TINY
print_opt("-$", "--softwrap", N_("Enable soft line wrapping"));
#endif
#ifdef ENABLE_YCMD
printf("\n");
printf("YCM-Generator environment variables");
printf("\n");
printf("YCMG_PROJECT_PATH - full path to the directory containing your top-level build script. Supported: CMakeList.txt, configure, GNUmakefile, Makefile, makefile, *.pro\n");
printf("YCMG_FLAGS - Additional flags to pass to YCM-Generator\n");
printf("\n");
#endif
}

/* Display the current version of nano, the date and time it was
Expand All @@ -929,8 +937,92 @@ void version(void)
printf(_(" (C) 2014..%s the contributors to nano\n"), "2016");
printf(
_(" Email: [email protected] Web: https://nano-editor.org/"));
printf(_("\n Compiled options:"));

#ifdef ENABLE_YCMD
printf(_("\n"));
printf(_("\n YCMD support:"));
printf(_("\n (C) 2017 Orson Teodoro <[email protected]>"));
printf(_("\n License: GPL3+"));
printf(_("\n Web: https://github.com/orsonteodoro/nano-ycmd"));
printf(_("\n "));
printf(_("\n Direct third party libraries and programs used for YCMD support. For dependencies of dependencies check the project:"));
printf(_("\n ycmd:"));
printf(_("\n (C) 2015 ycmd contributors"));
printf(_("\n License: GPL3+"));
printf(_("\n Web: https://github.com/Valloric/ycmd"));
printf(_("\n"));
printf(_("\n neon:"));
printf(_("\n (C) 1999-2007 Joe Orton"));
printf(_("\n AUTHORS: http://svn.webdav.org/repos/projects/neon/trunk/AUTHORS"));
printf(_("\n License: LGPL2+"));
printf(_("\n"));
printf(_("\n NXJSON:"));
printf(_("\n (C) 2013 Yaroslav Stavnichiy"));
printf(_("\n License: LGPL3+"));
printf(_("\n Web: https://bitbucket.org/yarosla/nxjson"));
printf(_("\n"));
printf(_("\n Bear:"));
printf(_("\n (C) 2012-2015 by Laszlo Nagy"));
printf(_("\n License: GPL3+"));
printf(_("\n Web: https://github.com/rizsotto/Bear"));
printf(_("\n"));
printf(_("\n YCM-Generator:"));
printf(_("\n (C) 2015-2016 Reuben D'Netto"));
printf(_("\n License: GPL3"));
printf(_("\n Web: https://github.com/rdnetto/YCM-Generator"));
printf(_("\n"));
printf(_("\n GNU Bash:"));
printf(_("\n (C) 1987-2016 Free Software Foundation, Inc."));
printf(_("\n AUTHORS: http://git.savannah.gnu.org/cgit/bash.git/tree/AUTHORS"));
printf(_("\n License: GPL3+"));
printf(_("\n Web: https://www.gnu.org/software/bash/"));
printf(_("\n"));
printf(_("\n GNU Sed:"));
printf(_("\n (C) 1989-2017 Free Software Foundation, Inc."));
printf(_("\n AUTHORS: http://git.savannah.gnu.org/cgit/sed.git/tree/AUTHORS"));
printf(_("\n License: GPL3+"));
printf(_("\n Web: https://www.gnu.org/software/sed/"));
printf(_("\n"));
printf(_("\n GNU Make:"));
printf(_("\n (C) 1988-2016 Free Software Foundation, Inc."));
printf(_("\n AUTHORS: http://git.savannah.gnu.org/cgit/make.git/tree/AUTHORS"));
printf(_("\n License: GPL3+"));
printf(_("\n Web: https://www.gnu.org/software/make/"));
printf(_("\n"));
#ifdef USE_OPENSSL
printf(_("\n OpenSSL:"));
printf(_("\n (C) 1998-2016 The OpenSSL Project"));
printf(_("\n License: OpenSSL"));
printf(_("\n Web: https://www.openssl.org/"));
printf(_("\n"));
#endif
#ifdef USE_LIBGCRYPT
printf(_("\n Libgcrypt:"));
printf(_("\n (C) 1997 Werner Koch"));
printf(_("\n (C) 2003, 2006, 2008 Free Software Foundation, Inc."));
printf(_("\n AUTHORS: https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=blob_plain;f=AUTHORS;hb=refs/heads/master"));
printf(_("\n License: LGPLv2.1+"));
printf(_("\n Web: https://www.gnu.org/software/libgcrypt"));
printf(_("\n"));
printf(_("\n GLib:"));
printf(_("\n (C) 2006 Alexander Larsson"));
printf(_("\n (C) 2000-2003 Ximian Inc."));
printf(_("\n (C) 1997-2000 GLib team and others"));
printf(_("\n AUTHORS: https://github.com/GNOME/glib/blob/master/AUTHORS"));
printf(_("\n License: LGPL2+"));
printf(_("\n Web: https://wiki.gnome.org/Projects/GLib"));
printf(_("\n"));
#endif
#ifdef USE_NETTLE
printf(_("\n Nettle:"));
printf(_("\n (C) 2002, 2013 Niels Möller"));
printf(_("\n License: LGPL-3+"));
printf(_("\n Web: http://www.lysator.liu.se/~nisse/nettle"));
printf(_("\n"));
#endif
#endif

printf(_("\n Compiled options:"));
#ifdef NANO_TINY
printf(" --enable-tiny");
#ifndef DISABLE_BROWSER
Expand Down
Loading

0 comments on commit 052b486

Please sign in to comment.