Skip to content

Commit

Permalink
[Patch] Install Move Tools to shared/amrex
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Oct 18, 2023
1 parent f39a06a commit da096fc
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
72 changes: 72 additions & 0 deletions recipes/amrex/3599.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
From 538ec2382f4e00baa9d1a916b1ef95ce7cef3502 Mon Sep 17 00:00:00 2001
From: Axel Huebl <[email protected]>
Date: Wed, 18 Oct 2023 09:58:37 -0700
Subject: [PATCH] Install Move Tools to `shared/amrex`

Packaging AMReX for Conda, we realized that we break with
common conventions on Unix systems by installing a top-level
`Tools/` directory.

This moves its content in both the build directory and the
install destination to `share/amrex/` and `<CMakePkgRoot>/Modules/`,
respectively.
---
Tools/CMake/AMReXInstallHelpers.cmake | 29 ++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/Tools/CMake/AMReXInstallHelpers.cmake b/Tools/CMake/AMReXInstallHelpers.cmake
index 0720efb4cf9..4d967700496 100644
--- a/Tools/CMake/AMReXInstallHelpers.cmake
+++ b/Tools/CMake/AMReXInstallHelpers.cmake
@@ -26,7 +26,7 @@ function (install_amrex_targets)
else()
set(CMAKE_FILES_DIR lib/cmake/AMReX)
endif()
- set(MODULE_PATH Tools/CMake) # Relative path to top level installation/build-tree
+ set(MODULE_PATH ${CMAKE_FILES_DIR}/Modules) # Relative path to top level installation/build-tree

# Write Config file -- this is designed to work for both install and build trees
configure_package_config_file(${AMREX_CMAKE_MODULES_PATH}/AMReXConfig.cmake.in
@@ -88,11 +88,17 @@ function (install_amrex_targets)
# Install Tools directory
install(
DIRECTORY
- ${PROJECT_SOURCE_DIR}/Tools/CMake
- ${PROJECT_SOURCE_DIR}/Tools/C_scripts
- ${PROJECT_SOURCE_DIR}/Tools/typechecker
+ ${PROJECT_SOURCE_DIR}/Tools/C_scripts
+ ${PROJECT_SOURCE_DIR}/Tools/typechecker
DESTINATION
- Tools
+ share/amrex
+ USE_SOURCE_PERMISSIONS
+ )
+ install(
+ DIRECTORY
+ ${PROJECT_SOURCE_DIR}/Tools/CMake/
+ DESTINATION
+ ${MODULE_PATH}
USE_SOURCE_PERMISSIONS
)
endif()
@@ -106,11 +112,16 @@ function (install_amrex_targets)
# Copy Tools directory to build tree
file(
COPY
- ${PROJECT_SOURCE_DIR}/Tools/CMake
- ${PROJECT_SOURCE_DIR}/Tools/C_scripts
- ${PROJECT_SOURCE_DIR}/Tools/typechecker
+ ${PROJECT_SOURCE_DIR}/Tools/C_scripts
+ ${PROJECT_SOURCE_DIR}/Tools/typechecker
+ DESTINATION
+ ${PROJECT_BINARY_DIR}/share/amrex
+ )
+ file(
+ COPY
+ ${PROJECT_SOURCE_DIR}/Tools/CMake/
DESTINATION
- ${PROJECT_BINARY_DIR}/Tools
+ ${PROJECT_BINARY_DIR}/${MODULE_PATH}
)


4 changes: 4 additions & 0 deletions recipes/amrex/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ package:
source:
url: https://github.com/AMReX-Codes/amrex/archive/refs/tags/{{ version }}.tar.gz
sha256: e76e4787735c06ae747eaf57a682b12fed297ef2d5c7727051e20d34e4e79ce3
patches:
# Install CMake Scripts from Tools/CMake/ to <CMakePkgRoot>/Modules/
# https://github.com/AMReX-Codes/amrex/pull/3599
- 3599.patch

build:
number: 0
Expand Down

0 comments on commit da096fc

Please sign in to comment.