#? sudo apt-get install libboost1.71-dev libboost-date-time1.71-dev libjsoncpp-dev libzmq3-dev libzmqpp-dev
sudo apt install libboost1.71-all-dev libboost1.71-tools-dev

# First
cd yacas-upstream-update

# https://github.com/grzegorzmazur/yacas/tree/v1.7.0
#git clone https://github.com/grzegorzmazur/yacas.git --branch "v1.7.0"
git clone https://github.com/grzegorzmazur/yacas.git

################################
# IF ONLY yacas/scripts
################################
Change LGPL -> GPL

cd yacas/scripts
egrep -lRZ 'Lesser General Public' . | xargs -0 -l sed -i -e 's/Lesser General Public/General Public/g'

Just copy, that's it!

APPLY PATCHES!

################################


cd ./yacas
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CYACAS_GUI=No -DENABLE_CYACAS_KERNEL=Yes -DENABLE_CYACAS_BENCHMARKS=No -DBUILD_TESTING=No -DENABLE_CYACAS_UNIT_TESTS=No -DENABLE_CYACAS_CONSOLE=No -DENABLE_JYACAS=No -DENABLE_DOCS=No ..
cd ../../../yacas-upstream-update

# Compare versions:
# Upstream:
cat ./yacas/build/cyacas/libyacas/config/yacas/yacas_version.h
# Current:
cat ../src/yacas/include/yacas/yacas_version.h

###########################
# 02
###########################
./02-extract-files.sh

###########################
# Compare old to new
###########################
meld ../src/yacas/ ./new-src-yacas/
meld ../inst/yacas/ ./new-inst-yacas/

###########################
03
###########################
./03-merge.sh

cat ./yacas/build/cyacas/libyacas/config/yacas/yacas_version.h
# Current:
cp ./yacas/build/cyacas/libyacas/config/yacas/yacas_version.h ../src/yacas/include/yacas/yacas_version.h


###########################
04
###########################
cd ../src/yacas
grep -iHR "string_view" .

"std::string_view" -> "std::string"
  yacas/include/yacas/mp/nn.hpp
  yacas/include/yacas/mp/zz.hpp
  yacas/src/nn.cpp
  yacas/src/zz.cpp

delete "#include <string_view>"
  yacas/include/yacas/mp/nn.hpp
  
#replace 'abort();' with 'throw std::invalid_argument("abort()");'
grep -iHR "abort();" .
  yacas/src/yacasnumbers.cpp


###########################
05
###########################

Change LGPL to GPL in inst/yacas:

grep -iHR "LGPL" inst/yacas
grep -iHR "Lesser" inst/yacas

  gedit inst/yacas/cse.rep/cse.ys
  gedit inst/yacas/r_form.rep/code.ys

  
/* 
 * Copyright (C) 2016 Grzegorz Mazur.
 *
 * Yacas is free software: you can redistribute it and/or modify  
 * it under the terms of the GNU General Public License as published by  
 * the Free Software Foundation, version 3.
 *
 * This program is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License 
 * along with this program. If not, see <http://www.gnu.org/licenses/> or 
 * write to the Free Software Foundation, Inc., 51 Franklin Street, 
 * Fifth Floor, Boston, MA 02110-1301, USA.
 */
 

###########################
06
###########################
Fix this warning:
yacas/include/yacas/string_utils.h:19:72: warning: 'ptr_fun<int, int>' is deprecated [-Wdeprecated-declarations]

Replace:

inline
std::string& ltrim(std::string& s)
{
    s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int c) { return !std::isspace(c); }));
    return s;
}

inline
std::string& rtrim(std::string& s)
{
    s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) { return !std::isspace(ch); }).base(), s.end());
    return s;
}


By:

inline
std::string& ltrim(std::string& s)
{
    //s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int c) { return !std::isspace(c); }));
    std::function<int(int)> lambdafun = [](int c) { return !std::isspace(c); };
    s.erase(s.begin(), std::find_if(s.begin(), s.end(), lambdafun));
    return s;
}

inline
std::string& rtrim(std::string& s)
{
    //s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) { return !std::isspace(ch); }).base(), s.end());
    std::function<int(int)> lambdafun = [](int ch) { return !std::isspace(ch); };
    s.erase(std::find_if(s.rbegin(), s.rend(), lambdafun).base(), s.end());
    return s;
}

###########################
07
###########################

APPLY PATCHES!

###########################
08
###########################

Add #include <cstdint> to Ryacas/src/yacas/include/yacas/anumber.h

