Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ option(MRTRIX_USE_PCH "Use precompiled headers" ON)
option(MRTRIX_PYTHON_SOFTLINK "Build directory softlink to Python source code rather than copying" ON)
option(MRTRIX_BUILD_STATIC "Build MRtrix's library statically" OFF)
option(MRTRIX_USE_LLD "Use lld as the linker" OFF)
option(MRTRIX_IGNORE_VERSION_MISMATCH "Ignore version mismatch between git tag and MRtrix base version" OFF)

option(MRTRIX_USE_SYSTEM_EIGEN "Use system-installed Eigen3 library" OFF)
option(MRTRIX_USE_SYSTEM_JSON "Use system-installed Json for Modern C++ library" OFF)
Expand Down
8 changes: 6 additions & 2 deletions cmake/FindVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ if(EXISTS ${ROOT_DIR}/.git)

if(NOT MRTRIX_GIT_TAG_ERROR AND NOT MRTRIX_GIT_COMMIT_ERROR)
message(VERBOSE "Git tag: ${MRTRIX_GIT_TAG}; Git commit: ${MRTRIX_GIT_COMMIT}")
if(NOT "${MRTRIX_GIT_TAG}" STREQUAL ${MRTRIX_BASE_VERSION})
message(FATAL_ERROR "MRtrix3 base version does not match the git tag!")
if(MRTRIX_IGNORE_VERSION_MISMATCH OR DEFINED ENV{MRTRIX_IGNORE_VERSION_MISMATCH})
message(STATUS "MRTRIX_IGNORE_VERSION_MISMATCH is set; ignoring version mismatch between git tag and MRtrix base version.")
else()
if(NOT "${MRTRIX_GIT_TAG}" STREQUAL ${MRTRIX_BASE_VERSION})
message(FATAL_ERROR "MRtrix3 base version does not match the git tag!")
endif()
endif()
set(MRTRIX_VERSION ${MRTRIX_GIT_COMMIT})
else()
Expand Down
12 changes: 10 additions & 2 deletions packaging/macos/build
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

TAGNAME="$1"

# Optional desired archive root directory name.
OUTNAME="$2"
if [ -z "$OUTNAME" ]; then
OUTNAME="mrtrix3"
fi

CMAKE=$(which cmake)
ORIG_PATH=${PATH}
PATH=$(getconf PATH)
Expand Down Expand Up @@ -171,8 +177,10 @@ cd ${PREFIX}/bin/shview.app/Contents
ln -s ../../../bin/plugins

cd ${PREFIX}/..
tar cfJ mrtrix3-${OS}-${TAGNAME}.tar.xz mrtrix3
rm -rf ${PREFIX}

mv mrtrix3 "${OUTNAME}"
tar cfJ "${OUTNAME}.tar.xz" "${OUTNAME}"
rm -rf "${OUTNAME}"

TOTAL_SECONDS=$((FFTW_SECONDS + EIGEN_SECONDS + QT_SECONDS + MRTRIX_SECONDS))
if [[ ! -n "$DEPCACHE" ]]; then
Expand Down
13 changes: 9 additions & 4 deletions packaging/package-linux-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

running_dir=$(pwd)
source_dir=$(realpath $1)
root_dir_name="$2"
if [ -z "$root_dir_name" ]; then root_dir_name="mrtrix3"; fi
tarball_dir=$running_dir/mrtrix_tarball_tmp

set -e
Expand Down Expand Up @@ -83,8 +85,11 @@ cp -r $install_dir/* appdir/usr

printf "Creating the tarball.\n"

rm -rf appdir/usr/translations # Remove translations since we don't need them
cp $source_dir/install_mime_types.sh appdir/usr
cp $source_dir/set_path appdir/usr
tar -czf mrtrix.tar.gz -C appdir/usr .
# Move the packaged files under a top-level directory
mv appdir/usr "appdir/${root_dir_name}"
rm -rf "appdir/${root_dir_name}/translations" # Remove translations since we don't need them
cp "$source_dir/install_mime_types.sh" "appdir/${root_dir_name}"
cp "$source_dir/set_path" "appdir/${root_dir_name}"

tar -czf mrtrix.tar.gz -C appdir "${root_dir_name}"
cp mrtrix.tar.gz $running_dir
Loading