From af3bc822fecb6dbf976a3f9c9528c1ff6141c2c8 Mon Sep 17 00:00:00 2001 From: Christopher West Date: Sun, 1 Aug 2021 21:23:02 +0100 Subject: [PATCH] Basic build container images with distribution package references (#4893) * Container based build environments * Initial commit for support of Arch and Manjaro Linux distros * Removed openSUSE as shiboken is not supported in 15.3 * Added system updates to container image build * Removed duplicates and ordered packages for easy reference * Updated documenation for openSUSE and package installation. Added documentation on how to install packages outside of conatiners Removed references to openSUSE due to missing dependancies. * Matched debian and ubuntu install script for eaiser comparison * Fixed error of image realease from latest to rolling Ubuntu's "latest" tag is to their LTS distribution release rather than their current cutting edge distro release. * Update debian.sh Remove unneeded deps and remove libboost-all-dev * Update ubuntu.sh Remove unneeded deps and remove libboost-all-dev Co-authored-by: Christopher West Co-authored-by: Kurt Kremitzki --- tools/build/Dockerfile.Arch | 11 +++ tools/build/Dockerfile.Debian | 17 +++++ tools/build/Dockerfile.Fedora | 11 +++ tools/build/Dockerfile.Manjaro | 11 +++ tools/build/Dockerfile.Ubuntu | 17 +++++ tools/build/README.rst | 136 +++++++++++++++++++++++++++++++++ tools/build/arch.sh | 7 ++ tools/build/debian.sh | 15 ++++ tools/build/fedora.sh | 9 +++ tools/build/manjaro.sh | 7 ++ tools/build/ubuntu.sh | 15 ++++ 11 files changed, 256 insertions(+) create mode 100644 tools/build/Dockerfile.Arch create mode 100644 tools/build/Dockerfile.Debian create mode 100644 tools/build/Dockerfile.Fedora create mode 100644 tools/build/Dockerfile.Manjaro create mode 100644 tools/build/Dockerfile.Ubuntu create mode 100644 tools/build/README.rst create mode 100644 tools/build/arch.sh create mode 100755 tools/build/debian.sh create mode 100644 tools/build/fedora.sh create mode 100755 tools/build/manjaro.sh create mode 100644 tools/build/ubuntu.sh diff --git a/tools/build/Dockerfile.Arch b/tools/build/Dockerfile.Arch new file mode 100644 index 0000000000..2727f16fa4 --- /dev/null +++ b/tools/build/Dockerfile.Arch @@ -0,0 +1,11 @@ +FROM archlinux:base + +COPY arch.sh /tmp + +RUN pacman --sync --refresh --sysupgrade --noconfirm && \ + sh /tmp/arch.sh && \ + mkdir /builds + +WORKDIR /builds + +VOLUME [ "/builds" ] diff --git a/tools/build/Dockerfile.Debian b/tools/build/Dockerfile.Debian new file mode 100644 index 0000000000..5e67b62b7e --- /dev/null +++ b/tools/build/Dockerfile.Debian @@ -0,0 +1,17 @@ +FROM debian:bullseye + +ENV DEBIAN_FRONTEND=noninteractive +ENV TZ=Etc/UTC +ENV UTC=true +ENV ARC=false + +COPY debian.sh /tmp + +RUN apt-get update && \ + apt-get upgrade --yes && \ + sh /tmp/debian.sh && \ + mkdir /builds + +WORKDIR /builds + +VOLUME [ "/builds" ] diff --git a/tools/build/Dockerfile.Fedora b/tools/build/Dockerfile.Fedora new file mode 100644 index 0000000000..46c912613b --- /dev/null +++ b/tools/build/Dockerfile.Fedora @@ -0,0 +1,11 @@ +FROM fedora:latest + +COPY fedora.sh /tmp + +RUN dnf update --assumeyes && \ + sh /tmp/fedora.sh && \ + mkdir /builds + +WORKDIR /builds + +VOLUME [ "/builds" ] diff --git a/tools/build/Dockerfile.Manjaro b/tools/build/Dockerfile.Manjaro new file mode 100644 index 0000000000..7cb3953b5f --- /dev/null +++ b/tools/build/Dockerfile.Manjaro @@ -0,0 +1,11 @@ +FROM manjarolinux/base + +COPY manjaro.sh /tmp + +RUN pacman --sync --refresh --sysupgrade --noconfirm && \ + sh /tmp/manjaro.sh && \ + mkdir /builds + +WORKDIR /builds + +VOLUME [ "/builds" ] diff --git a/tools/build/Dockerfile.Ubuntu b/tools/build/Dockerfile.Ubuntu new file mode 100644 index 0000000000..54a8499996 --- /dev/null +++ b/tools/build/Dockerfile.Ubuntu @@ -0,0 +1,17 @@ +FROM ubuntu:rolling + +ENV DEBIAN_FRONTEND=noninteractive +ENV TZ=Etc/UTC +ENV UTC=true +ENV ARC=false + +COPY ubuntu.sh /tmp + +RUN apt-get update && \ + apt-get upgrade --yes && \ + sh /tmp/ubuntu.sh && \ + mkdir /builds + +WORKDIR /builds + +VOLUME [ "/builds" ] diff --git a/tools/build/README.rst b/tools/build/README.rst new file mode 100644 index 0000000000..01032fa2bc --- /dev/null +++ b/tools/build/README.rst @@ -0,0 +1,136 @@ +========================== +FreeCAD build dependencies +========================== + +Distributions +============= + +The following commands are used to install the packages needed to build FreeCAD from source on the following distributions. + + +Arch Linux +---------- + +The following command is used to install the required packages used to compile FreeCAD on Arch Linux. + +.. code-block:: console + + sudo sh tools/build/arch.sh + + +Debian +------ + +The following command is used to install the required packages used to compile FreeCAD on Debian. + +.. code-block:: console + + sudo sh tools/build/debian.sh + + +Fedora +------ + +The following command is used to install the required packages used to compile FreeCAD on Fedora. + +.. code-block:: console + + sudo sh tools/build/fedora.sh + + +Manjaro +------- + +The following command is used to install the required packages used to compile FreeCAD on Manjaro Linux. + +.. code-block:: console + + sudo sh tools/build/manjaro.sh + + +Ubuntu +------ + + +The following command is used to install the required packages used to compile FreeCAD on Ubuntu Linux. + +.. code-block:: console + + sudo sh tools/build/ubuntu.sh + + +Containers +========== + +The following will create containers that have all the required dependencies +pre-installed that are needed to build FreeCAD from source. + + +Arch Linux +----------- + +The following commands are used to create and run a Arch Linux build environment. + +.. code-block:: console + + docker build --file tools/build/Dockerfile.Arch --tag freecad-arch + docker run --rm --interactive --tty --volume $(pwd):/builds:z freecad-arch + + +Debian +------ + +The following commands are used to create and run a Debian build environment. + +.. code-block:: console + + docker build --file tools/build/Dockerfile.Debian --tag freecad-debian + docker run --rm --interactive --tty --volume $(pwd):/builds:z freecad-debian + + +Fedora +------ + +The following commands are used to create and run a Fedora build environment. + +.. code-block:: console + + docker build --file tools/build/Dockerfile.Fedora --tag freecad-fedora + docker run --rm --interactive --tty --volume $(pwd):/builds:z freecad-fedora + + +Manjaro +------- + +The following commands are used to create and run a Manjaro build environment. + +.. code-block:: console + + docker build --file tools/build/Dockerfile.Manjaro --tag freecad-manjaro + docker run --rm --interactive --tty --volume $(pwd):/builds:z freecad-manjaro + + +Ubuntu +------ + +The following commands are used to create and run a Ubuntu build environment. + + +.. code-block:: console + + docker build --file tools/build/Dockerfile.Ubuntu --tag freecad-ubuntu + docker run --rm --interactive --tty --volume $(pwd):/builds:z freecad-ubuntu + + +Build Code +========== + +To build the FreeCAD code inside one of the running containers the following +commands should be used + +.. code-block:: console + + mkdir freecad-build + cd freecad-build + cmake ../freecad-source + make -j$(nproc --ignore=2) diff --git a/tools/build/arch.sh b/tools/build/arch.sh new file mode 100644 index 0000000000..b0bab1c06c --- /dev/null +++ b/tools/build/arch.sh @@ -0,0 +1,7 @@ +#!/bin/sh +pacman --noconfirm --sync boost boost-libs cmake coin curl desktop-file-utils doxygen \ + eigen gc gcc-fortran git glew gnu-free-fonts guile hicolor-icon-theme jsoncpp \ + libspnav libtool make med opencascade openmpi pyside2 pyside2-tools \ + python-matplotlib python-netcdf4 python-pivy qt5-svg qt5-tools qt5-webengine \ + qt5-webkit shared-mime-info shiboken2 swig texinfo xerces-c + diff --git a/tools/build/debian.sh b/tools/build/debian.sh new file mode 100755 index 0000000000..cfba4c9e7f --- /dev/null +++ b/tools/build/debian.sh @@ -0,0 +1,15 @@ +#!/bin/sh +apt-get install --no-install-recommends --yes build-essential cmake doxygen \ + git libboost-date-time-dev libboost-dev libboost-filesystem-dev \ + libboost-graph-dev libboost-iostreams-dev libboost-program-options-dev \ + libboost-python-dev libboost-regex-dev libboost-serialization-dev \ + libboost-thread-dev libcoin-dev libeigen3-dev libgtkglext1-dev libgts-dev \ + libkdtree++-dev libkml-dev libmedc-dev libocct-data-exchange-dev \ + libocct-draw-dev libocct-foundation-dev libocct-modeling-algorithms-dev \ + libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev \ + libopencv-dev libproj-dev libpyside2-dev libqt5svg5-dev libqt5webkit5-dev \ + libqt5xmlpatterns5-dev libshiboken2-dev libvtk9-dev libvtk9-qt-dev \ + libvtk-dicom-dev libx11-dev libxerces-c-dev libxmu-dev libxmuu-dev \ + libzipios++-dev netgen netgen-headers pyside2-tools python3-dev \ + python3-matplotlib python3-pivy python3-pyside2.qtuitools qtchooser \ + qttools5-dev shiboken2 swig diff --git a/tools/build/fedora.sh b/tools/build/fedora.sh new file mode 100644 index 0000000000..7c8823c883 --- /dev/null +++ b/tools/build/fedora.sh @@ -0,0 +1,9 @@ +#!/bin/sh +dnf --assumeyes install boost-devel cmake Coin3 Coin3-devel desktop-file-utils doxygen \ + eigen3-devel freeimage-devel freetype freetype-devel gcc gettext git libspnav-devel \ + libXmu-devel med med-devel mesa-libGLU-devel ode-devel opencascade-devel \ + opencv-devel openmpi-devel pcl-devel pyside2-tools python3 python3-devel \ + python3-matplotlib python3-pivy python3-pyside2-devel qt5-qtsvg-devel \ + qt5-qttools-static qt5-qtxmlpatterns qt5-qtxmlpatterns-devel qt-devel \ + qt-webkit-devel smesh-devel SoQt-devel swig tbb-devel vtk xerces-c xerces-c-devel + diff --git a/tools/build/manjaro.sh b/tools/build/manjaro.sh new file mode 100755 index 0000000000..b9edc23695 --- /dev/null +++ b/tools/build/manjaro.sh @@ -0,0 +1,7 @@ +#!/bin/sh +pacman --noconfirm --sync boost boost-libs cmake coin curl desktop-file-utils doxygen \ + eigen gc gcc-fortran git glew gnu-free-fonts guile hicolor-icon-theme jsoncpp \ + libspnav libtool make med opencascade pyside2 pyside2-tools python-matplotlib \ + python-netcdf4 python-pivy qt5-svg qt5-tools qt5-webengine qt5-webkit \ + shared-mime-info shiboken2 swig texinfo xerces-c + diff --git a/tools/build/ubuntu.sh b/tools/build/ubuntu.sh new file mode 100644 index 0000000000..3d84214a3b --- /dev/null +++ b/tools/build/ubuntu.sh @@ -0,0 +1,15 @@ +#!/bin/sh +apt-get install --no-install-recommends --yes build-essential cmake doxygen git \ + libboost-date-time-dev libboost-dev libboost-filesystem-dev \ + libboost-graph-dev libboost-iostreams-dev libboost-program-options-dev \ + libboost-python-dev libboost-regex-dev libboost-serialization-dev \ + libboost-thread-dev libcoin-dev libeigen3-dev libgtkglext1-dev \ + libgts-dev libkdtree++-dev libkml-dev libmedc-dev libocct-data-exchange-dev \ + libocct-draw-dev libocct-foundation-dev libocct-modeling-algorithms-dev \ + libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev \ + libopencv-dev libproj-dev libpyside2-dev libqt5svg5-dev libqt5webkit5-dev \ + libqt5xmlpatterns5-dev libshiboken2-dev libvtk9-dev libvtk9-qt-dev \ + libvtk-dicom-dev libx11-dev libxerces-c-dev libxmu-dev libxmuu-dev \ + libzipios++-dev netgen netgen-headers pyside2-tools python3-dev \ + python3-matplotlib python3-pivy python3-pyside2.qtuitools qtchooser \ + qttools5-dev shiboken2 swig