Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37044675
en ru br
Репозитории ALT

Группа :: Графика
Пакет: freecad

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%define _unpackaged_files_terminate_build 1
%add_python3_path %_libdir/freecad/Mod %_libdir/freecad/Ext/*
%add_python3_req_skip FreeCADGui FreeCAD
%add_findprov_skiplist %_libdir/freecad/Mod/* %_libdir/freecad/Ext/*
%def_with bundled_libs
%def_with glvnd
%define oname freecad
%define ldir %_libdir/%oname
%ifndef build_parallel_jobs
%define build_parallel_jobs 7
%endif
%define git_rev aaee1b5e39
%define git_date 05.12.2022

Name:    freecad
Version: 0.20.2
Release: alt3.1
Epoch:   1
Summary: OpenSource 3D CAD modeller
License: LGPL-2.0+
Group:   Graphics
Url:     http://free-cad.sourceforge.net/
# VCS:   https://github.com/FreeCAD/FreeCAD
Packager: Andrey Cherepanov <cas at altlinux.org>

Source: %name-%version.tar
Source1: freecad.1

%if_without bundled_libs
Patch1: %name-remove-3rdParty.patch
%endif
Patch2: freecad-0.19.2-alt-boost-link.patch
Patch3: freecad-alt-fix-icon-name-in-menu.patch
Patch4: freecad-alt-remove-unused-header.patch
Patch5: 0001-libE57Format-fix-compile-using-gcc13.patch

Provides:  free-cad = %version-%release
Obsoletes: free-cad < %version-%release

ExcludeArch: armh

BuildRequires(pre): cmake
BuildRequires(pre): rpm-build-xdg
BuildRequires(pre): rpm-build-ninja
BuildRequires(pre): rpm-build-python3
BuildRequires: qt5-base-devel
BuildRequires: qt5-assistant
BuildRequires: qt5-designer
BuildRequires: qt5-sql-sqlite3
BuildRequires: qt5-svg-devel
BuildRequires: qt5-tools-devel
BuildRequires: qt5-tools-devel-static
BuildRequires: qt5-webkit-devel
BuildRequires: qt5-x11extras-devel
BuildRequires: qt5-phonon-devel
BuildRequires: qt5-xmlpatterns-devel
BuildRequires: python3-module-PySide2
BuildRequires: pyside2-tools
BuildRequires: python3-module-PySide2-devel
BuildRequires: python3-module-shiboken2-devel
%define qmake %qmake_qt5
%define qtbindir %_qt5_bindir
BuildRequires: python3-devel swig gcc-fortran chrpath
BuildRequires: boost-devel
BuildRequires: boost-filesystem-devel
BuildRequires: boost-geometry-devel
BuildRequires: boost-polygon-devel
BuildRequires: boost-program_options-devel
BuildRequires: boost-python3-devel
BuildRequires: boost-signals-devel
BuildRequires: libcoin3d-devel
#BuildRequires: libSoQt-devel
BuildRequires: zlib-devel
BuildRequires: libopencv2-devel libxerces-c-devel gcc-c++
BuildRequires: java-devel-default
BuildRequires: libXxf86misc-devel
BuildRequires: opencascade-devel libgts-devel
BuildRequires: libode-devel libann-devel
BuildRequires: doxygen graphviz
BuildRequires: eigen3
#BuildRequires: python-module-pivy
BuildRequires: libnumpy-py3-devel
BuildRequires: boost-interprocess-devel
BuildRequires: gdb
BuildRequires: libvtk-devel vtk-examples vtk-python3
BuildRequires: libhdf5-devel
BuildRequires: libmed-devel libspnav-devel
BuildRequires: python3-module-matplotlib-qt5
BuildRequires: libkdtree++-devel
%if_without bundled_libs
BuildRequires: libsmesh-devel libnetgen-devel netgen openmpi-devel
%endif
%if_with glvnd
BuildRequires: libglvnd-devel
%else
Requires: libEGL-devel libGLU-devel
%endif
#BuildRequires: texlive-extra-utils
BuildRequires: python3-module-pivy

%py3_requires pivy matplotlib.backends.backend_qt5
#py3_provides Fem FreeCAD FreeCADGui Mesh Part MeshPart Drawing ImportGui
#py3_provides PartGui Sketcher TestSketcherApp Robot RobotGui SketcherGui
#py3_provides ImageGui PartDesignGui _PartDesign
%add_python3_req_skip pyopencl IfcImport Units
%add_findreq_skiplist %ldir/Mod/*

%ifnarch armh
# TODO: cgal needed for openscad was not built for armh
Requires: openscad
%endif
Requires: python3-module-GitPython
Requires: netgen
Requires: libredwg

%description
FreeCAD will be a general purpose 3D CAD modeler. FreeCAD is aimed directly at
mechanical engineering and product design but also fits in a wider range of uses
around engineering, such as architecture or other engineering specialties.

FreeCAD features tools similar to Catia, SolidWorks or Solid Edge, and therefore
also falls into the category of MCAD, PLM, CAx and CAE. It will be a feature
based parametric modeler with a modular software architecture which makes it
easy to provide additional functionality without modifying the core system.

%package docs
Summary: Documentation for FreeCAD
Group: Documentation
Provides:  free-cad-docs = %version-%release
Obsoletes: free-cad-docs < %version-%release
Requires: qt5-assistant

%description docs
FreeCAD will be a general purpose 3D CAD modeler. FreeCAD is aimed directly at
mechanical engineering and product design but also fits in a wider range of uses
around engineering, such as architecture or other engineering specialties.

FreeCAD features tools similar to Catia, SolidWorks or Solid Edge, and therefore
also falls into the category of MCAD, PLM, CAx and CAE. It will be a feature
based parametric modeler with a modular software architecture which makes it
easy to provide additional functionality without modifying the core system.

This package contains documentation for FreeCAD.

%prep
%setup
%if_without bundled_libs
# Removed bundled libraries
%patch1 -p1
rm -rf src/3rdParty
%endif
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%ifarch %e2k
sed -i "/-fext-numeric-literals/d" src/Mod/Path/App/CMakeLists.txt
# because "error: cpio archive too big"
%define optflags_debug -g0
# too much warnings of this type
%add_optflags -Wno-overloaded-virtual
%endif

%build
export PATH=$PATH:%_qt5_bindir
%add_optflags -Wl,-rpath,%ldir/lib
# Unable to use ninja-build because
# ninja: error: dependency cycle: src/Mod/TechDraw/Gui/mtextedit.h -> src/Mod/TechDraw/Gui/mtextedit.h
#cmake_insource -GNinja \
%cmake_insource \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
-DCMAKE_INSTALL_DATADIR=%ldir \
-DCMAKE_INSTALL_DOCDIR=%ldir/doc \
-DCMAKE_INSTALL_LIBDIR=%ldir/lib \
-DOPENMPI_INCLUDE_DIRS=%_libdir/openmpi/include \
-DPYTHON_EXECUTABLE=%__python3 \
-DFREECAD_LIBPACK_USEPYSIDE=OFF \
-DBUILD_QT5=ON \
%if_without bundled_libs
-DFREECAD_USE_EXTERNAL_SMESH=ON \
-DSMESH_DIR=%_libdir/cmake \
-DSMESH_INCLUDE_DIR=%_includedir/smesh \
-DBUILD_FEM_NETGEN=ON \
%endif
%if_with glvnd
-DOpenGL_GL_PREFERENCE=GLVND \
%endif
-DFREECAD_USE_EXTERNAL_PIVY=ON \
-DPACKAGE_WCREF="%git_rev" \
-DPACKAGE_WCDATE="%git_date" \
-DPACKAGE_WCURL="https://github.com/FreeCAD/FreeCAD" \
-Wno-dev
export NPROCS=%build_parallel_jobs
%make_build

%install
%makeinstall_std

# binaries

mkdir -p %buildroot%ldir/bin
mv %buildroot%_bindir/* %buildroot%ldir/bin
ln -s ../%_lib/%name/bin/FreeCAD %buildroot%_bindir/freecad
ln -s ../%_lib/%name/bin/FreeCADCmd %buildroot%_bindir/freecadcmd
ln -s ../%_lib/%name/bin/FreeCAD %buildroot%_bindir/FreeCAD
ln -s ../%_lib/%name/bin/FreeCADCmd %buildroot%_bindir/FreeCADCmd

# manpage

install -Dm0644 %SOURCE1 %buildroot%_man1dir/%name.1

# stuff

cp -af %buildroot%_prefix/Mod/* %buildroot%ldir/Mod
rm -rf %buildroot%_prefix/Mod
cp -af %buildroot%_prefix/Ext/ %buildroot%ldir/Ext
rm -rf %buildroot%_prefix/Ext

# l10n

%find_lang --with-kde %name

# fix python shebang

subst 's|#!.*python$|#!%__python3|' $(grep -Rl '#!.*python$' %buildroot%_libdir/freecad/Mod)

# remove static libraries

rm -f %buildroot%_libdir/freecad/lib/*.a

# remove header file

rm -f %buildroot%_includedir/E57Format/*.h

%files -f %name.lang
%doc ChangeLog.txt README.md
%doc %ldir/License.txt
%dir %ldir
%_bindir/*
%ldir/bin
%ldir/lib
%ldir/Gui
%ldir/Ext
%ldir/Mod
%ldir/3Dconnexion
%ldir/examples
%_desktopdir/*.desktop
%_iconsdir/hicolor/*/apps/%name.*
%_man1dir/*
%_xdgdatadir/mime/packages/*
%_pixmapsdir/%name.xpm
%_datadir/metainfo/*.appdata.xml
%_datadir/thumbnailers/FreeCAD.thumbnailer
%_iconsdir/hicolor/scalable/*/*.svg

%files docs
%ldir/doc

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin