-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
112 lines (98 loc) · 5.96 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
FROM debian:12
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies for the smartmontools Linux and WIN32 builds
RUN apt-get update -qy && \
apt-get install -y automake g\+\+ make jq curl subversion pkg-config \
g++-mingw-w64-x86-64 g++-mingw-w64-i686 dos2unix man2html-base groff \
clang cpio libxml2-dev libssl-dev libbz2-dev unzip wget xorriso cmake \
man g++-multilib libc6-dev-i386 clang-tools git xz-utils zlib1g-dev
# NSIS 3.08-3 from Debian 12 generates bogus relocation information (regression).
# The fixed version 3.10-2 is still only available from Debian 13 (trixie, testing).
# Manually install this version. The warning about outdated libstdc++6 could be
# safely ignored.
RUN v="3.10-2" \
&& cd /tmp \
&& wget http://http.us.debian.org/debian/pool/main/n/nsis/nsis-common_${v}_all.deb \
&& wget http://http.us.debian.org/debian/pool/main/n/nsis/nsis_${v}_amd64.deb \
&& dpkg --install --force-all nsis-common_${v}_all.deb nsis_${v}_amd64.deb \
&& rm -f nsis-common_${v}_all.deb nsis_${v}_amd64.deb
# Installing OSX cross-tools to make Darwin builds
#Build arguments
ARG osxcross_repo="tpoechtrager/osxcross"
ARG osxcross_revision="564e2b9aa8e7a40da663d890c0e853a1259ff8b1"
ARG darwin_sdk_version="11.3"
ARG darwin_osx_version_min="10.6"
ARG darwin_version="14"
# ARG darwin_sdk_url="https://www.dropbox.com/s/yfbesd249w10lpc/MacOSX${darwin_sdk_version}.sdk.tar.xz"
ARG darwin_sdk_url="https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX${darwin_sdk_version}.sdk.tar.xz"
# ENV available in docker image
ENV OSXCROSS_REPO="${osxcross_repo}" \
OSXCROSS_REVISION="${osxcross_revision}" \
DARWIN_SDK_VERSION="${darwin_sdk_version}" \
DARWIN_VERSION="${darwin_version}" \
DARWIN_OSX_VERSION_MIN="${darwin_osx_version_min}" \
DARWIN_SDK_URL="${darwin_sdk_url}"
RUN mkdir -p "/tmp/osxcross" \
&& cd "/tmp/osxcross" \
&& curl -sLo osxcross.tar.gz "https://codeload.github.com/${OSXCROSS_REPO}/tar.gz/${OSXCROSS_REVISION}" \
&& tar --strip=1 -xzf osxcross.tar.gz \
&& rm -f osxcross.tar.gz \
&& curl -sLo tarballs/MacOSX${DARWIN_SDK_VERSION}.sdk.tar.xz \
"${DARWIN_SDK_URL}" \
&& yes "" | SDK_VERSION="${DARWIN_SDK_VERSION}" OSX_VERSION_MIN="${DARWIN_OSX_VERSION_MIN}" ./build.sh \
&& mv target /usr/osxcross \
&& mv tools /usr/osxcross/ \
&& ln -sf ../tools/osxcross-macports /usr/osxcross/bin/omp \
&& ln -sf ../tools/osxcross-macports /usr/osxcross/bin/osxcross-macports \
&& ln -sf ../tools/osxcross-macports /usr/osxcross/bin/osxcross-mp \
&& rm -rf /tmp/osxcross \
&& rm -rf "/usr/osxcross/SDK/MacOSX${DARWIN_SDK_VERSION}.sdk/usr/share/man"
# Installing bomutils to make Darwin packages
# CXXFLAGS='-std=gnu++11' fixes "reference is ambiguous" error in lsbom.cpp
ARG bomutils_version="0.2"
ENV BOMUTILS_VERSION="${bomutils_version}"
RUN cd /tmp && wget https://github.com/hogliux/bomutils/archive/${bomutils_version}.tar.gz \
&& tar -xvzf ${bomutils_version}.tar.gz \
&& cd bomutils-${bomutils_version}/ \
&& make CXXFLAGS='-std=gnu++11 -Wall' && make install \
&& cd / && rm -rf /tmp/${bomutils_version}.tar.gz /tmp/bomutils-${bomutils_version}
# Installing libdmg-hfsplus to build Darwin dmg images
# 'C_DEFINES=' removes libssl1.0 dependency
RUN cd /tmp && wget https://github.com/planetbeing/libdmg-hfsplus/archive/master.zip \
&& unzip master.zip \
&& mkdir libdmg-hfsplus-master/build && cd libdmg-hfsplus-master/build \
&& cmake ../ && make C_DEFINES= && make install \
&& cd / && rm -rf /tmp/libdmg-hfsplus-master /tmp/master.zip
# Get FreeBSD 13 libs/headers, extract and fix broken links
RUN cd /tmp && wget http://ftp.plusline.de/FreeBSD/releases/amd64/13.4-RELEASE/base.txz \
&& mkdir -p /opt/cross-freebsd-13 \
&& cd /opt/cross-freebsd-13 \
&& tar -xf /tmp/base.txz ./lib/ ./usr/lib/ ./usr/include/ \
&& cd /opt/cross-freebsd-13/usr/lib \
&& find . -xtype l|xargs ls -l|grep ' /lib/' \
| awk '{print "ln -sf /opt/cross-freebsd-13"$11 " " $9}' \
| /bin/sh \
&& ln -s libc++.a /opt/cross-freebsd-13/usr/lib/libstdc++.a \
&& ln -s libc++.so /opt/cross-freebsd-13/usr/lib/libstdc++.so \
&& rm -f /tmp/base.txz
# Get FreeBSD 14 libs/headers, extract and fix broken links
RUN cd /tmp && wget http://ftp.plusline.de/FreeBSD/releases/amd64/14.1-RELEASE/base.txz \
&& mkdir -p /opt/cross-freebsd-14 \
&& cd /opt/cross-freebsd-14 \
&& tar -xf /tmp/base.txz ./lib/ ./usr/lib/ ./usr/include/ \
&& cd /opt/cross-freebsd-14/usr/lib \
&& find . -xtype l|xargs ls -l|grep ' /lib/' \
| awk '{print "ln -sf /opt/cross-freebsd-14"$11 " " $9}' \
| /bin/sh \
&& ln -s libc++.a /opt/cross-freebsd-14/usr/lib/libstdc++.a \
&& ln -s libc++.so /opt/cross-freebsd-14/usr/lib/libstdc++.so \
&& rm -f /tmp/base.txz
# Install cppcheck
RUN v=2.13.1 \
&& cd /tmp \
&& wget -O cppcheck-$v.tar.gz https://github.com/danmar/cppcheck/archive/$v.tar.gz \
&& tar -xf cppcheck-$v.tar.gz \
&& cd cppcheck-$v \
&& make="make MATCHCOMPILER=yes FILESDIR=/usr/local/share/cppcheck PREFIX=/usr/local" \
&& $make && $make install \
&& cd / && rm -rf /tmp/cppcheck-$v.tar.gz /tmp/cppcheck-$v