1name: Build libmysqlclient
2inputs:
3  configurationParameters:
4    default: ''
5    required: false
6  libmysql:
7    required: true
8  withMysqli:
9    required: true
10runs:
11  using: composite
12  steps:
13    - shell: bash
14      run: |
15        set -x
16        LIBMYSQL=${{ inputs.libmysql }}
17        MYSQL_BASE=${LIBMYSQL%%-linux-*}
18        MYSQL_VERSION=${MYSQL_BASE#*-}
19        MYSQL_DIR=$HOME/$MYSQL_BASE
20        mkdir -p $MYSQL_DIR
21        URL=https://cdn.mysql.com/Downloads/MySQL-${MYSQL_VERSION%.*}/$LIBMYSQL
22        wget -nv $URL
23        tar -xf $LIBMYSQL --strip-components=1 -C $MYSQL_DIR
24        PDO_MYSQL=${MYSQL_DIR}
25        ${{ inputs.withMysqli == 'true' && 'MYSQLI=${MYSQL_DIR}/bin/mysql_config' || '' }}
26        ./buildconf --force
27        ./configure ${{ inputs.configurationParameters }} \
28          --enable-option-checking=fatal \
29          --disable-all \
30          --enable-pdo \
31          --with-pdo-mysql=${PDO_MYSQL} \
32          ${{ inputs.withMysqli == 'true' && '--with-mysqli=${MYSQLI}' || '' }}
33        make clean
34        make -j$(/usr/bin/nproc) >/dev/null
35