# Exit on error:
set -e

wget http://www.x.org/releases/individual/lib/libXrender-0.9.8.tar.bz2
tar xf libXrender-0.9.8.tar.bz2
cd libXrender-0.9.8

PKG_CONFIG=/static/bin/pkg-config \
    CC=/static/bin/musl-gcc \
    LDFLAGS='-s -L/static/lib -static -static-libgcc' \
    ./configure --prefix=/static

# Fix:
# Xrenderint.h:116:20: error: static declaration of '_XEatDataWords' follows non-static declaration
sed -i.orig '/XEatDataWords/s/static //' src/Xrenderint.h 

make install
cd ..
rm -rf libXrender-0.9.8
rm libXrender-0.9.8.tar.bz2

exit 0
