Skip to content

Commit

Permalink
Fixing bugs and build scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Kruliš authored Aug 20, 2020
1 parent 4cedbbb commit cbb96ce
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
sudo: required
dist: xenial
dist: focal
language: cpp

before_install:
# Install bats testing suite
- sudo add-apt-repository ppa:duggan/bats --yes
- sudo apt-get update -qq
- sudo apt-get install -qq bats
- sudo apt-get install -y bats
# Install ZeroMQ
- sudo apt-get install -y libzmq3-dev libzmq5
# Install Boost
- sudo apt-get install -y libboost-all-dev
# Install yaml-cpp
- sudo apt-get install -y libyaml-cpp0.5v5 libyaml-cpp-dev
- sudo apt-get install -y libyaml-cpp-dev
# Install libcURL
- sudo apt-get install -y libcurl4-gnutls-dev
# Install libarchive (to avoid compiling it)
Expand Down
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,6 @@ if(UNIX)
set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
set(CPACK_RPM_PACKAGE_RELEASE "1")
set(CPACK_RPM_PACKAGE_DESCRIPTION "Backend part of ReCodEx programmer testing solution.")
#set(CPACK_RPM_PACKAGE_REQUIRES "boost-filesystem >= 1.53.0, boost-program-options >= 1.53.0, yaml-cpp >= 0.5.1, zeromq >= 4.0.5, libstdc++ >= 4.8.5, libcurl >= 7.29.0, libarchive >= 3.1.2")
#set(CPACK_RPM_PACKAGE_AUTOREQ " no")
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/install/postinst")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Petr Stefan <[email protected]>")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Worker specific requirements are written in this section. It covers only basic
requirements, additional runtimes or tools may be needed depending on type of
use. The package names are for CentOS if not specified otherwise.

- Boost 1.66 development libs (`boost-devel` package)
- ZeroMQ in version at least 4.0, packages `zeromq` and `zeromq-devel`
(`libzmq3-dev` on Debian)
- YAML-CPP library, `yaml-cpp` and `yaml-cpp-devel` (`libyaml-cpp0.5v5` and
Expand Down
6 changes: 4 additions & 2 deletions judges/recodex_token_judge/comparator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,10 @@ template <typename CHAR = char, typename OFFSET = std::uint32_t, typename RESULT
*/
template <typename T> static void mapRemoveEmpty(std::map<T, int> &m)
{
for (auto it = m.begin(); it != m.end(); ++it) {
if (it->second == 0) { m.erase(it); }
std::map<T, int> old;
old.swap(m);
for (auto it = old.begin(); it != old.end(); ++it) {
if (it->second != 0) { m[it->first] = it->second; }
}
}

Expand Down
8 changes: 4 additions & 4 deletions recodex-worker.spec
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
%define name recodex-worker
%define short_name worker
%define version 1.6.4
%define unmangled_version 0c3af00f74b5f088e68a7f1b79e130bef0105646
%define release 1
%define unmangled_version 597144f5dc757fc18446f3fc4a58f064f3ac4ba6
%define release 4

%define spdlog_name spdlog
%define spdlog_version 0.13.0
Expand All @@ -17,7 +17,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
Vendor: Petr Stefan <UNKNOWN>
Url: https://github.com/ReCodEx/worker
BuildRequires: systemd gcc-c++ cmake zeromq-devel cppzmq-devel yaml-cpp-devel libcurl-devel libarchive-devel
BuildRequires: systemd gcc-c++ cmake zeromq-devel cppzmq-devel yaml-cpp-devel libcurl-devel libarchive-devel boost-devel
Requires: systemd isolate

#Source0: %{name}-%{unmangled_version}.tar.gz
Expand All @@ -27,7 +27,7 @@ Source1: https://github.com/gabime/%{spdlog_name}/archive/v%{spdlog_version}.tar
%global debug_package %{nil}

%description
Backend part of ReCodEx programmer testing solution.
Worker is a backend component of ReCodEx code examiner, an educational application for evaluating programming assignments.

%prep
%setup -n %{short_name}-%{unmangled_version}
Expand Down

0 comments on commit cbb96ce

Please sign in to comment.