diff --git a/ThirdParty/rpmBuild/SOURCES/ParaView-4.3.1.patch_darwin b/ThirdParty/rpmBuild/SOURCES/ParaView-4.3.1.patch_darwin index 8c07db78f..3d1d8ce4b 100644 --- a/ThirdParty/rpmBuild/SOURCES/ParaView-4.3.1.patch_darwin +++ b/ThirdParty/rpmBuild/SOURCES/ParaView-4.3.1.patch_darwin @@ -5,8 +5,8 @@ diff -ruN ParaView-4.3.1_orig/Applications/ParaView-4.3.1_extra_install_Darwin.c +# +# Additional install rules for Mac OS X platforms +# -+INSTALL (DIRECTORY ../../buildObj/bin/paraview.app -+ DESTINATION ${PV_INSTALL_BIN_DIR} ++INSTALL (DIRECTORY buildObj/bin/paraview.app ++ DESTINATION ${CMAKE_INSTALL_PREFIX}/bin + USE_SOURCE_PERMISSIONS + COMPONENT Runtime) + diff --git a/ThirdParty/rpmBuild/SPECS/ParaView-4.3.1.spec b/ThirdParty/rpmBuild/SPECS/ParaView-4.3.1.spec index 4bf41924a..28436acbf 100644 --- a/ThirdParty/rpmBuild/SPECS/ParaView-4.3.1.spec +++ b/ThirdParty/rpmBuild/SPECS/ParaView-4.3.1.spec @@ -40,6 +40,10 @@ # Disable the generation of debuginfo packages %define debug_package %{nil} +# Turning off the Fascist build policy +# Useful for debugging the install section +%define _unpackaged_files_terminate_build 0 + # The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory %define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild %define _tmppath %{_topdir}/tmp @@ -155,9 +159,17 @@ Patch0: ParaView-4.3.1.patch_darwin # include development files in "make install" addCMakeVariable PARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON - %ifos darwin - # Additional installation rules for Mac OS X - addCMakeVariable PARAVIEW_EXTRA_INSTALL_RULES_FILE:FILEPATH=%{_topdir}/BUILD/%{name}-%{version}/Applications/ParaView-3.8.1_extra_install_Darwin.cmake +%ifos darwin + # Additional installation rules for Mac OSX + addCMakeVariable PARAVIEW_EXTRA_INSTALL_RULES_FILE:FILEPATH=%{_topdir}/BUILD/%{name}-v%{version}-source/Applications/ParaView-4.3.1_extra_install_Darwin.cmake + + # We activate the new Unix-style installation for Mac OS X + addCMakeVariable PARAVIEW_DO_UNIX_STYLE_INSTALLS:BOOL=ON + + # Recent version of Mac OSX (Yosemite) cannot compile ParaView with the gcc compiler + # Using clang instead + CC=clang + CXX=clang++ %endif # Add the value of _qmakePath for QT_QMAKE_EXECUTABLE @@ -190,6 +202,15 @@ Patch0: ParaView-4.3.1.patch_darwin cd buildObj make install DESTDIR=$RPM_BUILD_ROOT +%ifos darwin + # Cleaning up some strange install side effect from option + # PARAVIEW_DO_UNIX_STYLE_INSTALLS + # Need to revisit this section eventually. + if [ -d "$RPM_BUILD_ROOT/$RPM_BUILD_ROOT" ]; then + mv $RPM_BUILD_ROOT/$RPM_BUILD_ROOT/%{_installPrefix}/bin/* $RPM_BUILD_ROOT/%{_installPrefix}/bin + fi +%endif + # Creation of foam-extend specific .csh and .sh files" echo "" @@ -272,3 +293,4 @@ DOT_CSH_EOF %defattr(-,root,root) %{_installPrefix} + diff --git a/ThirdParty/tools/makeThirdPartyFunctionsForRPM b/ThirdParty/tools/makeThirdPartyFunctionsForRPM index 5cd7bc95c..b256f3944 100755 --- a/ThirdParty/tools/makeThirdPartyFunctionsForRPM +++ b/ThirdParty/tools/makeThirdPartyFunctionsForRPM @@ -127,6 +127,7 @@ rpm_make() echo "Making package $_PACKAGE using RPM." rpm_build ${_PACKAGE} ${_SPECFILE} ${_ADDITIONALFLAGS} "$@" + #rpm_build_install_stage_only ${_PACKAGE} ${_SPECFILE} ${_ADDITIONALFLAGS} "$@" fi # Install RPM package if not done already @@ -178,6 +179,31 @@ rpm_build() rpmbuild --define "_topdir $buildBase" --dbpath $buildBase/rpmDB -bb ./SPECS/$specFile "$@" } +# +# Build a RPM file using the package SPEC file. This function will only call the "%install" stage. +# Useful for debugging the "%install" stage. +# +rpm_build_install_stage_only() +{ + package="$1" + specFile="$2" + shift 2 + + cd $buildBase + + [ -e ./SPECS/$specFile ] || { + echo "rpm_build: Error: missing SPEC file for package $package. Aborting." + exit -1 + } + + #Build RPM package + echo "Building package $package using SPEC file : $specFile. Optional args: $@" + #rpmbuild --define "_topdir $buildBase" --dbpath $buildBase/rpmDB --clean -bb ./SPECS/$specFile "$@" + # + # Let's keep the compilation directory alive for now in order to facilitate postmortems of failed compilations + rpmbuild --define "_topdir $buildBase" --dbpath $buildBase/rpmDB --short-circuit -bi ./SPECS/$specFile "$@" +} + # # Uninstall a package using its RPM #