-
Notifications
You must be signed in to change notification settings - Fork 1
/
mingw.sh
executable file
·54 lines (43 loc) · 1.97 KB
/
mingw.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
set -e # Exit immediately on error
. ./local-env
SOURCEDIR=$HOME/src/kde/source
INSTALLDIR=$HOME/src/kde/install-mingw
KDESRC_BUILDRC=kdesrc-buildrc-mingw
DOCKERFILE=mingw.Dockerfile
IMAGE_TAG=voidlinux/kde-mingw-static
CONTAINER_NAME=kde-mingw-static
cd $(dirname $(realpath $0))
# Build the docker image
docker build \
--build-arg mirror=$mirror \
--build-arg http_proxy=$http_proxy \
--build-arg https_proxy=$https_proxy \
--build-arg ftp_proxy=$ftp_proxy \
--build-arg certificate=$certificate \
--file=$DOCKERFILE \
--tag=$IMAGE_TAG .
# Create installation directory - otherwise Docker will create it with root ownership.
if ! test -d $INSTALLDIR; then
mkdir $INSTALLDIR
fi
# Create container to build KDE
docker create \
--volume /tmp/.X11-unix:/tmp/.X11-unix --env DISPLAY=$DISPLAY \
--volume /srv/docker/ccache:/ccache --env CCACHE_DIR=/ccache \
--volume $SOURCEDIR:/home/kdedev/kde/source \
--volume $INSTALLDIR:/home/kdedev/kde/install \
--interactive --tty \
--name=$CONTAINER_NAME --hostname=$CONTAINER_NAME \
$IMAGE_TAG
# Prepare the KDE build
docker cp $KDESRC_BUILDRC $CONTAINER_NAME:/home/kdedev/kde/kdesrc-buildrc
docker cp kf5-frameworks-build-include $CONTAINER_NAME:/home/kdedev/kde
# Copy our public key to the image for eash SSH access
docker cp $HOME/.ssh/id_rsa.pub $CONTAINER_NAME:/home/kdedev/.ssh/authorized_keys
# Prebuilt executables needed for cross-building
docker cp hostapps $CONTAINER_NAME:/home/kdedev
docker start $CONTAINER_NAME
docker exec $CONTAINER_NAME sh -c "\$HOME/kdesrc-build/kdesrc-build --rc-file=\$HOME/kde/kdesrc-buildrc --build-only --refresh-build --include-dependencies frameworks"
docker exec $CONTAINER_NAME sh -c "\$HOME/kdesrc-build/kdesrc-build --rc-file=\$HOME/kde/kdesrc-buildrc --build-only --refresh-build libkexiv2"
docker exec $CONTAINER_NAME sh -c "\$HOME/kdesrc-build/kdesrc-build --rc-file=\$HOME/kde/kdesrc-buildrc --build-only --refresh-build okular"