diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml index 0c89240..39baad3 100755 --- a/.azure-pipelines/azure-pipelines-osx.yml +++ b/.azure-pipelines/azure-pipelines-osx.yml @@ -11,6 +11,9 @@ jobs: osx_64_: CONFIG: osx_64_ UPLOAD_PACKAGES: 'True' + osx_arm64_: + CONFIG: osx_arm64_ + UPLOAD_PACKAGES: 'True' timeoutInMinutes: 360 steps: diff --git a/.ci_support/osx_arm64_.yaml b/.ci_support/osx_arm64_.yaml new file mode 100644 index 0000000..3ab1148 --- /dev/null +++ b/.ci_support/osx_arm64_.yaml @@ -0,0 +1,32 @@ +MACOSX_DEPLOYMENT_TARGET: +- '11.0' +c_compiler: +- clang +c_compiler_version: +- '11' +channel_sources: +- conda-forge/label/rust_dev,conda-forge +channel_targets: +- conda-forge main +cxx_compiler: +- clangxx +cxx_compiler_version: +- '11' +freetype: +- '2' +macos_machine: +- arm64-apple-darwin20.0.0 +openexr: +- '2.5' +pin_run_as_build: + freetype: + max_pin: x + zlib: + max_pin: x.x +target_platform: +- osx-arm64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +zlib: +- '1.2' diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 658b5a2..ea796fa 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @seanyen @wolfv \ No newline at end of file +* @Tobias-Fischer @seanyen @wolfv \ No newline at end of file diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index aa9727b..99baf86 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -6,8 +6,15 @@ # benefit from the improvement. set -xeuo pipefail -export PYTHONUNBUFFERED=1 export FEEDSTOCK_ROOT="${FEEDSTOCK_ROOT:-/home/conda/feedstock_root}" +source ${FEEDSTOCK_ROOT}/.scripts/logging_utils.sh + + +( endgroup "Start Docker" ) 2> /dev/null + +( startgroup "Configuring conda" ) 2> /dev/null + +export PYTHONUNBUFFERED=1 export RECIPE_ROOT="${RECIPE_ROOT:-/home/conda/recipe_root}" export CI_SUPPORT="${FEEDSTOCK_ROOT}/.ci_support" export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml" @@ -18,8 +25,9 @@ conda-build: root-dir: ${FEEDSTOCK_ROOT}/build_artifacts CONDARC +BUILD_CMD=build -conda install --yes --quiet "conda-forge-ci-setup=3" conda-build pip -c conda-forge +conda install --yes --quiet "conda-forge-ci-setup=3" conda-build pip ${GET_BOA:-} -c conda-forge # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" @@ -29,6 +37,12 @@ source run_conda_forge_build_setup # make the build number clobber make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" +if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]] && [[ "${BUILD_WITH_CONDA_DEBUG:-0}" != 1 ]]; then + EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" +fi + + +( endgroup "Configuring conda" ) 2> /dev/null if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then @@ -37,17 +51,28 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then conda debug "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ ${EXTRA_CB_OPTIONS:-} \ --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" + # Drop into an interactive shell /bin/bash else - conda build "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + conda $BUILD_CMD "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ --suppress-variables ${EXTRA_CB_OPTIONS:-} \ --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" + ( startgroup "Validating outputs" ) 2> /dev/null + validate_recipe_outputs "${FEEDSTOCK_NAME}" + ( endgroup "Validating outputs" ) 2> /dev/null + + ( startgroup "Uploading packages" ) 2> /dev/null + if [[ "${UPLOAD_PACKAGES}" != "False" ]]; then upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" fi + + ( endgroup "Uploading packages" ) 2> /dev/null fi +( startgroup "Final checks" ) 2> /dev/null + touch "${FEEDSTOCK_ROOT}/build_artifacts/conda-forge-build-done-${CONFIG}" \ No newline at end of file diff --git a/.scripts/logging_utils.sh b/.scripts/logging_utils.sh new file mode 100644 index 0000000..57bc95c --- /dev/null +++ b/.scripts/logging_utils.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Provide a unified interface for the different logging +# utilities CI providers offer. If unavailable, provide +# a compatible fallback (e.g. bare `echo xxxxxx`). + +function startgroup { + # Start a foldable group of log lines + # Pass a single argument, quoted + case ${CI:-} in + azure ) + echo "##[group]$1";; + travis ) + echo "$1" + echo -en 'travis_fold:start:'"${1// /}"'\\r';; + github_actions ) + echo "::group::$1";; + * ) + echo "$1";; + esac +} 2> /dev/null + +function endgroup { + # End a foldable group of log lines + # Pass a single argument, quoted + + case ${CI:-} in + azure ) + echo "##[endgroup]";; + travis ) + echo -en 'travis_fold:end:'"${1// /}"'\\r';; + github_actions ) + echo "::endgroup::";; + esac +} 2> /dev/null diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index 36dacd6..44ad3ce 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -5,6 +5,10 @@ # changes to this script, consider a proposal to conda-smithy so that other feedstocks can also # benefit from the improvement. +source .scripts/logging_utils.sh + +( startgroup "Configure Docker" ) 2> /dev/null + set -xeo pipefail THISDIR="$( cd "$( dirname "$0" )" >/dev/null && pwd )" @@ -66,6 +70,10 @@ if [ -z "${CI}" ]; then DOCKER_RUN_ARGS="-it ${DOCKER_RUN_ARGS}" fi +( endgroup "Configure Docker" ) 2> /dev/null + +( startgroup "Start Docker" ) 2> /dev/null + export UPLOAD_PACKAGES="${UPLOAD_PACKAGES:-True}" docker run ${DOCKER_RUN_ARGS} \ -v "${RECIPE_ROOT}":/home/conda/recipe_root:rw,z,delegated \ @@ -88,4 +96,7 @@ docker run ${DOCKER_RUN_ARGS} \ /home/conda/feedstock_root/${PROVIDER_DIR}/build_steps.sh # verify that the end of the script was reached -test -f "$DONE_CANARY" \ No newline at end of file +test -f "$DONE_CANARY" + +# This closes the last group opened in `build_steps.sh` +( endgroup "Final checks" ) 2> /dev/null \ No newline at end of file diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index c299b79..cbcce72 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -1,29 +1,27 @@ #!/usr/bin/env bash -set -x +source .scripts/logging_utils.sh + +set -xe + +( startgroup "Installing a fresh version of Miniforge" ) 2> /dev/null -echo -e "\n\nInstalling a fresh version of Miniforge." -if [[ ${CI} == "travis" ]]; then - echo -en 'travis_fold:start:install_miniforge\\r' -fi MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/latest/download" MINIFORGE_FILE="Miniforge3-MacOSX-x86_64.sh" curl -L -O "${MINIFORGE_URL}/${MINIFORGE_FILE}" bash $MINIFORGE_FILE -b -if [[ ${CI} == "travis" ]]; then - echo -en 'travis_fold:end:install_miniforge\\r' -fi -echo -e "\n\nConfiguring conda." -if [[ ${CI} == "travis" ]]; then - echo -en 'travis_fold:start:configure_conda\\r' -fi +( endgroup "Installing a fresh version of Miniforge" ) 2> /dev/null + +( startgroup "Configuring conda" ) 2> /dev/null + +BUILD_CMD=build source ${HOME}/miniforge3/etc/profile.d/conda.sh conda activate base echo -e "\n\nInstalling conda-forge-ci-setup=3 and conda-build." -conda install -n base --quiet --yes "conda-forge-ci-setup=3" conda-build pip +conda install -n base --quiet --yes "conda-forge-ci-setup=3" conda-build pip ${GET_BOA:-} @@ -39,19 +37,28 @@ echo -e "\n\nRunning the build setup script." source run_conda_forge_build_setup -if [[ ${CI} == "travis" ]]; then - echo -en 'travis_fold:end:configure_conda\\r' -fi -set -e +( endgroup "Configuring conda" ) 2> /dev/null -echo -e "\n\nMaking the build clobber file and running the build." + +echo -e "\n\nMaking the build clobber file" make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml -conda build ./recipe -m ./.ci_support/${CONFIG}.yaml --suppress-variables --clobber-file ./.ci_support/clobber_${CONFIG}.yaml ${EXTRA_CB_OPTIONS:-} +if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]]; then + EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" +fi + +conda $BUILD_CMD ./recipe -m ./.ci_support/${CONFIG}.yaml --suppress-variables --clobber-file ./.ci_support/clobber_${CONFIG}.yaml ${EXTRA_CB_OPTIONS:-} +( startgroup "Validating outputs" ) 2> /dev/null + validate_recipe_outputs "${FEEDSTOCK_NAME}" +( endgroup "Validating outputs" ) 2> /dev/null + +( startgroup "Uploading packages" ) 2> /dev/null + if [[ "${UPLOAD_PACKAGES}" != "False" ]]; then - echo -e "\n\nUploading the packages." upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" ./ ./recipe ./.ci_support/${CONFIG}.yaml -fi \ No newline at end of file +fi + +( endgroup "Uploading packages" ) 2> /dev/null \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt index 5f30279..ed3f451 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,5 +1,5 @@ BSD 3-clause license -Copyright (c) 2015-2020, conda-forge contributors +Copyright (c) 2015-2021, conda-forge contributors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index 2a69c62..5620e04 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,13 @@ Current build status variant + + osx_arm64 + + + variant + + win_64 @@ -97,6 +104,7 @@ Installing `ogre` from the `conda-forge` channel can be achieved by adding `cond ``` conda config --add channels conda-forge +conda config --set channel_priority strict ``` Once the `conda-forge` channel has been enabled, `ogre` can be installed with: @@ -167,14 +175,15 @@ build distinct package versions. In order to produce a uniquely identifiable distribution: * If the version of a package **is not** being increased, please add or increase - the [``build/number``](https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#build-number-and-string). + the [``build/number``](https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#build-number-and-string). * If the version of a package **is** being increased, please remember to return - the [``build/number``](https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#build-number-and-string) + the [``build/number``](https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#build-number-and-string) back to 0. Feedstock Maintainers ===================== +* [@Tobias-Fischer](https://github.com/Tobias-Fischer/) * [@seanyen](https://github.com/seanyen/) * [@wolfv](https://github.com/wolfv/) diff --git a/conda-forge.yml b/conda-forge.yml index 2989916..93247a3 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -1,2 +1,4 @@ conda_forge_output_validation: true provider: {linux_aarch64: default, linux_ppc64le: default} +build_platform: {osx_arm64: osx_64} +test_on_native_only: true diff --git a/recipe/0003-arm-platform.patch b/recipe/0003-arm-platform.patch new file mode 100644 index 0000000..996782a --- /dev/null +++ b/recipe/0003-arm-platform.patch @@ -0,0 +1,90 @@ +--- a/OgreMain/include/OgrePlatform.h 2018-04-24 09:12:49.000000000 +1000 ++++ b/OgreMain/include/OgrePlatform.h 2021-04-20 08:29:03.133000630 +1000 +@@ -56,6 +56,47 @@ + #define OGRE_ARCHITECTURE_32 1 + #define OGRE_ARCHITECTURE_64 2 + ++ ++#define OGRE_CPU_UNKNOWN 0 ++#define OGRE_CPU_X86 1 ++#define OGRE_CPU_PPC 2 ++#define OGRE_CPU_ARM 3 ++#define OGRE_CPU_MIPS 4 ++ ++/* Find CPU type */ ++#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64) ++# define OGRE_CPU OGRE_CPU_X86 ++#elif defined(__ppc__) || defined(__ppc64__) || defined(_M_PPC) ++# define OGRE_CPU OGRE_CPU_PPC ++#elif defined(__arm__) || defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM) || defined(_M_ARM64) ++# define OGRE_CPU OGRE_CPU_ARM ++#elif defined(__mips__) || defined(__mips64) || defined(__mips64_) || defined(_M_MIPS) ++# define OGRE_CPU OGRE_CPU_MIPS ++#else ++# define OGRE_CPU OGRE_CPU_UNKNOWN ++#endif ++ ++/* Find the arch type */ ++#if defined(__x86_64__) || defined(_M_X64) || defined(_M_X64) || defined(_M_AMD64) \ ++ || defined(__ppc64__) \ ++ || defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64) \ ++ || defined(__mips64) || defined(__mips64_) \ ++ || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__) ++# define OGRE_ARCH_TYPE OGRE_ARCHITECTURE_64 ++#else ++# define OGRE_ARCH_TYPE OGRE_ARCHITECTURE_32 ++#endif ++ ++/* Determine CPU endian. ++ We were once in situation when XCode could produce mixed endian fat binary with x86 and ppc archs inside, so it's safer to sniff compiler macros too ++ */ ++#if defined(OGRE_CONFIG_BIG_ENDIAN) || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) ++# define OGRE_ENDIAN OGRE_ENDIAN_BIG ++#else ++# define OGRE_ENDIAN OGRE_ENDIAN_LITTLE ++#endif ++ ++ + /* Finds the compiler type and version. + */ + #if (defined( __WIN32__ ) || defined( _WIN32 )) && defined(__ANDROID__) // We are using NVTegra +--- a/OgreMain/include/OgrePlatformInformation.h 2018-04-24 09:12:49.000000000 +1000 ++++ b/OgreMain/include/OgrePlatformInformation.h 2021-04-20 08:29:25.192674729 +1000 +@@ -31,37 +31,7 @@ + #include "OgrePrerequisites.h" + + namespace Ogre { +-// +-// TODO: Puts following macros into OgrePlatform.h? +-// + +-/* Initial CPU stuff to set. +-*/ +-#define OGRE_CPU_UNKNOWN 0 +-#define OGRE_CPU_X86 1 +-#define OGRE_CPU_PPC 2 +-#define OGRE_CPU_ARM 3 +-#define OGRE_CPU_MIPS 4 +- +-/* Find CPU type +-*/ +-#if (defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))) || \ +- (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) +-# define OGRE_CPU OGRE_CPU_X86 +- +-#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE && defined(__BIG_ENDIAN__) +-# define OGRE_CPU OGRE_CPU_PPC +-#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE +-# define OGRE_CPU OGRE_CPU_X86 +-#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS && (defined(__i386__) || defined(__x86_64__)) +-# define OGRE_CPU OGRE_CPU_X86 +-#elif defined(__arm__) || defined(_M_ARM) || defined(__arm64__) || defined(__aarch64__) +-# define OGRE_CPU OGRE_CPU_ARM +-#elif defined(__mips64) || defined(__mips64_) +-# define OGRE_CPU OGRE_CPU_MIPS +-#else +-# define OGRE_CPU OGRE_CPU_UNKNOWN +-#endif + + /* Find how to declare aligned variable. + */ diff --git a/recipe/build.sh b/recipe/build.sh index be91d65..09857b6 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -10,7 +10,11 @@ else WARNING_FLAGS= fi -cmake .. \ +if [[ "${target_platform}" == "osx-arm64" ]]; then + OGRE_OSX_ARCH="-DCMAKE_OSX_ARCHITECTURES=arm64" +fi + +cmake ${CMAKE_ARGS} .. \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH=$PREFIX \ -DCMAKE_INSTALL_PREFIX=$PREFIX \ @@ -27,7 +31,8 @@ cmake .. \ -DOGRE_RESOURCEMANAGER_STRICT=0 \ -DOGRE_CONFIG_THREAD_PROVIDER="std" \ -DOGRE_BUILD_LIBS_AS_FRAMEWORKS=0 \ - ${WARNING_FLAGS} + ${WARNING_FLAGS} \ + ${OGRE_OSX_ARCH} make -j${CPU_COUNT} make install diff --git a/recipe/meta.yaml b/recipe/meta.yaml index f45b3e8..2efb9db 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -10,7 +10,8 @@ source: sha256: 5b755a91bcb2a48a01c74109a9b41592533700622a8394c62589dce2adeddead patches: - 0001-enable-pkg-config-for-Windows.patch # [win] - - 0002-osx-no-framework.patch # [osx] + - 0002-osx-no-framework.patch # [osx] + - 0003-arm-platform.patch # [arm64] build: number: 7 @@ -24,12 +25,12 @@ requirements: - cmake - pkg-config - make # [unix] - - {{ cdt('xorg-x11-proto-devel') }} # [unix] - - {{ cdt('mesa-libgl-devel') }} # [unix] - - {{ cdt('mesa-dri-drivers') }} # [unix] - - {{ cdt('libxrender-devel') }} # [unix] - - {{ cdt('libxrandr-devel') }} # [unix] - - {{ cdt('libxrandr') }} # [unix] + - {{ cdt('xorg-x11-proto-devel') }} # [linux] + - {{ cdt('mesa-libgl-devel') }} # [linux] + - {{ cdt('mesa-dri-drivers') }} # [linux] + - {{ cdt('libxrender-devel') }} # [linux] + - {{ cdt('libxrandr-devel') }} # [linux] + - {{ cdt('libxrandr') }} # [linux] host: - xorg-libx11 # [unix] - xorg-libxaw # [unix] @@ -43,7 +44,7 @@ requirements: - openexr - sdl2 - swig # [unix and not aarch64 and not ppc64le] - - mono # [unix and not aarch64 and not ppc64le] + - mono # [unix and not aarch64 and not ppc64le and not arm64] run: - xorg-libx11 # [unix] - xorg-libxaw # [unix] @@ -76,3 +77,4 @@ extra: recipe-maintainers: - seanyen - wolfv + - Tobias-Fischer