forked from MariaDB/buildbot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7792d9
commit 49e91de
Showing
8 changed files
with
168 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Buildbot worker for building MariaDB | ||
# | ||
# Provides a bintar image based on AlmaLinux with build dependencies | ||
# and statically compiled libraries | ||
|
||
ARG BASE_IMAGE | ||
FROM "$BASE_IMAGE" AS buildeps | ||
LABEL maintainer="MariaDB Buildbot maintainers" | ||
|
||
# Install updates and required packages | ||
# hadolint ignore=SC2086 | ||
RUN dnf -y install 'dnf-command(config-manager)' \ | ||
&& source /etc/os-release \ | ||
&& ARCH=amd64 \ | ||
&& dnf -y --enablerepo=extras install epel-release \ | ||
&& dnf config-manager --set-enabled powertools \ | ||
&& dnf -y module enable mariadb-devel \ | ||
&& dnf -y install almalinux-release-devel \ | ||
&& VERSION_ID=-${VERSION_ID} \ | ||
&& VERSION_ID=${VERSION_ID%%.*} \ | ||
&& dnf config-manager --add-repo https://ci.mariadb.org/galera/mariadb-4.x-latest-gal-${ARCH}-${ID}${VERSION_ID}.repo \ | ||
&& dnf -y upgrade \ | ||
&& dnf -y groupinstall "Development Tools" \ | ||
&& dnf -y builddep mariadb-server \ | ||
&& dnf -y install \ | ||
asio-devel \ | ||
buildbot-worker \ | ||
bzip2 \ | ||
bzip2-devel \ | ||
ccache \ | ||
check-devel \ | ||
cracklib-devel \ | ||
createrepo \ | ||
curl-devel \ | ||
eigen3-devel \ | ||
flex \ | ||
galera-4 \ | ||
gnutls-devel \ | ||
java-1.8.0-openjdk-devel \ | ||
java-1.8.0-openjdk \ | ||
jemalloc-devel \ | ||
libcurl-devel \ | ||
libevent-devel \ | ||
libffi-devel \ | ||
libpmem-devel \ | ||
libxml2-devel \ | ||
libzstd-devel \ | ||
perl-autodie \ | ||
perl-Net-SSLeay \ | ||
python3-devel \ | ||
readline-devel \ | ||
rpmlint \ | ||
ruby \ | ||
snappy-devel \ | ||
subversion \ | ||
unixODBC \ | ||
unixODBC-devel \ | ||
wget \ | ||
which \ | ||
xz-devel \ | ||
yum-utils \ | ||
&& dnf clean all \ | ||
&& curl -sL "https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_$(uname -m)" >/usr/local/bin/dumb-init \ | ||
&& chmod +x /usr/local/bin/dumb-init | ||
ENV WSREP_PROVIDER=/usr/lib64/galera-4/libgalera_smm.so | ||
|
||
## Build the static libraries in a separate stage so we save space | ||
FROM buildeps AS staticlibs | ||
|
||
COPY ./scripts/* /scripts/ | ||
WORKDIR /scripts | ||
RUN chmod +x *.sh | ||
|
||
# Directory where we move static libraries | ||
RUN mkdir -p ./local/lib/ | ||
|
||
# Build static libraries | ||
RUN ./libaio.sh | ||
RUN ./liblz4.sh | ||
RUN ./xz.sh | ||
RUN ./ncurses.sh | ||
RUN ./libpmem.sh | ||
RUN ./libzstd.sh | ||
RUN ./gnutls.sh | ||
|
||
FROM buildeps AS bintar | ||
COPY --from=staticlibs /scripts/local/lib /scripts/local/lib | ||
|
||
### Other .Dockerfiles will be concatenated here (worker, qpress, etc) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
yumdownloader --source gnutls-devel | ||
yum-builddep -y gnutls-*.src.rpm | ||
rpm -ivh gnutls-*.src.rpm | ||
sed -i 's/--disable-static/--enable-static \\\n--disable-tests/g' ~/rpmbuild/SPECS/gnutls.spec | ||
sed -i 's/export LDFLAGS="-Wl,--no-add-needed"/export LDFLAGS="-Wl,--copy-dt-needed-entries -fpic -fPIC"/g' ~/rpmbuild/SPECS/gnutls.spec | ||
sed -i 's/make %{?_smp_mflags}/make %{?_smp_mflags} CFLAGS="-fpic -fPIC" CXX_FLAGS="-fpic -fPIC"/g' ~/rpmbuild/SPECS/gnutls.spec | ||
rpmbuild -bc ~/rpmbuild/SPECS/gnutls.spec | ||
mv -v ~/rpmbuild/BUILD/gnutls-*/lib/.libs/libgnutls.a local/lib | ||
rm -rf ~/rpmbuild gnutls-*.src.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
yumdownloader --source libaio-devel | ||
yum-builddep -y libaio-*.src.rpm | ||
rpmbuild --recompile libaio-*.src.rpm | ||
mv -v ~/rpmbuild/BUILD/libaio-*/src/*.a local/lib | ||
rm -rf ~/rpmbuild libaio-*.src.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
yumdownloader --source lz4-devel | ||
yum-builddep -y lz4-*.src.rpm | ||
rpm -ivh lz4-*.src.rpm | ||
sed -i 's/%make_build/%make_build CFLAGS="-fpic -fPIC" CXX_FLAGS="-fpic -fPIC"/g' ~/rpmbuild/SPECS/lz4.spec | ||
rpmbuild -bc ~/rpmbuild/SPECS/lz4.spec | ||
mv -v ~/rpmbuild/BUILD/lz4-*/lib/liblz4.a local/lib | ||
rm -rf ~/rpmbuild lz4-*.src.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
yumdownloader --source libpmem-devel | ||
yum-builddep -y pmdk-*.src.rpm | ||
rpmbuild --recompile pmdk-*.src.rpm | ||
mv -v ~/rpmbuild/BUILD/pmdk-*/src/nondebug/libpmem.a local/lib | ||
rm -rf ~/rpmbuild pmdk-*.src.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
yumdownloader --source libzstd | ||
yum-builddep -y zstd-*.src.rpm | ||
rpm -ivh zstd-*.src.rpm | ||
rpmbuild -bp ~/rpmbuild/SPECS/zstd.spec | ||
make CFLAGS=-fPIC -C ~/rpmbuild/BUILD/zstd-* | ||
mv -v ~/rpmbuild/BUILD/zstd-*/lib/libzstd.a local/lib | ||
rm -rf ~/rpmbuild zstd-*.src.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
yumdownloader --source ncurses-devel | ||
yum-builddep -y ncurses-*.src.rpm | ||
rpmbuild --recompile ncurses-*.src.rpm | ||
mv -v ~/rpmbuild/BUILDROOT/ncurses-*/usr/lib64/*.a local/lib | ||
rm -rf ~/rpmbuild ncurses-*.src.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
yumdownloader --source xz-devel | ||
yum-builddep -y xz-*.src.rpm | ||
rpm -ivh xz-*.src.rpm | ||
sed -i 's/--disable-static/--disable-shared --enable-static --with-pic/g' ~/rpmbuild/SPECS/xz.spec | ||
sed -i 's/CFLAGS="/CFLAGS="-fpic -fPIC /g' ~/rpmbuild/SPECS/xz.spec | ||
sed -i 's/export CFLAGS/export CFLAGS\nCXXFLAGS="-fpic -fPIC"\nexport CXXFLAGS/g' ~/rpmbuild/SPECS/xz.spec | ||
sed -i '/\*\.a/d' ~/rpmbuild/SPECS/xz.spec | ||
rpmbuild -bc ~/rpmbuild/SPECS/xz.spec | ||
mv -v ~/rpmbuild/BUILD/xz-*/src/liblzma/.libs/liblzma.a local/lib | ||
rm -rf ~/rpmbuild xz-*.src.rpm |