This repository has been archived by the owner on Nov 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
89 lines (74 loc) · 1.85 KB
/
Dockerfile
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
FROM fedora:latest
ENV PROJECT_HOME=/src
ENV MINGW_GTKSOURCEVIEW4_FILENAME=mingw-w64-x86_64-gtksourceview4-4.8.3-1-any.pkg.tar.zst
ENV APP_NAME=mystudio-ide.exe
#
# Set up system
#
WORKDIR /root
RUN dnf -y update
RUN dnf clean all
RUN dnf install -y git cmake file gcc make man sudo tar zstd nano
RUN dnf install -y gcc-c++ boost boost-devel
#
# Add GtkSourceView
#
RUN dnf install -y gtksourceview4 gtksourceview4-devel
#
# Add Papirus icon
#
RUN dnf install -y papirus-icon-theme
#
# Build peldd to find dlls of exes
#
RUN git clone https://github.com/gsauthof/pe-util
WORKDIR pe-util
RUN git submodule update --init
RUN mkdir build
WORKDIR build
RUN cmake .. -DCMAKE_BUILD_TYPE=Release
RUN make
RUN mv /root/pe-util/build/peldd /usr/bin/peldd
RUN chmod +x /usr/bin/peldd
#
# Install Windows libraries
#
RUN dnf install -y mingw64-gcc
RUN dnf install -y mingw64-freetype
RUN dnf install -y mingw64-cairo
RUN dnf install -y mingw64-harfbuzz
RUN dnf install -y mingw64-pango
RUN dnf install -y mingw64-poppler
RUN dnf install -y mingw64-gtk3
RUN dnf install -y mingw64-winpthreads-static
RUN dnf install -y mingw64-glib2-static
RUN dnf install -y mingw64-libxml2-static
RUN dnf install -y mingw64-librsvg2-static
#
# Install rust
#
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
RUN $HOME/.cargo/bin/rustup update
#
# Set up rust for cross compiling
#
RUN $HOME/.cargo/bin/rustup target add x86_64-pc-windows-gnu
ADD cargo-win.config $HOME/.cargo/config
ENV PKG_CONFIG_ALLOW_CROSS=1
ENV PKG_CONFIG_PATH=/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig/
ENV GTK_INSTALL_PATH=/usr/x86_64-w64-mingw32/sys-root/mingw/
#
# Setup the mount point
#
VOLUME $PROJECT_HOME
WORKDIR $PROJECT_HOME
#
# Add package.sh
#
ENV PACKAGED_DIR=release
ADD build-win.sh /usr/bin/package.sh
RUN chmod +x /usr/bin/package.sh
#
# Build and package executable
#
CMD ["/usr/bin/package.sh"]