Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up klish patches and build commands #96

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions CLI/klish/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,18 @@ SHELL = /bin/bash
.SHELLFLAGS += -e

KLISH_VERSION = 2.1.4
PYTHONVER=3.7

KLISH_SRC = $(SONIC_CLI_ROOT)/klish-$(KLISH_VERSION)

ifeq ($(CROSS_BUILD_ENVIRON),y)
CROSS_CONFIGURE_OPTS = --host=$(CROSS_HOST_TYPE)
LIB_PATH = $(CROSS_PKGS_LIB_PATH)
else
LIB_PATH = /usr/lib/x86_64-linux-gnu
endif

SRC_REPLACEMENTS:=$(shell find patches -type f)
all : $(SRC_REPLACEMENTS)
tar xzvf klish-$(KLISH_VERSION).tgz -C $(SONIC_CLI_ROOT)
./patches/scripts/patchmake.sh -p VER=${KLISH_VERSION} TSP=${SONIC_CLI_ROOT} DSP=${CURDIR}/patches TWP=${SONIC_CLI_ROOT}
cd ${KLISH_SRC} && QUILT_PATCHES=${CURDIR}/patches quilt push -a

cd ${KLISH_SRC} && sh autogen.sh && ./configure --with-libxml2=/usr $(CROSS_CONFIGURE_OPTS) --enable-debug=no LIBS='-l:libcurl-gnutls.so.4 -L$(LIB_PATH) -lpython3.7m -Wl,-rpath=$(LIB_PATH) -lcjson' CFLAGS='${CFLAGS} -g -I/usr/include/python3.7m' CPPFLAGS='${CPPFLAGS} -I/usr/include/cjson' && make
ifeq ($(CROSS_BUILD_ENVIRON),y)
export PATH=/python_virtualenv/env3/bin/:${PATH}
endif
cd ${KLISH_SRC} && sh autogen.sh && ./configure --with-libxml2 --host=$(DEB_HOST_GNU_TYPE) --enable-debug=no CJSON_CFLAGS=-I/usr/include/cjson CJSON_LIBS=-lcjson && make

mkdir -p $(SONIC_CLI_ROOT)/target/.libs
cp $(CURDIR)/clish_start $(SONIC_CLI_ROOT)/target/.
Expand Down
34 changes: 34 additions & 0 deletions CLI/klish/patches/0001-Libxml-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From bf2fe604a732ee99e5560f3372815f04009877d0 Mon Sep 17 00:00:00 2001
From: Saikrishna Arcot <[email protected]>
Date: Fri, 12 Aug 2022 14:36:16 -0700
Subject: [PATCH 1/2] Libxml fix

---
clish/shell/shell_libxml2.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/clish/shell/shell_libxml2.c b/clish/shell/shell_libxml2.c
index 7acca05..32ca4e7 100644
--- a/clish/shell/shell_libxml2.c
+++ b/clish/shell/shell_libxml2.c
@@ -17,6 +17,7 @@
#include <string.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
+#include <libxml/xinclude.h>
#include "xmlapi.h"

#ifdef HAVE_LIB_LIBXSLT
@@ -91,7 +92,8 @@ int clish_xmldoc_stop(void)
clish_xmldoc_t *clish_xmldoc_read(const char *filename)
{
xmlDoc *doc;
- doc = xmlReadFile(filename, NULL, 0);
+ doc = xmlReadFile(filename, NULL, 1026);
+ xmlXIncludeProcess(doc);
return doc_to_xmldoc(doc);
}

--
2.25.1

Loading