mirror of
https://abf.rosa.ru/djam/freecad.git
synced 2025-02-23 14:02:52 +00:00
apply fedora patches
This commit is contained in:
parent
022aeb8972
commit
10b28cb935
4 changed files with 335 additions and 0 deletions
189
freecad-0.13-pycxx.patch
Normal file
189
freecad-0.13-pycxx.patch
Normal file
|
@ -0,0 +1,189 @@
|
|||
diff -Naur freecad-0.13.a057590.orig/CMakeLists.txt freecad-0.13.a057590/CMakeLists.txt
|
||||
--- freecad-0.13.a057590.orig/CMakeLists.txt 2013-01-12 08:10:36.000000000 -0600
|
||||
+++ freecad-0.13.a057590/CMakeLists.txt 2013-01-17 16:04:52.117940071 -0600
|
||||
@@ -73,6 +73,13 @@
|
||||
SET(CMAKE_INSTALL_INCLUDEDIR include CACHE PATH "Output directory for header files")
|
||||
SET(CMAKE_INSTALL_DOCDIR doc CACHE PATH "Output directory for documentation and license files")
|
||||
|
||||
+SET(PYCXX_INCLUDE_DIR
|
||||
+ "${CMAKE_CURRENT_LIST_DIR}/src" CACHE PATH
|
||||
+ "Path to the directory containing PyCXX's CXX/Config.hxx include file")
|
||||
+SET(PYCXX_SOURCE_DIR
|
||||
+ "${CMAKE_CURRENT_LIST_DIR}/src/CXX" CACHE PATH
|
||||
+ "Path to the directory containing PyCXX's cxxextensions.c source file")
|
||||
+
|
||||
# used as compiler defines
|
||||
SET(RESOURCEDIR "${CMAKE_INSTALL_DATADIR}")
|
||||
SET(DOCDIR "${CMAKE_INSTALL_DOCDIR}")
|
||||
@@ -201,6 +208,10 @@
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
|
||||
+# -------------------------------- PyCXX --------------------------------
|
||||
+
|
||||
+ find_package(PyCXX REQUIRED)
|
||||
+
|
||||
# -------------------------------- OpenCasCade --------------------------------
|
||||
|
||||
#first, look for OpenCASCADE Community Edition (OCE)
|
||||
diff -Naur freecad-0.13.a057590.orig/src/Base/CMakeLists.txt freecad-0.13.a057590/src/Base/CMakeLists.txt
|
||||
--- freecad-0.13.a057590.orig/src/Base/CMakeLists.txt 2013-01-12 08:10:36.000000000 -0600
|
||||
+++ freecad-0.13.a057590/src/Base/CMakeLists.txt 2013-01-17 16:06:36.985515701 -0600
|
||||
@@ -124,20 +124,6 @@
|
||||
SOURCE_GROUP("zipios" FILES ${zipios_SRCS})
|
||||
endif ()
|
||||
|
||||
-SET(pycxx_SRCS
|
||||
- ../CXX/Config.hxx
|
||||
- ../CXX/cxxextensions.c
|
||||
- ../CXX/cxx_extensions.cxx
|
||||
- ../CXX/cxxsupport.cxx
|
||||
- ../CXX/Exception.hxx
|
||||
- ../CXX/Extensions.hxx
|
||||
- ../CXX/IndirectPythonInterface.cxx
|
||||
- ../CXX/IndirectPythonInterface.hxx
|
||||
- ../CXX/Objects.hxx
|
||||
- ../CXX/Version.hxx
|
||||
- ../CXX/WrapPython.h
|
||||
-)
|
||||
-SOURCE_GROUP("pycxx" FILES ${pycxx_SRCS})
|
||||
|
||||
SET(FreeCADBase_XML_SRCS
|
||||
AxisPy.xml
|
||||
@@ -279,7 +265,6 @@
|
||||
)
|
||||
|
||||
SET(FreeCADBase_SRCS
|
||||
- ${pycxx_SRCS}
|
||||
${FreeCADBase_CPP_SRCS}
|
||||
${FreeCADBase_HPP_SRCS}
|
||||
${FreeCADBase_XML_SRCS}
|
||||
@@ -310,6 +295,9 @@
|
||||
list(APPEND FreeCADBase_SRCS ${zipios_SRCS})
|
||||
endif(FREECAD_USE_EXTERNAL_ZIPIOS)
|
||||
|
||||
+include_directories(${PYCXX_INCLUDE_DIR})
|
||||
+list(APPEND FreeCADBase_SRCS ${PYCXX_SOURCES})
|
||||
+SOURCE_GROUP("pycxx" FILES ${PYCXX_SOURCES})
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(-D_PreComp_)
|
||||
This patch adds an option to FreeCAD's cmake to specify an external
|
||||
PyCXX. PyCXX doesn't really have a standard location, so this will try
|
||||
to guess a couple of places, but best is to specify on the cmake command
|
||||
line:
|
||||
|
||||
cmake -DPYCXX_INCLUDE_DIR=/usr/include/python2.7 \
|
||||
-DPYCXX_SOURCE_DIR=/usr/share/python2.7/CXX
|
||||
|
||||
diff -ruN FreeCAD-0.12.5284.orig/cMake/FindPyCXX.cmake FreeCAD-0.12.5284/cMake/FindPyCXX.cmake
|
||||
--- FreeCAD-0.12.5284.orig/cMake/FindPyCXX.cmake 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ FreeCAD-0.12.5284/cMake/FindPyCXX.cmake 2012-06-25 01:30:25.000000000 -0500
|
||||
@@ -0,0 +1,107 @@
|
||||
+# Locate PyCXX headers and source files
|
||||
+
|
||||
+# This module defines
|
||||
+# PYCXX_INCLUDE_DIR
|
||||
+# PYCXX_SOURCE_DIR
|
||||
+# PYCXX_FOUND
|
||||
+# PYCXX_SOURCES
|
||||
+#
|
||||
+# The PYCXX_*_DIR variables can be set to tell this module where
|
||||
+# the files are.
|
||||
+
|
||||
+
|
||||
+# There's no standard location for PyCXX.
|
||||
+#
|
||||
+# The authors' example is to put it in "~\" [sic].
|
||||
+#
|
||||
+# Ubuntu puts the includes into /usr/include/python2.7/CXX and sources into
|
||||
+# /usr/share/python2.7/CXX.
|
||||
+#
|
||||
+# The Zultron Fedora RPM does the same as Ubuntu.
|
||||
+
|
||||
+set(PYCXX_FOUND "YES")
|
||||
+
|
||||
+# find the header directory
|
||||
+if(PYCXX_INCLUDE_DIR)
|
||||
+ # headers better be in there
|
||||
+ if(NOT EXISTS "${PYCXX_INCLUDE_DIR}/CXX/Config.hxx")
|
||||
+ if(PYCXX_FIND_REQUIRED)
|
||||
+ MESSAGE(FATAL_ERROR
|
||||
+ "PyCXX: could not find CXX/Config.hxx in PYCXX_INCLUDE_DIR "
|
||||
+ "${PYCXX_INCLUDE_DIR}")
|
||||
+ else(PYCXX_FIND_REQUIRED)
|
||||
+ MESSAGE(WARNING
|
||||
+ "PyCXX: could not find CXX/Config.hxx in PYCXX_INCLUDE_DIR "
|
||||
+ "${PYCXX_INCLUDE_DIR}")
|
||||
+ unset(PYCXX_FOUND)
|
||||
+ endif(PYCXX_FIND_REQUIRED)
|
||||
+ endif(NOT EXISTS "${PYCXX_INCLUDE_DIR}/CXX/Config.hxx")
|
||||
+else(PYCXX_INCLUDE_DIR)
|
||||
+ # check in 'standard' places
|
||||
+ find_path(PYCXX_INCLUDE_DIR CXX/Config.hxx
|
||||
+ ${PYTHON_INCLUDE_DIR}
|
||||
+ "${CMAKE_CURRENT_LIST_DIR}/..")
|
||||
+ if(NOT PYCXX_INCLUDE_DIR)
|
||||
+ if(PYCXX_FIND_REQUIRED)
|
||||
+ MESSAGE(FATAL_ERROR
|
||||
+ "PyCXX not found; please set PYCXX_INCLUDE_DIR to "
|
||||
+ "the location of CXX/Config.hxx")
|
||||
+ else(PYCXX_FIND_REQUIRED)
|
||||
+ MESSAGE(STATUS "PyCXX not found")
|
||||
+ unset(PYCXX_FOUND)
|
||||
+ endif(PYCXX_FIND_REQUIRED)
|
||||
+ endif(NOT PYCXX_INCLUDE_DIR)
|
||||
+endif(PYCXX_INCLUDE_DIR)
|
||||
+
|
||||
+# find the sources directory
|
||||
+if(PYCXX_SOURCE_DIR)
|
||||
+ # source directory specified, they'd better be there
|
||||
+ if(NOT EXISTS "${PYCXX_SOURCE_DIR}/cxxextensions.c")
|
||||
+ if(PYCXX_FIND_REQUIRED)
|
||||
+ MESSAGE(FATAL_ERROR
|
||||
+ "PyCXX: cxxextensions.c not found in PYCXX_INCLUDE_DIR "
|
||||
+ "${PYCXX_INCLUDE_DIR}")
|
||||
+ else(PYCXX_FIND_REQUIRED)
|
||||
+ MESSAGE(WARNING
|
||||
+ "PyCXX: cxxextensions.c not found in PYCXX_INCLUDE_DIR "
|
||||
+ "${PYCXX_INCLUDE_DIR}")
|
||||
+ unset(PYCXX_FOUND)
|
||||
+ endif(PYCXX_FIND_REQUIRED)
|
||||
+ endif(NOT EXISTS "${PYCXX_SOURCE_DIR}/cxxextensions.c")
|
||||
+else(PYCXX_SOURCE_DIR)
|
||||
+ # check in 'standard' places
|
||||
+ find_path(PYCXX_SOURCE_DIR cxxextensions.c
|
||||
+ "${PYCXX_INCLUDE_DIR}/CXX"
|
||||
+ "${PYCXX_INCLUDE_DIR}/Src"
|
||||
+ "${PYTHON_INCLUDE_DIR}/CXX"
|
||||
+ "${PYTHON_INCLUDE_DIR}/Src"
|
||||
+ "${CMAKE_CURRENT_LIST_DIR}/../Src"
|
||||
+ "${CMAKE_CURRENT_LIST_DIR}/../CXX")
|
||||
+ if(NOT PYCXX_SOURCE_DIR)
|
||||
+ if(PYCXX_FIND_REQUIRED)
|
||||
+ MESSAGE(FATAL_ERROR
|
||||
+ "PyCXX not found; please set PYCXX_SOURCE_DIR to "
|
||||
+ "the location of cxxextensions.c")
|
||||
+ else(PYCXX_FIND_REQUIRED)
|
||||
+ MESSAGE(STATUS "PyCXX not found")
|
||||
+ unset(PYCXX_FOUND)
|
||||
+ endif(PYCXX_FIND_REQUIRED)
|
||||
+ endif(NOT PYCXX_SOURCE_DIR)
|
||||
+endif(PYCXX_SOURCE_DIR)
|
||||
+
|
||||
+# see what we've got
|
||||
+if(PYCXX_FOUND)
|
||||
+ MESSAGE(STATUS "PyCXX found:")
|
||||
+ MESSAGE(STATUS " Headers: ${PYCXX_INCLUDE_DIR}")
|
||||
+ MESSAGE(STATUS " Sources: ${PYCXX_SOURCE_DIR}")
|
||||
+
|
||||
+ # Build the list of sources for convenience
|
||||
+ set(PYCXX_SOURCES
|
||||
+ ${PYCXX_SOURCE_DIR}/cxxextensions.c
|
||||
+ ${PYCXX_SOURCE_DIR}/cxx_extensions.cxx
|
||||
+ ${PYCXX_SOURCE_DIR}/cxxsupport.cxx
|
||||
+ ${PYCXX_SOURCE_DIR}/IndirectPythonInterface.cxx
|
||||
+ )
|
||||
+else(PYCXX_FOUND)
|
||||
+ MESSAGE(STATUS "PyCXX not found")
|
||||
+endif(PYCXX_FOUND)
|
130
freecad-0.13-qt4_cmake.patch
Normal file
130
freecad-0.13-qt4_cmake.patch
Normal file
|
@ -0,0 +1,130 @@
|
|||
diff -Naur freecad-0.13.1830.orig/cMake/FreeCadMacros.cmake freecad-0.13.1830.qt4/cMake/FreeCadMacros.cmake
|
||||
--- freecad-0.13.1830.orig/cMake/FreeCadMacros.cmake 2013-02-02 11:09:17.000000000 -0600
|
||||
+++ freecad-0.13.1830.qt4/cMake/FreeCadMacros.cmake 2014-01-13 18:32:47.637368958 -0600
|
||||
@@ -167,67 +167,48 @@
|
||||
#
|
||||
#endmacro(qt4_wrap_ui)
|
||||
|
||||
-
|
||||
-# This is a special version of the built in macro qt4_add_resources that generates .cpp files
|
||||
-#
|
||||
-#macro(fc_add_resources outfiles )
|
||||
-# #QT4_EXTRACT_OPTIONS(rcc_files rcc_options ${ARGN})
|
||||
-# set(ARGN )
|
||||
-# foreach (it ${rcc_files})
|
||||
-# get_filename_component(outfilename ${it} NAME_WE)
|
||||
-# get_filename_component(infile ${it} ABSOLUTE)
|
||||
-# get_filename_component(rc_path ${infile} PATH)
|
||||
-# set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cpp)
|
||||
-# # parse file for dependencies
|
||||
-# # all files are absolute paths or relative to the location of the qrc file
|
||||
-# file(READ "${infile}" _RC_FILE_CONTENTS)
|
||||
-# string(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
|
||||
-# set(_RC_DEPENDS)
|
||||
-# foreach(_RC_FILE ${_RC_FILES})
|
||||
-# string(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
|
||||
-# string(REGEX MATCH "^/|([A-Za-z]:/)" _ABS_PATH_INDICATOR "${_RC_FILE}")
|
||||
-# if(NOT _ABS_PATH_INDICATOR)
|
||||
-# set(_RC_FILE "${rc_path}/${_RC_FILE}")
|
||||
-# endif(NOT _ABS_PATH_INDICATOR)
|
||||
-# set(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
|
||||
-# endforeach(_RC_FILE)
|
||||
-# add_custom_command(OUTPUT ${outfile}
|
||||
-# COMMAND ${QT_RCC_EXECUTABLE}
|
||||
-# ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
|
||||
-# MAIN_DEPENDENCY ${infile}
|
||||
-# DEPENDS ${_RC_DEPENDS})
|
||||
-# set(${outfiles} ${${outfiles}} ${outfile})
|
||||
-# endforeach (it)
|
||||
-#endmacro(fc_add_resources)
|
||||
-
|
||||
MACRO (fc_add_resources outfiles )
|
||||
- QT4_EXTRACT_OPTIONS(rcc_files rcc_options ${ARGN})
|
||||
+ QT4_EXTRACT_OPTIONS(rcc_files rcc_options rcc_target ${ARGN})
|
||||
+
|
||||
+ foreach (it ${rcc_files})
|
||||
+ get_filename_component(outfilename ${it} NAME_WE)
|
||||
+ get_filename_component(infile ${it} ABSOLUTE)
|
||||
+ get_filename_component(rc_path ${infile} PATH)
|
||||
+ set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cpp)
|
||||
+
|
||||
+ set(_RC_DEPENDS)
|
||||
+ if(EXISTS "${infile}")
|
||||
+ # parse file for dependencies
|
||||
+ # all files are absolute paths or relative to the location of the qrc file
|
||||
+ file(READ "${infile}" _RC_FILE_CONTENTS)
|
||||
+ string(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
|
||||
+ foreach(_RC_FILE ${_RC_FILES})
|
||||
+ string(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
|
||||
+ if(NOT IS_ABSOLUTE "${_RC_FILE}")
|
||||
+ set(_RC_FILE "${rc_path}/${_RC_FILE}")
|
||||
+ endif()
|
||||
+ set(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
|
||||
+ endforeach()
|
||||
+ unset(_RC_FILES)
|
||||
+ unset(_RC_FILE_CONTENTS)
|
||||
+ # Since this cmake macro is doing the dependency scanning for these files,
|
||||
+ # let's make a configured file and add it as a dependency so cmake is run
|
||||
+ # again when dependencies need to be recomputed.
|
||||
+ QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends)
|
||||
+ configure_file("${infile}" "${out_depends}" COPY_ONLY)
|
||||
+ else()
|
||||
+ # The .qrc file does not exist (yet). Let's add a dependency and hope
|
||||
+ # that it will be generated later
|
||||
+ set(out_depends)
|
||||
+ endif()
|
||||
|
||||
- FOREACH (it ${rcc_files})
|
||||
- GET_FILENAME_COMPONENT(outfilename ${it} NAME_WE)
|
||||
- GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
|
||||
- GET_FILENAME_COMPONENT(rc_path ${infile} PATH)
|
||||
- SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cpp)
|
||||
- # parse file for dependencies
|
||||
- # all files are absolute paths or relative to the location of the qrc file
|
||||
- FILE(READ "${infile}" _RC_FILE_CONTENTS)
|
||||
- STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
|
||||
- SET(_RC_DEPENDS)
|
||||
- FOREACH(_RC_FILE ${_RC_FILES})
|
||||
- STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
|
||||
- STRING(REGEX MATCH "^/|([A-Za-z]:/)" _ABS_PATH_INDICATOR "${_RC_FILE}")
|
||||
- IF(NOT _ABS_PATH_INDICATOR)
|
||||
- SET(_RC_FILE "${rc_path}/${_RC_FILE}")
|
||||
- ENDIF(NOT _ABS_PATH_INDICATOR)
|
||||
- SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
|
||||
- ENDFOREACH(_RC_FILE)
|
||||
- ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
+ add_custom_command(OUTPUT ${outfile}
|
||||
COMMAND ${QT_RCC_EXECUTABLE}
|
||||
ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
|
||||
MAIN_DEPENDENCY ${infile}
|
||||
- DEPENDS ${_RC_DEPENDS})
|
||||
- SET(${outfiles} ${${outfiles}} ${outfile})
|
||||
- ENDFOREACH (it)
|
||||
+ DEPENDS ${_RC_DEPENDS} "${out_depends}" VERBATIM)
|
||||
+ set(${outfiles} ${${outfiles}} ${outfile})
|
||||
+ endforeach ()
|
||||
|
||||
ENDMACRO (fc_add_resources)
|
||||
|
||||
diff -Naur freecad-0.13.1830.orig/CMakeLists.txt freecad-0.13.1830.qt4/CMakeLists.txt
|
||||
--- freecad-0.13.1830.orig/CMakeLists.txt 2014-01-10 10:56:16.648269370 -0600
|
||||
+++ freecad-0.13.1830.qt4/CMakeLists.txt 2014-01-13 18:27:18.895600935 -0600
|
||||
@@ -325,15 +325,15 @@
|
||||
macro(fc_wrap_cpp outfiles )
|
||||
# get include dirs
|
||||
QT4_GET_MOC_FLAGS(moc_flags)
|
||||
- QT4_EXTRACT_OPTIONS(moc_files moc_options ${ARGN})
|
||||
+ QT4_EXTRACT_OPTIONS(moc_files moc_options moc_target ${ARGN})
|
||||
# fixes bug 0000585: bug with boost 1.48
|
||||
SET(moc_options ${moc_options} -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
|
||||
|
||||
foreach(it ${moc_files})
|
||||
get_filename_component(it ${it} ABSOLUTE)
|
||||
QT4_MAKE_OUTPUT_FILE(${it} moc_ cpp outfile)
|
||||
- QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}")
|
||||
- set(${outfiles} ${${outfiles}} ${outfile})
|
||||
+ QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}")
|
||||
+ list(APPEND outfiles ${outfile})
|
||||
add_file_dependencies(${it} ${outfile})
|
||||
endforeach(it)
|
||||
endmacro(fc_wrap_cpp)
|
10
freecad-3rdParty.patch
Normal file
10
freecad-3rdParty.patch
Normal file
|
@ -0,0 +1,10 @@
|
|||
diff -Naur freecad-0.12-svn5325.orig/src/CMakeLists.txt freecad-0.12-svn5325/src/CMakeLists.txt
|
||||
--- freecad-0.12-svn5325.orig/src/CMakeLists.txt 2011-03-03 09:57:25.000000000 -0600
|
||||
+++ freecad-0.12-svn5325/src/CMakeLists.txt 2011-12-21 10:58:18.396896819 -0600
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
add_subdirectory(Build)
|
||||
-add_subdirectory(3rdParty)
|
||||
add_subdirectory(Base)
|
||||
add_subdirectory(App)
|
||||
add_subdirectory(Main)
|
|
@ -9,6 +9,11 @@ Source0: http://dfn.dl.sourceforge.net/sourceforge/free-cad/freecad-%{version}.t
|
|||
Source1: freecad.desktop
|
||||
Source2: freecad.1
|
||||
Source3: %{name}.rpmlintrc
|
||||
Patch0: freecad-3rdParty.patch
|
||||
Patch1: freecad-0.13-pycxx.patch
|
||||
# Patch to build with non-backward compatible change in QT4.
|
||||
Patch3: freecad-0.13-qt4_cmake.patch
|
||||
|
||||
BuildRequires: cmake
|
||||
BuildRequires: eigen3
|
||||
BuildRequires: gcc-gfortran
|
||||
|
@ -61,6 +66,7 @@ Development files for FreeCAD.
|
|||
|
||||
%prep
|
||||
%setup -q
|
||||
%apply_patches
|
||||
|
||||
%build
|
||||
%define Werror_cflags %nil
|
||||
|
|
Loading…
Add table
Reference in a new issue