# Create a src directory under your home directory
mkdir -p -m 0700 ~/src
cd ~/src
# If it's there already, clean it up and update it
test -d ./cld2 &&
( cd cld2/internal
./clean.sh
cd ..
git fetch )
# If it's not there already, get it via 'git clone'
git clone https://github.com/CLD2Owners/cld2.git
cd cld2/internal
# If you have compiled it before, clean up
./clean.sh
# Build it
# If this CPPFLAGS doesn't work for you, check Github Issues and/or
# slackbuilds.org and/or Ubuntu packages
# https://packages.ubuntu.com/search?keywords=cld2&searchon=names&suite=all§ion=all
# Fedora
# https://rpmfind.net/linux/rpm2html/search.php?query=cld2&submit=Search+...
# openSUSE, etc., etc. for other ideas...
CPPFLAGS="-std=c++98 -O2" ./compile_libs.sh
cd ..
# Create a cld2.pc for pkg-config
# Change lib64 to lib if you are not 64-bit
# Version used here is the YYYYMMDD of the latest commit
echo "prefix=/usr" > cld2.pc
echo "exec_prefix=\${prefix}" >> cld2.pc
echo "libdir=\${exec_prefix}/lib64" >> cld2.pc
echo "includedir=\${prefix}/include" >> cld2.pc
echo >> cld2.pc
echo "Name: cld2" >> cld2.pc
echo "Description: Compact Language Detector 2" >> cld2.pc
echo "Version: 20150820" >> cld2.pc
echo "Libs: -L\${libdir} -lcld2" >> cld2.pc
echo "Cflags: -I\${includedir}" >> cld2.pc