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_DIR=$HOME/$MYSQL_BASE
19        mkdir -p $MYSQL_DIR
20        URL=https://downloads.mysql.com/archives/get/p/23/file/$LIBMYSQL
21        wget -nv $URL
22        tar -xf $LIBMYSQL --strip-components=1 -C $MYSQL_DIR
23        PDO_MYSQL=${MYSQL_DIR}
24        ${{ inputs.withMysqli == 'true' && 'MYSQLI=${MYSQL_DIR}/bin/mysql_config' || '' }}
25        ./buildconf --force
26        ./configure ${{ inputs.configurationParameters }} \
27          --enable-option-checking=fatal \
28          --disable-all \
29          --enable-pdo \
30          --with-pdo-mysql=${PDO_MYSQL} \
31          ${{ inputs.withMysqli == 'true' && '--with-mysqli=${MYSQLI}' || '' }}
32        make clean
33        make -j$(/usr/bin/nproc) >/dev/null
34