Skip to content

Commit

Permalink
Merge pull request #11 from klassen-software-solutions/development/v1
Browse files Browse the repository at this point in the history
Set the ksstest dependancy to the v6 release
  • Loading branch information
stevenklassen8376 authored Jan 10, 2020
2 parents 6a196c0 + a6e4a87 commit edd1398
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
6 changes: 3 additions & 3 deletions BuildSystem/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ ifeq ($(wildcard Dependancies/prereqs.json),)
PREREQS_LICENSE_FILE :=
endif

CFLAGS := $(CFLAGS) -I$(BUILDDIR)/include
CXXFLAGS := $(CXXFLAGS) -I$(BUILDDIR)/include -std=c++14 -Wno-unknown-pragmas

KSS_INSTALL_PREFIX ?= /opt/$(PREFIX)
CFLAGS := $(CFLAGS) -I$(KSS_INSTALL_PREFIX)/include
LDFLAGS := $(LDFLAGS) -L$(KSS_INSTALL_PREFIX)/lib
Expand All @@ -59,9 +62,6 @@ LDFLAGS := $(LDFLAGS) -L$(LIBDIR)
-include $(PROJECTDIR)/config.local
-include $(PROJECTDIR)/config.defs

CFLAGS := $(CFLAGS) -I$(BUILDDIR)/include
CXXFLAGS := $(CXXFLAGS) -I$(BUILDDIR)/include -std=c++14 -Wno-unknown-pragmas

.PHONY: build library install check analyze clean cleanall directory-checks hello
.PHONY: prep docs help prereqs

Expand Down
23 changes: 18 additions & 5 deletions BuildSystem/update_prereqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ def _update_repo(dirname: str):
logging.info("Updating %s", dirname)
_run('git pull', directory=dirname)

def _clone_repo(url: str):
def _clone_repo(url: str, dirname: str, branch: str):
logging.info("Cloning %s", url)
_run('git clone %s' % url)
if branch:
_run('git checkout %s' % branch, directory=dirname)

def _rebuild_and_install(dirname: str):
logging.info("Rebuilding %s", dirname)
Expand Down Expand Up @@ -85,12 +87,20 @@ def _extract(filename: str) -> str:
raise RuntimeError("Did not seem to create %s" % dirname)
return dirname

def _install_tarball(url: str):
filename = os.path.basename(urllib.parse.urlparse(url).path)
def _install_tarball(url: str, filename: str):
if not filename:
filename = os.path.basename(urllib.parse.urlparse(url).path)
_download(url, filename)
dirname = _extract(filename)
_rebuild_and_install(dirname)

def _install_pip(package_name: str):
install_options = ''
prefix = os.environ.get('KSS_INSTALL_PREFIX', None)
if prefix:
install_options = '--install-option="--prefix=%s"' % prefix
_run('python3 -m pip install --upgrade %s %s' % (install_options, package_name))

def _install_or_update(prereq: Dict):
if not _is_applicable(prereq):
logging.info("Skipping %s as not applicable to %s", prereq, ARCH)
Expand All @@ -101,11 +111,14 @@ def _install_or_update(prereq: Dict):
if os.path.isdir(dirname):
_update_repo(dirname)
else:
_clone_repo(prereq['git'])
_clone_repo(prereq['git'], dirname, prereq.get('branch', None))
_rebuild_and_install(dirname)
elif "tarball" in prereq:
logging.info("Found %s", prereq['tarball'])
_install_tarball(prereq['tarball'])
_install_tarball(prereq['tarball'], prereq.get('filename', None))
elif "pip" in prereq:
logging.info("Found %s", prereq['pip'])
_install_pip(prereq['pip'])
elif "command" in prereq:
logging.info("Found %s", prereq['command'])
_run(prereq['command'], directory=CWD)
Expand Down
5 changes: 4 additions & 1 deletion Dependancies/prereqs.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[
{"git": "https://github.com/klassen-software-solutions/ksstest.git"}
{
"git": "https://github.com/klassen-software-solutions/ksstest.git",
"branch": "release/v6"
}
]

0 comments on commit edd1398

Please sign in to comment.