Skip to content
This repository has been archived by the owner on Jun 12, 2020. It is now read-only.

Commit

Permalink
Merge pull request #7 from tgstation/FixBuild2
Browse files Browse the repository at this point in the history
Use libmariadb instead of libmariadbclient
  • Loading branch information
Cyberboss authored Jun 20, 2018
2 parents 52fc3a0 + 600b68b commit f101869
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 27 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:
cache:
directories:
- $HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}
- $HOME/MariaDB
addons:
apt:
sources:
Expand All @@ -17,13 +18,15 @@ addons:
- g++-7
- g++-7-multilib
- libc6-i386
- linux-libc-dev:i386
- libstdc++6:i386
- libmariadbclient-dev:i386
- zlib1g:i386
- libssl1.0.0:i386
services:
- mysql
install:
- eval "${MATRIX_EVAL}"
- build/install_byond.sh
- build/install_deps.sh
script:
- mkdir artifacts && cd artifacts && cmake .. && make && cd ..
- cp artifacts/src/BSQL/libBSQL.so tests/
Expand Down
21 changes: 0 additions & 21 deletions build/install_byond.sh

This file was deleted.

31 changes: 31 additions & 0 deletions build/install_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
set -e

if [ -d "$HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}/byond/bin" ];
then
echo "Using cached BYOND directory."
else
echo "Setting up BYOND."
mkdir -p "$HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}"
cd "$HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}"
curl "http://www.byond.com/download/build/${BYOND_MAJOR}/${BYOND_MAJOR}.${BYOND_MINOR}_byond_linux.zip" -o byond.zip
unzip byond.zip
cd byond
make here
cd ~/
fi

if [ -f "$HOME/MariaDB/libmariadb.so.2" ] && [ -f "$HOME/MariaDB/libmariadb.so" ];
then
echo "Using cached MariaDB library."
else
echo "Setting up MariaDB."
rm -rf "$HOME/MariaDB"
mkdir -p "$HOME/MariaDB"
wget http://mirrors.kernel.org/ubuntu/pool/universe/m/mariadb-client-lgpl/libmariadb2_2.0.0-1_i386.deb
dpkg -x libmariadb2_2.0.0-1_i386.deb /tmp/extract
rm libmariadb2_2.0.0-1_i386.deb
mv /tmp/extract/usr/lib/i386-linux-gnu/libmariadb.so.2 $HOME/MariaDB/
ln -s $HOME/MariaDB/libmariadb.so.2 $HOME/MariaDB/libmariadb.so
rm -rf /tmp/extract
fi
7 changes: 3 additions & 4 deletions src/BSQL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ find_library(MARIA_LIBRARY libmariadb)
find_path(MARIA_INCLUDE_DIR mysql/mysql.h)
add_precompiled_header(BSQL BSQL.h FORCEINCLUDE)
set(WSLIB ws2_32)
else() #system package
else() #system package, this pmuch only works for travis
set_target_properties(BSQL PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
find_path(MARIA_INCLUDE_DIR NAMES "mysql.h" PATHS "/usr/include/mysql")
find_library(MARIA_LIBRARY NAMES "mariadbclient" PATHS "/usr/lib/i386-linux-gnu")
find_library(MARIA_LIBRARY mariadb PATHS ~/MariaDB)
endif()

include_directories(${MARIA_INCLUDE_DIR})

target_link_libraries(BSQL ${MARIA_LIBRARY} ${WSLIB})

target_link_libraries(BSQL ${MARIA_LIBRARY} ${WSLIB})

0 comments on commit f101869

Please sign in to comment.