Cleanup and python 3.13

This commit is contained in:
Mario Fetka
2025-05-05 10:23:40 +02:00
parent 7c1ee4ca45
commit b56141d74d
121 changed files with 9006 additions and 479 deletions

View File

@@ -0,0 +1,7 @@
AUX freecad-0.21.0-0001-Gentoo-specific-disable-ccache-usage.patch 381 BLAKE2B 2fe05252a4e7846006c5f4e679eae5416ede589b9a6ad5fc30425933bedf933bf586b711c2c7d6a59c3881d454ea76ca39e0556a5a31c3769032694f0858e264 SHA512 731befc86267de4e5fa2caf619a8ae9692580d7025ebc26a80f6744a3104263622c38d87d0d8a263a1a15ef1c1d78c9ff3351aa463a9943941bd7d96d946e516
AUX freecad-1.0.0-r1-Gentoo-specific-don-t-check-vcs.patch 347 BLAKE2B 1c8119aec9408d77db8e09c34b86ba6a8da268509959ba5839b1ad0bb6c5b4023326055170836bf164d0d1e0a13a91ac601bde7eb6b184e4f9b1425e93ce9d38 SHA512 63bb73d0de1e12d3a34a2d055e3ddc2bdbdae5c1c67cd7c9a26047abfeda48943d793f30d190ae28f6f8e9ee7072f671badd4b8f3df29824b401bed0dbf90ed5
AUX freecad-9999-Gentoo-specific-don-t-check-vcs.patch 322 BLAKE2B 431b69d749c5639d2407207632ab48f1af36319290c1016985ed2431fe7a5314a5df8373a0a5235fcd08de5762dd090dd89b73846703348d5e2e0fac7c9c7048 SHA512 f67b3bfa013a497d0372649d9339665dd5c48b2dd00814e55ee6fcad6580a8219139f6c1931f2da5e210d181205af55e19b91a4d08b4d0dc7d45fcef358eb0ed
AUX freecad-9999-tests-src-Qt-only-build-test-for-BUILD_GUI-ON.patch 469 BLAKE2B 23e56fbc49b3c3d5ede85e6ec15d26c88c93590fce105e0b75e8b0bd3fee125c500cd59d8db0144c610edb371df318396e056333ec7a411f7647b38d18006efc SHA512 82737af95603ff1f667bf49ee43b85b411eeeb5fd9b577ad7fca6e02bcbfda5c3bbb6c70386e5f69d2181d6226574f82cb68b7e66dfe8f4bb14d946f594582cf
DIST freecad-1.0.0.tar.gz 91599325 BLAKE2B 65540eb42e7d508456c9edbf2122e0f288708c33e6d00d3c8c45550e7a614f658f91ba25978a66819bc094b7138aab72a89c0172d0841be1ff798ade5a8bdc64 SHA512 afc1079ea04fd5bb8135f8ad1012d9e4e05c8839dd0a4e00253eada58fe018f445c1200d1ca7ac9f268644c946cbf55b7b313dc3d6bd010f9da3a3334103b7db
EBUILD freecad-1.0.0-r3.ebuild 8822 BLAKE2B 4ffdcc7aa97922b7a52f30bc871ac751560b8b706fec978f05a7b9590913eea94347add1b950652db137dae43d99abad2bad9d93ca1ec2534eed964fc4c4200e SHA512 4f3de1aebd529b6ddd6b1e23c071355c567cf0e04b79c485537440cbde2bd6589f1befefbb87d05bb396c8aa0dfe594b305a5bef865ab7fd62f40892688d86f3
MISC metadata.xml 3060 BLAKE2B 7ad73261d4457110b7fbfa4a9304fe0e9fe7461bb01f49960b22c5a6c8433e8af8d416d0d28850b25c29158fd73847b2f0302cac73102c83019da00a13cc6786 SHA512 5b5e7b44f22b7fadc8ee79adb59308f1c5e398438f8304bb78829b73a65fea145a71a7d8cf1c5b0a9193455f1570fe57fdbd8aaa49bea6ee3a121faa23258515

View File

@@ -0,0 +1,11 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,7 +16,7 @@ else()
option(FREECAD_USE_CCACHE "Auto detect and use ccache during compilation" ON)
endif()
-if(FREECAD_USE_CCACHE)
+if(OFF)
find_program(CCACHE_PROGRAM ccache) #This check should occur before project()
if(CCACHE_PROGRAM)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")

View File

@@ -0,0 +1,15 @@
--- a/src/Tools/SubWCRev.py
+++ b/src/Tools/SubWCRev.py
@@ -510,12 +510,6 @@ def main():
bindir = a
vcs = [
- GitControl(),
- DebianGitHub(),
- BazaarControl(),
- Subversion(),
- MercurialControl(),
- DebianChangelog(),
UnknownControl(),
]
for i in vcs:

View File

@@ -0,0 +1,14 @@
--- a/src/Tools/SubWCRev.py
+++ b/src/Tools/SubWCRev.py
@@ -511,11 +511,6 @@ def main():
vcs = [
GitControl(),
- DebianGitHub(),
- BazaarControl(),
- Subversion(),
- MercurialControl(),
- DebianChangelog(),
UnknownControl(),
]
for i in vcs:

View File

@@ -0,0 +1,20 @@
--- a/tests/src/Base/CMakeLists.txt
+++ b/tests/src/Base/CMakeLists.txt
@@ -11,4 +11,6 @@ target_sources(
${CMAKE_CURRENT_SOURCE_DIR}/tst_Tools.cpp
)
-setup_qt_test(InventorBuilder)
+if(BUILD_GUI)
+ setup_qt_test(InventorBuilder)
+endif()
--- a/tests/src/Gui/CMakeLists.txt
+++ b/tests/src/Gui/CMakeLists.txt
@@ -6,4 +6,6 @@ target_sources(
)
# Qt tests
-setup_qt_test(QuantitySpinBox)
+if(BUILD_GUI)
+ setup_qt_test(QuantitySpinBox)
+endif()

View File

@@ -0,0 +1,305 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..13} )
inherit check-reqs cmake flag-o-matic optfeature python-single-r1 qmake-utils xdg
DESCRIPTION="Qt based Computer Aided Design application"
HOMEPAGE="https://www.freecad.org/ https://github.com/FreeCAD/FreeCAD"
MY_PN=FreeCAD
if [[ ${PV} == *9999* ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/${MY_PN}/${MY_PN}.git"
S="${WORKDIR}/freecad-${PV}"
else
SRC_URI="https://github.com/${MY_PN}/${MY_PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64"
S="${WORKDIR}/FreeCAD-${PV}"
fi
# code is licensed LGPL-2
# examples are licensed CC-BY-SA (without note of specific version)
LICENSE="LGPL-2 CC-BY-SA-4.0"
SLOT="0"
IUSE="debug designer +gui netgen pcl +smesh spacenav test X"
# Modules are found in src/Mod/ and their options defined in:
# cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake
# To get their dependencies:
# 'grep REQUIRES_MODS cMake/FreeCAD_Helpers/CheckInterModuleDependencies.cmake'
IUSE+=" addonmgr assembly +bim cam cloud fem idf inspection +mesh openscad points reverse robot surface +techdraw"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
bim? ( mesh )
cam? ( mesh )
gui? ( bim )
designer? ( gui )
fem? ( smesh )
inspection? ( points )
mesh? ( smesh )
openscad? ( mesh )
reverse? ( mesh points )
test? ( techdraw )
"
# Draft Workbench needs BIM
RESTRICT="!test? ( test )"
RDEPEND="
${PYTHON_DEPS}
dev-cpp/gtest
dev-cpp/yaml-cpp
dev-libs/boost:=
dev-libs/libfmt:=
dev-libs/xerces-c[icu]
dev-qt/qtbase:6[concurrent,network,xml]
media-libs/freetype
sci-libs/opencascade:=[json]
sys-libs/zlib
$(python_gen_cond_dep '
dev-python/numpy[${PYTHON_USEDEP}]
dev-python/pybind11[${PYTHON_USEDEP}]
dev-python/pyyaml[${PYTHON_USEDEP}]
')
assembly? ( sci-libs/ondselsolver )
cloud? (
dev-libs/openssl:=
net-misc/curl
)
fem? (
sci-libs/vtk:=
$(python_gen_cond_dep 'dev-python/ply[${PYTHON_USEDEP}]')
)
gui? (
>=media-libs/coin-4.0.0
dev-qt/qtbase:6[gui,opengl,widgets]
dev-qt/qtsvg:6
dev-qt/qttools:6[designer?,widgets]
$(python_gen_cond_dep '
dev-python/matplotlib[${PYTHON_USEDEP}]
>=dev-python/pivy-0.6.5[${PYTHON_USEDEP}]
dev-python/pyside:6=[uitools(-),gui,svg,${PYTHON_USEDEP}]
' )
virtual/glu
virtual/opengl
spacenav? ( dev-libs/libspnav[X?] )
)
netgen? ( media-gfx/netgen[opencascade] )
openscad? ( $(python_gen_cond_dep 'dev-python/ply[${PYTHON_USEDEP}]') )
pcl? ( sci-libs/pcl:= )
smesh? (
sci-libs/hdf5:=[zlib]
>=sci-libs/med-4.0.0-r1
sci-libs/vtk:=
)
"
DEPEND="${RDEPEND}
>=dev-cpp/eigen-3.3.1:3
dev-cpp/ms-gsl
"
BDEPEND="
dev-lang/swig
test? ( dev-cpp/gtest )
"
PATCHES=(
"${FILESDIR}"/${PN}-1.0.0-r1-Gentoo-specific-don-t-check-vcs.patch
"${FILESDIR}"/${PN}-0.21.0-0001-Gentoo-specific-disable-ccache-usage.patch
"${FILESDIR}"/${PN}-9999-tests-src-Qt-only-build-test-for-BUILD_GUI-ON.patch
)
DOCS=( CODE_OF_CONDUCT.md README.md )
CHECKREQS_DISK_BUILD="2G"
pkg_setup() {
check-reqs_pkg_setup
python-single-r1_pkg_setup
}
src_prepare() {
# Fix desktop file
sed -e 's/Exec=FreeCAD/Exec=freecad/' -i src/XDGData/org.freecad.FreeCAD.desktop || die
cmake_src_prepare
}
src_configure() {
# -Werror=odr, -Werror=lto-type-mismatch
# https://bugs.gentoo.org/875221
# https://github.com/FreeCAD/FreeCAD/issues/13173
filter-lto
# Fix building tests
append-ldflags -Wl,--copy-dt-needed-entries
local mycmakeargs=(
-DBUILD_DESIGNER_PLUGIN=$(usex designer)
-DBUILD_FORCE_DIRECTORY=ON # force building in a dedicated directory
-DBUILD_GUI=$(usex gui)
-DBUILD_SMESH=$(usex smesh)
-DBUILD_VR=OFF
-DBUILD_WITH_CONDA=OFF
# Modules
-DBUILD_ADDONMGR=$(usex addonmgr)
-DBUILD_ASSEMBLY=$(usex assembly)
-DBUILD_BIM=$(usex bim)
-DBUILD_CAM=$(usex cam)
-DBUILD_CLOUD=$(usex cloud)
-DBUILD_DRAFT=ON
# see below for DRAWING
-DBUILD_FEM=$(usex fem)
-DBUILD_FEM_NETGEN=$(usex fem $(usex netgen))
-DBUILD_FLAT_MESH=$(usex mesh) # a submodule of MeshPart
-DBUILD_HELP=ON
-DBUILD_IDF=$(usex idf)
-DBUILD_IMPORT=ON # import module for various file formats
-DBUILD_INSPECTION=$(usex inspection)
-DBUILD_JTREADER=OFF # uses an old proprietary library
-DBUILD_MATERIAL=ON
-DBUILD_MEASURE=ON
-DBUILD_MESH=$(usex mesh)
-DBUILD_MESH_PART=$(usex mesh)
-DBUILD_OPENSCAD=$(usex openscad)
-DBUILD_PART=ON
-DBUILD_PART_DESIGN=ON
-DBUILD_PLOT=ON
-DBUILD_POINTS=$(usex points)
-DBUILD_REVERSEENGINEERING=$(usex reverse)
-DBUILD_ROBOT=$(usex robot)
-DBUILD_SANDBOX=OFF
-DBUILD_SHOW=$(usex gui)
-DBUILD_SKETCHER=ON # needed by draft workspace
-DBUILD_SPREADSHEET=ON
-DBUILD_START=ON
-DBUILD_SURFACE=$(usex surface)
-DBUILD_TECHDRAW=$(usex techdraw)
-DBUILD_TEST=ON # always build test workbench for run-time testing
-DBUILD_TUX=$(usex gui)
-DBUILD_WEB=ON # needed by start workspace
-DCMAKE_INSTALL_DATADIR=/usr/share/${PN}/data
-DCMAKE_INSTALL_DOCDIR=/usr/share/doc/${PF}
-DCMAKE_INSTALL_INCLUDEDIR=/usr/include/${PN}
-DCMAKE_INSTALL_PREFIX=/usr/$(get_libdir)/${PN}
-DFREECAD_BUILD_DEBIAN=OFF
-DFREECAD_USE_EXTERNAL_ONDSELSOLVER=$(usex assembly)
-DFREECAD_USE_EXTERNAL_SMESH=OFF # no package in Gentoo
-DFREECAD_USE_EXTERNAL_ZIPIOS=OFF # doesn't work yet, also no package in Gentoo tree
-DFREECAD_USE_FREETYPE=ON
-DFREECAD_USE_OCC_VARIANT:STRING="Official Version"
-DFREECAD_USE_PCL=$(usex pcl)
-DFREECAD_USE_PYBIND11=ON
-DFREECAD_USE_QT_FILEDIALOG=ON
# install python modules to site-packages' dir. True only for the main package,
# sub-packages will still be installed inside /usr/lib64/freecad
-DINSTALL_TO_SITEPACKAGES=ON
# Use the version of shiboken2 that matches the selected python version
-DPYTHON_CONFIG_SUFFIX="-${EPYTHON}"
-DPython3_EXECUTABLE=${PYTHON}
)
if use debug; then
# BUILD_SANDBOX currently broken, see
# https://forum.freecadweb.org/viewtopic.php?f=4&t=36071&start=30#p504595
mycmakeargs+=(
-DBUILD_SANDBOX=OFF
-DBUILD_TEMPLATE=ON
)
else
mycmakeargs+=(
-DBUILD_SANDBOX=OFF
-DBUILD_TEMPLATE=OFF
)
fi
if use gui; then
mycmakeargs+=(
-DFREECAD_QT_MAJOR_VERSION=6
-DFREECAD_QT_VERSION=6
-DQT_DEFAULT_MAJOR_VERSION=6
-DQt6Core_MOC_EXECUTABLE="$(qt6_get_bindir)/moc"
-DQt6Core_RCC_EXECUTABLE="$(qt6_get_bindir)/rcc"
-DBUILD_QT5=OFF
# Drawing module unmaintained and not ported to qt6
-DBUILD_DRAWING=OFF
)
fi
cmake_src_configure
}
# We use the FreeCADCmd binary instead of the FreeCAD binary here
# for two reasons:
# 1. It works out of the box with USE=-gui as well, not needing a guard
# 2. We don't need virtualx.eclass and its dependencies
# The environment variables are needed, so that FreeCAD knows
# where to save its temporary files, and where to look and write its
# configuration. Without those, there is a sandbox violation, when it
# tries to create /var/lib/portage/home/.FreeCAD directory.
src_test() {
cd "${BUILD_DIR}" || die
local -x FREECAD_USER_HOME="${HOME}"
local -x FREECAD_USER_DATA="${T}"
local -x FREECAD_USER_TEMP="${T}"
./bin/FreeCADCmd --run-test 0 --set-config AppHomePath="${BUILD_DIR}/" || die
}
src_install() {
cmake_src_install
dobin src/Tools/freecad-thumbnailer
if use gui; then
newbin - freecad <<- _EOF_
#!/bin/sh
# https://github.com/coin3d/coin/issues/451
: "\${QT_QPA_PLATFORM:=xcb}"
export QT_QPA_PLATFORM
exec /usr/$(get_libdir)/${PN}/bin/FreeCAD "\${@}"
_EOF_
mv "${ED}"/usr/$(get_libdir)/${PN}/share/* "${ED}"/usr/share || die "failed to move shared resources"
fi
dosym -r /usr/$(get_libdir)/${PN}/bin/FreeCADCmd /usr/bin/freecadcmd
rm -r "${ED}"/usr/$(get_libdir)/${PN}/include/E57Format || die "failed to drop unneeded include directory E57Format"
python_optimize "${ED}"/usr/share/${PN}/data/Mod/Start/StartPage "${ED}"/usr/$(get_libdir)/${PN}{/Ext,/Mod}/
# compile main package in python site-packages as well
python_optimize
}
pkg_postinst() {
xdg_pkg_postinst
einfo "You can load a lot of additional workbenches using the integrated"
einfo "AddonManager."
einfo "There are a lot of additional tools, for which FreeCAD has builtin"
einfo "support. Some of them are available in Gentoo. Take a look at"
einfo "https://wiki.freecad.org/Installing_additional_components"
optfeature_header "External programs used by FreeCAD"
optfeature "dependency graphs" media-gfx/graphviz
optfeature "importing and exporting 2D AutoCAD DWG files" media-gfx/libredwg
optfeature "importing OpenSCAD files, Mesh booleans" media-gfx/openscad
use bim && optfeature "working with COLLADA documents" dev-python/pycollada
if use fem || use mesh; then
optfeature "mesh generation" sci-libs/gmsh
fi
}
pkg_postrm() {
xdg_pkg_postrm
}

View File

@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person" proxied="yes">
<email>negril.nx+gentoo@gmail.com</email>
<name>Paul Zander</name>
</maintainer>
<maintainer type="project" proxied="proxy">
<email>proxy-maint@gentoo.org</email>
<name>Gentoo Proxy Maintainers</name>
</maintainer>
<use>
<flag name="addonmgr">
Build the addon manager module for automatic handling of 3rd
party addons
</flag>
<flag name="assembly">
Build the assembly module to create 3D models composed of several
distinguishable parts as a conformed machine.
</flag>
<flag name="bim">
Build the BIM module and workbench
</flag>
<flag name="cam">
Build the CAM module and workbench
</flag>
<flag name="cloud">
Build the Cloud workbench, to access cloud providers (mostly
Amazon S3).
</flag>
<flag name="designer">
Build and install the Qt designer plugin, so the FreeCAD widgets
can be used from within designer.
</flag>
<flag name="fem">
Build the FEM module and workbench which provides Finite Element
Analysis (FEA) workflows
</flag>
<flag name="gui">
Build FreeCAD with a Qt based GUI. If built without setting this
USE flag, FreeCAD can be used in a headless mode, for server-side
instances.
The Python modules are available, without their GUI parts though,
if this is unset.
</flag>
<flag name="idf">
Build the IDF module to provide file exchange capabilities with
IDF files
</flag>
<flag name="inspection">
Build the inspection workbench which gives you specific tools
for examination of shapes (experimental)
</flag>
<flag name="mesh">
Build the mesh module and workbench
</flag>
<flag name="netgen">
Build support for the netgen mesher through <pkg>media-gfx/netgen</pkg>.
</flag>
<flag name="openscad">
Build the OpenSCAD module for interoperability with OpenSCAD
and repairing Constructive Solid Geometry (CSG) history
</flag>
<flag name="pcl">
Use external <pkg>sci-libs/pcl</pkg> for point clouds support.
</flag>
<flag name="points">
Build the points module and workbench for working with point clouds
</flag>
<flag name="reverse">
Build the reverse engineering module and workbench
</flag>
<flag name="robot">
Build the robot module and workbench for studying robot movements
</flag>
<flag name="smesh">
Build Salome SMESH
</flag>
<flag name="spacenav">
Add support for space navigator devices through
<pkg>dev-libs/libspnav</pkg>
</flag>
<flag name="surface">
Build the surface module and workbench
</flag>
<flag name="techdraw">
Build the techdraw module and workbench, a more advanced and
feature-rich successor of the drawing workbench
</flag>
</use>
<upstream>
<bugs-to>https://github.com/FreeCAD/FreeCAD/issues</bugs-to>
<remote-id type="github">FreeCAD/FreeCAD</remote-id>
<doc lang="en">https://wiki.freecad.org/Main_Page</doc>
</upstream>
</pkgmetadata>