diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index c1c9f4dc..00000000 --- a/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -.git* diff --git a/.gitignore b/.gitignore index bf5798cc..f7f95302 100644 --- a/.gitignore +++ b/.gitignore @@ -96,3 +96,7 @@ ENV/ .ropeproject .DS_Store + +# Backups +*.bak +*~ diff --git a/CMakeLists.txt b/CMakeLists.txt index 14b85bba..c5d3de29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,74 +1,99 @@ -#Copyright (c) 2020 Ultimaker B.V. -#cura-build-environment is released under the terms of the AGPLv3 or higher. +# Copyright 2022 Ultimaker -project(cura-build-environment) - -cmake_minimum_required(VERSION 3.6) +# Setting the MACOSX_DEPLOYMENT_TARGET needs to be done before the first project() call. Setting this value should also +# take care of the CMAKE_OSX_SYSROOT. The variable is ignored on non-Apple systems. -if(NOT CURA_ARCUS_BRANCH_OR_TAG) - set(CURA_ARCUS_BRANCH_OR_TAG "master") -endif() -if(NOT CURA_SAVITAR_BRANCH_OR_TAG) - set(CURA_SAVITAR_BRANCH_OR_TAG "master") -endif() +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) +include(GetFromEnvironmentOrCache) +GetFromEnvironmentOrCache( + NAME + CMAKE_OSX_DEPLOYMENT_TARGET + DESCRIPTION + "Specify the minimum version of the target platform (e.g. macOS or iOS)") -# This should care that our CMAKE_INSTALL_PREFIX is absolute at the end... -get_filename_component(CMAKE_INSTALL_PREFIX - ${CMAKE_INSTALL_PREFIX} - ABSOLUTE - CACHE FORCE) +project(cura-build-environment) +cmake_minimum_required(VERSION 3.20) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) +include(cmake/conan.cmake) +include(cmake/os.cmake) include(ExternalProject) include(GNUInstallDirs) -include(BuildPlatformDetection) -include(SetProjectDependencies) - -# Hard-code the CPython executable to use later because all find_package() -# commands are executed when the Makefiles are generated. Because we need to -# compile CPython first, all other projects that require Python must use our -# compiled one. Because we cannot use find_package() to find Python at runtime, -# we have to hard-code the CPython executable that will be created later. All -# projects that requires Python must use the variable Python3_EXECUTABLE so they -# will use the right CPython. -if(BUILD_OS_WINDOWS) - # Minimalistic preinstalled Python on Windows: - set(Python3_EXECUTABLE ${CMAKE_INSTALL_PREFIX}/bin/python.exe) -else() - # All other OSs like OSX - set(Python3_EXECUTABLE ${CMAKE_INSTALL_PREFIX}/bin/python3) +# Create the version-related variables +GetFromEnvironmentOrCache( + NAME + CURA_VERSION_MAJOR + DEFAULT + "5" + DESCRIPTION + "Cura Major Version") +GetFromEnvironmentOrCache( + NAME + CURA_VERSION_MINOR + DEFAULT + "0" + DESCRIPTION + "Cura Minor Version") +GetFromEnvironmentOrCache( + NAME + CURA_VERSION_PATCH + DEFAULT + "0" + DESCRIPTION + "Cura Patch Version") +GetFromEnvironmentOrCache( + NAME + CURA_VERSION_PRE_RELEASE_TAG + DESCRIPTION + "Cura pre release tag Version Information a, b or rc") +GetFromEnvironmentOrCache( + NAME + CURA_VERSION_BUILD + DESCRIPTION + "Cura Version buildmetadata ignored when determining version precedence. Only used to identify a build.") +set(CURA_VERSION_EXTRA ) +if(NOT ${CURA_VERSION_PRE_RELEASE_TAG} STREQUAL "") + set(CURA_VERSION_EXTRA "-${CURA_VERSION_PRE_RELEASE_TAG}+${CURA_VERSION_BUILD}") endif() +set(_default_cura_version "${CURA_VERSION_MAJOR}.${CURA_VERSION_MINOR}.${CURA_VERSION_PATCH}${CURA_VERSION_EXTRA}") +GetFromEnvironmentOrCache( + NAME + CURA_VERSION + DEFAULT + ${_default_cura_version} + DESCRIPTION + "Cura Extra Version Information" + REQUIRED) -# Build projects step -add_custom_target(projects ALL COMMENT "Building Projects...") +include(projects/python.cmake) +include(projects/charon.cmake) +include(projects/savitar.cmake) +include(projects/arcus.cmake) +include(projects/uranium.cmake) +include(projects/libnest2d.cmake) +include(projects/pynest2d.cmake) +include(projects/curaengine.cmake) +include(projects/cura.cmake) +include(projects/fdm_materials.cmake) +include(projects/cura-binary-data.cmake) -# On Linux, make sure that we use "lib" for libraries and create a symlink "lib64" pointing to "lib". -if(BUILD_OS_LINUX) - message(STATUS "Prepare lib and lib64 on Linux...") - execute_process( - COMMAND mkdir -p "${CMAKE_INSTALL_PREFIX}/lib" - ) - execute_process( - COMMAND ln -s "lib" "lib64" - WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" - ) +# Collect the artifacts with pyinstaller +include(cmake/pyinstaller.cmake) + +if(APPLE) + include(cmake/create-dmg.cmake) + include(cmake/sign-dmg.cmake) + include(cmake/notarize-dmg.cmake) endif() -# Some extra post build additions are needed on macOS, as the eventual Cura build will fail, because otool -# throws an error while copying pynest2d.so to the Ultimaker Cura.app bundle. -if(BUILD_OS_OSX) - add_custom_command( - TARGET projects POST_BUILD - COMMAND /Library/Developer/CommandLineTools/usr/bin/install_name_tool -change @rpath/libnlopt.0.dylib "${CMAKE_INSTALL_PREFIX}/lib/libnlopt.0.dylib" "${CMAKE_INSTALL_PREFIX}/lib/python3.10/site-packages/pynest2d.so" - COMMENT "Changing the RPATH of pynest2d" - ) +if(LINUX) + include(cmake/create-appimage.cmake) + include(cmake/sign-appimage.cmake) endif() -file(GLOB _projects projects/*.cmake) -foreach(_project ${_projects}) - include(${_project}) -endforeach() +if(WIN32) + include(cmake/nsis.cmake) +endif() -ProcessProjectDependencies(TARGET projects) +include(cmake/dev.cmake) \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index b75fa473..00000000 --- a/Jenkinsfile +++ /dev/null @@ -1,58 +0,0 @@ -// Only rebuild the environment when we actually want to rebuild it. -timeout(time: 5, unit: 'DAYS') -{ - input 'This will rebuild the Cura build environment. This is a long process that will block all Cura build slaves from building until it is done. Continue?' -} - -// This will trigger a build of cura-build-environment on each node with the -// label 'cura'. This is done because we need cura-build-environment working on -// all the slaves since it contains all the dependencies for the other projects. -def jobs = [:] -def nodes = node_names('cura') -for(int i = 0; i < nodes.size(); ++i) { - def name = nodes[i]; - - jobs[name] = { - node(name) { - stage('Prepare') { - step([$class: 'WsCleanup']) - - // Clean up the previous installation - try { - if(isUnix()) { - sh "rm -r /opt/ultimaker/cura-build-environment/${env.BRANCH_NAME}" - } else { - bat "rmdir /S /Q C:\\ultimaker\\cura-build-environment\\${env.BRANCH_NAME}" - } - } catch(e) { - // Ignore - } - - checkout scm - } - - stage('Build') { - if(isUnix()) { - dir('build') { - // Build and install the new environment - sh "cmake .. -DCMAKE_INSTALL_PREFIX=/opt/ultimaker/cura-build-environment/${env.BRANCH_NAME} -DCMAKE_PREFIX_PATH=/opt/ultimaker/cura-build-environment/${env.BRANCH_NAME} -DCMAKE_BUILD_TYPE=Release -DINCLUDE_DEVEL=ON" - sh "make" - } - } else { - bat """ - subst Q: . - Q: - mkdir build && cd build - call ../env_win64.bat - cmake .. -DCMAKE_INSTALL_PREFIX=C:/ultimaker/cura-build-environment/${env.BRANCH_NAME} -DCMAKE_PREFIX_PATH=/opt/ultimaker/cura-build-environment/${env.BRANCH_NAME} -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" -DINCLUDE_DEVEL=ON - nmake - C: - subst /D Q: - """ - } - } - } - } -} - -parallel jobs diff --git a/Note.md b/Note.md deleted file mode 100644 index cd24bbfa..00000000 --- a/Note.md +++ /dev/null @@ -1,23 +0,0 @@ -Build on Mac OS X for 10.9 -========================== - -**References:** - - https://www.felix-schwarz.org/blog/2016/03/how-to-use-the-os-x-109-sdk-with-xcode-73 - -If you install Xcode 7.3, it only ships with OS X 10.11 SDK, and this unfortunately causes problems when you want to -compile code targeting an earlier OS X version, such as 10.9. To fix this, I did what's described in the reference -page linked above. The steps are: - - Quit Xcode 7.3 - - Get Xcode 6.4 which contains SDKs for OS X 10.9 and 10.10. It's probably going to be an - [Xcode_6.4.dmg](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_6.4/Xcode_6.4.dmg) - - Mount the DMG using `hdiutil` probably to /Volumes/Xcode - - The SDKs are located in `Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/` - - `MacOSX10.9.sdk` - - `MacOSX10.10.sdk` - - Copy the required SDKs to `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/` - - Open file `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist` - and remove the following lines: - ``` - MinimumSDKVersion - 10.11 - ``` diff --git a/README.md b/README.md index a838da17..d77195c6 100644 --- a/README.md +++ b/README.md @@ -1,283 +1,160 @@ -cura-build-environment -====================== - -This is a CMake-based project that will build the dependencies for Cura. - -It will download and build the following projects: - -- Python -- Qt (Not on Windows) -- Sip -- PyQt (Installs Wheel on Windows) -- OpenBLAS (Only on Linux) -- Numpy (Installs Wheel on Windows) -- Scipy (Installs Wheel on Windows) -- Protobuf -- Arcus -- python-netifaces -- python-six -- python-zeroconf -- pyserial -- Savitar -- cx_Freeze -- AppImageKit (Only on Linux) -- python-utils -- Numpy-STL - -To build these dependencies of Cura, the following software needs to be installed on your system: - -- **CMake** Once CMake is installed make sure it is available on your `%PATH%`. Check this by running `cmake --version` in the Windows console. (http://www.cmake.org/) -- **git** - The `git` command should be available on your `%PATH%` or `$PATH`, depending which OS you are using. (https://git-scm.com/) - - (WINDOWS) Make sure that the `cmd` directory in the git for windows installation directory is on the `%PATH%` and *not* its `bin` directory, otherwise mingw32 will complain about `sh.exe` being on the path. (https://git-for-windows.github.io/) - - (LINUX) Check your package management system for the term `git`. You should be able to find easily there. -- **Subversion aka "svn"** - To fetch some sources - -On Linux, the following dependencies are required in order to build Qt: -- pkg-config -- freetype -- xcb -- opengl-desktop -- fontconfig - -The end result of this project should be a complete build environment -installed to CMAKE_INSTALL_PREFIX. This environment can be used in -combination with the [cura-build] repository to produce Cura executables for -all three supported platforms. - -[cura-build]: https://github.com/ultimaker/cura-build - - -# Docker Images (Linux and Windows) - -The lastest docker images can be found on DockerHub via https://hub.docker.com/r/ultimaker/cura-build-environment. -Currently only the CentOS-based images are available. To get the latest CentOS-base image, you can run - -```shell script -docker pull ultimaker/cura-build-environment -``` - -There are Dockerfiles for Linux and Windows. You can find them in the `docker` -directory. The main Dockerfiles are as follows: - - - `docker/linux/Dockerfile.centos`: Based on centos7 - - `docker/windows/Dockerfile.vs2015`: Based on Windows Server Core 1809 with - Visual Studio 2015 Build Tools - -To build a docker, you can use the commands below: - -```shell script -# Make sure that you are in the `cura-build-environment` root directory. - -# Build the Linux image based on centos7 -docker build -t -f docker/linux/Dockerfile.centos . -``` - -```powershell -# Build the Windows image based on Windows Server Core 1809 with -# Visual Studio 2015 Build Tools -docker build -t -f docker/windows/Dockerfile.vs2015 . -``` - -Note that the Windows Dockerfile uses `mcr.microsoft.com/windows/servercore:1809-amd64` -as the base image. See https://hub.docker.com/_/microsoft-windows-servercore): "Windows -requires the host OS version to match the container OS version." So, if the `1809` base -image doesn't work for you, try to change it to an eariler version, for example `1607`. -To check your Windows version, you can run the PowerShell command below: - -```powershell -PS > [System.Environment]::OSVersion.Version - -Major Minor Build Revision ------ ----- ----- -------- -10 0 17763 0 -``` - -**IMPORTANT:** There's a known issue with Windows docker images earlier than version `1809` -that CMake git clone and submodule commands can fail due to SSL verification. In -cura-build-environment, this can happen for `libArcus` and `libSavitar`. A workaround is -to use the `GIT_CONFIG` option in `ExternalProject_Add()` to disable SSL verification. -To do so, add the following line: - -``` -ExternalProject_Add(myProj - GIT_REPOSITORY https://github.com/my/project - ... - GIT_CONFIG http.sslVerify=false - ... -) -``` - -The built cura-build-environment will be installed in the following paths in the -docker images: - - `Linux` : `/srv/cura-build-environment` - - `Windows` : `C:\cura-build-environment` - -There are 2 main environment variables in the image: - - - `CURA_BUILD_ENV_BUILD_TYPE`: The build type, either `Release` (default) or - `Debug`. - - `CURA_BUILD_ENV_PATH`: Where the cura-build-environment is installed. - -You can use a number of arguments to customize the image you want to build. The -available arugments are as follows: - - - `CURA_BUILD_ENV_BUILD_TYPE`: By default `Release`, this is passed to cmake via `CMAKE_BUILD_TYPE`. - - `CURA_BUILD_ENV_PATH`: Where the cura-build-environment will be installed in the image. - - `CURA_ARCUS_BRANCH_OR_TAG`: The git branch/tag to use for building libArcus. - - `CURA_SAVITAR_BRANCH_OR_TAG`: The git branch/tag to use for building libSavitar. - -You can configure them via the example command below: +# cura-build-environment + +**WIP** + +This repository contains helper scripts for building Cura from source. It will create a base environment from which +which are used to build an installer for the specific OS. + +## System Requirements + +- Python 3.10.2 +- conan >= 1.46 + +### Linux +- GCC >= 8.0 +- CMake >= 3.16 +- GNU Make >= 4 +- Docker >= 20 + +### MacOS +- MacOS SDK +- clang-apple +- MacOS + +### Windows +- Visual Studio >= 16 +- NMake +- Docker +- makensis (should be on the PATH) +- jinja2 (should be parth of Conan) + +## CMake script + +The CMake project will ensure that the following dependencies are build and can be installed in a location for future +use. It will download and install the following projects: + +- libnest2d +- pynest2d +- libsavitar +- libarcus +- Python dependencies + - Automat + - PyQt6 + - PyQt6-NetworkAuth + - PyQt6-NetworkAuth-Qt6 + - PyQt6-Qt6 + - PyQt6-sip + - SecretStorage + - Twisted + - altgraph + - appdirs + - atomicwrites + - attrs + - certifi + - cffi + - chardet + - colorama + - constantly + - coverage + - cryptography + - cx-Logging + - cython + - decorator + - future + - hyperlink + - idna + - ifaddr + - importlib-metadata + - incremental + - jeepney + - keyring + - lxml + - macholib + - more-itertools + - mypy + - mypy-extensions + - netifaces + - networkx + - numpy + - numpy-stl + - packaging + - pefile + - pluggy + - py + - py-cpuinfo + - pybind11 + - pyclipper + - pycollada + - pycparser + - pyinstaller + - pyinstaller-hooks-contrib + - pyparsing + - pyserial + - pytest + - pytest-benchmark + - pytest-cov + - python-dateutil + - python-utils + - pywin32 + - pywin32-ctypes + - requests + - scipy + - sentry-sdk + - setuptools + - sip + - six + - sys_platform + - toml + - tomli + - trimesh + - twisted-iocpsupport + - typed-ast + - typing-extensions + - urllib3 + - wcwidth + - wheel + - zeroconf + - zipp + - zope.interface + +The list of dependencies above also have their own dependencies, such as: + +- cpython +- protobuf +- clipper +- boost +- gtest +- nlopt + +These can be installed with the help of [Conan](https://conan.io/), which is a dependency manager for C++ projects. +It will either download the binaries and header files or compile it automatically from source. It will also generate +the CMake find_package modules, such that these can be used. The `conanfile.txt` located in the root of this directory +specifies a list of used dependencies. + +Installation of Conan is simple: ```bash -docker build \ - --build-arg CURA_BUILD_ENV_BUILD_TYPE=Release \ - --build-arg CURA_ARCUS_BRANCH_OR_TAG=master \ - ... +pip install conan ``` -## Details about the Linux CentOS 7 Docker Image - -The default user is `ultimaker` with `uid=1000` and group `ultimaker` with -`gid=1000`. This ensures if volume mounting is used, the resulting files should -have the correct ownerships which corresponds to the default linux user on the -host machine. +> Ultimaker has its own standard Conan configuration, you could apply these with the command below. Keep in mind that +> this isn't necesarry and it might overwrite your current Conan configuration +> ```bash +> conan config install https://github.com/ultimaker/conan-config.git +> ``` -The development tool in use is `devtoolset-7`. In order to use the build -environment correctly in the docker container, make sure that the following -is done before you do anything else: +Once Conan is installed and configured, installing the cura-build-environment is easy. The steps below should do the +trick. ```bash -#!/bin/bash - -# Enable devtoolset-7 with its environment variables -source /opt/rh/devtoolset-7/enable -# Make sure that the executables and packages in the install cura-build-environment -# will be preferred. -export PATH="${CURA_BUILD_ENV_PATH}/bin:${PATH}" -export PKG_CONFIG_PATH="${CURA_BUILD_ENV_PATH}/lib/pkgconfig:${PKG_CONFIG_PATH}" -``` - -Note that the default entrypoint of this image is `/docker-entrypoint.sh`, -which executes the commands above. - -# Building cura-build-environment on Native Machine - -## Linux - -Building on Linux is fairly straightforward: - -``` -cbe_src_dir= -cbe_install_dir= - -cd $cbe_src_dir -mkdir build -cd build - -# Set some environment variables to make sure that the installed tools can be found. -export PATH=$cbe_install_dir/bin:$PATH -export PKG_CONFIG_PATH=$cbe_install_dir/lib/pkgconfig:$PKG_CONFIG_PATH - -cmake -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=$cbe_install_dir \ - -DCMAKE_PREFIX_PATH=$cbe_install_dir \ - .. -make -``` - -Note that a fairly recent C++ compiler is required, at the very least GCC -4.9. If you are building on CentOS, you can get this from the devtoolset -packages. - -## Mac OS - -Building on MacOS currently requires OpenSSL and a recent version of the -development tools distributed with XCode. You may also want to set -MACOSX_DEPLOYMENT_TARGET to ensure everything can be used with older -versions of Mac OS. The "env_osx.sh" will set it to 10.7 and ensure the -right compiler is still used. It also add the relevant directories for -OpenSSL installed through Brew. - -On newer versions of MacOS, the zlib headers cannot be found unless -XCode Command Line Tools are installed first. To install those, please -run the following first: - -``` -xcode-select --install -``` - -To build, run the following: - +mkdir build && cd build +cmake -DCMAKE_PREFIX_PATH= -DCMAKE_INSTALL_PREFIX= .. +cmake --build . ``` -cbe_src_dir= -cbe_install_dir= -cd $cbe_src_dir -mkdir build -cd build +The Installer for your OS can now be found in the `/installer/dist/` -source ../env_osx.sh - -# Set some environment variables to make sure that the installed tools can be found. -export PATH=$cbe_install_dir/bin:$PATH -export PKG_CONFIG_PATH=$cbe_install_dir/lib/pkgconfig:$PKG_CONFIG_PATH - -cmake -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=$cbe_install_dir \ - -DCMAKE_PREFIX_PATH=$cbe_install_dir \ - .. -make -``` - -## Windows - - - -cura-build-environment on Windows requires Visual C++ 2015 (14.0) and MinGW-w64 -(version 4.9 or higher). Python and all Python modules are compiled with VC++ -and CuraEngine is built with MinGW. - -**Microsoft Visual Studio 2015 (Recommended)** -1. Download Microsoft Visual Studio from [here (Web Installer)](https://go.microsoft.com/fwlink/?LinkId=532606&clcid=0x409) or -[here (ISO Image)](https://go.microsoft.com/fwlink/?LinkId=615448&clcid=0x409). -2. Run the installer. To save on space, Custom can be selected with only `Visual C++` selected in Programming Languages. The complete installation will be large (>12 GB) and will take a while to complete. - -**MinGW-w64** -1. Download mingw-w64 from [here (executable installer)](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe/download) -2. In the Settings page of the installer, select Architecture: i686 for 32bit or x86_64 for 64bit systems -3. Ensure that the directory C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin (or the i686 equivalent) is in your PATH - -The current cura-build-environment uses Python 3.5.2 which can be compiled with -Visual C++ 2015 (14.0) with Windows 8.1 SDK. Visual Studio 2017 doesn't seem to -be able to compile Python 3.5.* successfully. - -In addition, Subversion is required for building Python (for building OpenSSL). -Please make sure all required tools are accessible through your path. - -The `env_win32.bat` and `env_win64.bat` will make sure to set a few -environment variables that are required. Most importantly, they call the -`vcvarsall.bat` files from Visual C++ to ensure VC++ can be used. - -To build, run the following: - -``` -set cbe_src_dir= -set cbe_install_dir= - -cd %cbe_src_dir% -mkdir build -cd build - -..\env_win64.bat - -cmake -DCMAKE_BUILD_TYPE=Release ^ - -DCMAKE_INSTALL_PREFIX=%cbe_install_dir% ^ - -DCMAKE_PREFIX_PATH=%cbe_install_dir% ^ - -G "NMake Makefiles" ^ - .. -nmake -``` +> On Windows make sure you are working in the x64 Visual Studio 2019/2022 Command Prompt and specify the NMake generator using the +> `cmake -G "NMake Makefiles" -DCMAKE_PREFIX_PATH= -DCMAKE_INSTALL_PREFIX= ..` -Note: Using the NMake Makefiles generator is important, since the normal -Visual Studio generator does not work well in combination with some of -the build systems of the sub-projects that are built. +> If you want to see all the options available use a tool such as `ccmake` or `cmake-gui` \ No newline at end of file diff --git a/cmake/BuildPlatformDetection.cmake b/cmake/BuildPlatformDetection.cmake deleted file mode 100644 index 87848b9a..00000000 --- a/cmake/BuildPlatformDetection.cmake +++ /dev/null @@ -1,24 +0,0 @@ -set(BUILD_OS_OSX OFF) -set(BUILD_OS_LINUX OFF) -set(BUILD_OS_WINDOWS OFF) -set(BUILD_OS_WIN32 OFF) -set(BUILD_OS_WIN64 OFF) - -if(APPLE) - set(BUILD_OS_OSX ON) - message(STATUS "Building for OSX") -elseif(WIN32) - set(BUILD_OS_WINDOWS ON) - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(BUILD_OS_WIN64 ON) - message(STATUS "Building for 64-bit Windows") - elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) - set(BUILD_OS_WIN32 ON) - message(STATUS "Building for 32-bit Windows") - else() - message(FATAL_ERROR "Could not determine platform architecture!") - endif() -elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - set(BUILD_OS_LINUX ON) - message(STATUS "Building for Linux") -endif() diff --git a/cmake/GetFromEnvironmentOrCache.cmake b/cmake/GetFromEnvironmentOrCache.cmake new file mode 100644 index 00000000..e03d61db --- /dev/null +++ b/cmake/GetFromEnvironmentOrCache.cmake @@ -0,0 +1,54 @@ +# Copyright 2022 Ultimaker + +macro(GetFromEnvironmentOrCache) + set(options BOOL FILEPATH PATH STRING INTERNAL REQUIRED) + set(oneValueArgs NAME DEFAULT DESCRIPTION) + set(multiValueArgs ) + cmake_parse_arguments(VAR "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if(NOT VAR_NAME) + message(FATAL_ERROR "NAME is a required keyword") + endif() + + if(NOT ${VAR_NAME}) + if(VAR_BOOL) + set(VAR_CACHE BOOL) + elseif(VAR_FILEPATH) + set(VAR_CACHE FILEPATH) + elseif(VAR_PATH) + set(VAR_CACHE PATH) + elseif(VAR_STRING) + set(VAR_CACHE STRING) + elseif(VAR_INTERNAL) + set(VAR_CACHE INTERNAL) + else() + set(VAR_CACHE STRING) + endif() + + if(DEFINED ENV{${VAR_NAME}) + set(VAR_VALUE $ENV{${VAR_NAME}}) + message(STATUS "Using value of environment variable for ${VAR_NAME}: ${VAR_VALUE}") + elseif(DEFINED VAR_DEFAULT) + set(VAR_VALUE ${VAR_DEFAULT}) + message(STATUS "Using default value for ${VAR_NAME}: ${VAR_VALUE}") + elseif(VAR_REQUIRED) + message(SEND_ERROR "${VAR_NAME} is a required variable, either provide a commandline arg, environment variable or default value") + else() + set(VAR_VALUE ) + message(STATUS "Using empty default value for ${VAR_NAME}") + endif() + + if(NOT DEFINED VAR_DESCRIPTION) + set(VAR_DESCRIPTION "") + endif() + + set(${VAR_NAME} + "${VAR_VALUE}" + CACHE + ${VAR_CACHE} + ${VAR_DESCRIPTION} + FORCE) + else() + message(STATUS "Using CMake provided variable ${VAR_NAME}: ${${VAR_NAME}}") + endif() +endmacro() \ No newline at end of file diff --git a/cmake/SetProjectDependencies.cmake b/cmake/SetProjectDependencies.cmake deleted file mode 100644 index 3bc40fcd..00000000 --- a/cmake/SetProjectDependencies.cmake +++ /dev/null @@ -1,25 +0,0 @@ - -include(CMakeParseArguments) - -macro(SetProjectDependencies) - set(_single_value_args TARGET) - set(_multi_value_args DEPENDS) - cmake_parse_arguments("" "" "${_single_value_args}" "${_multi_value_args}" ${ARGN}) - - list(APPEND ALL_PROJECT_TARGETS ${_TARGET}) - - set_property(TARGET ${_TARGET} PROPERTY PROJECT_DEPENDS ${_DEPENDS}) -endmacro() - -macro(ProcessProjectDependencies) - set(_single_value_args TARGET) - cmake_parse_arguments("" "" "${_single_value_args}" "" ${ARGN}) - - foreach(_project ${ALL_PROJECT_TARGETS}) - get_property(_depends TARGET ${_project} PROPERTY PROJECT_DEPENDS) - if(_depends) - add_dependencies(${_project} ${_depends}) - endif() - add_dependencies(${_TARGET} ${_project}) - endforeach() -endmacro() diff --git a/cmake/conan.cmake b/cmake/conan.cmake new file mode 100644 index 00000000..950f4478 --- /dev/null +++ b/cmake/conan.cmake @@ -0,0 +1,28 @@ +if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake") + message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan") + file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.0/conan.cmake" + "${CMAKE_BINARY_DIR}/conan.cmake" + EXPECTED_HASH SHA256=65fc3508c91bf201f5472d28b21259e02b6f975a2917be457412ab7a87906c1e + TLS_VERIFY ON) +endif() +include(${CMAKE_BINARY_DIR}/conan.cmake) + +# === Project specific === + +conan_config_install(ITEM https://github.com/ultimaker/conan-config.git TYPE git VERIFY_SSL True) +conan_check(VERSION 1.46.0 REQUIRED) + +conan_cmake_run( + BASIC_SETUP + CONANFILE + conanfile.py + PROFILE + default + BUILD + missing + ) + +if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND EXISTS "${CMAKE_BINARY_DIR}/conan_toolchain.cmake") + include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake) + set(CMAKE_TOOLCHAIN_FILE ${CMAKE_BINARY_DIR}/conan_toolchain.cmake) +endif() \ No newline at end of file diff --git a/cmake/create-appimage.cmake b/cmake/create-appimage.cmake new file mode 100644 index 00000000..23a2410d --- /dev/null +++ b/cmake/create-appimage.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2022 Ultimaker B.V. +# Cura's build system is released under the terms of the AGPLv3 or higher. + +set(INSTALLER_EXT AppImage) +include(${CMAKE_SOURCE_DIR}/cmake/installer-filename.cmake) + +#Put correct version in cura.desktop. +configure_file(${CMAKE_SOURCE_DIR}/packaging/cura.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/cura.desktop @ONLY) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/apprun-attr.cmake" "file(COPY ${CMAKE_SOURCE_DIR}/packaging/AppRun DESTINATION ${ULTIMAKER_CURA_PATH} FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_WRITE GROUP_READ WORLD_READ OWNER_EXECUTE)") + +add_custom_target(packaging ALL + COMMENT "Package into an AppImage file." + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/apprun-attr.cmake + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/packaging/cura-icon_256x256.png ${ULTIMAKER_CURA_PATH}/cura-icon.png + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/cura.desktop ${ULTIMAKER_CURA_PATH}/cura.desktop + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/packaging/cura.appdata.xml ${ULTIMAKER_CURA_PATH}/cura.appdata.xml + COMMAND ${CMAKE_COMMAND} -E remove ${installer_DIR}/dist/${INSTALLER_FILENAME} + COMMAND appimagetool --appimage-extract-and-run ${ULTIMAKER_CURA_PATH}/ ${installer_DIR}/dist/${INSTALLER_FILENAME} + WORKING_DIRECTORY ${ULTIMAKER_CURA_PATH}) +add_dependencies(packaging pyinstaller) diff --git a/cmake/create-dmg.cmake b/cmake/create-dmg.cmake new file mode 100644 index 00000000..24c4e672 --- /dev/null +++ b/cmake/create-dmg.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2022 Ultimaker B.V. +# cura-build-environment is released under the terms of the AGPLv3 or higher. + +GetFromEnvironmentOrCache( + NAME + CREATE_DMG_EXECUTABLE + DEFAULT + /usr/local/bin/create-dmg + FILEPATH + DESCRIPTION + "The path to the create-dmg executable") + +GetFromEnvironmentOrCache( + NAME + REZ_EXECUTABLE + DEFAULT + /Library/Developer/CommandLineTools/usr/bin/Rez + FILEPATH + DESCRIPTION + "The path to the Rez (Resource compiler)") + +set(INSTALLER_EXT dmg) +include(${CMAKE_SOURCE_DIR}/cmake/installer-filename.cmake) +set(DMG_PATH ${installer_DIR}/${INSTALLER_FILENAME}) + +add_custom_target(packaging ALL COMMENT "Create the MacOS dmg") +add_custom_command( + TARGET + packaging + WORKING_DIRECTORY + ${installer_DIR} + COMMAND + ${CREATE_DMG_EXECUTABLE} --window-pos 640 360 + --volicon "${CMAKE_SOURCE_DIR}/packaging/VolumeIcons_Cura.icns" + --window-size 690 503 + --icon-size 90 + --icon "Ultimaker-Cura.app" 169 272 + --app-drop-link 520 272 + --eula "${CMAKE_SOURCE_DIR}/packaging/cura_license.txt" + --background "${CMAKE_SOURCE_DIR}/packaging/cura_background_dmg.png" + --rez ${REZ_EXECUTABLE} + ${DMG_PATH} + ${ULTIMAKER_CURA_APP_PATH}) +add_dependencies(packaging pyinstaller install-python-requirements Cura create_installer_dir) \ No newline at end of file diff --git a/cmake/dev.cmake b/cmake/dev.cmake new file mode 100644 index 00000000..b5ca8ecd --- /dev/null +++ b/cmake/dev.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2022 Ultimaker B.V. +# Cura's build system is released under the terms of the AGPLv3 or higher. + +add_custom_target(create-dev-env COMMENT "Create development virtual environment") +add_dependencies(create-dev-env install-python-requirements Arcus Savitar pynest2d Charon fdm_materials) \ No newline at end of file diff --git a/cmake/installer-filename.cmake b/cmake/installer-filename.cmake new file mode 100644 index 00000000..a3780705 --- /dev/null +++ b/cmake/installer-filename.cmake @@ -0,0 +1,50 @@ +# Copyright (c) 2022 Ultimaker B.V. +# Cura's build system is released under the terms of the AGPLv3 or higher. + +GetFromEnvironmentOrCache( + NAME + POSTFIX_OS_INSTALLER_FILENAME_WINDOWS + DEFAULT + win64 + DESCRIPTION + "postfix for the installer file name when a Windows build is made (default win64): Ultimaker-Cura-5.0.0-b+2-win64.exe") +GetFromEnvironmentOrCache( + NAME + POSTFIX_OS_INSTALLER_FILENAME_LINUX + DEFAULT + linux + DESCRIPTION + "postfix for the installer file name when a Windows build is made (default linux): Ultimaker-Cura-5.0.0-b+2-linux.AppImage") +GetFromEnvironmentOrCache( + NAME + POSTFIX_OS_INSTALLER_FILENAME_MAC + DEFAULT + mac + DESCRIPTION + "postfix for the installer file name when a Windows build is made (default mac): Ultimaker-Cura-5.0.0-b+2-mac.dmg") + +set(INSTALLER_BASE_FILENAME "Ultimaker-Cura") +if(NOT CURA_BUILDTYPE STREQUAL "") + string(REPLACE " " "_" CURA_BUILDTYPE_NO_SPACES "${CURA_BUILDTYPE}") + set(INSTALLER_BASE_FILENAME ${INSTALLER_BASE_FILENAME}-${CURA_BUILDTYPE_NO_SPACES}) +endif() +set(INSTALLER_BASE_FILENAME ${INSTALLER_BASE_FILENAME}-${CURA_VERSION}) + +if(WIN32) + set(INSTALLER_BASE_FILENAME ${INSTALLER_BASE_FILENAME}-${POSTFIX_OS_INSTALLER_FILENAME_WINDOWS}) +endif() + +if(LINUX) + set(INSTALLER_BASE_FILENAME ${INSTALLER_BASE_FILENAME}-${POSTFIX_OS_INSTALLER_FILENAME_LINUX}) +endif() + +if(APPLE) + set(INSTALLER_BASE_FILENAME ${INSTALLER_BASE_FILENAME}-${POSTFIX_OS_INSTALLER_FILENAME_MAC}) +endif() + +if(INSTALLER_EXT) + set(INSTALLER_FILENAME ${INSTALLER_BASE_FILENAME}.${INSTALLER_EXT}) +else() + set(INSTALLER_FILENAME ${INSTALLER_BASE_FILENAME}) +endif() + diff --git a/cmake/notarize-dmg.cmake b/cmake/notarize-dmg.cmake new file mode 100644 index 00000000..59662806 --- /dev/null +++ b/cmake/notarize-dmg.cmake @@ -0,0 +1,51 @@ +# Copyright (c) 2022 Ultimaker B.V. +# cura-build-environment is released under the terms of the AGPLv3 or higher. + +if(SIGN_DMG) + GetFromEnvironmentOrCache( + NAME + NOTARIZE_DMG + DEFAULT + TRUE + BOOL + DESCRIPTION + "Notarize the dmg") + + if(NOTARIZE_DMG) + GetFromEnvironmentOrCache( + NAME + NOTARIZE_USER + REQUIRED + DESCRIPTION + "The Apple notarizing username") + + GetFromEnvironmentOrCache( + NAME + NOTARIZE_PASSWORD + REQUIRED + DESCRIPTION + "The Apple password of the notarizing user") + + GetFromEnvironmentOrCache( + NAME + ALTOOL_EXECUTABLE + DEFAULT + /Applications/Xcode.app/Contents/Developer/usr/bin/altool + FILEPATH + DESCRIPTION + "The path to the altool executable") + + add_custom_target(notarize ALL COMMENT "Notarize the MacOS dmg") + add_custom_command( + TARGET + notarize + WORKING_DIRECTORY + ${installer_DIR} + COMMAND xcrun ${ALTOOL_EXECUTABLE} --notarize-app + --primary-bundle-id "${ULTIMAKER_CURA_DOMAIN}" + --username "${NOTARIZE_USER}" + --password "${NOTARIZE_PASSWORD}" + --file "${DMG_PATH}") + add_dependencies(notarize signing pyinstaller install-python-requirements Cura create_installer_dir) + endif() +endif() \ No newline at end of file diff --git a/cmake/nsis.cmake b/cmake/nsis.cmake new file mode 100644 index 00000000..afd8dc83 --- /dev/null +++ b/cmake/nsis.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2022 Ultimaker B.V. +# Cura's build system is released under the terms of the AGPLv3 or higher. + +# Only NSIS needs to have arduino and vcredist +include(InstallRequiredSystemLibraries) +install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION "." COMPONENT VC_Runtime_Libs) +add_custom_target(packaging ALL COMMENT "Package into a NSIS installer.") + +set(INSTALLER_EXT exe) +include(${CMAKE_SOURCE_DIR}/cmake/installer-filename.cmake) + +add_custom_command( + TARGET + packaging + WORKING_DIRECTORY + ${installer_DIR}/dist + COMMAND + ${Python_EXECUTABLE} ${CMAKE_SOURCE_DIR}/packaging/NSIS/nsis-configurator.py + ${ULTIMAKER_CURA_PATH} + ${CMAKE_SOURCE_DIR}/packaging/NSIS/Ultimaker-Cura.nsi.jinja + "Ultimaker Cura" + "Ultimaker-Cura.exe" + ${CURA_VERSION_MAJOR} + ${CURA_VERSION_MINOR} + ${CURA_VERSION_PATCH} + ${CURA_VERSION_BUILD} + "Ultimaker B.V." + "https://ultimaker.com" + ${CMAKE_SOURCE_DIR}/packaging/cura_license.txt + LZMA + ${CMAKE_SOURCE_DIR}/packaging/cura_banner_nsis.bmp + ${CMAKE_SOURCE_DIR}/packaging/Cura.ico + ${installer_DIR}/dist/${INSTALLER_FILENAME} + COMMAND + makensis /V2 /P4 ${installer_DIR}/dist/Ultimaker-Cura.nsi + COMMENT "Package into a NSIS installer." + ) +add_dependencies(packaging pyinstaller) \ No newline at end of file diff --git a/cmake/os.cmake b/cmake/os.cmake new file mode 100644 index 00000000..8e58f18b --- /dev/null +++ b/cmake/os.cmake @@ -0,0 +1,26 @@ +# Copyright (c) 2022 Ultimaker B.V. +# cura-build-environment is released under the terms of the AGPLv3 or higher. + +if(WIN32) + set(ext .pyd) + set(env_path_sep ";") + set(exe_ext ".exe") + set(exe_path "Scripts") + set(lib_path "Lib") + set(python_lib_path "${lib_path}") +else() + set(ext .so) + set(env_path_sep ":") + set(exe_ext "") + set(exe_path "bin") + set(lib_path "lib") + set(python_lib_path "${lib_path}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}") +endif() + +set(PYTHONPATH ${CMAKE_INSTALL_PREFIX}/${python_lib_path}/site-packages) +set(Python_VENV_EXECUTABLE ${CMAKE_INSTALL_PREFIX}/${exe_path}/python${exe_ext}) +set(Python_SITELIB_LOCAL ${CMAKE_INSTALL_PREFIX}/${python_lib_path}/site-packages/) + +if(UNIX AND NOT APPLE) + set(LINUX TRUE) +endif() \ No newline at end of file diff --git a/cmake/pyinstaller.cmake b/cmake/pyinstaller.cmake new file mode 100644 index 00000000..6b5af03e --- /dev/null +++ b/cmake/pyinstaller.cmake @@ -0,0 +1,81 @@ +# Copyright (c) 2022 Ultimaker B.V. +# cura-build-environment is released under the terms of the AGPLv3 or higher. + +set(pyinstaller_EXECUTABLE ${CMAKE_INSTALL_PREFIX}/${exe_path}/pyinstaller) +set(cura_EXECUTABLE ${CMAKE_INSTALL_PREFIX}/bin/cura_app.py) +set(curaengine_EXECUTABLE ${CMAKE_INSTALL_PREFIX}/bin/CuraEngine${exe_ext}) +set(installer_DIR "${CMAKE_INSTALL_PREFIX}/installer") +set(ULTIMAKER_CURA_PATH "${installer_DIR}/dist/Ultimaker-Cura" CACHE INTERNAL "ultimaker_cura_path") +set(extra_pyinstaller_args ) + +if (APPLE) + set(ULTIMAKER_CURA_APP_PATH "${ULTIMAKER_CURA_PATH}.app") + GetFromEnvironmentOrCache( + NAME + SIGN_DMG + DEFAULT + TRUE + BOOL + DESCRIPTION + "Sign the dmg") + if (SIGN_DMG) + GetFromEnvironmentOrCache( + NAME + CODESIGN_IDENTITY + REQUIRED + DESCRIPTION + "The Apple codesign identity") + GetFromEnvironmentOrCache( + NAME + ULTIMAKER_CURA_DOMAIN + DEFAULT + nl.ultimaker.cura.dmg + DESCRIPTION + "The Ultimaker Cura domain to be used (usually reversed)") + list(APPEND extra_pyinstaller_args --codesign-identity "${CODESIGN_IDENTITY}" --osx-entitlements-file "${CMAKE_SOURCE_DIR}/signing/cura.entitlements" --osx-bundle-identifier "${ULTIMAKER_CURA_DOMAIN}") + endif () + list(APPEND extra_pyinstaller_args --icon ${CMAKE_SOURCE_DIR}/packaging/cura.icns) +endif () + +if(LINUX) + list(APPEND extra_pyinstaller_args )#--add-binary "/usr/lib/x86_64-linux-gnu/libwayland-cursor.so.0.0.0${env_path_sep}.") +endif() + +if (WIN32) + list(APPEND extra_pyinstaller_args --hidden-import fcntl --collect-all win32ctypes --icon ${CMAKE_SOURCE_DIR}/packaging/Cura.ico) +endif () + +add_custom_target(create_installer_dir ALL COMMAND ${CMAKE_COMMAND} -E make_directory ${installer_DIR}) +add_custom_target(pyinstaller ALL COMMENT "Collect the build artifacts in a single installer") + +add_custom_command( + TARGET + pyinstaller + WORKING_DIRECTORY + ${installer_DIR} + COMMAND + ${CMAKE_COMMAND} -E env "PYTHONPATH=${PYTHONPATH}" ${pyinstaller_EXECUTABLE} ${cura_EXECUTABLE} + --collect-all cura + --collect-all UM + --collect-all serial #Used only in plug-ins. + --collect-all Charon + --hidden-import pySavitar + --hidden-import pyArcus + --hidden-import pynest2d + --hidden-import PyQt6.QtNetwork + --hidden-import logging.handlers + --collect-all sqlite3 + --hidden-import zeroconf + --collect-all trimesh + --add-binary "${curaengine_EXECUTABLE}${env_path_sep}." + --add-data "${CMAKE_INSTALL_PREFIX}/${lib_path}/cura/plugins${env_path_sep}share/cura/plugins" + --add-data "${CMAKE_INSTALL_PREFIX}/${lib_path}/uranium/plugins${env_path_sep}share/uranium/plugins" + --add-data "${CMAKE_INSTALL_PREFIX}/share/cura/resources${env_path_sep}share/cura/resources" + --add-data "${CMAKE_INSTALL_PREFIX}/share/uranium/resources${env_path_sep}share/uranium/resources" + --add-data "${Python_SITELIB_LOCAL}/UM/Qt/qml/UM/${env_path_sep}PyQt6/Qt6/qml/UM" + --windowed --clean --noconfirm --log-level INFO ${extra_pyinstaller_args} + --name "Ultimaker-Cura" + COMMAND + ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/packaging/Cura.ico ${ULTIMAKER_CURA_PATH}/ +) +add_dependencies(pyinstaller create_installer_dir Cura fdm_materials cura-binary-data) \ No newline at end of file diff --git a/cmake/sign-appimage.cmake b/cmake/sign-appimage.cmake new file mode 100644 index 00000000..d075ab46 --- /dev/null +++ b/cmake/sign-appimage.cmake @@ -0,0 +1,9 @@ +# Copyright (c) 2022 Ultimaker B.V. +# Cura's build system is released under the terms of the AGPLv3 or higher. + +add_custom_target(signing ALL COMMENT "Create the asc file for the AppImage file.") +add_custom_command( + TARGET + signing + COMMAND sha256sum ${CMAKE_CURRENT_BINARY_DIR}/${INSTALLER_FILENAME} >> ${CMAKE_CURRENT_BINARY_DIR}/${INSTALLER_BASE_FILENAME}.asc) +add_dependencies(signing packaging) \ No newline at end of file diff --git a/cmake/sign-dmg.cmake b/cmake/sign-dmg.cmake new file mode 100644 index 00000000..9ed2bd93 --- /dev/null +++ b/cmake/sign-dmg.cmake @@ -0,0 +1,26 @@ +# Copyright (c) 2022 Ultimaker B.V. +# cura-build-environment is released under the terms of the AGPLv3 or higher. + +if(SIGN_DMG) + GetFromEnvironmentOrCache( + NAME + CODESIGN_EXECUTABLE + DEFAULT + /usr/bin/codesign + FILEPATH + DESCRIPTION + "The path to the codesign executable") + + add_custom_target(signing ALL COMMENT "Sign the MacOS dmg") + add_custom_command( + TARGET + signing + WORKING_DIRECTORY + ${installer_DIR} + COMMAND + ${CODESIGN_EXECUTABLE} -s "${CODESIGN_IDENTITY}" + --timestamp + -i "${ULTIMAKER_CURA_DOMAIN}" + "${DMG_PATH}") + add_dependencies(signing packaging pyinstaller install-python-requirements Cura create_installer_dir) +endif() \ No newline at end of file diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 00000000..9b2e46e8 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,67 @@ +from pathlib import Path + +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake + +from conans.errors import ConanInvalidConfiguration +from conans.tools import Version +from conan.tools.files import files + +required_conan_version = ">=1.46.2" + + +class CuraBuildEnvironemtConan(ConanFile): + name = "cura-build-environment" + description = "Building Cura dependencies" + topics = ("conan", "python", "pypi", "pip") + settings = "os", "compiler", "build_type", "arch" + build_policy = "missing" + + def configure(self): + self.options["boost"].header_only = True + + def requirements(self): + self.requires("protobuf/3.17.1") + self.requires("clipper/6.4.2") + self.requires("boost/1.78.0") + self.requires("gtest/1.8.1") + self.requires("nlopt/2.7.0") + self.requires("rapidjson/1.1.0") + self.requires("stb/20200203") + + def generate(self): + cmake = CMakeDeps(self) + cmake.generate() + + tc = CMakeToolchain(self) + + # Don't use Visual Studio as the CMAKE_GENERATOR + if self.settings.compiler == "Visual Studio": + tc.blocks["generic_system"].values["generator_platform"] = None + tc.blocks["generic_system"].values["toolset"] = None + + tc.variables["CHARON_BRANCH_OR_TAG"] = "origin/CURA-8640_PyQt6_upgrade" + tc.variables["CURA_BRANCH_OR_TAG"] = "origin/qt6_beyond_the_splash" + tc.variables["URANIUM_BRANCH_OR_TAG"] = "origin/qt6_beyond_the_splash" + tc.variables["ARCUS_BRANCH_OR_TAG"] = "origin/CURA-8640_PyQt6_upgrade" + tc.variables["SAVITAR_BRANCH_OR_TAG"] = "origin/CURA-8640_PyQt6_upgrade" + tc.variables["LIBNEST2D_BRANCH_OR_TAG"] = "origin/CURA-8640_PyQt6_upgrade" + tc.variables["PYNEST2D_BRANCH_OR_TAG"] = "origin/CURA-8640_PyQt6_upgrade" + tc.variables["ARCUS_BRANCH_OR_TAG"] = "origin/CURA-8640_PyQt6_upgrade" + tc.variables["CURAENGINE_BRANCH_OR_TAG"] = "origin/CURA-8640_PyQt6_upgrade" + tc.variables["CURABINARYDATA_BRANCH_OR_TAG"] = "origin/CURA-8640_PyQt6" + + tc.variables["CURA_VERSION_MAJOR"] = "5" + tc.variables["CURA_VERSION_MINOR"] = "0" + tc.variables["CURA_VERSION_PATCH"] = "0" + tc.variables["CURA_VERSION_PRE_RELEASE_TAG"] = "a" + tc.variables["CURA_VERSION_BUILD"] = "7" + + tc.variables["CURA_CLOUD_API_VERSION"] = "1" + tc.variables["CURA_CLOUD_API_ROOT"] = "https://api.ultimaker.com" + tc.variables["CURA_CLOUD_ACCOUNT_API_ROOT"] = "https://account.ultimaker.com" + tc.variables["CURA_MARKETPLACE_ROOT"] = "https://marketplace.ultimaker.com" + tc.variables["CURA_DIGITAL_FACTORY_URL"] = "https://digitalfactory.ultimaker.com" + + + tc.generate() diff --git a/docker/linux/.env b/docker/linux/.env new file mode 100644 index 00000000..b2ad9dfd --- /dev/null +++ b/docker/linux/.env @@ -0,0 +1,27 @@ +CONAN_VERSION=1.47.0 +DOCKER_TAG=0.1.4 +DOCKER_USERNAME=ultimaker + +# This versions are mandatory by 'conan-io/conan-center-index' +CMAKE_VERSION_FULL=3.23.0 +CMAKE_VERSION=3.23 +PYTHON_VERSION=3.10 +PYTHON_VERSION_FULL=3.10.4 +LIBSTDCPP_VERSION=10.3.0 +LIBSTDCPP_PATCH_VERSION=28 +LIBSTDCPP_MAJOR_VERSION=10 + +# Exact compiler versions +GCC7_VERSION=7.5.0 +GCC8_VERSION=8.4.0 +GCC9_VERSION=9.3.0 +GCC10_VERSION=10.3.0 +GCC11_VERSION=11.1.0 + +CLANG10_VERSION=10.0.1 +CLANG11_VERSION=11.1.0 +CLANG12_VERSION=12.0.0 +CLANG13_VERSION=13.0.0 + +DISTRO=ubuntu20.04 +DISTRO_VERSION=20.04 \ No newline at end of file diff --git a/docker/linux/Dockerfile.centos b/docker/linux/Dockerfile.centos deleted file mode 100644 index dafe9334..00000000 --- a/docker/linux/Dockerfile.centos +++ /dev/null @@ -1,175 +0,0 @@ -# ------------------------------- -# Stage 1: Build cura-build-environment -# -FROM centos:centos8 - -LABEL linux_distro="centos8" \ - architecture="amd64" \ - python_version="3.10.0" \ - qt_version="5.15.2" - -# Set build time arugments -ARG CURA_BUILD_ENV_BUILD_TYPE=Release -ARG CURA_BUILD_ENV_PATH=/srv/cura-build-environment -ARG CURA_BUILD_ENV_WORK_DIR=/tmp/cura-build-environment -ARG CURA_ARCUS_BRANCH_OR_TAG=master -ARG CURA_SAVITAR_BRANCH_OR_TAG=master - -# Create unprivileged user -RUN groupadd -g 1000 ultimaker && \ - useradd -g ultimaker -u 1000 ultimaker -m - -# Install package repositories. Use ius to get the latest git -RUN yum -y update && \ - yum install -y epel-release && \ - yum remove -y git && \ - yum update -y && \ - yum update -y - -# Install dependencies -RUN yum install --enablerepo=powertools -y \ - gcc \ - gcc-c++ \ - gcc-gfortran \ - cmake3 \ - curl \ - git \ - libtool \ - make \ - file \ - tar \ - which \ - bzip2 \ - bzip2-devel \ - freetype \ - freetype-devel \ - fontconfig \ - fontconfig-devel \ - patch \ - mesa-libGL \ - mesa-libGL-devel \ - libX11-devel \ - libxcb-devel \ - xcb-util-devel \ - xcb-util-image-devel \ - xcb-util-keysyms-devel \ - xcb-util-renderutil-devel \ - xcb-util-wm-devel \ - libxkbcommon-devel \ - libxkbcommon-x11-devel \ - libxml2-devel \ - libxslt-devel \ - python2 \ - libxcb \ - xcb-util \ - libXrender-devel \ - libXi-devel \ - libdrm-devel \ - libXcursor-devel \ - libXcomposite-devel - - -# Set up the build environment -RUN mkdir -p "${CURA_BUILD_ENV_WORK_DIR}" "${CURA_BUILD_ENV_PATH}" -ADD . "${CURA_BUILD_ENV_WORK_DIR}"/src - -# Build the build environment -RUN mkdir -p "${CURA_BUILD_ENV_WORK_DIR}"/build && \ - chown -R ultimaker:ultimaker "${CURA_BUILD_ENV_WORK_DIR}" && \ - chown -R ultimaker:ultimaker "${CURA_BUILD_ENV_PATH}" -WORKDIR "${CURA_BUILD_ENV_WORK_DIR}"/build -USER ultimaker -RUN "${CURA_BUILD_ENV_WORK_DIR}"/src/docker/linux/build.sh "${CURA_BUILD_ENV_WORK_DIR}"/src - -# ------------------------------- -# Stage 2: Create a cleaner image with cura-build-environment installed -# -FROM centos:centos8 - -LABEL linux_distro="centos8" \ - architecture="amd64" \ - python_version="3.10.0" \ - qt_version="5.15.2" - -# Set build time arguments -ARG CURA_BUILD_ENV_BUILD_TYPE=Release -ARG CURA_BUILD_ENV_PATH=/srv/cura-build-environment -ARG CURA_ARCUS_BRANCH_OR_TAG=master -ARG CURA_SAVITAR_BRANCH_OR_TAG=master - -# Set environment variables -ENV CURA_BUILD_ENV_BUILD_TYPE="${CURA_BUILD_ENV_BUILD_TYPE}" \ - CURA_BUILD_ENV_PATH="${CURA_BUILD_ENV_PATH}" \ - CURA_ARCUS_BRANCH_OR_TAG="${CURA_ARCUS_BRANCH_OR_TAG}" \ - CURA_SAVITAR_BRANCH_OR_TAG="${CURA_SAVITAR_BRANCH_OR_TAG}" - -# Create unprivileged user -RUN groupadd -g 1000 ultimaker && \ - useradd -g ultimaker -u 1000 ultimaker - -# Install package repositories -RUN yum -y update && \ - yum install -y epel-release && \ - yum remove -y git && \ - yum update -y && \ - yum update -y - -# Install dependencies -# Note: In this cleaner image, install ONLY dependencies that Cura links dynamically to! -RUN yum install --enablerepo=powertools -y \ - gcc \ - gcc-c++ \ - gcc-gfortran \ - cmake3 \ - curl \ - git \ - gettext \ - doxygen \ - libtool \ - make \ - file \ - tar \ - which \ - bzip2 \ - bzip2-devel \ - freetype \ - freetype-devel \ - fontconfig \ - fontconfig-devel \ - mesa-libGL \ - mesa-libGL-devel \ - libX11-devel \ - patchelf \ - patch \ - libX11-devel \ - libxcb-devel \ - xcb-util-devel \ - xcb-util-image-devel \ - xcb-util-keysyms-devel \ - xcb-util-renderutil-devel \ - xcb-util-wm-devel \ - libxkbcommon-devel \ - libxkbcommon-x11-devel \ - libxml2-devel \ - libxslt-devel \ - libxcb \ - xcb-util \ - libXrender-devel \ - libXi-devel \ - libdrm-devel \ - libXcursor-devel \ - libXcomposite-devel - -# Copy cura-build-environment here -COPY --from=0 "${CURA_BUILD_ENV_PATH}" "${CURA_BUILD_ENV_PATH}" - -# Cleanup -RUN rm -rf /tmp/* && \ - rm -rf /var/cache - -# Change working directory -WORKDIR /home/ultimaker - -ADD ./docker/linux/entrypoint.sh /docker-entrypoint.sh - -ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/docker/linux/Dockerfile.debian b/docker/linux/Dockerfile.debian deleted file mode 100644 index 5f1735c8..00000000 --- a/docker/linux/Dockerfile.debian +++ /dev/null @@ -1,53 +0,0 @@ -FROM debian:buster - -LABEL linux_distro="debian-buster" \ - architecture="amd64" \ - python_version="3.10.0" \ - qt_version="5.15.2" - -# Set build time arugments -ARG CURA_BUILD_ENV_BUILD_TYPE=Release -ARG CURA_BUILD_ENV_PATH=/srv/cura-build-environment -ARG CURA_BUILD_ENV_WORK_DIR=/tmp/cura-build-environment -ARG CURA_ARCUS_BRANCH_OR_TAG=master -ARG CURA_SAVITAR_BRANCH_OR_TAG=master - -# Create unprivileged user -RUN groupadd -g 1000 ultimaker && \ - useradd -g ultimaker -u 1000 ultimaker -m - -# Update and install packages -RUN apt update -y && \ - apt upgrade -y && \ - apt install -y build-essential g++ gfortran libtool make autoconf automake git curl wget cmake tar \ - libffi-dev pkg-config libx11-xcb-dev libxcb* libfreetype6-dev libgl1-mesa-dev libegl1-mesa libxkbcommon-dev \ - libxkbcommon-x11-dev libx11-dev libxml2-dev libxslt-dev libfontconfig1-dev patchelf - -# Set up the working directory -RUN mkdir -p "${CURA_BUILD_ENV_WORK_DIR}" "${CURA_BUILD_ENV_PATH}" -ADD . "${CURA_BUILD_ENV_WORK_DIR}"/src - -ENV PATH="${CURA_BUILD_ENV_PATH}/bin:${PATH}" \ - PKG_CONFIG_PATH="${CURA_BUILD_ENV_PATH}/lib/pkgconfig:${PKG_CONFIG_PATH}" - -# Build the build environment -RUN mkdir -p "${CURA_BUILD_ENV_WORK_DIR}"/build && \ - chown -R ultimaker:ultimaker "${CURA_BUILD_ENV_WORK_DIR}" && \ - chown -R ultimaker:ultimaker "${CURA_BUILD_ENV_PATH}" -WORKDIR "${CURA_BUILD_ENV_WORK_DIR}"/build -USER ultimaker -RUN "${CURA_BUILD_ENV_WORK_DIR}"/src/docker/linux/build.sh "${CURA_BUILD_ENV_WORK_DIR}"/src - - -# Cleanup -USER root -WORKDIR / -RUN rm -rf /tmp/* && \ - rm -rf /var/cache - -# Change working directory -WORKDIR /home/ultimaker - -ADD ./docker/linux/entrypoint.sh /docker-entrypoint.sh - -ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/docker/linux/base/.dockerignore b/docker/linux/base/.dockerignore new file mode 100644 index 00000000..95103f8d --- /dev/null +++ b/docker/linux/base/.dockerignore @@ -0,0 +1,11 @@ +.git +unused +Dockerfile +.gitignore +README.md +test/ +LICENSE +/tmp/gcc/share +/tmp/gcc/doc +/tmp/install/share +/tmp/install/doc \ No newline at end of file diff --git a/docker/linux/base/Dockerfile b/docker/linux/base/Dockerfile new file mode 100644 index 00000000..4d4ae68f --- /dev/null +++ b/docker/linux/base/Dockerfile @@ -0,0 +1,182 @@ +ARG DISTRO_VERSION + +FROM ubuntu:${DISTRO_VERSION} + +LABEL maintainer="Ultimaker b.v. " + +ARG PYTHON_VERSION +ARG PYTHON_VERSION_FULL + +ENV PYENV_ROOT=/opt/pyenv \ + PATH=/usr/local/bin/:/opt/pyenv/versions/${PYTHON_VERSION_FULL}/bin/:/opt/conan/binutils/bin:${PATH} \ + LD_LIBRARY_PATH="/home/conan/env:${LD_LIBRARY_PATH}" \ + CONAN_USER_HOME=/home/conan \ + APPIMAGE_EXTRA_AND_RUN=1 + +ARG CMAKE_VERSION +ARG CMAKE_VERSION_FULL +ARG CONAN_VERSION + +WORKDIR /root + +COPY conan.lock conanfile.txt /opt/conan/ + +RUN apt-get -qq update \ + && apt-get -qq install -y --no-install-recommends software-properties-common \ + && add-apt-repository ppa:git-core/ppa -y \ + && apt-get -qq update \ + && apt-get -qq install -y --no-install-recommends --no-install-suggests -o=Dpkg::Use-Pty=0 \ + sudo \ + binutils \ + wget \ + git \ + g++-multilib \ + libgmp-dev \ + libmpfr-dev \ + libmpc-dev \ + nasm \ + dh-autoreconf \ + libffi-dev \ + libssl-dev \ + pkg-config \ + subversion \ + zlib1g-dev \ + libbz2-dev \ + libsqlite3-dev \ + libreadline-dev \ + xz-utils \ + curl \ + libncurses5-dev \ + libncursesw5-dev \ + liblzma-dev \ + ca-certificates \ + autoconf-archive \ + gdb \ + lcov \ + libssl-dev \ + libgdbm-dev \ + uuid-dev \ + build-essential \ + llvm \ + libxml2-dev \ + libxmlsec1-dev \ + libgl1-mesa-dev \ + libx11-dev \ + libx11-xcb-dev \ + libfontenc-dev \ + libice-dev \ + libsm-dev \ + libxau-dev \ + libxaw7-dev \ + libxcomposite-dev \ + libxcursor-dev \ + libxdamage-dev \ + libxdmcp-dev \ + libxext-dev \ + libxfixes-dev \ + libxft-dev \ + libxi-dev \ + libxinerama-dev \ + libxkbfile-dev \ + libxmu-dev \ + libxmuu-dev \ + libxpm-dev \ + libxrandr-dev \ + libxrender-dev \ + libxres-dev \ + libxss-dev \ + libxt-dev \ + libxtst-dev \ + libxv-dev \ + libxvmc-dev \ + libxxf86vm-dev \ + xtrans-dev \ + libxcb-render0-dev \ + libxcb-render-util0-dev \ + libxcb-xkb-dev \ + libxcb-icccm4-dev \ + libxcb-image0-dev \ + libxcb-keysyms1-dev \ + libxcb-randr0-dev \ + libxcb-shape0-dev \ + libxcb-sync-dev \ + libxcb-xfixes0-dev \ + libxcb-xinerama0-dev \ + xkb-data \ + libxcb-dri3-dev \ + uuid-dev \ + libxcb-util-dev \ + ninja-build \ + patchelf \ + desktop-file-utils \ + libgdk-pixbuf2.0-dev \ + fakeroot \ + strace \ + fuse \ + libwayland-cursor0 \ + libwayland-client0 \ + libwayland-egl1 \ + && rm -rf /var/lib/apt/lists/* \ + && useradd -ms /bin/bash conan \ + && printf "conan:conan" | chpasswd \ + && adduser conan sudo \ + && groupadd ultimaker \ + && usermod -a -G ultimaker conan \ + && printf "conan ALL= NOPASSWD: ALL\\n" >> /etc/sudoers \ + && wget -q --no-check-certificate https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION_FULL}/cmake-${CMAKE_VERSION_FULL}.tar.gz \ + && tar -xzf cmake-${CMAKE_VERSION_FULL}.tar.gz \ + && cd cmake-${CMAKE_VERSION_FULL} \ + && ./bootstrap \ + && make -j $(nproc) \ + && make install \ + && cd .. \ + && rm /root/cmake-${CMAKE_VERSION_FULL}.tar.gz \ + && wget --no-check-certificate --quiet -O pyenv-installer https://raw.githubusercontent.com/pyenv/pyenv-installer/56d708c8bda56370c4bc1e2fce68087cfcd007eb/bin/pyenv-installer \ + && chmod +x pyenv-installer \ + && ./pyenv-installer \ + && rm pyenv-installer \ + && update-alternatives --install /usr/bin/pyenv pyenv /opt/pyenv/bin/pyenv 100 \ + && git clone https://github.com/openssl/openssl.git \ + && cd openssl \ + && git checkout OpenSSL_1_1_1m \ + && ./config \ + && apt-get remove -y openssl \ + && make -j $(nproc) \ + && make install \ + && ldconfig \ + && cd .. \ + && rm -rf openssl \ + && PYTHON_CONFIGURE_OPTS="--enable-shared --with-openssl-rpath" CPPFLAG="-I/usr/include/" LDFLAGS="-L/usr/local/lib/" pyenv install ${PYTHON_VERSION_FULL} \ + && pyenv global ${PYTHON_VERSION_FULL} \ + && update-alternatives --install /usr/bin/python3 python3 /opt/pyenv/shims/python3 100 \ + && update-alternatives --install /usr/bin/pip3 pip3 /opt/pyenv/shims/pip3 100 \ + && update-alternatives --install /usr/local/bin/python python /opt/pyenv/shims/python 100 \ + && update-alternatives --install /usr/local/bin/pip pip /opt/pyenv/shims/pip 100 \ + && ln -s /usr/share/pyshared/lsb_release.py /opt/pyenv/versions/${PYTHON_VERSION_FULL}/lib/python${PYTHON_VERSION}/site-packages/lsb_release.py \ + && pip install -q --upgrade --no-cache-dir pip \ + && printf '/usr/local/lib\n' > /etc/ld.so.conf.d/20local-lib.conf \ + && printf '/usr/local/lib64\n' >> /etc/ld.so.conf.d/20local-lib.conf \ + && mv /etc/ld.so.conf.d/libc.conf /etc/ld.so.conf.d/10libc.conf \ + && rm /etc/ld.so.cache \ + && ldconfig -C /etc/ld.so.cache \ + && apt-get -qq purge -y g++-multilib \ + && apt-get -qq autoremove -y \ + && apt-get -qq autoclean \ + && apt-get -qq update \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /tmp/* \ + && runuser -u conan -- printf 'eval "$(pyenv init -)"\n' >> /home/conan/.bashrc \ + && runuser -u conan -- printf 'eval "$(pyenv virtualenv-init -)"\n' >> ~/.bashrc \ + && wget --no-check-certificate --quiet https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool \ + && chmod +x /usr/local/bin/appimagetool \ + && chown -R conan:conan /opt/pyenv \ + && chown -R conan:conan /opt/conan + +USER conan +WORKDIR /home/conan + +RUN python -m pip install conan==${CONAN_VERSION} \ + && CONAN_REVISIONS_ENABLED=1 CONAN_USER_HOME=/tmp/conan conan install -r conancenter -g deploy -if /opt/conan -l /opt/conan/conan.lock /opt/conan/conanfile.txt \ + && rm -rf /tmp/conan \ + && conan config set general.revisions_enabled=1 \ + && conan config install https://github.com/ultimaker/conan-config.git \ No newline at end of file diff --git a/docker/linux/base/conan.lock b/docker/linux/base/conan.lock new file mode 100644 index 00000000..bccfa9b0 --- /dev/null +++ b/docker/linux/base/conan.lock @@ -0,0 +1,52 @@ +{ + "graph_lock": { + "nodes": { + "0": { + "options": "readline:fPIC=True\nreadline:shared=False\nreadline:with_library=termcap\ntermcap:fPIC=True\ntermcap:shared=False\nzlib:fPIC=True\nzlib:shared=False", + "requires": [ + "1" + ], + "path": "conanfile.txt", + "context": "host" + }, + "1": { + "ref": "binutils/2.37#7e1081ddda1762c3f97d47399c4b1691", + "options": "readline:fPIC=True\nreadline:shared=False\nreadline:with_library=termcap\ntermcap:fPIC=True\ntermcap:shared=False\nzlib:fPIC=True\nzlib:shared=False", + "package_id": "8e7714e05da644d1474247995163817b009f35ad", + "prev": "92231e81212010b1f015f78125760d49", + "requires": [ + "2", + "3" + ], + "context": "host" + }, + "2": { + "ref": "zlib/1.2.11#b46bf663179824c23085bb71666ba8e6", + "options": "fPIC=True\nshared=False", + "package_id": "76f87539fc90ff313e0b3182641a9bb558a717d2", + "prev": "a4730ad7fc025658ed1806f0b0d5ba1f", + "context": "host" + }, + "3": { + "ref": "readline/8.0#6bfe51715475f7b96c43adfa7b6aef96", + "options": "fPIC=True\nshared=False\nwith_library=termcap\ntermcap:fPIC=True\ntermcap:shared=False", + "package_id": "ad3074fd90ef13789cde8b160ab25ce883db3c6e", + "prev": "15a274e05579977eaebf58e1bdb8b51e", + "requires": [ + "4" + ], + "context": "host" + }, + "4": { + "ref": "termcap/1.3.1#a75d9f61bf0d1899b64967958dfa6538", + "options": "fPIC=True\nshared=False", + "package_id": "76f87539fc90ff313e0b3182641a9bb558a717d2", + "prev": "34552acd6624780a5f6251750f40d9c5", + "context": "host" + } + }, + "revisions_enabled": true + }, + "version": "0.4", + "profile_host": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=gcc\ncompiler.libcxx=libstdc++11\ncompiler.version=5\nos=Linux\nos_build=Linux\n[options]\n[build_requires]\n[env]\n" +} \ No newline at end of file diff --git a/docker/linux/base/conanfile.txt b/docker/linux/base/conanfile.txt new file mode 100644 index 00000000..f773c3ac --- /dev/null +++ b/docker/linux/base/conanfile.txt @@ -0,0 +1,2 @@ +[requires] +binutils/2.37 \ No newline at end of file diff --git a/docker/linux/base/profile b/docker/linux/base/profile new file mode 100644 index 00000000..bedce735 --- /dev/null +++ b/docker/linux/base/profile @@ -0,0 +1,13 @@ +[settings] +os=Linux +os_build=Linux +arch=x86_64 +arch_build=x86_64 +compiler=gcc +compiler.version=5 +compiler.libcxx=libstdc++11 +build_type=Release +[options] +[conf] +[build_requires] +[env] \ No newline at end of file diff --git a/docker/linux/build.sh b/docker/linux/build.sh deleted file mode 100755 index 23713393..00000000 --- a/docker/linux/build.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# -# This script builds the cura-build-environment with the CentOS 8 or Debian Buster base docker image. -# -# Usage: -# -# Arguments: -# - src_path : the cura-build-environment source directory. -# - -set -e - -# Check and set arguments -SRC_PATH="$1" -if [[ -z "${SRC_PATH}" ]]; then - echo "Missing ." - exit 1 -fi - -# Set up environment variables -export PATH="${CURA_BUILD_ENV_PATH}/bin:${PATH}" -export PKG_CONFIG_PATH="${CURA_BUILD_ENV_PATH}/lib/pkgconfig:${PKG_CONFIG_PATH}" - -# Build -cmake "${SRC_PATH}" \ - -DCMAKE_BUILD_TYPE="${CURA_BUILD_ENV_BUILD_TYPE}" \ - -DCMAKE_INSTALL_PREFIX="${CURA_BUILD_ENV_PATH}" \ - -DCMAKE_PREFIX_PATH="${CURA_BUILD_ENV_PATH}" \ - -DCURA_ARCUS_BRANCH_OR_TAG="${CURA_ARCUS_BRANCH_OR_TAG}" \ - -DCURA_SAVITAR_BRANCH_OR_TAG="${CURA_SAVITAR_BRANCH_OR_TAG}" -make diff --git a/docker/linux/clang/.dockerignore b/docker/linux/clang/.dockerignore new file mode 100644 index 00000000..95103f8d --- /dev/null +++ b/docker/linux/clang/.dockerignore @@ -0,0 +1,11 @@ +.git +unused +Dockerfile +.gitignore +README.md +test/ +LICENSE +/tmp/gcc/share +/tmp/gcc/doc +/tmp/install/share +/tmp/install/doc \ No newline at end of file diff --git a/docker/linux/clang/Dockerfile b/docker/linux/clang/Dockerfile new file mode 100644 index 00000000..16a0ee5d --- /dev/null +++ b/docker/linux/clang/Dockerfile @@ -0,0 +1,159 @@ +ARG DOCKER_USERNAME +ARG LIBSTDCPP_MAJOR_VERSION +ARG DOCKER_TAG +ARG DISTRO_VERSION +ARG DISTRO +ARG SUFFIX + +FROM ubuntu:${DISTRO_VERSION} as builder + +ARG CLANG_VERSION +ARG LIBSTDCPP_VERSION + +LABEL maintainer="Ultimaker b.v. " + +RUN apt-get -qq update \ + && apt-get -qq install -y --no-install-recommends --no-install-suggests -o=Dpkg::Use-Pty=0 \ + apt-transport-https \ + binutils \ + wget \ + curl \ + ca-certificates \ + git \ + python3 \ + python3-pip \ + && pip3 install ninja cmake \ + && ln -s /usr/bin/python3 /usr/bin/python \ + && printf 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main\n' > /etc/apt/sources.list.d/llvm.list \ + && wget -q --no-check-certificate https://apt.llvm.org/llvm-snapshot.gpg.key \ + && apt-key add llvm-snapshot.gpg.key \ + && apt-get -qq update \ + && apt-get -qq install -y --no-install-recommends --no-install-suggests -o=Dpkg::Use-Pty=0 clang-10 lld-10 libc++-10-dev \ + && wget -q --no-check-certificate https://github.com/llvm/llvm-project/archive/llvmorg-${CLANG_VERSION}.tar.gz \ + && tar zxf llvmorg-${CLANG_VERSION}.tar.gz \ + && sed -E -i 's/OUTPUT_NAME\s+"unwind"/OUTPUT_NAME "llvm-unwind"/g' llvm-project-llvmorg-${CLANG_VERSION}/libunwind/src/CMakeLists.txt \ + && sed -i 's/unwind/llvm-unwind/g' llvm-project-llvmorg-${CLANG_VERSION}/clang/lib/Driver/ToolChains/CommonArgs.cpp \ + && cd llvm-project-llvmorg-${CLANG_VERSION} \ + && mkdir build \ + && cd build/ \ + && cmake ../llvm \ + -G Ninja \ + -DCMAKE_CXX_COMPILER=clang++-10 \ + -DCMAKE_C_COMPILER=clang-10 \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_INSTALL_PREFIX=/tmp/install \ + -DLLVM_INCLUDE_EXAMPLES=OFF \ + -DLLVM_INCLUDE_TESTS=OFF \ + -DLLVM_INCLUDE_GO_TESTS=OFF \ + -DLLVM_INCLUDE_DOCS=OFF \ + -DLLVM_INCLUDE_TOOLS=ON \ + -DLLVM_INCLUDE_UTILS=OFF \ + -DLLVM_INCLUDE_BENCHMARKS=OFF \ + -DLLVM_TARGETS_TO_BUILD=X86 \ + -DLLVM_ENABLE_OCAMLDOC=OFF \ + -DLLVM_ENABLE_BACKTRACES=OFF \ + -DLLVM_ENABLE_WARNINGS=OFF \ + -DLLVM_ENABLE_PEDANTIC=OFF \ + -DLLVM_ENABLE_ASSERTIONS=OFF \ + -DLLVM_ENABLE_PROJECTS="libunwind;clang;libcxx;libcxxabi;lld;compiler-rt" \ + -DLLVM_BUILD_DOCS=OFF \ + -DLLVM_BUILD_TESTS=OFF \ + -DLLVM_BUILD_32_BITS=OFF \ + -DLLVM_BUILD_TOOLS=OFF \ + -DLLVM_BUILD_UTILS=OFF \ + -DLLVM_BUILD_EXAMPLES=OFF \ + -DLLVM_BUILD_BENCHMARKS=OFF \ + -DLLVM_BUILD_STATIC=OFF \ + -DLLVM_USE_SANITIZER=OFF \ + -DLLVM_USE_LINKER=lld-10 \ + -DLLVM_OPTIMIZED_TABLEGEN=ON \ + -DLIBUNWIND_ENABLE_ASSERTIONS=OFF \ + -DLIBUNWIND_ENABLE_PEDANTIC=OFF \ + -DLIBUNWIND_ENABLE_SHARED=ON \ + -DLIBUNWIND_ENABLE_STATIC=ON \ + -DLIBUNWIND_USE_COMPILER_RT=ON \ + -DCLANG_INCLUDE_TESTS=OFF \ + -DCLANG_ENABLE_ARCMT=OFF \ + -DCLANG_ENABLE_STATIC_ANALYZER=OFF \ + -DCLANG_INCLUDE_DOCS=OFF \ + -DCLANG_BUILD_EXAMPLES=OFF \ + -DCLANG_ENABLE_BOOTSTRAP=OFF \ + -DCLANG_DEFAULT_RTLIB=compiler-rt \ + -DCLANG_DEFAULT_UNWINDLIB=libunwind \ + -DLIBCXX_INCLUDE_TESTS=OFF \ + -DLIBCXX_ENABLE_SHARED=YES \ + -DLIBCXX_ENABLE_STATIC=OFF \ + -DLIBCXX_INCLUDE_BENCHMARKS=OFF \ + -DLIBCXX_INCLUDE_DOCS=OFF \ + -DLIBCXX_GENERATE_COVERAGE=OFF \ + -DLIBCXX_BUILD_32_BITS=OFF \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \ + -DLIBCXX_USE_COMPILER_RT=ON \ + -DLIBCXX_DEBUG_BUILD=OFF \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DLIBCXX_CXX_ABI_INCLUDE_PATHS=../libcxxabi/include/ \ + -DLIBCXXABI_ENABLE_ASSERTIONS=OFF \ + -DLIBCXXABI_ENABLE_PEDANTIC=OFF \ + -DLIBCXXABI_BUILD_32_BITS=OFF \ + -DLIBCXXABI_INCLUDE_TESTS=OFF \ + -DLIBCXXABI_ENABLE_SHARED=ON \ + -DLIBCXXABI_ENABLE_STATIC=ON \ + -DLIBCXXABI_USE_COMPILER_RT=ON \ + -DLIBCXXABI_USE_LLVM_UNWINDER=ON \ + -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON \ + -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY=ON \ + -DLIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL=ON \ + -DCOMPILER_RT_INCLUDE_TESTS=OFF \ + -DCOMPILER_RT_USE_LIBCXX=ON \ + && ninja unwind \ + && ninja cxxabi \ + && cp lib/libc++abi* /usr/lib/ \ + && ninja cxx \ + && ninja clang \ + && ninja lld \ + && ninja compiler-rt \ + && ninja install-unwind install-cxxabi install-cxx install-clang install-lld install-compiler-rt \ + && cp -a lib/clang/${CLANG_VERSION}/include /tmp/install/lib/clang/${CLANG_VERSION}/include \ + && cp $(find lib -name "*.so*") /tmp/install/lib + +FROM ${DOCKER_USERNAME}/gcc${LIBSTDCPP_MAJOR_VERSION}-${DISTRO}${SUFFIX}:${DOCKER_TAG} as libstdcpp + +FROM ${DOCKER_USERNAME}/base-${DISTRO}${SUFFIX}:${DOCKER_TAG} as deploy + +ARG LIBSTDCPP_VERSION +ARG LIBSTDCPP_PATCH_VERSION + +ARG DOCKER_USERNAME +ARG DOCKER_TAG +ARG DISTRO + +COPY --from=builder /tmp/install /tmp/clang +COPY --from=libstdcpp /usr/local /tmp/gcc + +ENV CC=clang \ + CXX=clang++ \ + CMAKE_C_COMPILER=clang \ + CMAKE_CXX_COMPILER=clang++ + +RUN sudo mv /tmp/gcc/lib64 /usr/local/ \ + && sudo ln -s -f /usr/local/lib64/libstdc++.so.6.0.${LIBSTDCPP_PATCH_VERSION} /usr/local/lib64/libstdc++.so.6 \ + && sudo ln -s -f /usr/local/lib64/libstdc++.so.6 /usr/local/lib64/libstdc++.so \ + && sudo cp -a /tmp/gcc/include/* /usr/local/include/ \ + && sudo rm -rf /usr/lib/gcc/x86_64-linux-gnu/* \ + && sudo cp -a /tmp/gcc/lib/gcc/x86_64-linux-gnu/${LIBSTDCPP_VERSION} /usr/lib/gcc/x86_64-linux-gnu/ \ + && sudo cp -a /tmp/gcc/lib/* /usr/local/lib/ \ + && sudo rm -rf /tmp/gcc \ + && sudo cp -a /tmp/clang/bin/* /usr/local/bin/ \ + && sudo cp -a /tmp/clang/lib/* /usr/local/lib/ \ + && sudo cp -a /tmp/clang/include/* /usr/local/include/ \ + && sudo rm -rf /tmp/clang \ + && sudo update-alternatives --install /usr/local/bin/cc cc /usr/local/bin/clang 100 \ + && sudo update-alternatives --install /usr/local/bin/cpp ccp /usr/local/bin/clang++ 100 \ + && sudo update-alternatives --install /usr/local/bin/c++ c++ /usr/local/bin/clang++ 100 \ + && sudo update-alternatives --install /usr/local/bin/ld ld /usr/local/bin/ld.lld 100 \ + && sudo rm /etc/ld.so.cache \ + && sudo ldconfig -C /etc/ld.so.cache \ + && conan profile new --detect --force default \ No newline at end of file diff --git a/docker/linux/docker-compose.yml b/docker/linux/docker-compose.yml new file mode 100644 index 00000000..79c0afd8 --- /dev/null +++ b/docker/linux/docker-compose.yml @@ -0,0 +1,397 @@ +version: '3.4' + +x-common-args: &common-args + CMAKE_VERSION_FULL: ${CMAKE_VERSION_FULL} + CMAKE_VERSION: ${CMAKE_VERSION} + PYTHON_VERSION: ${PYTHON_VERSION} + PYTHON_VERSION_FULL: ${PYTHON_VERSION_FULL} + CONAN_VERSION: ${CONAN_VERSION} + LIBSTDCPP_VERSION: ${LIBSTDCPP_VERSION} + LIBSTDCPP_PATCH_VERSION: ${LIBSTDCPP_PATCH_VERSION} + LIBSTDCPP_MAJOR_VERSION: ${LIBSTDCPP_MAJOR_VERSION} + DOCKER_USERNAME: ${DOCKER_USERNAME} + DOCKER_TAG: ${DOCKER_TAG} + DISTRO: ${DISTRO} + DISTRO_VERSION: ${DISTRO_VERSION} + +x-gcc7: &gcc7 + GCC_VERSION: ${GCC7_VERSION} + +x-gcc8: &gcc8 + GCC_VERSION: ${GCC8_VERSION} + +x-gcc9: &gcc9 + GCC_VERSION: ${GCC9_VERSION} + +x-gcc10: &gcc10 + GCC_VERSION: ${GCC10_VERSION} + +x-gcc11: &gcc11 + GCC_VERSION: ${GCC11_VERSION} + +x-llvm10: &llvm10 + CLANG_VERSION: ${CLANG10_VERSION} + +x-llvm11: &llvm11 + CLANG_VERSION: ${CLANG11_VERSION} + +x-llvm12: &llvm12 + CLANG_VERSION: ${CLANG12_VERSION} + +x-llvm13: &llvm13 + CLANG_VERSION: ${CLANG13_VERSION} + + +services: + # Base image + base: + build: + context: base + dockerfile: Dockerfile + args: + <<: *common-args + image: ${DOCKER_USERNAME}/base-${DISTRO}:${DOCKER_TAG} + container_name: base + tty: true + + # Builder images + gcc7-builder: + build: + context: gcc + dockerfile: Dockerfile + target: gcc-builder + args: + <<: *common-args + <<: *gcc7 + image: ${DOCKER_USERNAME}/gcc7-builder-${DISTRO}:${DOCKER_TAG} + container_name: gcc7-builder + tty: true + gcc8-builder: + build: + context: gcc + dockerfile: Dockerfile + target: gcc-builder + args: + <<: *common-args + <<: *gcc8 + image: ${DOCKER_USERNAME}/gcc8-builder-${DISTRO}:${DOCKER_TAG} + container_name: gcc8-builder + tty: true + gcc9-builder: + build: + context: gcc + dockerfile: Dockerfile + target: gcc-builder + args: + <<: *common-args + <<: *gcc9 + image: ${DOCKER_USERNAME}/gcc9-builder-${DISTRO}:${DOCKER_TAG} + container_name: gcc9-builder + tty: true + gcc10-builder: + build: + context: gcc + dockerfile: Dockerfile + target: gcc-builder + args: + <<: *common-args + <<: *gcc10 + image: ${DOCKER_USERNAME}/gcc10-builder-${DISTRO}:${DOCKER_TAG} + container_name: gcc10-builder + tty: true + gcc11-builder: + build: + context: gcc + dockerfile: Dockerfile + target: gcc-builder + args: + <<: *common-args + <<: *gcc11 + image: ${DOCKER_USERNAME}/gcc11-builder-${DISTRO}:${DOCKER_TAG} + container_name: gcc11-builder + tty: true + clang10-builder: + build: + context: clang + dockerfile: Dockerfile + target: clang-builder + args: + <<: *common-args + <<: *llvm10 + image: ${DOCKER_USERNAME}/clang10-builder-${DISTRO}:${DOCKER_TAG} + container_name: clang10-builder + tty: true + clang11-builder: + build: + context: clang + dockerfile: Dockerfile + target: clang-builder + args: + <<: *common-args + <<: *llvm11 + image: ${DOCKER_USERNAME}/clang11-builder-${DISTRO}:${DOCKER_TAG} + container_name: clang11-builder + tty: true + clang12-builder: + build: + context: clang + dockerfile: Dockerfile + target: clang-builder + args: + <<: *common-args + <<: *llvm12 + image: ${DOCKER_USERNAME}/clang12-builder-${DISTRO}:${DOCKER_TAG} + container_name: clang12-builder + tty: true + clang13-builder: + build: + context: clang + dockerfile: Dockerfile + target: clang-builder + args: + <<: *common-args + <<: *llvm13 + image: ${DOCKER_USERNAME}/clang13-builder-${DISTRO}:${DOCKER_TAG} + container_name: clang13-builder + tty: true + + # Deploy images + gcc7-deploy: + build: + context: gcc + dockerfile: Dockerfile + target: deploy + cache_from: + - ${DOCKER_USERNAME}/gcc7-builder-${DISTRO}:${DOCKER_TAG} + args: + <<: *common-args + image: ${DOCKER_USERNAME}/gcc7-deploy-${DISTRO}:${DOCKER_TAG} + container_name: gcc7-deploy + tty: true + gcc8-deploy: + build: + context: gcc + dockerfile: Dockerfile + target: deploy + cache_from: + - ${DOCKER_USERNAME}/gcc8-builder-${DISTRO}:${DOCKER_TAG} + args: + <<: *common-args + image: ${DOCKER_USERNAME}/gcc8-deploy-${DISTRO}:${DOCKER_TAG} + container_name: gcc8-deploy + tty: true + gcc9-deploy: + build: + context: gcc + dockerfile: Dockerfile + target: deploy + cache_from: + - ${DOCKER_USERNAME}/gcc9-builder-${DISTRO}:${DOCKER_TAG} + args: + <<: *common-args + image: ${DOCKER_USERNAME}/gcc9-deploy-${DISTRO}:${DOCKER_TAG} + container_name: gcc9-deploy + tty: true + gcc10-deploy: + build: + context: gcc + dockerfile: Dockerfile + target: deploy + cache_from: + - ${DOCKER_USERNAME}/gcc10-builder-${DISTRO}:${DOCKER_TAG} + args: + <<: *common-args + image: ${DOCKER_USERNAME}/gcc10-deploy-${DISTRO}:${DOCKER_TAG} + container_name: gcc10-deploy + tty: true + gcc11-deploy: + build: + context: gcc + dockerfile: Dockerfile + target: deploy + cache_from: + - ${DOCKER_USERNAME}/gcc11-builder-${DISTRO}:${DOCKER_TAG} + args: + <<: *common-args + image: ${DOCKER_USERNAME}/gcc11-deploy-${DISTRO}:${DOCKER_TAG} + container_name: gcc11-deploy + tty: true + clang10-deploy: + build: + context: clang + dockerfile: Dockerfile + target: deploy + cache_from: + - ${DOCKER_USERNAME}/clang10-builder-${DISTRO}:${DOCKER_TAG} + args: + <<: *common-args + image: ${DOCKER_USERNAME}/clang10-deploy-${DISTRO}:${DOCKER_TAG} + container_name: clang10-deploy + tty: true + clang11-deploy: + build: + context: clang + dockerfile: Dockerfile + target: deploy + cache_from: + - ${DOCKER_USERNAME}/clang11-builder-${DISTRO}:${DOCKER_TAG} + args: + <<: *common-args + image: ${DOCKER_USERNAME}/clang11-deploy-${DISTRO}:${DOCKER_TAG} + container_name: clang11-deploy + tty: true + clang12-deploy: + build: + context: clang + dockerfile: Dockerfile + target: deploy + cache_from: + - ${DOCKER_USERNAME}/clang12-builder-${DISTRO}:${DOCKER_TAG} + args: + <<: *common-args + image: ${DOCKER_USERNAME}/clang12-deploy-${DISTRO}:${DOCKER_TAG} + container_name: clang12-deploy + tty: true + clang13-deploy: + build: + context: clang + dockerfile: Dockerfile + target: deploy + cache_from: + - ${DOCKER_USERNAME}/clang13-builder-${DISTRO}:${DOCKER_TAG} + args: + <<: *common-args + image: ${DOCKER_USERNAME}/clang13-deploy-${DISTRO}:${DOCKER_TAG} + container_name: clang13-deploy + tty: true + + # Images + gcc7: + build: + context: gcc + dockerfile: Dockerfile + args: + <<: *common-args + <<: *gcc7 + image: ${DOCKER_USERNAME}/gcc7-${DISTRO}:${DOCKER_TAG} + container_name: gcc7 + tty: true + ports: + - 2222:22 + volumes: + - conan_data:/home/conan/.conan/data + gcc8: + build: + context: gcc + dockerfile: Dockerfile + args: + <<: *common-args + <<: *gcc8 + image: ${DOCKER_USERNAME}/gcc8-${DISTRO}:${DOCKER_TAG} + container_name: gcc8 + tty: true + ports: + - 2222:22 + volumes: + - conan_data:/home/conan/.conan/data + gcc9: + build: + context: gcc + dockerfile: Dockerfile + args: + <<: *common-args + <<: *gcc9 + image: ${DOCKER_USERNAME}/gcc9-${DISTRO}:${DOCKER_TAG} + container_name: gcc9 + tty: true + ports: + - 2222:22 + volumes: + - conan_data:/home/conan/.conan/data + gcc10: + build: + context: gcc + dockerfile: Dockerfile + args: + <<: *common-args + <<: *gcc10 + image: ${DOCKER_USERNAME}/gcc10-${DISTRO}:${DOCKER_TAG} + container_name: gcc10 + tty: true + ports: + - 2222:22 + volumes: + - conan_data:/home/conan/.conan/data + gcc11: + build: + context: gcc + dockerfile: Dockerfile + args: + <<: *common-args + <<: *gcc11 + image: ${DOCKER_USERNAME}/gcc11-${DISTRO}:${DOCKER_TAG} + container_name: gcc11 + tty: true + ports: + - 2222:22 + volumes: + - conan_data:/home/conan/.conan/data + clang10: + build: + context: clang + dockerfile: Dockerfile + args: + <<: *common-args + <<: *llvm10 + image: ${DOCKER_USERNAME}/clang10-${DISTRO}:${DOCKER_TAG} + container_name: clang10 + tty: true + ports: + - 2222:22 + volumes: + - conan_data:/home/conan/.conan/data + clang11: + build: + context: clang + dockerfile: Dockerfile + args: + <<: *common-args + <<: *llvm11 + image: ${DOCKER_USERNAME}/clang11-${DISTRO}:${DOCKER_TAG} + container_name: clang11 + tty: true + ports: + - 2222:22 + volumes: + - conan_data:/home/conan/.conan/data + clang12: + build: + context: clang + dockerfile: Dockerfile + args: + <<: *common-args + <<: *llvm12 + image: ${DOCKER_USERNAME}/clang12-${DISTRO}:${DOCKER_TAG} + container_name: clang12 + tty: true + ports: + - 2222:22 + volumes: + - conan_data:/home/conan/.conan/data + clang13: + build: + context: clang + dockerfile: Dockerfile + args: + <<: *common-args + <<: *llvm13 + image: ${DOCKER_USERNAME}/clang13-${DISTRO}:${DOCKER_TAG} + container_name: clang13 + tty: true + ports: + - 2222:22 + volumes: + - conan_data:/home/conan/.conan/data + +volumes: + conan_data: \ No newline at end of file diff --git a/docker/linux/entrypoint.sh b/docker/linux/entrypoint.sh deleted file mode 100755 index f9190428..00000000 --- a/docker/linux/entrypoint.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# The entrypoint script for the cura-build-environment CentOS docker image. -# - -set -ex - -if [[ -z "${CURA_BUILD_ENV_PATH}" ]]; then - echo "CURA_BUILD_ENV_PATH is not defined. Could not find where cura-build-environment is installed." - exit 1 -fi - -# Sets up the environment variables. -export PATH="${CURA_BUILD_ENV_PATH}/bin:${PATH}" -export PKG_CONFIG_PATH="${CURA_BUILD_ENV_PATH}/lib/pkgconfig:${PKG_CONFIG_PATH}" - -# Execute command -exec "$@" diff --git a/docker/linux/gcc/.dockerignore b/docker/linux/gcc/.dockerignore new file mode 100644 index 00000000..95103f8d --- /dev/null +++ b/docker/linux/gcc/.dockerignore @@ -0,0 +1,11 @@ +.git +unused +Dockerfile +.gitignore +README.md +test/ +LICENSE +/tmp/gcc/share +/tmp/gcc/doc +/tmp/install/share +/tmp/install/doc \ No newline at end of file diff --git a/docker/linux/gcc/Dockerfile b/docker/linux/gcc/Dockerfile new file mode 100644 index 00000000..aedbafe6 --- /dev/null +++ b/docker/linux/gcc/Dockerfile @@ -0,0 +1,70 @@ +ARG DOCKER_USERNAME +ARG DOCKER_TAG +ARG DISTRO_VERSION +ARG DISTRO +ARG SUFFIX + +FROM ubuntu:${DISTRO_VERSION} as builder + +ARG GCC_VERSION + +LABEL maintainer="Ultimaker b.v. " + +RUN apt-get -qq update \ + && apt-get -qq install -y --no-install-recommends --no-install-suggests -o=Dpkg::Use-Pty=0 \ + g++-multilib \ + gcc \ + curl \ + wget \ + zlib1g \ + zlib1g-dev \ + ca-certificates \ + autoconf-archive \ + binutils \ + libgmp-dev \ + libmpfr-dev \ + libmpc-dev \ + nasm \ + dh-autoreconf \ + libffi-dev \ + libssl-dev \ + pkg-config + +RUN wget -q --no-check-certificate http://mirrors.concertpass.com/gcc/releases/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz \ + && tar Jxf gcc-${GCC_VERSION}.tar.xz + +RUN cd gcc-${GCC_VERSION} \ + && ./configure --build=x86_64-linux-gnu \ + --disable-bootstrap \ + --disable-multilib \ + --disable-nsl \ + --enable-languages=c,c++,fortran \ + --disable-werror \ + --without-isl \ + --with-system-zlib \ + --prefix=/tmp/install \ + && make -s -j$(nproc) \ + && make install-strip + +FROM ${DOCKER_USERNAME}/base-${DISTRO}${SUFFIX}:${DOCKER_TAG} as deploy + +ARG GCC_VERSION +ARG LIBSTDCPP_PATCH_VERSION + +COPY --from=builder /tmp/install /tmp/install + +RUN sudo rm -rf /usr/lib/gcc/x86_64-linux-gnu/* \ + && sudo cp -a /tmp/install/lib/gcc/x86_64-linux-gnu/${GCC_VERSION} /usr/lib/gcc/x86_64-linux-gnu/ \ + && sudo cp -a /tmp/install/include/* /usr/local/include/ \ + && sudo cp -a /tmp/install/lib64/ /usr/local/ \ + && sudo cp -a /tmp/install/libexec/ /usr/local/ \ + && sudo cp -a /tmp/install/lib/* /usr/local/lib/ \ + && sudo cp -a /tmp/install/bin/* /usr/local/bin/ \ + && sudo rm -rf /tmp/install \ + && sudo update-alternatives --install /usr/local/bin/cc cc /usr/local/bin/gcc 100 \ + && sudo update-alternatives --install /usr/local/bin/cpp cpp /usr/local/bin/g++ 100 \ + && sudo update-alternatives --install /usr/local/bin/c++ c++ /usr/local/bin/g++ 100 \ + && sudo rm /etc/ld.so.cache \ + && sudo ldconfig -C /etc/ld.so.cache \ + && conan profile new --detect --force default \ + && conan profile update settings.compiler.libcxx=libstdc++11 default \ No newline at end of file diff --git a/docker/windows/Dockerfile-base.vs2019 b/docker/windows/Dockerfile-base.vs2019 deleted file mode 100644 index 2504f96a..00000000 --- a/docker/windows/Dockerfile-base.vs2019 +++ /dev/null @@ -1,69 +0,0 @@ -# Use the latest Windows Server Core image with .NET Framework 4.8. -FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 - -# Restore the default Windows shell for correct batch processing. -SHELL ["cmd", "/S", "/C"] - -LABEL windows_version="1809" \ - architecture="amd64" \ - vs_version="2019" \ - windows_sdk_version="10" \ - python_version="3.8.10" \ - qt_version="5.15.2" - -ARG CURA_BUILD_ENV_BUILD_TYPE=Release -ARG CURA_BUILD_ENV_PATH=C:\\cura-build-environment -ARG CURA_BUILD_ENV_WORK_DIR=C:\\temp\\cura-build-environment -ARG CURA_ARCUS_BRANCH_OR_TAG=master -ARG CURA_SAVITAR_BRANCH_OR_TAG=master - -# Install chocolatey -RUN powershell.exe Set-ExecutionPolicy Bypass -Scope Process -Force; \ - [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; \ - iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) - -# Enable global confirmation -RUN powershell.exe -NoLogo -ExecutionPolicy Bypass -Command \ - choco feature enable -n=allowGlobalConfirmation - -# Install other build tools -# - perl, svn, and nasm are needed by OpenSSL for Python -RUN powershell.exe -NoLogo -ExecutionPolicy Bypass -Command \ - choco install -y 7zip; \ - choco install -y cmake --installargs 'ADD_CMAKE_TO_PATH=System'; \ - choco install -y git --params '/GitOnlyOnPath /NoAutoCrlf /SChannel'; \ - choco install -y nsis; \ - choco install -y strawberryperl; \ - choco install -y tortoisesvn; \ - choco install -y nasm; \ - choco install -y doxygen.install; \ - choco install -y poedit - -# Download mingw -RUN curl -SL --output mingw-8.4.0.zip https://software.ultimaker.com/cura-binary-dependencies/mingw-w64-x86_64-8.4.0-7.0.0-r1.zip - -# Extract and install mingw -RUN powershell.exe -NoLogo -ExecutionPolicy Bypass -Command \ - 7z x mingw-8.4.0.zip -oC:\; \ - Remove-Item -Force .\mingw-8.4.0.zip - -ADD . "${CURA_BUILD_ENV_WORK_DIR}"/src - -# Install Visual Studio buildtools -RUN "%CURA_BUILD_ENV_WORK_DIR%"\\src\\docker\\windows\\install_vs2019_buildtools.cmd - -# Get WiX Toolset 3.11.2 -RUN powershell.exe -NoLogo -ExecutionPolicy Bypass -Command \ - "%CURA_BUILD_ENV_WORK_DIR%"\\src\\docker\\windows\\install_wixtoolset.ps1 - -# Set up environment variables. -RUN powershell.exe -NoLogo -ExecutionPolicy Bypass -Command \ - "%CURA_BUILD_ENV_WORK_DIR%"\\src\\docker\\windows\\setup_envvars.ps1 - -# Cleanup -RUN powershell.exe -NoLogo -ExecutionPolicy Bypass -Command \ - Remove-Item -Recurse -Force "%CURA_BUILD_ENV_WORK_DIR%" - -# Define the entry point for the docker container. -# This entry point starts the developer command prompt and launches the PowerShell shell. -ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"] diff --git a/docker/windows/Dockerfile-build.vs2019 b/docker/windows/Dockerfile-build.vs2019 deleted file mode 100644 index 3dbacb51..00000000 --- a/docker/windows/Dockerfile-build.vs2019 +++ /dev/null @@ -1,21 +0,0 @@ -FROM ultimaker/cura-build-environment:win1809-base - -ARG CURA_BUILD_ENV_BUILD_TYPE=Release -ARG CURA_BUILD_ENV_PATH=C:\\cura-build-environment -ARG CURA_BUILD_ENV_WORK_DIR=C:\\temp\\cura-build-environment -ARG CURA_ARCUS_BRANCH_OR_TAG=master -ARG CURA_SAVITAR_BRANCH_OR_TAG=master - -# Add the current sources to the container -ADD . "${CURA_BUILD_ENV_WORK_DIR}"/src - -# Build the build environment. -RUN powershell.exe -NoLogo -ExecutionPolicy Bypass -Command \ - cmd /c "%CURA_BUILD_ENV_WORK_DIR%"\\src\\docker\\windows\\build_vs2019.cmd - -# Cleanup -# Note: Using powershell's or cmd's native remove commands fails to remove -# a file that resides within the BoostHeaders sources, due to a long path name. -# Using rm.exe seems to work fine and remove everything from the temp directory. -RUN powershell.exe -NoLogo -ExecutionPolicy Bypass -Command \ - "& 'C:\Program Files\Git\usr\bin\rm.exe' -r -f "%CURA_BUILD_ENV_WORK_DIR%"" diff --git a/docker/windows/build_vs2019.cmd b/docker/windows/build_vs2019.cmd deleted file mode 100644 index 7cd7ffa1..00000000 --- a/docker/windows/build_vs2019.cmd +++ /dev/null @@ -1,21 +0,0 @@ -REM This script builds the cura-build-environment with a Windows Server Core 2019 (1809) docker image. - -@echo OFF - -call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64 - -set PATH=%CURA_BUILD_ENV_PATH%\bin;%PATH% - -cd %CURA_BUILD_ENV_WORK_DIR% -mkdir build -cd build - -cmake -DCMAKE_BUILD_TYPE=Release ^ - -DCMAKE_PREFIX_PATH="%CURA_BUILD_ENV_PATH%" ^ - -DCMAKE_INSTALL_PREFIX="%CURA_BUILD_ENV_PATH%" ^ - -DBUILD_OS_WIN64=ON ^ - -DCURA_ARCUS_BRANCH_OR_TAG="%ARCUS_BRANCH_OR_TAG%" ^ - -DCURA_SAVITAR_BRANCH_OR_TAG="%SAVITAR_BRANCH_OR_TAG%" ^ - -G "NMake Makefiles" ^ - ..\src -nmake diff --git a/docker/windows/install_vs2019_buildtools.cmd b/docker/windows/install_vs2019_buildtools.cmd deleted file mode 100644 index 9f22efa3..00000000 --- a/docker/windows/install_vs2019_buildtools.cmd +++ /dev/null @@ -1,17 +0,0 @@ -REM This script install the Visual Studio 2019 build tools on a Windows Server Core 2019 (1809) docker image - -REM Download the Build Tools bootstrapper and install them with the -REM Microsoft.VisualStudio.Workload.AzureBuildTools workload, excluding workloads and components with known issues. -curl -SL --output vs_buildtools.exe https://aka.ms/vs/16/release/vs_buildtools.exe -vs_buildtools.exe --quiet --wait --norestart --nocache modify ^ - --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools" ^ - --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ^ - --add Microsoft.VisualStudio.Component.VC.CMake.Project ^ - --add Microsoft.VisualStudio.Component.Windows10SDK.19041 ^ - --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 ^ - --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 ^ - --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 ^ - --remove Microsoft.VisualStudio.Component.Windows81SDK ^ - || IF "%ERRORLEVEL%"=="3010" EXIT 0 -REM Cleanup -del /q vs_buildtools.exe diff --git a/docker/windows/install_wixtoolset.ps1 b/docker/windows/install_wixtoolset.ps1 deleted file mode 100644 index df83b6a4..00000000 --- a/docker/windows/install_wixtoolset.ps1 +++ /dev/null @@ -1,10 +0,0 @@ -$tmpDir = "C:\temp-cura" -New-Item -Path $tmpDir -ItemType Directory -Force -Invoke-WebRequest -UseBasicParsing ` - -Uri https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip ` - -OutFile $tmpDir\wix.zip -( Get-FileHash -Algorithm SHA256 $tmpDir\wix.zip ).Hash -eq '2c1888d5d1dba377fc7fa14444cf556963747ff9a0a289a3599cf09da03b9e2e' -7z x $tmpDir\wix.zip -y -aoa -o"$tmpDir\wix" -ls $tmpDir -Move-Item $tmpDir\wix "C:\Program Files (x86)\wixtoolset" -Remove-Item -Recurse -Force -Path $tmpDir diff --git a/docker/windows/setup_envvars.ps1 b/docker/windows/setup_envvars.ps1 deleted file mode 100644 index ee7aa86e..00000000 --- a/docker/windows/setup_envvars.ps1 +++ /dev/null @@ -1,13 +0,0 @@ -# Set up environment variables for the cura-build-environment docker image. - -# chocolatey doesn't seem to add NSIS to PATH, so we add it here. -$newPath = "$env:Path" -$newPath = "$newPath" + ";C:\Program Files (x86)\wixtoolset" -$newPath = "$newPath" + ";C:\Program Files (x86)\NSIS" -$newPath = "$newPath" + ";C:\Program Files (x86)\Poedit\GettextTools\bin" -$newPath = "$newPath" + ";C:\mingw-w64-x86_64-8.4.0-7.0.0-r1\mingw64\bin" -[Environment]::SetEnvironmentVariable("Path", "$newPath", [System.EnvironmentVariableTarget]::Machine) - -# Set Cura build environment variables. -[Environment]::SetEnvironmentVariable("CURA_BUILD_ENV_BUILD_TYPE", "$env:CURA_BUILD_ENV_BUILD_TYPE", [System.EnvironmentVariableTarget]::Machine) -[Environment]::SetEnvironmentVariable("CURA_BUILD_ENV_PATH", "$env:CURA_BUILD_ENV_PATH", [System.EnvironmentVariableTarget]::Machine) diff --git a/env_osx.sh b/env_osx.sh deleted file mode 100644 index 890218f4..00000000 --- a/env_osx.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# -# The following optional environment variables can be set to configure the build: -# - CURA_TARGET_OSX_VERSION: The minimum OSX version you are targeting -# - CURA_OSX_SDK_VERSION : The OSX SDK version to use for compiling -# - - -# (Optional) Minimum OSX version for deployment -if [ -n "${CURA_TARGET_OSX_VERSION}" ]; then - echo "Using ${CURA_TARGET_OSX_VERSION} as the minimum OSX version." - export MACOSX_DEPLOYMENT_TARGET="${CURA_TARGET_OSX_VERSION}" - export CMAKE_OSX_DEPLOYMENT_TARGET="${CURA_TARGET_OSX_VERSION}" - export QMAKE_MACOSX_DEPLOYMENT_TARGET="${CURA_TARGET_OSX_VERSION}" - - echo "Set MACOSX_DEPLOYMENT_TARGET to ${MACOSX_DEPLOYMENT_TARGET}" - echo "Set CMAKE_OSX_DEPLOYMENT_TARGET to ${CMAKE_OSX_DEPLOYMENT_TARGET}" - echo "Set QMAKE_MACOSX_DEPLOYMENT_TARGET to ${QMAKE_MACOSX_DEPLOYMENT_TARGET}" -fi -# (Optional) OSX SDK version to use -if [ -n "${CURA_OSX_SDK_VERSION}" ]; then - echo "Using ${CURA_OSX_SDK_VERSION} as the OSX SDK version." - export CMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX${CURA_OSX_SDK_VERSION}.sdk" - - echo "Set CMAKE_OSX_SYSROOT to ${CMAKE_OSX_SYSROOT}" -fi - -export CMAKE_CXX_FLAGS="-stdlib=libc++" -export CXXFLAGS="-stdlib=libc++" - -export CC="/Library/Developer/CommandLineTools/usr/bin/clang" -export CXX="/Library/Developer/CommandLineTools/usr/bin/clang++" diff --git a/env_win32.bat b/env_win32.bat deleted file mode 100644 index b0706126..00000000 --- a/env_win32.bat +++ /dev/null @@ -1,5 +0,0 @@ -call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x86 - -REM cryptography by default links to OpenSSL 1.1.0 which has different library -REM file names, so we need this flag to be able to link to OpenSSL 1.0.2 -set CRYPTOGRAPHY_WINDOWS_LINK_LEGACY_OPENSSL=1 diff --git a/env_win64.bat b/env_win64.bat deleted file mode 100644 index b344b759..00000000 --- a/env_win64.bat +++ /dev/null @@ -1,5 +0,0 @@ -call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat" -set CFLAGS=-m64 -set CXXFLAGS=-m64 -set LDFLAGS=-m64 - diff --git a/packaging/AppRun b/packaging/AppRun new file mode 100644 index 00000000..40148141 --- /dev/null +++ b/packaging/AppRun @@ -0,0 +1,15 @@ +#!/bin/sh + +scriptdir=$(dirname $0) + +export PYTHONPATH="$scriptdir/lib/python3.10" +export LD_LIBRARY_PATH=$scriptdir +export QT_PLUGIN_PATH="$scriptdir/qt/plugins" +export QML2_IMPORT_PATH="$scriptdir/qt/qml" +export QT_QPA_FONTDIR=/usr/share/fonts +export QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb + +# Use the openssl.cnf packaged in the AppImage +export OPENSSL_CONF="$scriptdir/openssl.cnf" + +$scriptdir/Ultimaker-Cura "$@" diff --git a/packaging/Cura.ico b/packaging/Cura.ico new file mode 100644 index 00000000..b1d34e54 Binary files /dev/null and b/packaging/Cura.ico differ diff --git a/packaging/NSIS/Ultimaker-Cura.nsi.jinja b/packaging/NSIS/Ultimaker-Cura.nsi.jinja new file mode 100644 index 00000000..8e7a63de --- /dev/null +++ b/packaging/NSIS/Ultimaker-Cura.nsi.jinja @@ -0,0 +1,181 @@ +# Copyright (c) 2022 Ultimaker B.V. +# Cura's build system is released under the terms of the AGPLv3 or higher. + +!define APP_NAME "{{ app_name }} {{ version_major }}.{{ version_minor }}.{{ version_patch }}" +!define COMP_NAME "{{ company }}" +!define WEB_SITE "{{ web_site }}" +!define VERSION "{{ version_major }}.{{ version_minor }}.{{ version_patch }}.{{ version_build }}" +!define COPYRIGHT "Copyright (c) {{ year }} {{ company }}" +!define DESCRIPTION "Application" +!define LICENSE_TXT "{{ cura_license_file }}" +!define INSTALLER_NAME "{{ destination }}" +!define MAIN_APP_EXE "{{ main_app }}" +!define INSTALL_TYPE "SetShellVarContext current" +!define REG_ROOT "HKCU" +!define REG_APP_PATH "Software\Microsoft\Windows\CurrentVersion\App Paths\${MAIN_APP_EXE}" +!define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" + +!define REG_START_MENU "Start Menu Folder" + +;Require administrator access +RequestExecutionLevel admin + +var SM_Folder + +###################################################################### + +VIProductVersion "${VERSION}" +VIAddVersionKey "ProductName" "${APP_NAME}" +VIAddVersionKey "CompanyName" "${COMP_NAME}" +VIAddVersionKey "LegalCopyright" "${COPYRIGHT}" +VIAddVersionKey "FileDescription" "${DESCRIPTION}" +VIAddVersionKey "FileVersion" "${VERSION}" + +###################################################################### + +SetCompressor {{ compression_method }} +Name "${APP_NAME}" +Caption "${APP_NAME}" +OutFile "${INSTALLER_NAME}" +BrandingText "${APP_NAME}" +InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" "" +InstallDir "$PROGRAMFILES64\${APP_NAME}" + +###################################################################### + +!include "MUI.nsh" +!include fileassoc.nsh + +!define MUI_ABORTWARNING +!define MUI_UNABORTWARNING + +!define MUI_WELCOMEFINISHPAGE_BITMAP "{{ cura_banner_img }}" +!define MUI_UNWELCOMEFINISHPAGE_BITMAP "{{ cura_banner_img }}" + +!insertmacro MUI_PAGE_WELCOME + +!ifdef LICENSE_TXT +!insertmacro MUI_PAGE_LICENSE "${LICENSE_TXT}" +!endif + +!insertmacro MUI_PAGE_DIRECTORY + +!ifdef REG_START_MENU +!define MUI_STARTMENUPAGE_NODISABLE +!define MUI_STARTMENUPAGE_DEFAULTFOLDER "{{ app_name }}" +!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${REG_ROOT}" +!define MUI_STARTMENUPAGE_REGISTRY_KEY "${UNINSTALL_PATH}" +!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${REG_START_MENU}" +!insertmacro MUI_PAGE_STARTMENU Application $SM_Folder +!endif + +!insertmacro MUI_PAGE_INSTFILES + +!define MUI_FINISHPAGE_RUN "$INSTDIR\${MAIN_APP_EXE}" +!insertmacro MUI_PAGE_FINISH + +!insertmacro MUI_UNPAGE_CONFIRM + +!insertmacro MUI_UNPAGE_INSTFILES + +!insertmacro MUI_UNPAGE_FINISH + +!insertmacro MUI_LANGUAGE "English" + +###################################################################### + +Section -MainProgram +${INSTALL_TYPE} +SetOverwrite ifnewer +{% for out_path, files in mapped_out_paths.items() %}SetOutPath "{{ out_path }}"{% for file in files %} +File "{{ file }}"{% endfor %} +{% endfor %}SectionEnd + +###################################################################### + +Section -Extension_Reg +!insertmacro APP_ASSOCIATE "stl" "Cura.model" "Standard Tessellation Language (STL) files" "$INSTDIR\${MAIN_APP_EXE},0" "Open with {{ app_name }}" "$INSTDIR\${MAIN_APP_EXE} $\"%1$\"" +!insertmacro APP_ASSOCIATE "3mf" "Cura.project" "3D Manufacturing Format (3MF) files" "$INSTDIR\${MAIN_APP_EXE},0" "Open with {{ app_name }}" "$INSTDIR\${MAIN_APP_EXE} $\"%1$\"" +SectionEnd + +Section -Icons_Reg +SetOutPath "$INSTDIR" +WriteUninstaller "$INSTDIR\uninstall.exe" + +!ifdef REG_START_MENU +!insertmacro MUI_STARTMENU_WRITE_BEGIN Application +CreateDirectory "$SMPROGRAMS\$SM_Folder" +CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}" +CreateShortCut "$SMPROGRAMS\$SM_Folder\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe" + +!ifdef WEB_SITE +WriteIniStr "$INSTDIR\${APP_NAME} website.url" "InternetShortcut" "URL" "${WEB_SITE}" +CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME} Website.lnk" "$INSTDIR\${APP_NAME} website.url" +!endif +!insertmacro MUI_STARTMENU_WRITE_END +!endif + +!ifndef REG_START_MENU +CreateDirectory "$SMPROGRAMS\{{ app_name }}" +CreateShortCut "$SMPROGRAMS\{{ app_name }}\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}" +CreateShortCut "$SMPROGRAMS\{{ app_name }}\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe" + +!ifdef WEB_SITE +WriteIniStr "$INSTDIR\${APP_NAME} website.url" "InternetShortcut" "URL" "${WEB_SITE}" +CreateShortCut "$SMPROGRAMS\{{ app_name }}\${APP_NAME} Website.lnk" "$INSTDIR\${APP_NAME} website.url" +!endif +!endif + +WriteRegStr ${REG_ROOT} "${REG_APP_PATH}" "" "$INSTDIR\${MAIN_APP_EXE}" +WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayName" "${APP_NAME}" +WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "UninstallString" "$INSTDIR\uninstall.exe" +WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayIcon" "$INSTDIR\${MAIN_APP_EXE}" +WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayVersion" "${VERSION}" +WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "Publisher" "${COMP_NAME}" + +!ifdef WEB_SITE +WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "URLInfoAbout" "${WEB_SITE}" +!endif +SectionEnd + +###################################################################### + +Section Uninstall +${INSTALL_TYPE}{% for files in mapped_out_paths.values() %}{% for file in files %} +Delete "{{ file }}"{% endfor %}{% endfor %}{% for rem_dir in mapped_out_paths.keys() %} +RmDir "{{ rem_dir }}"{% endfor %} + +Delete "$INSTDIR\uninstall.exe" +!ifdef WEB_SITE +Delete "$INSTDIR\${APP_NAME} website.url" +!endif + +RmDir "$INSTDIR" + +!ifdef REG_START_MENU +!insertmacro MUI_STARTMENU_GETFOLDER "Application" $SM_Folder +Delete "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk" +Delete "$SMPROGRAMS\$SM_Folder\Uninstall ${APP_NAME}.lnk" +!ifdef WEB_SITE +Delete "$SMPROGRAMS\$SM_Folder\${APP_NAME} Website.lnk" +!endif +RmDir "$SMPROGRAMS\$SM_Folder" +!endif + +!ifndef REG_START_MENU +Delete "$SMPROGRAMS\{{ app_name }}\${APP_NAME}.lnk" +Delete "$SMPROGRAMS\{{ app_name }}\Uninstall ${APP_NAME}.lnk" +!ifdef WEB_SITE +Delete "$SMPROGRAMS\{{ app_name }}\${APP_NAME} Website.lnk" +!endif +RmDir "$SMPROGRAMS\{{ app_name }}" +!endif + +!insertmacro APP_UNASSOCIATE "stl" "Cura.model" +!insertmacro APP_UNASSOCIATE "3mf" "Cura.project" + +DeleteRegKey ${REG_ROOT} "${REG_APP_PATH}" +DeleteRegKey ${REG_ROOT} "${UNINSTALL_PATH}" +SectionEnd + +###################################################################### diff --git a/packaging/NSIS/fileassoc.nsh b/packaging/NSIS/fileassoc.nsh new file mode 100644 index 00000000..cb0fb2fe --- /dev/null +++ b/packaging/NSIS/fileassoc.nsh @@ -0,0 +1,134 @@ +; fileassoc.nsh +; File association helper macros +; Written by Saivert +; +; Improved by Nikku. +; +; Features automatic backup system and UPDATEFILEASSOC macro for +; shell change notification. +; +; |> How to use <| +; To associate a file with an application so you can double-click it in explorer, use +; the APP_ASSOCIATE macro like this: +; +; Example: +; !insertmacro APP_ASSOCIATE "txt" "myapp.textfile" "Description of txt files" \ +; "$INSTDIR\myapp.exe,0" "Open with myapp" "$INSTDIR\myapp.exe $\"%1$\"" +; +; Never insert the APP_ASSOCIATE macro multiple times, it is only ment +; to associate an application with a single file and using the +; the "open" verb as default. To add more verbs (actions) to a file +; use the APP_ASSOCIATE_ADDVERB macro. +; +; Example: +; !insertmacro APP_ASSOCIATE_ADDVERB "myapp.textfile" "edit" "Edit with myapp" \ +; "$INSTDIR\myapp.exe /edit $\"%1$\"" +; +; To have access to more options when registering the file association use the +; APP_ASSOCIATE_EX macro. Here you can specify the verb and what verb is to be the +; standard action (default verb). +; +; Note, that this script takes into account user versus global installs. +; To properly work you must initialize the SHELL_CONTEXT variable via SetShellVarContext. +; +; And finally: To remove the association from the registry use the APP_UNASSOCIATE +; macro. Here is another example just to wrap it up: +; !insertmacro APP_UNASSOCIATE "txt" "myapp.textfile" +; +; |> Note <| +; When defining your file class string always use the short form of your application title +; then a period (dot) and the type of file. This keeps the file class sort of unique. +; Examples: +; Winamp.Playlist +; NSIS.Script +; Photoshop.JPEGFile +; +; |> Tech info <| +; The registry key layout for a global file association is: +; +; HKEY_LOCAL_MACHINE\Software\Classes +; <".ext"> = +; = <"description"> +; shell +; = <"menu-item text"> +; command = <"command string"> +; +; +; The registry key layout for a per-user file association is: +; +; HKEY_CURRENT_USER\Software\Classes +; <".ext"> = +; = <"description"> +; shell +; = <"menu-item text"> +; command = <"command string"> +; + +!macro APP_ASSOCIATE EXT FILECLASS DESCRIPTION ICON COMMANDTEXT COMMAND + ; Backup the previously associated file class + ReadRegStr $R0 SHELL_CONTEXT "Software\Classes\.${EXT}" "" + WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "${FILECLASS}_backup" "$R0" + + WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "" "${FILECLASS}" + + WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}" "" `${DESCRIPTION}` + WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\DefaultIcon" "" `${ICON}` + WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell" "" "open" + WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\open" "" `${COMMANDTEXT}` + WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\open\command" "" `${COMMAND}` +!macroend + +!macro APP_ASSOCIATE_EX EXT FILECLASS DESCRIPTION ICON VERB DEFAULTVERB SHELLNEW COMMANDTEXT COMMAND + ; Backup the previously associated file class + ReadRegStr $R0 SHELL_CONTEXT "Software\Classes\.${EXT}" "" + WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "${FILECLASS}_backup" "$R0" + + WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "" "${FILECLASS}" + StrCmp "${SHELLNEW}" "0" +2 + WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}\ShellNew" "NullFile" "" + + WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}" "" `${DESCRIPTION}` + WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\DefaultIcon" "" `${ICON}` + WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell" "" `${DEFAULTVERB}` + WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\${VERB}" "" `${COMMANDTEXT}` + WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\${VERB}\command" "" `${COMMAND}` +!macroend + +!macro APP_ASSOCIATE_ADDVERB FILECLASS VERB COMMANDTEXT COMMAND + WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\${VERB}" "" `${COMMANDTEXT}` + WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\${VERB}\command" "" `${COMMAND}` +!macroend + +!macro APP_ASSOCIATE_REMOVEVERB FILECLASS VERB + DeleteRegKey SHELL_CONTEXT `Software\Classes\${FILECLASS}\shell\${VERB}` +!macroend + + +!macro APP_UNASSOCIATE EXT FILECLASS + ; Backup the previously associated file class + ReadRegStr $R0 SHELL_CONTEXT "Software\Classes\.${EXT}" `${FILECLASS}_backup` + WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "" "$R0" + + DeleteRegKey SHELL_CONTEXT `Software\Classes\${FILECLASS}` +!macroend + +!macro APP_ASSOCIATE_GETFILECLASS OUTPUT EXT + ReadRegStr ${OUTPUT} SHELL_CONTEXT "Software\Classes\.${EXT}" "" +!macroend + + +; !defines for use with SHChangeNotify +!ifdef SHCNE_ASSOCCHANGED +!undef SHCNE_ASSOCCHANGED +!endif +!define SHCNE_ASSOCCHANGED 0x08000000 +!ifdef SHCNF_FLUSH +!undef SHCNF_FLUSH +!endif +!define SHCNF_FLUSH 0x1000 + +!macro UPDATEFILEASSOC +; Using the system.dll plugin to call the SHChangeNotify Win32 API function so we +; can update the shell. + System::Call "shell32::SHChangeNotify(i,i,i,i) (${SHCNE_ASSOCCHANGED}, ${SHCNF_FLUSH}, 0, 0)" +!macroend \ No newline at end of file diff --git a/packaging/NSIS/nsis-configurator.py b/packaging/NSIS/nsis-configurator.py new file mode 100644 index 00000000..ecc6cc8a --- /dev/null +++ b/packaging/NSIS/nsis-configurator.py @@ -0,0 +1,68 @@ +import shutil +import sys +from datetime import datetime + +from pathlib import Path + +from jinja2 import Template + +if __name__ == "__main__": + """ + - dist_loc: Location of distribution folder, as output by pyinstaller + - nsi_jinja_loc: Jinja2 template to use + - app_name: Should be "Ultimaker Cura". + - main_app: Name of executable, e.g. Ultimaker-Cura.exe? + - version_major: Major version number of Semver (e.g. 5). + - version_minor: Minor version number of Semver (e.g. 0). + - version_patch: Patch version number of Semver (e.g. 0). + - version_build: A version number that gets manually incremented at each build. + - company: Publisher of the application. Should be "Ultimaker B.V." + - web_site: Website to find more information. Should be "https://ultimaker.com". + - cura_license_file: Path to a license file in Cura. Should point to packaging/cura_license.txt in this repository. + - compression_method: Compression algorithm to use to compress the data inside the executable. Should be ZLIB, ZBIP2 or LZMA. + - cura_banner_img: Path to an image shown on the left in the installer. Should point to packaging/cura_banner_nsis.bmp in this repository. + - icon_path: Path to the icon to use on the installer + - destination: Where to put the installer after it's generated. +` """ + for i, v in enumerate(sys.argv): + print(f"{i} = {v}") + dist_loc = Path(sys.argv[1]) + instdir = Path("$INSTDIR") + dist_paths = [p.relative_to(dist_loc) for p in sorted(dist_loc.rglob("*")) if p.is_file()] + mapped_out_paths = {} + for dist_path in dist_paths: + if "__pycache__" not in dist_path.parts: + out_path = instdir.joinpath(dist_path.parent) + if out_path not in mapped_out_paths: + mapped_out_paths[out_path] = [dist_loc.joinpath(dist_path)] + else: + mapped_out_paths[out_path].append(dist_loc.joinpath(dist_path)) + + jinja_template_path = Path(sys.argv[2]) + with open(jinja_template_path, "r") as f: + template = Template(f.read()) + + nsis_content = template.render( + app_name = sys.argv[3], + main_app = sys.argv[4], + version_major = sys.argv[5], + version_minor = sys.argv[6], + version_patch = sys.argv[7], + version_build = sys.argv[8], + company = sys.argv[9], + web_site = sys.argv[10], + year = datetime.now().year, + cura_license_file = Path(sys.argv[11]), + compression_method = sys.argv[12], # ZLIB, BZIP2 or LZMA + cura_banner_img = Path(sys.argv[13]), + mapped_out_paths = mapped_out_paths, + destination = Path(sys.argv[15]) + ) + + with open(dist_loc.parent.joinpath(jinja_template_path.stem), "w") as f: + f.write(nsis_content) + + shutil.copy(Path(__file__).absolute().parent.joinpath("fileassoc.nsh"), dist_loc.parent.joinpath("fileassoc.nsh")) + icon_path = Path(sys.argv[14]) + shutil.copy(icon_path, dist_loc.joinpath(icon_path.name)) + diff --git a/packaging/VolumeIcons_Cura.icns b/packaging/VolumeIcons_Cura.icns new file mode 100644 index 00000000..6ea45262 Binary files /dev/null and b/packaging/VolumeIcons_Cura.icns differ diff --git a/packaging/cura-icon_128x128.png b/packaging/cura-icon_128x128.png new file mode 100644 index 00000000..7f70fe33 Binary files /dev/null and b/packaging/cura-icon_128x128.png differ diff --git a/packaging/cura-icon_256x256.png b/packaging/cura-icon_256x256.png new file mode 100644 index 00000000..a9ddbd94 Binary files /dev/null and b/packaging/cura-icon_256x256.png differ diff --git a/packaging/cura-icon_64x64.png b/packaging/cura-icon_64x64.png new file mode 100644 index 00000000..5bfbf782 Binary files /dev/null and b/packaging/cura-icon_64x64.png differ diff --git a/packaging/cura.appdata.xml b/packaging/cura.appdata.xml new file mode 100644 index 00000000..de940af9 --- /dev/null +++ b/packaging/cura.appdata.xml @@ -0,0 +1,18 @@ + + + com.ultimaker.cura + CC0-1.0 + LGPL-3.0 + Ultimaker Cura + Slicer to prepare your 3D printing projects + +

Ultimaker Cura is a slicer, an application that prepares your model for 3D printing. Optimized, expert-tested profiles for 3D printers and materials mean you can start printing reliably in no time. And with industry-standard software integration, you can streamline your workflow for maximum efficiency.

+
+ https://ultimaker.com/en/software/ultimaker-cura + + + Print preparation screen + https://raw.githubusercontent.com/Ultimaker/Cura/master/screenshot.png + + +
diff --git a/packaging/cura.desktop.in b/packaging/cura.desktop.in new file mode 100644 index 00000000..93ae4a60 --- /dev/null +++ b/packaging/cura.desktop.in @@ -0,0 +1,14 @@ +[Desktop Entry] +Name=Ultimaker Cura +Name[de]=Ultimaker Cura +GenericName=3D Printing Software +GenericName[de]=3D-Druck-Software +Comment=Cura converts 3D models into paths for a 3D printer. It prepares your print for maximum accuracy, minimum printing time and good reliability with many extra features that make your print come out great. +Exec=Ultimaker-Cura %F +Icon=cura-icon +Terminal=false +Type=Application +MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;image/bmp;image/gif;image/jpeg;image/png;text/x-gcode;application/x-amf;application/x-ply;application/x-ctm;model/vnd.collada+xml;model/gltf-binary;model/gltf+json;model/vnd.collada+xml+zip; +Categories=Graphics; +Keywords=3D;Printing; +X-AppImage-Version=@CURA_VERSION@ diff --git a/packaging/cura.icns b/packaging/cura.icns new file mode 100644 index 00000000..51d8ea71 Binary files /dev/null and b/packaging/cura.icns differ diff --git a/packaging/cura_background_dmg.png b/packaging/cura_background_dmg.png new file mode 100644 index 00000000..e8386082 Binary files /dev/null and b/packaging/cura_background_dmg.png differ diff --git a/packaging/cura_banner_nsis.bmp b/packaging/cura_banner_nsis.bmp new file mode 100644 index 00000000..86435106 Binary files /dev/null and b/packaging/cura_banner_nsis.bmp differ diff --git a/packaging/cura_license.txt b/packaging/cura_license.txt new file mode 100644 index 00000000..07b1d92c --- /dev/null +++ b/packaging/cura_license.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file diff --git a/projects/appimagekit.cmake b/projects/appimagekit.cmake deleted file mode 100644 index 5d4d777b..00000000 --- a/projects/appimagekit.cmake +++ /dev/null @@ -1,17 +0,0 @@ -if(BUILD_OS_LINUX) - set(_appimagetool_path "${CMAKE_INSTALL_PREFIX}/bin/appimagetool.AppImage") - set(_apprun_path "${CMAKE_INSTALL_PREFIX}/bin/AppRun") - set(_appimagetool_sha256 "d918b4df547b388ef253f3c9e7f6529ca81a885395c31f619d9aaf7030499a13") - set(_apprun_sha256 "e8f44f56bb23e105905850250d9d87fb1a5cf64211ad141b85864b1b7a092332") - - add_custom_target(AppImageKit ALL - COMMENT "Installing AppImageKit tools to ${CMAKE_INSTALL_PREFIX}/bin/" - COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_INSTALL_PREFIX}/bin/ - COMMAND curl -o "${_appimagetool_path}" -SL https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage - COMMAND echo "${_appimagetool_sha256} ${_appimagetool_path}" | sha256sum --check - COMMAND chmod a+x "${_appimagetool_path}" - COMMAND curl -o "${_apprun_path}" -SL https://github.com/AppImage/AppImageKit/releases/download/12/AppRun-x86_64 - COMMAND echo "${_apprun_sha256} ${_apprun_path}" | sha256sum --check - COMMAND chmod a+x "${_apprun_path}" - ) -endif() diff --git a/projects/arcus.cmake b/projects/arcus.cmake index fb726ffa..082de5ac 100644 --- a/projects/arcus.cmake +++ b/projects/arcus.cmake @@ -1,71 +1,25 @@ -#Copyright (c) 2021 Ultimaker B.V. -#cura-build-environment is released under the terms of the AGPLv3 or higher. +# Copyright (c) 2022 Ultimaker B.V. +# cura-build-environment is released under the terms of the AGPLv3 or higher. -set(extra_cmake_args "") -set(pylib_cmake_command ${CMAKE_COMMAND}) -if(BUILD_OS_WINDOWS) - set(extra_cmake_args - -DCMAKE_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/libs - -DMSVC_STATIC_RUNTIME=ON - -DCMAKE_EXE_LINKER_FLAGS=/LIBPATH:"${CMAKE_INSTALL_PREFIX}/libs" /machine:x64 - -DCMAKE_EXE_LINKER_FLAGS_RELEASE=/LIBPATH:"${CMAKE_INSTALL_PREFIX}/libs" /machine:x64 - -DCMAKE_MODULE_LINKER_FLAGS=/LIBPATH:"${CMAKE_INSTALL_PREFIX}/libs" /machine:x64 - -DCMAKE_MODULE_LINKER_FLAGS_RELEASE=/LIBPATH:"${CMAKE_INSTALL_PREFIX}/libs" /machine:x64 - -DCMAKE_SHARED_LINKER_FLAGS=/LIBPATH:"${CMAKE_INSTALL_PREFIX}/libs" /machine:x64 - -DCMAKE_SHARED_LINKER_FLAGS_RELEASE=/LIBPATH:"${CMAKE_INSTALL_PREFIX}/libs" /machine:x64 - -DCMAKE_STATIC_LINKER_FLAGS=/LIBPATH:"${CMAKE_INSTALL_PREFIX}/libs" /machine:x64 - -DCMAKE_STATIC_LINKER_FLAGS_RELEASE=/LIBPATH:"${CMAKE_INSTALL_PREFIX}/libs" /machine:x64 - ) -endif() - -if(BUILD_OS_OSX) - if(CMAKE_OSX_DEPLOYMENT_TARGET) - list(APPEND extra_cmake_args - -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} - ) - endif() - if(CMAKE_OSX_SYSROOT) - list(APPEND extra_cmake_args - -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} - ) - endif() -endif() +GetFromEnvironmentOrCache( + NAME + ARCUS_BRANCH_OR_TAG + DEFAULT + master + DESCRIPTION + "The name of the tag (e.q.: v4.13.0), branch (e.q.: origin/CURA-8640) or commit hash (e.q.: 961dabf) for Arcus") ExternalProject_Add(Arcus - GIT_REPOSITORY https://github.com/ultimaker/libArcus.git - GIT_TAG origin/${CURA_ARCUS_BRANCH_OR_TAG} - GIT_SHALLOW 1 - CMAKE_COMMAND ${pylib_cmake_command} - CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_CXX_STANDARD=17 - -DBUILD_STATIC=ON - -DBUILD_PYTHON=ON - -DBUILD_EXAMPLES=OFF - ${extra_cmake_args} -) - -SetProjectDependencies(TARGET Arcus DEPENDS Sip Protobuf) - -if(BUILD_OS_WINDOWS) - ExternalProject_Add(Arcus-MinGW - GIT_REPOSITORY https://github.com/ultimaker/libArcus.git - GIT_TAG origin/${CURA_ARCUS_BRANCH_OR_TAG} - GIT_SHALLOW 1 - CMAKE_GENERATOR "MinGW Makefiles" - CMAKE_COMMAND ${pylib_cmake_command} + GIT_REPOSITORY https://github.com/Ultimaker/libArcus.git + GIT_TAG ${ARCUS_BRANCH_OR_TAG} + CMAKE_GENERATOR ${CMAKE_GENERATOR} CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib-mingw - -DCMAKE_CXX_STANDARD=17 - -DBUILD_STATIC=ON - -DBUILD_PYTHON=OFF - -DBUILD_EXAMPLES=OFF - ../Arcus-MinGW - BUILD_COMMAND mingw32-make - INSTALL_COMMAND mingw32-make install - ) - - SetProjectDependencies(TARGET Arcus-MinGW DEPENDS Sip Protobuf-MinGW Arcus) -endif() + -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + -DSIP_BUILD_EXECUTABLE=${CMAKE_INSTALL_PREFIX}/${exe_path}/sip-build + -DPYTHONPATH=${PYTHONPATH} + -DPython_SITELIB_LOCAL=${Python_SITELIB_LOCAL} + -DPython_ROOT=${CMAKE_INSTALL_PREFIX} + -DPython_EXECUTABLE=${Python_VENV_EXECUTABLE}) +add_dependencies(Arcus install-python-requirements) diff --git a/projects/base_requirements.txt b/projects/base_requirements.txt index 22822370..aca700c2 100644 --- a/projects/base_requirements.txt +++ b/projects/base_requirements.txt @@ -1,125 +1,6 @@ -# These hashes were generated with: -# hashin --verbose --python-version --requirements-file= == == ... -# make sure you use the verbose flag and personally inspect the hosts that were used when generating -# When updating a major Python version these need to be updates as well - -pip==21.3.1 \ - --hash=sha256:deaf32dcd9ab821e359cd8330786bcd077604b5c5730c0b096eda46f95c24a2d \ - --hash=sha256:fd11ba3d0fdb4c07fbc5ecbba0b1b719809420f25038f8ee3cd913d3faa3033a -setuptools==60.1.1 \ - --hash=sha256:89e8cb2d5ade19e9885e56cd110f2f1e80697f7cffa048886c585fe559ebbe32 \ - --hash=sha256:10d6eff7fc27ada30cc87e21abf324713b7169b97af1f81f8744d66260e91d10 wheel==0.37.1 \ --hash=sha256:e9a504e793efbca1b8e0e9cb979a249cf4a0a7b5b8c9e8b65a5e39d49529c1c4 \ --hash=sha256:4bdcd7d840138086126cd09254dc6195fb4fc6f01c050a1d7236f2630db1d22a -cython==0.29.26 \ - --hash=sha256:af377d543a762867da11fcf6e558f7a4a535ff8693f30cce123fab10c00fa312 \ - --hash=sha256:f5e15ff892c8afad64931ee3dd723c4755c2c516606f9aae7613bebfac62b0f6 \ - --hash=sha256:2b834ff6e4d10ba6d7a0d676dd71c1b427a181ddbbbbf79e91d1861557aab59f \ - --hash=sha256:c813799d533194b7d85203d881d8b4f567a8c644a67f50d47f1ffbf316df412f \ - --hash=sha256:6773cce9d4b3b6168d8feb2b6f06b658ef1e11cbfec075041745666d8e2a5e45 \ - --hash=sha256:362fbb9cb4627c7786231429768b54aaba5459a2a0e46c25e59f202ca6155437 -pybind11==2.6.2 \ - --hash=sha256:2d8aebe1709bc367e34e3b23d8eccbf3f387ee9d5640548c6260d33b59f02405 \ - --hash=sha256:d0e0aed9279656f21501243b707eb6e3b951e89e10c3271dedf3ae41c365e5ed - -# pytest -pytest==5.2.1 \ - --hash=sha256:7e4800063ccfc306a53c461442526c5571e1462f61583506ce97e4da6a1d88c8 \ - --hash=sha256:ca563435f4941d0cb34767301c27bc65c510cb82e90b9ecf9cb52dc2c63caaa0 -more-itertools==8.9.0 \ - --hash=sha256:70401259e46e216056367a0a6034ee3d3f95e0bf59d3aa6a4eb77837171ed996 \ - --hash=sha256:8c746e0d09871661520da4f1241ba6b908dc903839733c8203b552cffaf173bd -wcwidth==0.2.5 \ - --hash=sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784 \ - --hash=sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83 -pluggy==0.13.1 \ - --hash=sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0 \ - --hash=sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d -attrs==21.2.0 \ - --hash=sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1 \ - --hash=sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb -py==1.10.0 \ - --hash=sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3 \ - --hash=sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a -atomicwrites==1.4.0 \ - --hash=sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197 \ - --hash=sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a -colorama==0.4.4 \ - --hash=sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b \ - --hash=sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2 - -# packaging is a dependency of pytest -packaging==18.0 \ - --hash=sha256:0886227f54515e592aaa2e5a553332c73962917f2831f1b0f9b9f4380a4b9807 \ - --hash=sha256:f95a1e147590f204328170981833854229bb2912ac3d5f89e2a8ccd2834800c9 -pyparsing==2.4.2 \ - --hash=sha256:6f98a7b9397e206d78cc01df10131398f1c8b8510a2f4d97d9abd82e1aacdd80 \ - --hash=sha256:d9338df12903bbf5d65a0e4e87c2161968b10d2e489652bb47001d82a9b028b4 -six==1.12.0 \ - --hash=sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c \ - --hash=sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73 - -# pytest-benchmark -pytest-benchmark==3.2.2 \ - --hash=sha256:4512c6805318d07926efcb3b39f7b98a10d035305a93edfd5329c86cbf9cfbf7 \ - --hash=sha256:ab851115ce022639173b9497d4a4183a1d8fe9cdcf8fab9d8a57607008aedd3d -py-cpuinfo==8.0.0 \ - --hash=sha256:5f269be0e08e33fd959de96b34cd4aeeeacac014dd8305f70eb28d06de2345c5 - -# pytest-cov -pytest-cov==2.8.1 \ - --hash=sha256:cc6742d8bac45070217169f5f72ceee1e0e55b0221f54bcf24845972d3a47f2b \ - --hash=sha256:cdbdef4f870408ebdbfeb44e63e07eb18bb4619fae852f6e760645fa36172626 -coverage==5.5 \ - --hash=sha256:01d84219b5cdbfc8122223b39a954820929497a1cb1422824bb86b07b74594b6 \ - --hash=sha256:1aa846f56c3d49205c952d8318e76ccc2ae23303351d9270ab220004c580cfe2 \ - --hash=sha256:217658ec7187497e3f3ebd901afdca1af062b42cfe3e0dafea4cced3983739f6 \ - --hash=sha256:24d4a7de75446be83244eabbff746d66b9240ae020ced65d060815fac3423759 \ - --hash=sha256:2e0d881ad471768bf6e6c2bf905d183543f10098e3b3640fc029509530091502 \ - --hash=sha256:970284a88b99673ccb2e4e334cfb38a10aab7cd44f7457564d11898a74b62d0a \ - --hash=sha256:d1f8bf7b90ba55699b3a5e44930e93ff0189aa27186e96071fac7dd0d06a1873 \ - --hash=sha256:ebe78fe9a0e874362175b02371bdfbee64d8edc42a044253ddf4ee7d3c15212c - -# mypy -mypy==0.740 \ - --hash=sha256:3b1a411909c84b2ae9b8283b58b48541654b918e8513c20a400bb946aa9111ae \ - --hash=sha256:48c8bc99380575deb39f5d3400ebb6a8a1cb5cc669bbba4d3bb30f904e0a0e7d \ - --hash=sha256:540c9caa57a22d0d5d3c69047cc9dd0094d49782603eb03069821b41f9e970e9 \ - --hash=sha256:672e418425d957e276c291930a3921b4a6413204f53fe7c37cad7bc57b9a3391 \ - --hash=sha256:f4748697b349f373002656bf32fede706a0e713d67bfdcf04edf39b1f61d46eb -mypy-extensions==0.4.3 \ - --hash=sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d \ - --hash=sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8 -typing-extensions==3.10.0.2 \ - --hash=sha256:49f75d16ff11f1cd258e1b988ccff82a3ca5570217d7ad8c5f48205dd99a677e \ - --hash=sha256:f1d25edafde516b146ecd0613dabcc61409817af4766fbbcfb8d1ad4ec441a34 -typed-ast==1.4.3 \ - --hash=sha256:7538e495704e2ccda9b234b82423a4038f324f3a10c43bc088a1636180f11a41 \ - --hash=sha256:af3d4a73793725138d6b334d9d247ce7e5f084d96284ed23f22ee626a7b88e39 \ - --hash=sha256:b36b4f3920103a25e1d5d024d155c504080959582b928e91cb608a65c3a49e1a \ - --hash=sha256:dd4a21253f42b8d2b48410cb31fe501d32f8b9fbeb1f55063ad102fe9c425e40 \ - --hash=sha256:fb1bbeac803adea29cedd70781399c99138358c26d05fcbd23c13016b7f5ec65 - -# cryptography is needed before we collect/install PyQt5 -cffi==1.14.1 \ - --hash=sha256:267adcf6e68d77ba154334a3e4fc921b8e63cbb38ca00d33d40655d4228502bc \ - --hash=sha256:6923d077d9ae9e8bacbdb1c07ae78405a9306c8fd1af13bfa06ca891095eb995 \ - --hash=sha256:98be759efdb5e5fa161e46d404f4e0ce388e72fbf7d9baf010aff16689e22abe \ - --hash=sha256:b1d6ebc891607e71fd9da71688fcf332a6630b7f5b7f5549e6e631821c0e5d90 \ - --hash=sha256:b2a2b0d276a136146e012154baefaea2758ef1f56ae9f4e01c612b0831e0bd2f \ - --hash=sha256:d3148b6ba3923c5850ea197a91a42683f946dba7e8eb82dfa211ab7e708de939 -pycparser==2.20 \ - --hash=sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705 - -cryptography==3.4.8; \ -sys_platform=="darwin" \ - --hash=sha256:a00cf305f07b26c351d8d4e1af84ad7501eca8a342dedf24a7acb0e7b7406e14 - -cryptography==3.4.8; \ -sys_platform=="win32" \ - --hash=sha256:3520667fda779eb788ea00080124875be18f2d8f0848ec00733c0ec3bb8219fc - -cryptography==3.4.8; \ -sys_platform=="linux" \ - --hash=sha256:1eb7bb0df6f6f583dd8e054689def236255161ebbcf62b226454ab9ec663746b +setuptools==62.0.0 \ + --hash=sha256:7999cbd87f1b6e1f33bf47efa368b224bed5e27b5ef2c4d46580186cbcb1a86a \ + --hash=sha256:a65e3802053e99fc64c6b3b29c11132943d5b8c8facbcc461157511546510967 diff --git a/projects/boost_headers.cmake b/projects/boost_headers.cmake deleted file mode 100644 index 7b519e49..00000000 --- a/projects/boost_headers.cmake +++ /dev/null @@ -1,12 +0,0 @@ -#Copyright (c) 2021 Ultimaker B.V. -#cura-build-environment is released under the terms of the AGPLv3 or higher. - -if(NOT TARGET BoostHeaders) - ExternalProject_Add(BoostHeaders - URL https://boostorg.jfrog.io/artifactory/main/release/1.67.0/source/boost_1_67_0.tar.bz2 - URL_HASH SHA256=2684c972994ee57fc5632e03bf044746f6eb45d4920c343937a465fd67a5adba - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_CURRENT_BINARY_DIR}/BoostHeaders-prefix/src/BoostHeaders/boost" "${CMAKE_INSTALL_PREFIX}/include/boost" - ) -endif() diff --git a/projects/build_python_windows.bat b/projects/build_python_windows.bat deleted file mode 100644 index 78cf9f67..00000000 --- a/projects/build_python_windows.bat +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -setlocal enableextensions -rem Custom Python installation script, because Python itself lacks one. - -%* "/p:PlatformToolset=v142" "/p:DefaultWindowsSDKVersion=10" diff --git a/projects/bzip2.cmake b/projects/bzip2.cmake deleted file mode 100644 index a5eba706..00000000 --- a/projects/bzip2.cmake +++ /dev/null @@ -1,21 +0,0 @@ -if(BUILD_OS_LINUX) - ExternalProject_Add(bzip2-static - URL https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz - URL_HASH SHA256=ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269 - CONFIGURE_COMMAND "" - BUILD_COMMAND make -f Makefile PREFIX=${CMAKE_INSTALL_PREFIX} - INSTALL_COMMAND make -f Makefile install PREFIX=${CMAKE_INSTALL_PREFIX} - BUILD_IN_SOURCE 1 - ) - # bzip2 "Makefile-libbz2_so" builds the dynamic library but doesn't include any installation targets. The patch - # file "bzip2_shared.patch" adds a install target so the dynamic libraries can be installed. - ExternalProject_Add(bzip2-shared - URL https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz - URL_HASH SHA256=ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269 - PATCH_COMMAND patch Makefile-libbz2_so ${CMAKE_SOURCE_DIR}/projects/bzip2_shared.patch - CONFIGURE_COMMAND "" - BUILD_COMMAND make -f Makefile-libbz2_so PREFIX=${CMAKE_INSTALL_PREFIX} - INSTALL_COMMAND make -f Makefile-libbz2_so install PREFIX=${CMAKE_INSTALL_PREFIX} - BUILD_IN_SOURCE 1 - ) -endif() diff --git a/projects/bzip2_shared.patch b/projects/bzip2_shared.patch deleted file mode 100644 index 179acd53..00000000 --- a/projects/bzip2_shared.patch +++ /dev/null @@ -1,11 +0,0 @@ -@@ -57,3 +57,10 @@ - $(CC) $(CFLAGS) -c decompress.c - bzlib.o: bzlib.c - $(CC) $(CFLAGS) -c bzlib.c -+ -+install: all -+ if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi -+ cp -f libbz2.so.1.0.8 $(PREFIX)/lib/ -+ ln -s -f libbz2.so.1.0.8 $(PREFIX)/lib/libbz2.so.1.0 -+ ln -s -f libbz2.so.1.0.8 $(PREFIX)/lib/libbz2.so.1 -+ ln -s -f libbz2.so.1.0.8 $(PREFIX)/lib/libbz2.so diff --git a/projects/charon.cmake b/projects/charon.cmake new file mode 100644 index 00000000..016799ff --- /dev/null +++ b/projects/charon.cmake @@ -0,0 +1,22 @@ +#Copyright (c) 2022 Ultimaker B.V. +#cura-build is released under the terms of the AGPLv3 or higher. + +GetFromEnvironmentOrCache( + NAME + CHARON_BRANCH_OR_TAG + DEFAULT + master + DESCRIPTION + "The name of the tag or branch to build for libCharon") + +ExternalProject_Add(Charon + GIT_REPOSITORY https://github.com/Ultimaker/libCharon + GIT_TAG ${CHARON_BRANCH_OR_TAG} + CMAKE_GENERATOR ${CMAKE_GENERATOR} + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + -DPython_ROOT=${Python_ROOT} + -DPython_SITELIB_LOCAL=${Python_SITELIB_LOCAL}) +add_dependencies(Charon install-python-requirements) diff --git a/projects/clipper.cmake b/projects/clipper.cmake deleted file mode 100644 index 7022bfe0..00000000 --- a/projects/clipper.cmake +++ /dev/null @@ -1,18 +0,0 @@ -#Copyright (c) 2020 Ultimaker B.V. -#cura-build-environment is released under the terms of the AGPLv3 or higher. - -#Clipper (dependency of libnest2d). - -#CMake 3.6 (our minimum requirement) doesn't support SOURCE_SUBDIR yet. Instead we copy the source from the cpp subfolder to the main folder. -if(NOT TARGET Clipper) - ExternalProject_Add(Clipper - URL https://sourceforge.net/projects/polyclipping/files/clipper_ver6.4.2.zip - URL_HASH SHA256=a14320d82194807c4480ce59c98aa71cd4175a5156645c4e2b3edd330b930627 - PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_BINARY_DIR}/Clipper-prefix/src/Clipper/cpp" "${CMAKE_CURRENT_BINARY_DIR}/Clipper-prefix/src/Clipper" && ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/projects/clipper_cmakelists_patch.txt" "${CMAKE_CURRENT_BINARY_DIR}/Clipper-prefix/src/Clipper/CMakeLists.txt" - CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_CXX_FLAGS=-fPIC - -DBUILD_SHARED_LIBS=OFF - ) -endif() diff --git a/projects/clipper_cmakelists_patch.txt b/projects/clipper_cmakelists_patch.txt deleted file mode 100644 index 155241e7..00000000 --- a/projects/clipper_cmakelists_patch.txt +++ /dev/null @@ -1,25 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0) -PROJECT(polyclipping) - -SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Release type") -# The header name clipper.hpp is too generic, so install in a subdirectory -SET(CMAKE_INSTALL_INCDIR "${CMAKE_INSTALL_PREFIX}/include/polyclipping") -SET(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") -SET(CMAKE_INSTALL_PKGCONFIGDIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig") -SET(PCFILE "${CMAKE_CURRENT_BINARY_DIR}/polyclipping.pc") - -SET(BUILD_SHARED_LIBS ON CACHE BOOL - "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)") -ADD_LIBRARY(polyclipping clipper.cpp) - -CONFIGURE_FILE (polyclipping.pc.cmakein "${PCFILE}" @ONLY) - -INSTALL (FILES clipper.hpp DESTINATION "${CMAKE_INSTALL_INCDIR}") -INSTALL (TARGETS polyclipping - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - RUNTIME DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" -) -INSTALL (FILES "${PCFILE}" DESTINATION "${CMAKE_INSTALL_PKGCONFIGDIR}") - -SET_TARGET_PROPERTIES(polyclipping PROPERTIES VERSION 22.0.0 SOVERSION 22 ) diff --git a/projects/cura-binary-data.cmake b/projects/cura-binary-data.cmake new file mode 100644 index 00000000..92aa03c7 --- /dev/null +++ b/projects/cura-binary-data.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2022 Ultimaker B.V. +# cura-build is released under the terms of the AGPLv3 or higher. + +GetFromEnvironmentOrCache( + NAME + CURABINARYDATA_BRANCH_OR_TAG + DEFAULT + master + DESCRIPTION + "The name of the tag or branch to build for cura-binary-data") + +ExternalProject_Add(cura-binary-data + GIT_REPOSITORY https://github.com/ultimaker/cura-binary-data + GIT_TAG ${CURABINARYDATA_BRANCH_OR_TAG} + GIT_SHALLOW 1 + STEP_TARGETS update + CMAKE_GENERATOR ${CMAKE_GENERATOR} + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) +add_dependencies(cura-binary-data Cura Uranium) diff --git a/projects/cura.cmake b/projects/cura.cmake new file mode 100644 index 00000000..ee50cacf --- /dev/null +++ b/projects/cura.cmake @@ -0,0 +1,75 @@ +GetFromEnvironmentOrCache( + NAME + CURA_BRANCH_OR_TAG + DEFAULT + master + DESCRIPTION + "The name of the tag or branch to build for Cura") + +GetFromEnvironmentOrCache( + NAME + CURA_DEBUGMODE + DEFAULT + OFF + DESCRIPTION + "Enable crash handler and other debug options in Cura" + BOOL) +GetFromEnvironmentOrCache( + NAME + CURA_CLOUD_API_ROOT + DESCRIPTION + "The cloud API root") +GetFromEnvironmentOrCache( + NAME + CURA_CLOUD_ACCOUNT_API_ROOT + DESCRIPTION + "The cloud account API root") +GetFromEnvironmentOrCache( + NAME + CURA_DIGITAL_FACTORY_URL + DESCRIPTION + "The Ultimaker Digital Factory URL") +GetFromEnvironmentOrCache( + NAME + CURA_MARKETPLACE_ROOT + DESCRIPTION + "The Cura Marketplace API root URL") +GetFromEnvironmentOrCache( + NAME + URANIUM_SCRIPTS_DIR + DESCRIPTION + "The Uranium script directory") +GetFromEnvironmentOrCache( + NAME + CURA_NO_INSTALL_PLUGINS + DESCRIPTION + "A list of plugins to exclude from installation, should be separated by ','.") +GetFromEnvironmentOrCache( + NAME + CURA_BUILDTYPE + DESCRIPTION + "Build type of Cura, eg. 'Enterprise'") + +ExternalProject_Add(Cura + GIT_REPOSITORY https://github.com/ultimaker/Cura + GIT_TAG ${CURA_BRANCH_OR_TAG} + GIT_SHALLOW 1 + STEP_TARGETS update + CMAKE_GENERATOR ${CMAKE_GENERATOR} + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + -DPython_ROOT=${Python_ROOT} + -DPython_SITELIB_LOCAL=${Python_SITELIB_LOCAL} + -DURANIUM_SCRIPTS_DIR=${URANIUM_SCRIPTS_DIR} + -DCURA_VERSION=${CURA_VERSION} + -DCURA_BUILDTYPE=${CURA_BUILDTYPE} + -DCURA_DEBUGMODE=${CURA_DEBUGMODE} + -DCURA_CLOUD_API_ROOT=${CURA_CLOUD_API_ROOT} + -DCURA_CLOUD_API_VERSION=${CURA_CLOUD_API_VERSION} + -DCURA_CLOUD_ACCOUNT_API_ROOT=${CURA_CLOUD_ACCOUNT_API_ROOT} + -DCURA_DIGITAL_FACTORY_URL=${CURA_DIGITAL_FACTORY_URL} + -DCURA_MARKETPLACE_ROOT=${CURA_MARKETPLACE_ROOT} + -DCURA_NO_INSTALL_PLUGINS=${CURA_NO_INSTALL_PLUGINS}) +add_dependencies(Cura install-python-requirements Arcus Savitar Uranium CuraEngine pynest2d Charon) diff --git a/projects/curaengine.cmake b/projects/curaengine.cmake new file mode 100644 index 00000000..88a754eb --- /dev/null +++ b/projects/curaengine.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2022 Ultimaker B.V. +# cura-build is released under the terms of the AGPLv3 or higher. + +GetFromEnvironmentOrCache( + NAME + CURAENGINE_BRANCH_OR_TAG + DEFAULT + master + DESCRIPTION + "The name of the tag or branch to build for CuraEngine") +GetFromEnvironmentOrCache( + NAME + CURA_ENGINE_VERSION + DEFAULT + ${CURA_VERSION} + DESCRIPTION + "The version of CuraEngine") + +ExternalProject_Add(CuraEngine + GIT_REPOSITORY https://github.com/ultimaker/CuraEngine + GIT_TAG ${CURAENGINE_BRANCH_OR_TAG} + GIT_SHALLOW 1 + STEP_TARGETS update + CMAKE_GENERATOR ${CMAKE_GENERATOR} + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + -DCURA_ENGINE_VERSION=${CURA_ENGINE_VERSION}) +add_dependencies(CuraEngine Arcus) \ No newline at end of file diff --git a/projects/fdm_materials.cmake b/projects/fdm_materials.cmake new file mode 100644 index 00000000..d25d5196 --- /dev/null +++ b/projects/fdm_materials.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2022 Ultimaker B.V. +# cura-build is released under the terms of the AGPLv3 or higher. + +GetFromEnvironmentOrCache( + NAME + FDMMATERIALS_BRANCH_OR_TAG + DEFAULT + master + DESCRIPTION + "The name of the tag or branch to build for fdm_materials") + +ExternalProject_Add(fdm_materials + GIT_REPOSITORY https://github.com/ultimaker/fdm_materials + GIT_TAG ${FDMMATERIALS_BRANCH_OR_TAG} + GIT_SHALLOW 1 + STEP_TARGETS update + CMAKE_GENERATOR ${CMAKE_GENERATOR} + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) +add_dependencies(fdm_materials Cura) diff --git a/projects/googletest.cmake b/projects/googletest.cmake deleted file mode 100644 index 83437678..00000000 --- a/projects/googletest.cmake +++ /dev/null @@ -1,26 +0,0 @@ -set(_googletest_url "https://github.com/google/googletest/archive/release-1.8.1.tar.gz") -set(_googletest_sha256 "9bf1fe5182a604b4135edc1a425ae356c9ad15e9b23f9f12a02e80184c3a249c") - -ExternalProject_Add(GoogleTest - URL ${_googletest_url} - URL_HASH SHA256=${_googletest_sha256} - CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - BUILD_IN_SOURCE 1 -) - -# Also need to build with MinGW on Windows -if(BUILD_OS_WINDOWS) - ExternalProject_Add(GoogleTest-MinGW - URL ${_googletest_url} - URL_MD5 ${_googletest_md5sum} - CMAKE_GENERATOR "MinGW Makefiles" - CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_INSTALL_LIBDIR=lib-mingw - BUILD_COMMAND mingw32-make - INSTALL_COMMAND mingw32-make install - ) -endif() diff --git a/projects/install_python_windows.bat b/projects/install_python_windows.bat deleted file mode 100644 index 72e0f609..00000000 --- a/projects/install_python_windows.bat +++ /dev/null @@ -1,78 +0,0 @@ -@echo off -setlocal enableextensions -rem Custom Python installation script, because Python itself lacks one. - -set SCRIPTDIR=%~dp0 - -set ARCH=%~1 -set SOURCEDIR=%~f2 -set DESTDIR=%~f3 - -echo arch %ARCH% -echo source %SOURCEDIR% -echo dest %DESTDIR% - -if not defined ARCH goto :help -if not defined SOURCEDIR goto :help -if not defined DESTDIR goto :help - -if "%ARCH%"=="win32" ( - goto :install -) else ( - if "%ARCH%"=="amd64" ( - goto :install - ) -) -goto :invalid_arch - -:install - -set BINDIR=%SOURCEDIR%\PCbuild\%ARCH% - -echo bindir %BINDIR% - -echo Install binaries to DESTDIR/bin - -mkdir %DESTDIR%\bin - -echo %BINDIR%\python.exe - -copy /Y %BINDIR%\python.exe %DESTDIR%\bin -copy /Y %BINDIR%\*.dll %DESTDIR%\bin - -echo Install libraries to DESTDIR/lib - -mkdir %DESTDIR%\lib - -copy /Y %BINDIR%\*.pyd %DESTDIR%\lib - -xcopy /Y /E %SOURCEDIR%\lib\* %DESTDIR%\lib - -echo Install import libraries to DESTDIR/libs - -mkdir %DESTDIR%\libs - -copy /Y %BINDIR%\*.lib %DESTDIR%\libs - -echo Install headers into DESTDIR/include - -mkdir %DESTDIR%\include - -xcopy /Y /E %SOURCEDIR%\include\* %DESTDIR%\include - -copy /Y %SOURCEDIR%\PC\pyconfig.h %DESTDIR%\include - -exit /B 0 - -:invalid_arch - -echo Invalid architecture. Options are win32 or amd64. -echo. - -:help - -echo Usage: install_python_windows.bat [arch] [source dir] [dest dir] -echo. -echo [arch] Architecture to install. Either win32 or amd64. -echo [source dir] Source directory. Should be root of the Python source. -echo [dest dir] Destination directory. Will be cleaned before installation. diff --git a/projects/libffi.cmake b/projects/libffi.cmake deleted file mode 100644 index 5dd5a3b5..00000000 --- a/projects/libffi.cmake +++ /dev/null @@ -1,22 +0,0 @@ -if(NOT BUILD_OS_WINDOWS) - set(_libffi_config_cmd - ./configure --disable-dependency-tracking --disable-silent-rules --enable-portable-binary - --prefix=${CMAKE_INSTALL_PREFIX} - ) - - if(BUILD_OS_OSX) - if(CMAKE_OSX_SYSROOT) - # On OS X, make sure the right OS X SDK is used. - list(APPEND _libffi_config_cmd --with-sysroot=${CMAKE_OSX_SYSROOT}) - endif() - endif() - - ExternalProject_Add(libffi - URL ftp://sourceware.org/pub/libffi/libffi-3.3.tar.gz - URL_HASH SHA256=72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056 - CONFIGURE_COMMAND ${_libffi_config_cmd} - BUILD_COMMAND make - INSTALL_COMMAND make install - BUILD_IN_SOURCE 1 - ) -endif() diff --git a/projects/libnest2d.cmake b/projects/libnest2d.cmake index f5bb0f2e..b561ea0c 100644 --- a/projects/libnest2d.cmake +++ b/projects/libnest2d.cmake @@ -1,23 +1,19 @@ -#Copyright (c) 2020 Ultimaker B.V. -#cura-build-environment is released under the terms of the AGPLv3 or higher. +# Copyright (c) 2022 Ultimaker B.V. +# cura-build-environment is released under the terms of the AGPLv3 or higher. -include(${CMAKE_CURRENT_SOURCE_DIR}/projects/boost_headers.cmake) -include(${CMAKE_CURRENT_SOURCE_DIR}/projects/nlopt.cmake) -include(${CMAKE_CURRENT_SOURCE_DIR}/projects/clipper.cmake) +GetFromEnvironmentOrCache( + NAME + LIBNEST2D_BRANCH_OR_TAG + DEFAULT + master + DESCRIPTION + "The name of the tag (e.q.: v4.13.0), branch (e.q.: origin/CURA-8640) or commit hash (e.q.: 961dabf) for libnest2d") -set(extra_cmake_args "") - -#libnest2d (dependency of pynest2d). ExternalProject_Add(libnest2d - GIT_REPOSITORY https://github.com/Ultimaker/libnest2d.git - GIT_TAG master - GIT_SHALLOW 1 - UPDATE_DISCONNECTED 1 - PATCH_COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/projects/libnest2d_find_clipper.cmake" "${CMAKE_CURRENT_BINARY_DIR}/libnest2d-prefix/src/libnest2d/cmake_modules/FindClipper.cmake" - CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_CXX_STANDARD=17 - ${extra_cmake_args} - DEPENDS BoostHeaders nlopt Clipper -) + GIT_REPOSITORY https://github.com/Ultimaker/libnest2d.git + GIT_TAG ${LIBNEST2D_BRANCH_OR_TAG} + CMAKE_GENERATOR ${CMAKE_GENERATOR} + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) \ No newline at end of file diff --git a/projects/libnest2d_find_clipper.cmake b/projects/libnest2d_find_clipper.cmake deleted file mode 100644 index 264f1e07..00000000 --- a/projects/libnest2d_find_clipper.cmake +++ /dev/null @@ -1,92 +0,0 @@ -# Find Clipper library (http://www.angusj.com/delphi/clipper.php). -# The following variables are set -# -# CLIPPER_FOUND -# CLIPPER_INCLUDE_DIRS -# CLIPPER_LIBRARIES -# -# It searches the environment variable $CLIPPER_PATH automatically. - -unset(CLIPPER_FOUND CACHE) -unset(CLIPPER_INCLUDE_DIRS CACHE) -unset(CLIPPER_LIBRARIES CACHE) -unset(CLIPPER_LIBRARIES_RELEASE CACHE) -unset(CLIPPER_LIBRARIES_DEBUG CACHE) - -if(CMAKE_BUILD_TYPE MATCHES "(Debug|DEBUG|debug)") - set(CLIPPER_BUILD_TYPE DEBUG) -else() - set(CLIPPER_BUILD_TYPE RELEASE) -endif() - -FIND_PATH(CLIPPER_INCLUDE_DIRS clipper.hpp - $ENV{CLIPPER_PATH}/ - $ENV{CLIPPER_PATH}/cpp/ - $ENV{CLIPPER_PATH}/include/ - $ENV{CLIPPER_PATH}/include/polyclipping/ - ${PROJECT_SOURCE_DIR}/python/pymesh/third_party/include/ - ${PROJECT_SOURCE_DIR}/python/pymesh/third_party/include/polyclipping/ - ${CMAKE_PREFIX_PATH}/include/polyclipping/ - ${CMAKE_PREFIX_PATH}/include/ - ${CMAKE_INSTALL_PREFIX}/include/polyclipping/ - ${CMAKE_INSTALL_PREFIX}/include/ - /opt/local/include/ - /opt/local/include/polyclipping/ - /usr/local/include/ - /usr/local/include/polyclipping/ - /usr/include/ - /usr/include/polyclipping/) - -set(LIB_SEARCHDIRS - $ENV{CLIPPER_PATH} - $ENV{CLIPPER_PATH}/cpp/ - $ENV{CLIPPER_PATH}/cpp/build/ - $ENV{CLIPPER_PATH}/lib/ - $ENV{CLIPPER_PATH}/lib/polyclipping/ - ${PROJECT_SOURCE_DIR}/python/pymesh/third_party/lib/ - ${PROJECT_SOURCE_DIR}/python/pymesh/third_party/lib/polyclipping/ - ${CMAKE_PREFIX_PATH}/lib/ - ${CMAKE_PREFIX_PATH}/lib/polyclipping/ - ${CMAKE_INSTALL_PREFIX}/lib/ - ${CMAKE_INSTALL_PREFIX}/lib/polyclipping/ - /opt/local/lib/ - /opt/local/lib/polyclipping/ - /usr/local/lib/ - /usr/local/lib/polyclipping/ - /usr/lib/polyclipping -) - -set(_deb_postfix "d") - -FIND_LIBRARY(CLIPPER_LIBRARIES_RELEASE polyclipping ${LIB_SEARCHDIRS}) -FIND_LIBRARY(CLIPPER_LIBRARIES_DEBUG polyclipping${_deb_postfix} ${LIB_SEARCHDIRS}) - -if(CLIPPER_LIBRARIES_${CLIPPER_BUILD_TYPE}) - set(CLIPPER_LIBRARIES "${CLIPPER_LIBRARIES_${CLIPPER_BUILD_TYPE}}") -else() - set(CLIPPER_LIBRARIES "${CLIPPER_LIBRARIES_RELEASE}") -endif() - -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Clipper - "Clipper library cannot be found. Consider set CLIPPER_PATH environment variable" - CLIPPER_INCLUDE_DIRS - CLIPPER_LIBRARIES) - -MARK_AS_ADVANCED( - CLIPPER_INCLUDE_DIRS - CLIPPER_LIBRARIES) - -if(CLIPPER_FOUND) - add_library(Clipper::Clipper UNKNOWN IMPORTED) - set_target_properties(Clipper::Clipper PROPERTIES IMPORTED_LOCATION ${CLIPPER_LIBRARIES}) - set_target_properties(Clipper::Clipper PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${CLIPPER_INCLUDE_DIRS}) - if(CLIPPER_LIBRARIES_RELEASE AND CLIPPER_LIBRARIES_DEBUG) - set_target_properties(Clipper::Clipper PROPERTIES - IMPORTED_LOCATION_DEBUG ${CLIPPER_LIBRARIES_DEBUG} - IMPORTED_LOCATION_RELWITHDEBINFO ${CLIPPER_LIBRARIES_RELEASE} - IMPORTED_LOCATION_RELEASE ${CLIPPER_LIBRARIES_RELEASE} - IMPORTED_LOCATION_MINSIZEREL ${CLIPPER_LIBRARIES_RELEASE} - ) - endif() -endif() diff --git a/projects/nlopt.cmake b/projects/nlopt.cmake deleted file mode 100644 index 1cb15a52..00000000 --- a/projects/nlopt.cmake +++ /dev/null @@ -1,14 +0,0 @@ -#Copyright (c) 2020 Ultimaker B.V. -#cura-build-environment is released under the terms of the AGPLv3 or higher. - -#NLopt (dependency of libnest2d). -if(NOT TARGET nlopt) - ExternalProject_Add(nlopt - GIT_REPOSITORY https://github.com/stevengj/nlopt.git - GIT_TAG v2.6.2 - GIT_SHALLOW 1 - CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - ) -endif() \ No newline at end of file diff --git a/projects/openblas.cmake b/projects/openblas.cmake deleted file mode 100644 index 135e9346..00000000 --- a/projects/openblas.cmake +++ /dev/null @@ -1,18 +0,0 @@ -if(NOT BUILD_OS_WINDOWS) - # Fortran compiler is needed for OpenBLAS, but it does no check whether it is available. - enable_language(Fortran) - set(openblas_options DYNAMIC_ARCH=1 DYNAMIC_OLDER=1 NO_STATIC=1 TARGET=GENERIC) - - ExternalProject_Add(OpenBLAS - URL https://github.com/xianyi/OpenBLAS/archive/v0.3.13.tar.gz - URL_HASH SHA256=79197543b17cc314b7e43f7a33148c308b0807cd6381ee77f77e15acf3e6459e - CONFIGURE_COMMAND "" - BUILD_COMMAND make PREFIX=${CMAKE_INSTALL_PREFIX} ${openblas_options} - INSTALL_COMMAND make PREFIX=${CMAKE_INSTALL_PREFIX} ${openblas_options} install - BUILD_IN_SOURCE 1 - ) -else() - add_custom_target(OpenBLAS) -endif() - -SetProjectDependencies(TARGET OpenBLAS) diff --git a/projects/openctm.cmake b/projects/openctm.cmake deleted file mode 100644 index 5b6701e7..00000000 --- a/projects/openctm.cmake +++ /dev/null @@ -1,38 +0,0 @@ -set(_cura_openctm_url https://sourceforge.net/projects/openctm/files/OpenCTM-1.0.3/OpenCTM-1.0.3-src.tar.bz2/download) -set(_cura_openctm_sha256 4a8d2608d97364f7eec56b7c637c56b9308ae98286b3e90dbb7413c90e943f1d) - -if (BUILD_OS_WINDOWS) - ExternalProject_Add(OpenCTM - URL ${_cura_openctm_url} - URL_HASH SHA256=${_cura_openctm_sha256} - CONFIGURE_COMMAND "" - BUILD_COMMAND nmake /f Makefile.msvc openctm - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy lib/openctm.dll ${CMAKE_INSTALL_PREFIX}/bin/openctm.dll - COMMAND ${CMAKE_COMMAND} -E copy lib/openctm.lib ${CMAKE_INSTALL_PREFIX}/lib/openctm.lib - COMMAND ${CMAKE_COMMAND} -E copy lib/openctm.h ${CMAKE_INSTALL_PREFIX}/include/openctm.h - COMMAND ${CMAKE_COMMAND} -E copy lib/openctmpp.h ${CMAKE_INSTALL_PREFIX}/include/openctmpp.h - BUILD_IN_SOURCE 1 - ) -elseif (BUILD_OS_LINUX) - ExternalProject_Add(OpenCTM - URL ${_cura_openctm_url} - URL_HASH SHA256=${_cura_openctm_sha256} - CONFIGURE_COMMAND "" - BUILD_COMMAND make -f Makefile.linux openctm - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy lib/libopenctm.so ${CMAKE_INSTALL_PREFIX}/lib/libopenctm.so - COMMAND ${CMAKE_COMMAND} -E copy lib/openctm.h ${CMAKE_INSTALL_PREFIX}/include/openctm.h - COMMAND ${CMAKE_COMMAND} -E copy lib/openctmpp.h ${CMAKE_INSTALL_PREFIX}/include/openctmpp.h - BUILD_IN_SOURCE 1 - ) -else () # OSX - ExternalProject_Add(OpenCTM - URL ${_cura_openctm_url} - URL_HASH SHA256=${_cura_openctm_sha256} - CONFIGURE_COMMAND "" - BUILD_COMMAND make -f Makefile.macosx openctm - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy lib/libopenctm.dylib ${CMAKE_INSTALL_PREFIX}/lib/libopenctm.dylib - COMMAND ${CMAKE_COMMAND} -E copy lib/openctm.h ${CMAKE_INSTALL_PREFIX}/include/openctm.h - COMMAND ${CMAKE_COMMAND} -E copy lib/openctmpp.h ${CMAKE_INSTALL_PREFIX}/include/openctmpp.h - BUILD_IN_SOURCE 1 - ) -endif () diff --git a/projects/openssl.cmake b/projects/openssl.cmake deleted file mode 100644 index 3349e2bd..00000000 --- a/projects/openssl.cmake +++ /dev/null @@ -1,18 +0,0 @@ -if(NOT BUILD_OS_WINDOWS) - set(_openssl_build make depend && make) - set(_openssl_install make install) - if(BUILD_OS_LINUX) - set(_openssl_configure perl Configure --prefix=${CMAKE_INSTALL_PREFIX} --openssldir=${CMAKE_INSTALL_PREFIX} no-ssl2 no-ssl3 no-zlib shared enable-cms linux-x86_64 enable-ec_nistp_64_gcc_128) - elseif(BUILD_OS_OSX) - set(_openssl_configure perl Configure --prefix=${CMAKE_INSTALL_PREFIX} --openssldir=${CMAKE_INSTALL_PREFIX} no-ssl2 no-ssl3 no-zlib shared enable-cms darwin64-x86_64-cc enable-ec_nistp_64_gcc_128) - endif() - - ExternalProject_Add(OpenSSL - URL https://www.openssl.org/source/openssl-1.1.1l.tar.gz - URL_HASH SHA256=0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1 - CONFIGURE_COMMAND ${_openssl_configure} - BUILD_COMMAND ${_openssl_build} - INSTALL_COMMAND ${_openssl_install} - BUILD_IN_SOURCE 1 - ) -endif() diff --git a/projects/protobuf.cmake b/projects/protobuf.cmake deleted file mode 100644 index 19e975d1..00000000 --- a/projects/protobuf.cmake +++ /dev/null @@ -1,77 +0,0 @@ -set(_cura_protobuf_url https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.15.7.tar.gz) -set(_cura_protobuf_sha256 efdd6b932a2c0a88a90c4c80f88e4b2e1bf031e7514dbb5a5db5d0bf4f295504) - -if(BUILD_OS_OSX) - set(protobuf_cxx_flags "-fPIC -std=c++11 -stdlib=libc++") -elseif(BUILD_OS_LINUX) - set(protobuf_cxx_flags "-fPIC -std=c++11") -else() - set(protobuf_cxx_flags "") -endif() - -set(protobuf_configure_args - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_INSTALL_LIBDIR=lib - -DCMAKE_INSTALL_CMAKEDIR=lib/cmake/protobuf - -DCMAKE_CXX_FLAGS=${protobuf_cxx_flags} - -Dprotobuf_BUILD_TESTS=OFF - -Dprotobuf_BUILD_EXAMPLES=OFF - -Dprotobuf_BUILD_SHARED_LIBS=OFF - -Dprotobuf_WITH_ZLIB=OFF -) - -if(BUILD_OS_OSX) - if (CMAKE_OSX_DEPLOYMENT_TARGET) - list(APPEND protobuf_configure_args - -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} - ) - endif() - if (CMAKE_OSX_SYSROOT) - list(APPEND protobuf_configure_args - -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} - ) - endif() -endif() - -ExternalProject_Add(Protobuf - URL ${_cura_protobuf_url} - URL_MD5 ${_cura_protobuf_md5} - CONFIGURE_COMMAND ${CMAKE_COMMAND} ${protobuf_configure_args} -G ${CMAKE_GENERATOR} ../Protobuf/cmake -) - -if(BUILD_OS_WINDOWS) - # Compile it again, this time using MinGW - # We need to build the Arcus Python plugin with MSVC due to Python. - # However, we also need a MinGW library because CuraEngine does not really support MSVC. - # Since the two are ABI-incompatible we need two versions of the library... - set(protobuf_configure_args - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_INSTALL_LIBDIR=lib-mingw - -DCMAKE_CXX_STANDARD=11 - -DCMAKE_CXX_STANDARD_REQUIRED=ON - -DCMAKE_CXX_EXTENSIONS=OFF - -Dprotobuf_BUILD_TESTS=OFF - -Dprotobuf_BUILD_EXAMPLES=OFF - -Dprotobuf_BUILD_SHARED_LIBS=OFF - -Dprotobuf_WITH_ZLIB=OFF - ) - - # HACK: Protobuf-MinGW depends on Protobuf is because CuraEngine needs to use protoc.exe to generate C++ code. - # Because we compile CuraEngine with MinGW, it needs to use the protoc.exe that's also compiled with MinGW to - # generate C++ code and library links that works with MinGW. With the current configuration, because Protobuf-MinGW - # depends on Protobuf, it will install its binary into CMAKE_INSTALL_PREFIX\bin, overwriting the protoc.exe - # compiled with MSVC. Because we don't need the protoc.exe from MSVC, this works. Ideally, it would be better to - # separate the 2 sub-environments, MSVC and MinGW, but to keep this compatible with the current systems, we leave - # it for now. - ExternalProject_Add(Protobuf-MinGW - URL ${_cura_protobuf_url} - URL_HASH SHA256=${_cura_protobuf_sha256} - DEPENDS Protobuf - CONFIGURE_COMMAND ${CMAKE_COMMAND} ${protobuf_configure_args} -G "MinGW Makefiles" ../Protobuf-MinGW/cmake - BUILD_COMMAND mingw32-make - INSTALL_COMMAND mingw32-make install - ) -endif() diff --git a/projects/pynest2d.cmake b/projects/pynest2d.cmake index 22ce8775..df4b99f1 100644 --- a/projects/pynest2d.cmake +++ b/projects/pynest2d.cmake @@ -1,34 +1,25 @@ -#Copyright (c) 2020 Ultimaker B.V. -#cura-build-environment is released under the terms of the AGPLv3 or higher. +# Copyright (c) 2022 Ultimaker B.V. +# cura-build-environment is released under the terms of the AGPLv3 or higher. -set(pylib_cmake_command ${CMAKE_COMMAND}) - -set(extra_cmake_args "") -if(BUILD_OS_WINDOWS) - set(extra_cmake_args -DCMAKE_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/libs -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX}) -elseif(BUILD_OS_OSX) - if(CMAKE_OSX_DEPLOYMENT_TARGET) - list(APPEND extra_cmake_args - -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} - ) - endif() - if(CMAKE_OSX_SYSROOT) - list(APPEND extra_cmake_args - -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} - ) - endif() -endif() +GetFromEnvironmentOrCache( + NAME + PYNEST2D_BRANCH_OR_TAG + DEFAULT + master + DESCRIPTION + "The name of the tag (e.q.: v4.13.0), branch (e.q.: origin/CURA-8640) or commit hash (e.q.: 961dabf) for pynest2d") ExternalProject_Add(pynest2d - GIT_REPOSITORY https://github.com/Ultimaker/pynest2d.git - GIT_TAG origin/master - GIT_SHALLOW 1 - CMAKE_COMMAND ${pylib_cmake_command} - CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} - -DBUILD_STATIC=ON - ${extra_cmake_args} -) - -SetProjectDependencies(TARGET pynest2d DEPENDS Sip libnest2d) + GIT_REPOSITORY https://github.com/Ultimaker/pynest2d.git + GIT_TAG ${PYNEST2D_BRANCH_OR_TAG} + CMAKE_GENERATOR ${CMAKE_GENERATOR} + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + -DSIP_BUILD_EXECUTABLE=${CMAKE_INSTALL_PREFIX}/${exe_path}/sip-build + -DPYTHONPATH=${PYTHONPATH} + -DPython_SITELIB_LOCAL=${Python_SITELIB_LOCAL} + -DPython_ROOT=${CMAKE_INSTALL_PREFIX} + -DPython_EXECUTABLE=${Python_VENV_EXECUTABLE}) +add_dependencies(pynest2d install-python-requirements libnest2d) diff --git a/projects/pyqt.cmake b/projects/pyqt.cmake deleted file mode 100644 index 9902057a..00000000 --- a/projects/pyqt.cmake +++ /dev/null @@ -1,36 +0,0 @@ -set(pyqt_command "") -if(NOT BUILD_OS_WINDOWS) - # Building PyQt on Windows is problematic due to linking against specific Windows libraries. - # Instead, we'll use the less favourable approach of installation via Pip, which drags PyPI into the circle of trust. - # See requirements.txt for installing on windows with pip - # TODO: PyPi is already in out circle of trust why not use the same approach for the Linux and MacOS - if(BUILD_OS_OSX) - set(pyqt_command - ${Python3_EXECUTABLE} configure.py - --sysroot ${CMAKE_INSTALL_PREFIX} - --qmake ${CMAKE_INSTALL_PREFIX}/bin/qmake - --sip ${CMAKE_INSTALL_PREFIX}/bin/sip - --confirm-license - ) - else() - set(pyqt_command - # On Linux, PyQt configure fails because it creates an executable that does not respect RPATH - "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib" - ${Python3_EXECUTABLE} configure.py - --sysroot ${CMAKE_INSTALL_PREFIX} - --qmake ${CMAKE_INSTALL_PREFIX}/bin/qmake - --sip ${CMAKE_INSTALL_PREFIX}/bin/sip - --confirm-license - ) - endif() - - ExternalProject_Add(PyQt - URL https://files.pythonhosted.org/packages/28/6c/640e3f5c734c296a7193079a86842a789edb7988dca39eab44579088a1d1/PyQt5-5.15.2.tar.gz - URL_HASH SHA256=372b08dc9321d1201e4690182697c5e7ffb2e0770e6b4a45519025134b12e4fc - CONFIGURE_COMMAND ${pyqt_command} - BUILD_IN_SOURCE 1 - ) - - SetProjectDependencies(TARGET PyQt DEPENDS Qt Sip) - -endif() diff --git a/projects/python.cmake b/projects/python.cmake index e838332b..0d17d109 100644 --- a/projects/python.cmake +++ b/projects/python.cmake @@ -1,56 +1,41 @@ -set(python_configure_command ./configure --prefix=${CMAKE_INSTALL_PREFIX} --enable-shared --enable-ipv6 --without-pymalloc ) -set(python_build_command make) -set(python_install_command make install) - -if(BUILD_OS_WINDOWS) - # Otherwise Python will not be able to get external dependencies. - find_package(Subversion REQUIRED) - - set(python_configure_command ) - - # Use the Windows Batch script to pass an argument "/p:PlatformToolset=v140". The argument must have double quotes - # around it, otherwise it will be evaluated as "/p:PlatformToolset v140" in Windows Batch. Passing this argument - # in CMake via a command seems to always result in "/p:PlatformToolset v140". - set(python_build_command cmd /c "${CMAKE_SOURCE_DIR}/projects/build_python_windows.bat" "/PCbuild/build.bat" --no-tkinter -c Release -e -M -p x64) - set(python_install_command cmd /c "${CMAKE_SOURCE_DIR}/projects/install_python_windows.bat amd64 ${CMAKE_INSTALL_PREFIX}") -endif() - -if(BUILD_OS_OSX) - set(python_configure_command ${python_configure_command} --with-openssl=${CMAKE_INSTALL_PREFIX}) +# Copyright (c) 2022 Ultimaker B.V. +# cura-build-environment is released under the terms of the AGPLv3 or higher. +# +# Sets up a virtual environment using the Python interpreter + +if(NOT DEFINED Python_VERSION) + set(Python_VERSION + 3.10 + CACHE STRING "Python Version" FORCE) + message(STATUS "Setting Python version to ${Python_VERSION}. Set Python_VERSION if you want to compile against an other version.") endif() - -if(BUILD_OS_LINUX) - # Set a proper RPATH so everything depending on Python does not need LD_LIBRARY_PATH - set(python_configure_command LDFLAGS=-Wl,-rpath=${CMAKE_INSTALL_PREFIX}/lib ${python_configure_command} --with-openssl=${CMAKE_INSTALL_PREFIX}) +if(APPLE) + set(Python_FIND_FRAMEWORK NEVER) endif() - -ExternalProject_Add(Python - URL https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz - URL_HASH SHA256=c4e0cbad57c90690cb813fb4663ef670b4d0f587d8171e2c42bd4c9245bd2758 - CONFIGURE_COMMAND "${python_configure_command}" - BUILD_COMMAND ${python_build_command} - INSTALL_COMMAND ${python_install_command} - BUILD_IN_SOURCE 1 -) - -# CPython has a number of dependencies (OpenSSL, bzip, xz, zlib, sqlite) -# cryptography requires cffi, which requires libffi -# Numpy needs OpenBLAS. -if(BUILD_OS_LINUX) - SetProjectDependencies(TARGET Python DEPENDS OpenBLAS OpenSSL bzip2-static bzip2-shared xz zlib sqlite3 libffi) -elseif(BUILD_OS_OSX) - SetProjectDependencies(TARGET Python DEPENDS OpenBLAS OpenSSL xz zlib sqlite3 libffi) +find_package(cpython ${Python_VERSION} QUIET COMPONENTS Interpreter) +if(NOT TARGET cpython::python) + find_package(Python ${Python_VERSION} EXACT REQUIRED COMPONENTS Interpreter) else() - SetProjectDependencies(TARGET Python DEPENDS OpenBLAS) + add_library(Python::Python ALIAS cpython::python) + set(Python_SITEARCH "${CMAKE_INSTALL_PREFIX}/lib/python3.10/site-packages") + set(Python_EXECUTABLE ${cpython_PACKAGE_FOLDER_RELEASE}/bin/python${exe_ext}) + set(ENV{PYTHONPATH} ${Python_SITEARCH}) endif() - -# Make sure pip and setuptools are installed into our new Python -ExternalProject_Add_Step(Python ensurepip - COMMAND ${Python3_EXECUTABLE} -m ensurepip - DEPENDEES install -) - -ExternalProject_Add_Step(Python baserequirements - COMMAND ${Python3_EXECUTABLE} -m pip install --require-hashes -r ${CMAKE_SOURCE_DIR}/projects/base_requirements.txt - DEPENDEES ensurepip -) +message(STATUS "Using Python ${Python_VERSION}") + +add_custom_target(create-virtual-env ALL COMMENT "Create Virtual Environment") +add_custom_command( + TARGET create-virtual-env + COMMAND ${Python_EXECUTABLE} -m venv ${CMAKE_INSTALL_PREFIX}) + +add_custom_target(install-base-python-requirements ALL COMMENT "Install base python requirements in virtual environment") +add_custom_command( + TARGET install-base-python-requirements + COMMAND ${CMAKE_COMMAND} -E env "PYTHONPATH=${PYTHONPATH}" ${Python_VENV_EXECUTABLE} -m pip install --prefix ${CMAKE_INSTALL_PREFIX} --require-hashes -r ${CMAKE_SOURCE_DIR}/projects/base_requirements.txt) +add_dependencies(install-base-python-requirements create-virtual-env) + +add_custom_target(install-python-requirements ALL COMMENT "Install python requirements in virtual environment") +add_custom_command( + TARGET install-python-requirements + COMMAND ${CMAKE_COMMAND} -E env "PYTHONPATH=${PYTHONPATH}" ${Python_VENV_EXECUTABLE} -m pip install --prefix ${CMAKE_INSTALL_PREFIX} --require-hashes -r ${CMAKE_SOURCE_DIR}/projects/requirements.txt) +add_dependencies(install-python-requirements install-base-python-requirements) diff --git a/projects/python_packages.cmake b/projects/python_packages.cmake deleted file mode 100644 index 16284d28..00000000 --- a/projects/python_packages.cmake +++ /dev/null @@ -1,14 +0,0 @@ -add_custom_target(PythonPackagesGeneral ALL - COMMAND ${Python3_EXECUTABLE} -m pip install --require-hashes -r ${CMAKE_SOURCE_DIR}/projects/requirements.txt - COMMENT "Install Python packages" - DEPENDS Python -) - -if(BUILD_OS_WINDOWS) - add_custom_command( - TARGET PythonPackagesGeneral POST_BUILD - COMMAND powershell -Command "(gc hooks.py) -replace 'libffi-7.dll', 'libffi-8.dll' | Out-File -encoding ASCII hooks.py" - COMMENT "Make libffi-8.dll visible to cx_Freeze" - WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/site-packages/cx_Freeze - ) -endif() diff --git a/projects/qt-patch-macosx-target.sh b/projects/qt-patch-macosx-target.sh deleted file mode 100755 index 5a933c5e..00000000 --- a/projects/qt-patch-macosx-target.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# -# If QMAKE_MACOSX_DEPLOYMENT_TARGET is defined in the environment, -# modify the configuration scripts in Qt (qtbase/mkspecs/) to use -# that as the target OSX version. -# - -if [ -z "${QMAKE_MACOSX_DEPLOYMENT_TARGET}" ]; then - echo "QMAKE_MACOSX_DEPLOYMENT_TARGET not defined, do nothing" - exit -fi - -grep -r 'QMAKE_MACOSX_DEPLOYMENT_TARGET = ' ./qtbase/mkspecs | cut -d':' -f1 | xargs sed -i '' 's/^\(QMAKE_MACOSX_DEPLOYMENT_TARGET =\)\(.*\)$/\1 '"${QMAKE_MACOSX_DEPLOYMENT_TARGET}"'/g' diff --git a/projects/qt.cmake b/projects/qt.cmake deleted file mode 100644 index 86d3418b..00000000 --- a/projects/qt.cmake +++ /dev/null @@ -1,79 +0,0 @@ -set(qt_url https://download.qt.io/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz) -set(qt_SHA256 3a530d1b243b5dec00bc54937455471aaa3e56849d2593edb8ded07228202240) - -if(BUILD_OS_WINDOWS) - # For some as of yet unknown reason, building Qt on Windows fails because it does not create moc targets. - # Due to that we install the PyQt wheel into the built Python manually. - return() -endif() - -set(_qt_configure_cmd "./configure") -set(qt_options - -release - -prefix ${CMAKE_INSTALL_PREFIX} - -archdatadir ${CMAKE_INSTALL_PREFIX}/lib - -datadir ${CMAKE_INSTALL_PREFIX}/share - -opensource - -confirm-license - -nomake examples - -nomake tests - -nomake tools - -no-cups - -no-sql-db2 - -no-sql-ibase - -no-sql-mysql - -no-sql-oci - -no-sql-odbc - -no-sql-psql - -no-sql-sqlite - -no-sql-sqlite2 - -no-sql-tds - -skip qtconnectivity - -skip qtdoc - -skip qtlocation - -skip qtmultimedia - -skip qtscript - -skip qtsensors - -skip qtwebchannel - -skip qtwebengine - -skip qtandroidextras - -skip qtactiveqt - -skip qttools - -skip qtxmlpatterns - -skip qt3d - -skip qtcanvas3d - -skip qtserialport - -skip qtwayland - -skip qtgamepad - -skip qtscxml -) - -if(BUILD_OS_OSX) - list(APPEND qt_options -no-framework) - if(CURA_OSX_SDK_VERSION) - list(APPEND qt_options -sdk macosx${CURA_OSX_SDK_VERSION}) - endif() - set(_qt_config_cmd ${CMAKE_SOURCE_DIR}/projects/qt-patch-macosx-target.sh && ${_qt_configure_cmd}) -elseif(BUILD_OS_WINDOWS) - list(APPEND qt_options -opengl desktop) -elseif(BUILD_OS_LINUX) - list(APPEND qt_options - -rpath - -pkg-config - -opengl desktop -no-gtk - -fontconfig - -system-freetype - -system-zlib - -ssl -openssl-runtime - -xcb -xcb-xlib # To build the xcb platform plug-in, found in https://forum.qt.io/topic/115827/build-on-linux-qt-xcb-option/16 - -I "${CMAKE_INSTALL_PREFIX}/include" - -L "${CMAKE_INSTALL_PREFIX}/lib") -endif() - -ExternalProject_Add(Qt - URL ${qt_url} - URL_HASH SHA256=${qt_SHA256} - CONFIGURE_COMMAND ${_qt_configure_cmd} ${qt_options} - BUILD_IN_SOURCE 1 - DEPENDS OpenSSL -) diff --git a/projects/requirements.txt b/projects/requirements.txt index ac6dd103..e9b9aafb 100644 --- a/projects/requirements.txt +++ b/projects/requirements.txt @@ -1,12 +1,180 @@ -# These hashes were generated with: -# hashin --verbose --python-version --requirements-file= == == ... -# make sure you use the verbose flag and personally inspect the hosts that were used when generating -# When updating a major Python version these need to be updates as well - -cx-Freeze==6.9 \ - --hash=sha256:776d4fb68a4831691acbd3c374362b9b48ce2e568514a73c3d4cb14d5dcf1470 \ - --hash=sha256:243f36d35a034a409cd6247d8cb5d1fbfd7374e3e668e813d0811f64d6bd5ed3 \ - --hash=sha256:673aa3199af2ef87fc03a43a30e5d78b27ced2cedde925da89c55b5657da267b + +cython==0.29.26 \ + --hash=sha256:af377d543a762867da11fcf6e558f7a4a535ff8693f30cce123fab10c00fa312 \ + --hash=sha256:f5e15ff892c8afad64931ee3dd723c4755c2c516606f9aae7613bebfac62b0f6 \ + --hash=sha256:2b834ff6e4d10ba6d7a0d676dd71c1b427a181ddbbbbf79e91d1861557aab59f \ + --hash=sha256:c813799d533194b7d85203d881d8b4f567a8c644a67f50d47f1ffbf316df412f \ + --hash=sha256:6773cce9d4b3b6168d8feb2b6f06b658ef1e11cbfec075041745666d8e2a5e45 \ + --hash=sha256:362fbb9cb4627c7786231429768b54aaba5459a2a0e46c25e59f202ca6155437 +pybind11==2.6.2 \ + --hash=sha256:2d8aebe1709bc367e34e3b23d8eccbf3f387ee9d5640548c6260d33b59f02405 \ + --hash=sha256:d0e0aed9279656f21501243b707eb6e3b951e89e10c3271dedf3ae41c365e5ed + +# pytest +pytest==5.2.1 \ + --hash=sha256:7e4800063ccfc306a53c461442526c5571e1462f61583506ce97e4da6a1d88c8 \ + --hash=sha256:ca563435f4941d0cb34767301c27bc65c510cb82e90b9ecf9cb52dc2c63caaa0 +more-itertools==8.9.0 \ + --hash=sha256:70401259e46e216056367a0a6034ee3d3f95e0bf59d3aa6a4eb77837171ed996 \ + --hash=sha256:8c746e0d09871661520da4f1241ba6b908dc903839733c8203b552cffaf173bd +wcwidth==0.2.5 \ + --hash=sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784 \ + --hash=sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83 +pluggy==0.13.1 \ + --hash=sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0 \ + --hash=sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d +attrs==21.2.0 \ + --hash=sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1 \ + --hash=sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb +py==1.10.0 \ + --hash=sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3 \ + --hash=sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a +atomicwrites==1.4.0 \ + --hash=sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197 \ + --hash=sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a +colorama==0.4.4 \ + --hash=sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b \ + --hash=sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2 + +# packaging is a dependency of pytest +packaging==18.0 \ + --hash=sha256:0886227f54515e592aaa2e5a553332c73962917f2831f1b0f9b9f4380a4b9807 \ + --hash=sha256:f95a1e147590f204328170981833854229bb2912ac3d5f89e2a8ccd2834800c9 +pyparsing==2.4.2 \ + --hash=sha256:6f98a7b9397e206d78cc01df10131398f1c8b8510a2f4d97d9abd82e1aacdd80 \ + --hash=sha256:d9338df12903bbf5d65a0e4e87c2161968b10d2e489652bb47001d82a9b028b4 +six==1.12.0 \ + --hash=sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c \ + --hash=sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73 + +# pytest-benchmark +pytest-benchmark==3.2.2 \ + --hash=sha256:4512c6805318d07926efcb3b39f7b98a10d035305a93edfd5329c86cbf9cfbf7 \ + --hash=sha256:ab851115ce022639173b9497d4a4183a1d8fe9cdcf8fab9d8a57607008aedd3d +py-cpuinfo==8.0.0 \ + --hash=sha256:5f269be0e08e33fd959de96b34cd4aeeeacac014dd8305f70eb28d06de2345c5 + +# pytest-cov +pytest-cov==2.8.1 \ + --hash=sha256:cc6742d8bac45070217169f5f72ceee1e0e55b0221f54bcf24845972d3a47f2b \ + --hash=sha256:cdbdef4f870408ebdbfeb44e63e07eb18bb4619fae852f6e760645fa36172626 +coverage==5.5 \ + --hash=sha256:01d84219b5cdbfc8122223b39a954820929497a1cb1422824bb86b07b74594b6 \ + --hash=sha256:1aa846f56c3d49205c952d8318e76ccc2ae23303351d9270ab220004c580cfe2 \ + --hash=sha256:217658ec7187497e3f3ebd901afdca1af062b42cfe3e0dafea4cced3983739f6 \ + --hash=sha256:24d4a7de75446be83244eabbff746d66b9240ae020ced65d060815fac3423759 \ + --hash=sha256:2e0d881ad471768bf6e6c2bf905d183543f10098e3b3640fc029509530091502 \ + --hash=sha256:970284a88b99673ccb2e4e334cfb38a10aab7cd44f7457564d11898a74b62d0a \ + --hash=sha256:d1f8bf7b90ba55699b3a5e44930e93ff0189aa27186e96071fac7dd0d06a1873 \ + --hash=sha256:ebe78fe9a0e874362175b02371bdfbee64d8edc42a044253ddf4ee7d3c15212c + +# mypy +tomli==2.0.1 \ + --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ + --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f +mypy-extensions==0.4.3 \ + --hash=sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d \ + --hash=sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8 +typing-extensions==3.10.0.2 \ + --hash=sha256:49f75d16ff11f1cd258e1b988ccff82a3ca5570217d7ad8c5f48205dd99a677e \ + --hash=sha256:f1d25edafde516b146ecd0613dabcc61409817af4766fbbcfb8d1ad4ec441a34 +typed-ast==1.5.2 \ + --hash=sha256:0eb77764ea470f14fcbb89d51bc6bbf5e7623446ac4ed06cbd9ca9495b62e36e \ + --hash=sha256:1098df9a0592dd4c8c0ccfc2e98931278a6c6c53cb3a3e2cf7e9ee3b06153344 \ + --hash=sha256:183b183b7771a508395d2cbffd6db67d6ad52958a5fdc99f450d954003900266 \ + --hash=sha256:18fe320f354d6f9ad3147859b6e16649a0781425268c4dde596093177660e71a \ + --hash=sha256:26a432dc219c6b6f38be20a958cbe1abffcc5492821d7e27f08606ef99e0dffd \ + --hash=sha256:294a6903a4d087db805a7656989f613371915fc45c8cc0ddc5c5a0a8ad9bea4d \ + --hash=sha256:31d8c6b2df19a777bc8826770b872a45a1f30cfefcfd729491baa5237faae837 \ + --hash=sha256:33b4a19ddc9fc551ebabca9765d54d04600c4a50eda13893dadf67ed81d9a098 \ + --hash=sha256:42c47c3b43fe3a39ddf8de1d40dbbfca60ac8530a36c9b198ea5b9efac75c09e \ + --hash=sha256:525a2d4088e70a9f75b08b3f87a51acc9cde640e19cc523c7e41aa355564ae27 \ + --hash=sha256:58ae097a325e9bb7a684572d20eb3e1809802c5c9ec7108e85da1eb6c1a3331b \ + --hash=sha256:676d051b1da67a852c0447621fdd11c4e104827417bf216092ec3e286f7da596 \ + --hash=sha256:74cac86cc586db8dfda0ce65d8bcd2bf17b58668dfcc3652762f3ef0e6677e76 \ + --hash=sha256:8c08d6625bb258179b6e512f55ad20f9dfef019bbfbe3095247401e053a3ea30 \ +mypy==0.931 \ + --hash=sha256:0038b21890867793581e4cb0d810829f5fd4441aa75796b53033af3aa30430ce \ + --hash=sha256:1171f2e0859cfff2d366da2c7092b06130f232c636a3f7301e3feb8b41f6377d \ + --hash=sha256:1b06268df7eb53a8feea99cbfff77a6e2b205e70bf31743e786678ef87ee8069 \ + --hash=sha256:1b65714dc296a7991000b6ee59a35b3f550e0073411ac9d3202f6516621ba66c \ + --hash=sha256:1bf752559797c897cdd2c65f7b60c2b6969ffe458417b8d947b8340cc9cec08d \ + --hash=sha256:300717a07ad09525401a508ef5d105e6b56646f7942eb92715a1c8d610149714 \ + --hash=sha256:3c5b42d0815e15518b1f0990cff7a705805961613e701db60387e6fb663fe78a \ + --hash=sha256:4365c60266b95a3f216a3047f1d8e3f895da6c7402e9e1ddfab96393122cc58d \ + --hash=sha256:50c7346a46dc76a4ed88f3277d4959de8a2bd0a0fa47fa87a4cde36fe247ac05 \ + --hash=sha256:5b56154f8c09427bae082b32275a21f500b24d93c88d69a5e82f3978018a0266 \ + --hash=sha256:74f7eccbfd436abe9c352ad9fb65872cc0f1f0a868e9d9c44db0893440f0c697 \ + --hash=sha256:7b3f6f557ba4afc7f2ce6d3215d5db279bcf120b3cfd0add20a5d4f4abdae5bc \ + --hash=sha256:8c11003aaeaf7cc2d0f1bc101c1cc9454ec4cc9cb825aef3cafff8a5fdf4c799 \ + --hash=sha256:8ca7f8c4b1584d63c9a0f827c37ba7a47226c19a23a753d52e5b5eddb201afcd \ + --hash=sha256:c89702cac5b302f0c5d33b172d2b55b5df2bede3344a2fbed99ff96bddb2cf00 \ + --hash=sha256:d8f1ff62f7a879c9fe5917b3f9eb93a79b78aad47b533911b853a757223f72e7 \ + --hash=sha256:d9d2b84b2007cea426e327d2483238f040c49405a6bf4074f605f0156c91a47a \ + --hash=sha256:e839191b8da5b4e5d805f940537efcaa13ea5dd98418f06dc585d2891d228cf0 \ + --hash=sha256:f9fe20d0872b26c4bba1c1be02c5340de1019530302cf2dcc85c7f9fc3252ae0 \ + --hash=sha256:ff3bf387c14c805ab1388185dd22d6b210824e164d4bb324b195ff34e322d166 + +# cryptography is needed before we collect/install PyQt5 +cffi==1.15.0 \ + --hash=sha256:920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954 \ + --hash=sha256:5e069f72d497312b24fcc02073d70cb989045d1c91cbd53979366077959933e0 \ + --hash=sha256:00c878c90cb53ccfaae6b8bc18ad05d2036553e6d9d1d9dbcf323bbe83854ca3 \ + --hash=sha256:0104fb5ae2391d46a4cb082abdd5c69ea4eab79d8d44eaaf79f1b1fd806ee4c2 +pycparser==2.20 \ + --hash=sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705 + +cryptography==3.4.8; \ +sys_platform=="darwin" \ + --hash=sha256:a00cf305f07b26c351d8d4e1af84ad7501eca8a342dedf24a7acb0e7b7406e14 + +cryptography==3.4.8; \ +sys_platform=="win32" \ + --hash=sha256:3520667fda779eb788ea00080124875be18f2d8f0848ec00733c0ec3bb8219fc + +cryptography==3.4.8; \ +sys_platform=="linux" \ + --hash=sha256:1eb7bb0df6f6f583dd8e054689def236255161ebbcf62b226454ab9ec663746b + +toml==0.10.2 \ + --hash=sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b \ + --hash=sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f +sip==6.5.1 \ + --hash=sha256:204f0240db8999a749d638a987b351861843e69239b811ec3d1881412c3706a6 \ + --hash=sha256:57e5ac40744c0f10a6c53dd45d2ef2c90e52f34a0210d8309e6563a07f914d0d \ + --hash=sha256:13b09357615c2d8bcb23bf21c1637941ac8ff5f28b346c1ccad7efafa57673e9 \ + --hash=sha256:01a637b44c5918505801c3d56e1e010b8e86a4edee71c0bd8541c54387b57ae2 + +# pyinstaller +pyinstaller==4.10 \ + --hash=sha256:05c21117b84199272ebd355b556af4714f6e79245e1c435d6f16653786d7d17e \ + --hash=sha256:0dcaf6557cdb2da763c46e06e95a94a7634ab03fb09d91bc77988b01ee05c907 \ + --hash=sha256:15557cd1a79d182967f0a5040750e6902e13ebd6cab41e3ed84d7b28a306357b \ + --hash=sha256:581620bdcd32f01e89b13231256b807bb090e7eadf40c81c864ec402afa4758a \ + --hash=sha256:70c71e827f4b34602cbc7a0947a067b662c1cbdc4db51832e13b97cca3c54dd7 \ + --hash=sha256:714c4dcc319a41416744d1e30c6317405dfaed80d2adc45f8bfa70dc7367e664 \ + --hash=sha256:7749c868d2e2dc84df7d6f65437226183c8a366f3a99bb2737785625c3a3cca1 \ + --hash=sha256:7d94518ba1f8e9a8577345312276891ad7d6cd9785e453e9951b35647e2c7078 \ + --hash=sha256:cfed0b3a43e73550a43a094610328109564710b9514afa093ef7199d072cae87 \ + --hash=sha256:d4f79c0a774451f12baca4e476376418f011fa3039dde8fd172ea2aa8ff67bad \ + --hash=sha256:f2166ff2cd95eefb0d377ae8d1071f186fa25edd410ede65b376162d5ec41909 +altgraph==0.17.2 \ + --hash=sha256:743628f2ac6a7c26f5d9223c91ed8ecbba535f506f4b6f558885a8a56a105857 \ + --hash=sha256:ebf2269361b47d97b3b88e696439f6e4cbc607c17c51feb1754f90fb79839158 +pyinstaller-hooks-contrib==2022.2 \ + --hash=sha256:7605e440ccb55904cb2a87d72e83642ef176fb7030c77e52ac4d9679bb3d1537 \ + --hash=sha256:ab1d14fe053016fff7b0c6aea51d980bac6d02114b04063b46ef7dac70c70e1e +pefile==2021.9.3; \ + sys_platform=="win32" \ + --hash=sha256:344a49e40a94e10849f0fe34dddc80f773a12b40675bf2f7be4b8be578bdd94a +future==0.18.2; \ + sys_platform=="win32" \ + --hash=sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d +macholib==1.15.2; \ + sys_platform=="darwin" \ + --hash=sha256:1542c41da3600509f91c165cb897e7e54c0e74008bd8da5da7ebbee519d593d2 \ + --hash=sha256:885613dd02d3e26dbd2b541eb4cc4ce611b841f827c0958ab98656e478b9e6f6 + appdirs==1.4.3 \ --hash=sha256:9e5896d1372858f8dd3344faf4e5014d21849c756c8d5701f78f8a103b372d92 \ --hash=sha256:d8b24664561d0d34ddfaec54636d502d7cea6e29c3eaf68f3df6180863e2166e @@ -22,8 +190,8 @@ decorator==4.4.0 \ idna==2.8 \ --hash=sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407 \ --hash=sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c -netifaces==0.10.9 \ - --hash=sha256:2dee9ffdd16292878336a58d04a20f0ffe95555465fee7c9bd23b3490ef2abf3 +netifaces==0.11.0 \ + --hash=sha256:043a79146eb2907edf439899f262b3dfe41717d34124298ed281139a8b93ca32 networkx==2.6.2 \ --hash=sha256:2306f1950ce772c5a59a57f5486d59bb9cab98497c45fc49cbc45ac0dec119bb \ --hash=sha256:5fcb7004be69e8fbdf07dcb502efa5c77cadcaad6982164134eeb9721f826c2e @@ -31,12 +199,30 @@ numpy-stl==2.10.1 \ --hash=sha256:f6b529b8a8112dfe456d4f7697c7aee0aca62be5a873879306afe4b26fca963c pycollada==0.6 \ --hash=sha256:fcd6f38fd981e350f9ec754d9671834017accd600e967d6d299a6cfdae5ba4f4 -PyQt5-sip==12.9.0 \ - --hash=sha256:d3e4489d7c2b0ece9d203ae66e573939f7f60d4d29e089c9f11daa17cfeaae32 \ - --hash=sha256:485972daff2fb0311013f471998f8ec8262ea381bded244f9d14edaad5f54271 \ - --hash=sha256:0fc9aefacf502696710b36cdc9fa2a61487f55ee883dbcf2c2a6477e261546f7 \ - --hash=sha256:d59af63120d1475b2bf94fe8062610720a9be1e8940ea146c7f42bb449d49067 \ - --hash=sha256:6d5bca2fc222d58e8093ee8a81a6e3437067bb22bc3f86d06ec8be721e15e90a +PyQt6-sip==13.2.1 \ + --hash=sha256:b7bce59900b2e0a04f70246de2ccf79ee7933036b6b9183cf039b62eeae2b858 \ + --hash=sha256:8b52d42e42e6e9f934ac7528cd154ac0210a532bb33fa1edfb4a8bbfb73ff88b \ + --hash=sha256:0314d011633bc697e99f3f9897b484720e81a5f4ba0eaa5f05c5811e2e74ea53 \ + --hash=sha256:226e9e349aa16dc1132f106ca01fa99cf7cb8e59daee29304c2fea5fa33212ec +PyQt6==6.2.3 \ + --hash=sha256:a9bfcac198fe4b703706f809bb686c7cef5f60a7c802fc145c6b57929c7a6a34 \ + --hash=sha256:11c039b07962b29246de2da0912f4f663786185fd74d48daac7a270a43c8d92a \ + --hash=sha256:8a2f357b86fec8598f52f16d5f93416931017ca1986d5f68679c9565bfc21fff \ + --hash=sha256:577334c9d4518022a4cb6f9799dfbd1b996167eb31404b5a63d6c43d603e6418 +PyQt6-Qt6==6.2.4 \ + --hash=sha256:42c37475a50ec7e06e0445ac9ce39465f69a86af407ad9b28b183da178d401ee \ + --hash=sha256:b68543e5d5a4f5d24c26b517569da3cd30b0fbe75390b841e142c160399b3c0a \ + --hash=sha256:0aa93581b92e01deaf2dcaad88ed6718996a6d84de59ee88316bcba143f008c9 \ + --hash=sha256:48bc5b7400d6bca13d8c0a145f82295a6da317952ee1a3f107f1cd7d078c8140 +PyQt6-NetworkAuth==6.2.0 \ + --hash=sha256:23e730cc0d6b828bec2f92d9fac3607871e6033a8af4620e5d4e3afc13bd6c3c \ + --hash=sha256:b85ee25b01d6cb38d6141df0052b96de2df7f6e69066eaddb22ae238f56be40b \ + --hash=sha256:e637781a00dd2032d0fd2025af09274898335033763e1dc765a5a99348f60c3b \ + --hash=sha256:542e9d9a8a5bb78e1f26fa3d35ee01f45209bcf5a35b0cc367aaa85932c29750 +PyQt6-NetworkAuth-Qt6==6.2.4 \ + --hash=sha256:c7996a9d8c4ce024529ec37981fbfd525ab1a2d497af1281f81f2b6054452d2e \ + --hash=sha256:1ae9e08e03bd9d5ebdb42dfaccf484a9cc62eeea7504621fe42c005ff1745e66 \ + --hash=sha256:8ed4e5e0eaaa42a6f91aba6745eea23fb3ffcbddc6b162016936530ed28dd0ad pyserial==3.4 \ --hash=sha256:6e2d401fdee0eab996cf734e67773a0143b932772ca8b42451440cfed942c627 \ --hash=sha256:e0770fadba80c31013896c7e6ef703f72e7834965954a78e71a3049488d4d7d8 @@ -172,14 +358,3 @@ pywin32-ctypes==0.2.0; \ sys_platform=="win32" \ --hash=sha256:24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942 \ --hash=sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98 -cx-Logging==3.0; \ - sys_platform=="win32" \ - --hash=sha256:ba8a7465facf7b98d8f494030fb481a2e8aeee29dc191e10383bb54ed42bdb34 -PyQt5==5.15.6; \ - sys_platform=="win32" \ - --hash=sha256:80343bcab95ffba619f2ed2467fd828ffeb0a251ad7225be5fc06dcc333af452 \ - --hash=sha256:f411ecda52e488e1d3c5cce7563e1b2ca9cf0b7531e3c25b03d9a7e56e07e7fc \ - --hash=sha256:9d2dcdaf82263ae56023410a7af15d1fd746c8e361733a7d0d1bd1f004ec2793 -PyQt5-Qt5==5.15.2; \ - sys_platform=="win32" \ - --hash=sha256:750b78e4dba6bdf1607febedc08738e318ea09e9b10aea9ff0d73073f11f6962 diff --git a/projects/savitar.cmake b/projects/savitar.cmake index 9121bad1..4ca0987c 100644 --- a/projects/savitar.cmake +++ b/projects/savitar.cmake @@ -1,36 +1,25 @@ -set(savitar_cmake_command ${CMAKE_COMMAND}) +#Copyright (c) 2022 Ultimaker B.V. +#cura-build-environment is released under the terms of the AGPLv3 or higher. -set(extra_cmake_args "") -if(BUILD_OS_WINDOWS) - set(extra_cmake_args - -DCMAKE_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/libs - ) -else() - if(BUILD_OS_OSX) - if(CMAKE_OSX_DEPLOYMENT_TARGET) - list(APPEND extra_cmake_args - -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} - ) - endif() - if(CMAKE_OSX_SYSROOT) - list(APPEND extra_cmake_args - -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} - ) - endif() - endif() -endif() +GetFromEnvironmentOrCache( + NAME + SAVITAR_BRANCH_OR_TAG + DEFAULT + master + DESCRIPTION + "The name of the tag (e.q.: v4.13.0), branch (e.q.: origin/CURA-8640) or commit hash (e.q.: 961dabf) for Savitar") ExternalProject_Add(Savitar - GIT_REPOSITORY https://github.com/ultimaker/libSavitar.git - GIT_TAG origin/${CURA_SAVITAR_BRANCH_OR_TAG} - GIT_SHALLOW 1 - CMAKE_COMMAND ${savitar_cmake_command} - CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} - -DCMAKE_CXX_STANDARD=17 - -DBUILD_STATIC=ON - ${extra_cmake_args} -) - -SetProjectDependencies(TARGET Savitar DEPENDS Sip) + GIT_REPOSITORY https://github.com/ultimaker/libSavitar.git + GIT_TAG ${SAVITAR_BRANCH_OR_TAG} + CMAKE_GENERATOR ${CMAKE_GENERATOR} + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + -DSIP_BUILD_EXECUTABLE=${CMAKE_INSTALL_PREFIX}/${exe_path}/sip-build + -DPYTHONPATH=${PYTHONPATH} + -DPython_SITELIB_LOCAL=${Python_SITELIB_LOCAL} + -DPython_ROOT=${CMAKE_INSTALL_PREFIX} + -DPython_EXECUTABLE=${Python_VENV_EXECUTABLE}) +add_dependencies(Savitar install-python-requirements) diff --git a/projects/sip.cmake b/projects/sip.cmake deleted file mode 100644 index 394e4ebb..00000000 --- a/projects/sip.cmake +++ /dev/null @@ -1,28 +0,0 @@ -if(BUILD_OS_WINDOWS) - set(sip_command - ${Python3_EXECUTABLE} - configure.py - --platform win32-msvc2015 - ) -elseif(BUILD_OS_LINUX) - set(sip_command - ${Python3_EXECUTABLE} - configure.py - ) -elseif(BUILD_OS_OSX) - set(sip_command - ${Python3_EXECUTABLE} - configure.py - ) -else() - set(sip_command "") -endif() - -ExternalProject_Add(Sip - URL https://www.riverbankcomputing.com/static/Downloads/sip/4.19.25/sip-4.19.25.tar.gz - URL_HASH SHA256=b39d93e937647807bac23579edbff25fe46d16213f708370072574ab1f1b4211 - CONFIGURE_COMMAND ${sip_command} - BUILD_IN_SOURCE 1 -) - -SetProjectDependencies(TARGET Sip DEPENDS Python) diff --git a/projects/sqlite3.cmake b/projects/sqlite3.cmake deleted file mode 100644 index 7a6819d7..00000000 --- a/projects/sqlite3.cmake +++ /dev/null @@ -1,22 +0,0 @@ -if(BUILD_OS_OSX) - ExternalProject_Add(sqlite3 - URL https://sqlite.org/2018/sqlite-autoconf-3260000.tar.gz - URL_HASH SHA256=5daa6a3fb7d1e8c767cd59c4ded8da6e4b00c61d3b466d0685e35c4dd6d7bf5d - CONFIGURE_COMMAND ./configure --disable-debug --disable-dependency-tracking --disable-silent-rules --prefix=${CMAKE_INSTALL_PREFIX} --with-sysroot=${CMAKE_OSX_SYSROOT} - BUILD_COMMAND make - INSTALL_COMMAND make install - BUILD_IN_SOURCE 1 - ) - SetProjectDependencies(TARGET sqlite3 DEPENDS zlib) -elseif(BUILD_OS_LINUX) - ExternalProject_Add(sqlite3 - URL https://sqlite.org/2018/sqlite-autoconf-3260000.tar.gz - URL_HASH SHA256=5daa6a3fb7d1e8c767cd59c4ded8da6e4b00c61d3b466d0685e35c4dd6d7bf5d - PATCH_COMMAND libtoolize - CONFIGURE_COMMAND ./configure --disable-debug --disable-dependency-tracking --disable-silent-rules --prefix=${CMAKE_INSTALL_PREFIX} - BUILD_COMMAND make - INSTALL_COMMAND make install - BUILD_IN_SOURCE 1 - ) - SetProjectDependencies(TARGET sqlite3 DEPENDS zlib) -endif() diff --git a/projects/uranium.cmake b/projects/uranium.cmake new file mode 100644 index 00000000..14c46be9 --- /dev/null +++ b/projects/uranium.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2022 Ultimaker B.V. +# cura-build is released under the terms of the AGPLv3 or higher. + +GetFromEnvironmentOrCache( + NAME + URANIUM_BRANCH_OR_TAG + DEFAULT + master + DESCRIPTION + "The name of the tag or branch to build for Uranium") + +GetFromEnvironmentOrCache( + NAME + CURA_NO_INSTALL_PLUGINS + DESCRIPTION + "A list of plugins to exclude from installation, should be separated by ','.") + +ExternalProject_Add(Uranium + GIT_REPOSITORY https://github.com/ultimaker/Uranium + GIT_TAG ${URANIUM_BRANCH_OR_TAG} + CMAKE_GENERATOR ${CMAKE_GENERATOR} + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + -DPython_ROOT=${Python_ROOT} + -DPython_SITELIB_LOCAL=${Python_SITELIB_LOCAL} + -DUM_NO_INSTALL_PLUGINS=${CURA_NO_INSTALL_PLUGINS}) +add_dependencies(Uranium install-python-requirements Arcus Savitar) diff --git a/projects/xz.cmake b/projects/xz.cmake deleted file mode 100644 index b3b79bb8..00000000 --- a/projects/xz.cmake +++ /dev/null @@ -1,19 +0,0 @@ -if(BUILD_OS_OSX) - ExternalProject_Add(xz - URL https://sourceforge.net/projects/lzmautils/files/xz-5.2.4.tar.gz - URL_HASH SHA256=b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145 - CONFIGURE_COMMAND ./configure --disable-debug --disable-dependency-tracking --disable-silent-rules --prefix=${CMAKE_INSTALL_PREFIX} --with-sysroot=${CMAKE_OSX_SYSROOT} - BUILD_COMMAND make - INSTALL_COMMAND make install - BUILD_IN_SOURCE 1 - ) -elseif(BUILD_OS_LINUX) - ExternalProject_Add(xz - URL https://sourceforge.net/projects/lzmautils/files/xz-5.2.4.tar.gz - URL_HASH SHA256=b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145 - CONFIGURE_COMMAND ./configure --disable-debug --disable-dependency-tracking --disable-silent-rules --prefix=${CMAKE_INSTALL_PREFIX} - BUILD_COMMAND make - INSTALL_COMMAND make install - BUILD_IN_SOURCE 1 - ) -endif() diff --git a/projects/zlib.cmake b/projects/zlib.cmake deleted file mode 100644 index 8888f6fb..00000000 --- a/projects/zlib.cmake +++ /dev/null @@ -1,10 +0,0 @@ -if(BUILD_OS_OSX OR BUILD_OS_LINUX) - ExternalProject_Add(zlib - URL https://www.zlib.net/fossils/zlib-1.2.11.tar.gz - URL_HASH SHA256=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 - CONFIGURE_COMMAND ./configure --64 --prefix=${CMAKE_INSTALL_PREFIX} - BUILD_COMMAND make - INSTALL_COMMAND make install - BUILD_IN_SOURCE 1 - ) -endif() diff --git a/signing/cura.entitlements b/signing/cura.entitlements new file mode 100644 index 00000000..3b95f077 --- /dev/null +++ b/signing/cura.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.cs.allow-dyld-environment-variables + + com.apple.security.cs.disable-executable-page-protection + + com.apple.security.cs.disable-library-validation + + +