Bug 1152696

Summary: MinGW CMake macro causes CPack packaging to fail.
Product: [Fedora] Fedora Reporter: Richard Shaw <hobbes1069>
Component: mingw-filesystemAssignee: Erik van Pienbroek <erik-fedora>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: alex94puchades, drizt72, erik-fedora, kalevlember, rjones
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: mingw-filesystem-100-1.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1454501 (view as bug list) Environment:
Last Closed: 2015-04-21 18:28:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Richard Shaw 2014-10-14 18:14:19 UTC
Description of problem:
The mingw{32,64}-cmake command uses absolute paths to specify certain locations. If the cmake configuration honors these paths then it breaks CPack which does a fake install for packaging purposes.

Version-Release number of selected component (if applicable):

Actual results:
An error is generated:
Run CPack packaging tool...
/usr/bin/cpack --config ./CPackConfig.cmake
CPack: Create package using NSIS
CPack: Install projects
CPack: - Run preinstall target for: codec2
CPack: - Install project: codec2
CMake Error at /home/build/mingw32/codec2/src/cmake_install.cmake:37 (message):
  ABSOLUTE path INSTALL DESTINATION forbidden (by caller):

Expected results:
Package is created correctly.

Additional info:
The main problem seems to be CMAKE_INSTALL_LIBDIR...

$ rpm -E %{mingw32_cmake}
unset $(/usr/bin/env | egrep '^(w+)=(.*)$' | egrep -vw 'PWD|USER|LANG' | /usr/bin/cut -d= -f1);
  if test -z "$PATH_ORIG" ; then
    PATH_ORIG="$PATH"; export PATH_ORIG;
  PATH="/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH_ORIG"; export PATH;
  HOST_CC=gcc; export HOST_CC;
  for i in `ls -1 ${_PREFIX}* | grep -v 'gcc-'`; do
    x=`echo $i|sed "s,${_PREFIX},,"|tr "a-z+-." "A-ZX__"`;
    declare -x $x="$i" ; export $x;
  unset _PREFIX;
  CC="${MINGW32_CC:-i686-w64-mingw32-gcc}"; export CC;
  CFLAGS="${MINGW32_CFLAGS:- -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4}"; export CFLAGS;
  if [ -x "/usr/bin/i686-w64-mingw32-g++" ]; then
    CXX="${MINGW32_CXX:-i686-w64-mingw32-g++}"; export CXX;
    CXXFLAGS="${MINGW32_CXXFLAGS:- -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4}"; export CXXFLAGS;
    CXX=; export CXX;
    ac_cv_prog_CXX=no; export ac_cv_prog_CXX;
  for i in `ls /usr/i686-w64-mingw32/sys-root/mingw/bin/*|grep -- "-config$"` ; do
    x=`basename $i|tr "a-z+-." "A-ZX_"`;
    declare -x $x="$i" ; export $x;
  unset x i ;
  PKG_CONFIG_LIBDIR="/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig:/usr/i686-w64-mingw32/sys-root/mingw/share/pkgconfig"; export PKG_CONFIG_LIBDIR;
  if test -f CMakeLists.txt; then __mingw32_topdir=.; \
  elif test -f ../CMakeLists.txt; then __mingw32_topdir=..; \
  else __mingw32_topdir=""; fi; \
  PATH=/usr/i686-w64-mingw32/bin:$PATH /usr/bin/cmake \
        -DCMAKE_INSTALL_PREFIX:PATH=/usr/i686-w64-mingw32/sys-root/mingw \
        -DCMAKE_INSTALL_LIBDIR:PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib \
        -DINCLUDE_INSTALL_DIR:PATH=/usr/i686-w64-mingw32/sys-root/mingw/include \
        -DLIB_INSTALL_DIR:PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib \
        -DSYSCONF_INSTALL_DIR:PATH=/usr/i686-w64-mingw32/sys-root/mingw/etc \
        -DSHARE_INSTALL_PREFIX:PATH=/usr/i686-w64-mingw32/sys-root/mingw/share \
        -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/Toolchain-mingw32.cmake \
        ${MINGW_CMAKE_ARGS} \
        ${MINGW32_CMAKE_ARGS} \
        "$@" $__mingw32_topdir

Comment 1 Jaroslav Reznik 2015-03-03 16:22:06 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:

Comment 2 Fedora Update System 2015-04-11 20:33:55 UTC
mingw-filesystem-100-1.fc22 has been submitted as an update for Fedora 22.

Comment 3 Fedora Update System 2015-04-11 20:34:36 UTC
mingw-filesystem-100-1.fc21 has been submitted as an update for Fedora 21.

Comment 4 Fedora Update System 2015-04-11 20:35:07 UTC
mingw-filesystem-100-1.fc20 has been submitted as an update for Fedora 20.

Comment 5 Fedora Update System 2015-04-12 18:00:17 UTC
Package mingw-filesystem-100-1.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mingw-filesystem-100-1.fc22'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2015-04-21 18:28:19 UTC
mingw-filesystem-100-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2015-04-21 19:00:14 UTC
mingw-filesystem-100-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2015-04-21 19:13:06 UTC
mingw-filesystem-100-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Alex Puchades 2017-05-19 18:28:31 UTC
I'm running Fedora 25 and this bug is still present.

$ rpm -q mingw64-filesystem