freecad: python3, qt5, occt7 (#63348)

freecad: python3, qt5, occt7
This commit is contained in:
Gabriel Ebner 2019-06-18 22:00:23 +02:00 committed by GitHub
commit c740f71c35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 249 additions and 144 deletions

View File

@ -1,12 +1,12 @@
{ stdenv, fetchurl, cmake, coin3d, xercesc, ode, eigen, qt4, opencascade, gts
, hdf5, vtk, medfile, zlib, python27Packages, swig, gfortran
, soqt, libf2c, makeWrapper
{ stdenv, fetchurl, cmake, ninja, coin3d, xercesc, ode, eigen, qt5, opencascade-occt, gts
, hdf5, vtk, medfile, zlib, python3Packages, swig, gfortran, libXmu
, soqt, libf2c, libGLU, makeWrapper, pkgconfig
, mpi ? null }:
assert mpi != null;
let
pythonPackages = python27Packages;
pythonPackages = python3Packages;
in stdenv.mkDerivation rec {
name = "freecad-${version}";
version = "0.18.2";
@ -16,13 +16,27 @@ in stdenv.mkDerivation rec {
sha256 = "1r5rhaiq22yhrfpmcmzx6bflqj6q9asbyjyfja4x4rzfy9yh0a4v";
};
buildInputs = [ cmake coin3d xercesc ode eigen qt4 opencascade gts
zlib swig gfortran soqt libf2c makeWrapper mpi vtk hdf5 medfile
] ++ (with pythonPackages; [
matplotlib pycollada pyside pysideShiboken pysideTools pivy python boost
nativeBuildInputs = [ cmake ninja pkgconfig pythonPackages.pyside2-tools ];
buildInputs = [ cmake coin3d xercesc ode eigen opencascade-occt gts
zlib swig gfortran soqt libf2c makeWrapper mpi vtk hdf5 medfile
libGLU libXmu
] ++ (with qt5; [
qtbase qttools qtwebkit
]) ++ (with pythonPackages; [
matplotlib pycollada shiboken2 pyside2 pyside2-tools pivy python boost
]);
enableParallelBuilding = true;
cmakeFlags = [
"-DBUILD_QT5=ON"
"-DSHIBOKEN_INCLUDE_DIR=${pythonPackages.shiboken2}/include"
"-DSHIBOKEN_LIBRARY=Shiboken2::libshiboken"
("-DPYSIDE_INCLUDE_DIR=${pythonPackages.pyside2}/include"
+ ";${pythonPackages.pyside2}/include/PySide2/QtCore"
+ ";${pythonPackages.pyside2}/include/PySide2/QtWidgets"
+ ";${pythonPackages.pyside2}/include/PySide2/QtGui"
)
"-DPYSIDE_LIBRARY=PySide2::pyside2"
];
# This should work on both x86_64, and i686 linux
preBuild = ''
@ -42,7 +56,7 @@ in stdenv.mkDerivation rec {
postFixup = ''
mv $out/share/doc $out
'';
meta = with stdenv.lib; {
description = "General purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM modeler";
homepage = https://www.freecadweb.org/;

View File

@ -1,30 +1,25 @@
{ fetchurl, stdenv, libGLU_combined }:
{ fetchFromBitbucket, stdenv, boost, cmake, libGLU_combined }:
stdenv.mkDerivation rec {
name = "coin3d-${version}";
version = "3.1.3";
pname = "coin";
version = "unstable-2019-06-12";
src = fetchurl {
url = "https://bitbucket.org/Coin3D/coin/downloads/Coin-${version}.tar.gz";
sha256 = "05ylhrcglm81dajbk132l1w892634z2i97x10fm64y1ih72phd2q";
src = fetchFromBitbucket {
owner = "Coin3D";
repo = "coin";
rev = "8d860d7ba112b22c4e9b289268fd8b3625ab81d3";
sha256 = "1cpncljqvw28k5wvpgchv593nayhby5gwpvbnyllc9hb9ms816xn";
};
patches = [
(fetchurl {
url = http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-libs/coin/files/coin-3.1.3-gcc-4.7.patch;
name = "gcc-4.7.patch";
sha256 = "076dyc52swk8qc7ylps53fg6iqmd52x8s7m18i80x49dd109yw20";
})
./gcc-4.8.patch # taken from FC-17 source rpm
# see https://bitbucket.org/Coin3D/coin/issues/128/crash-in-cc_memalloc_deallocate
# patch adapted from https://bitbucket.org/Coin3D/coin/pull-requests/75/added-fix-for-issue-128-provided-by-fedora/diff
./sbhashentry.patch
];
postPatch = ''
sed -i /cpack.d/d CMakeLists.txt
'';
buildInputs = [ libGLU_combined ];
nativeBuildInputs = [ cmake ];
buildInputs = [ boost libGLU_combined ];
meta = {
homepage = http://www.coin3d.org/;
homepage = "https://bitbucket.org/Coin3D/coin/wiki/Home";
license = stdenv.lib.licenses.gpl2Plus;
description = "High-level, retained-mode toolkit for effective 3D graphics development";
maintainers = [ stdenv.lib.maintainers.viric ];

View File

@ -1,38 +0,0 @@
From 9f5d96a2b9a71ab539237d2dab4c54fc46fc5c5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ralf=20Cors=C3=A9pius?= <corsepiu@corsepiu.home>
Date: Thu, 18 Apr 2013 19:17:06 +0200
Subject: [PATCH 10/10] GCC-4.8.0 fixes
---
src/fonts/freetype.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/fonts/freetype.cpp b/src/fonts/freetype.cpp
index 760b88b..e705d3a 100644
--- a/src/fonts/freetype.cpp
+++ b/src/fonts/freetype.cpp
@@ -32,18 +32,18 @@
20050613 mortene. */
-#include "fonts/freetype.h"
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
-#include <stdlib.h>
+#include <cstdlib>
#include <assert.h>
#include "glue/freetype.h"
#include "glue/GLUWrapper.h"
+#include "fonts/freetype.h"
+
/* ************************************************************************* */
#ifdef __cplusplus
--
1.8.1.4

View File

@ -1,25 +0,0 @@
diff -u --label /tmp/Coin-3.1.3/src/misc/SbHash.h --label \#\<buffer\ SbHash.h\> /tmp/Coin-3.1.3/src/misc/SbHash.h /tmp/buffer-content-21756V0
--- a/src/misc/SbHash.h
+++ b/src/misc/SbHash.h
@@ -88,8 +88,8 @@
SbHashEntry<Type, Key> * entry = static_cast<SbHashEntry<Type, Key> *>( ptr);
cc_memalloc_deallocate(entry->memhandler, ptr);
}
- SbHashEntry(const Key & key, const Type & obj) : key(key), obj(obj) {}
-
+ SbHashEntry(const Key & key, const Type & obj, cc_memalloc *memhandler)
+ : key(key), obj(obj), memhandler(memhandler) {}
Key key;
Type obj;
SbHashEntry<Type, Key> * next;
@@ -218,7 +218,7 @@
/* Key not already in the hash table; insert a new
* entry as the first element in the bucket
*/
- entry = new (this->memhandler) SbHashEntry<Type, Key>(key, obj);
+ entry = new (this->memhandler) SbHashEntry<Type, Key>(key, obj, this->memhandler);
entry->next = this->buckets[i];
this->buckets[i] = entry;
Diff finished. Sat Sep 9 19:50:32 2017

View File

@ -1,22 +1,10 @@
{ stdenv
, fetchurl
, cmake
, tcl
, tk
, vtk
, mesa_glu
, libXext
, libXmu
, libXi
, doxygen
}:
{ stdenv, fetchurl, fetchpatch, cmake, ninja, tcl, tk,
libGL, libGLU, libXext, libXmu, libXi }:
let version = "7.3.0p3";
commit = "V${builtins.replaceStrings ["."] ["_"] version}";
in stdenv.mkDerivation {
name = "opencascade-occt-${version}";
stdenv.mkDerivation rec {
pname = "opencascade-occt";
version = "7.3.0p3";
commit = "V${builtins.replaceStrings ["."] ["_"] version}";
src = fetchurl {
name = "occt-${commit}.tar.gz";
@ -24,10 +12,8 @@ in stdenv.mkDerivation {
sha256 = "0k9c3ypcnjcilq1dhsf6xxbd52gyq4h5rchvp30k3c8ph4ris5pz";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ tcl tk vtk mesa_glu libXext libXmu libXi doxygen ];
enableParallelBuilding = true;
nativeBuildInputs = [ cmake ninja ];
buildInputs = [ tcl tk libGL libGLU libXext libXmu libXi ];
meta = with stdenv.lib; {
description = "Open CASCADE Technology, libraries for 3D modeling and numerical simulation";

View File

@ -68,7 +68,7 @@ stdenv.mkDerivation rec {
++ stdenv.lib.optionals enableGDML [ xercesc ]
++ stdenv.lib.optionals enableXM [ motif ]
++ stdenv.lib.optionals enableQT [ qtbase ]
++ stdenv.lib.optionals enableInventor [ libXpm coin3d soxt ];
++ stdenv.lib.optionals enableInventor [ libXpm coin3d soxt motif ];
postFixup = ''
# Don't try to export invalid environment variables.

View File

@ -1,17 +1,19 @@
{ fetchurl, stdenv, coin3d, qt4, pkgconfig }:
{ fetchhg, stdenv, coin3d, qt5, cmake, pkgconfig }:
stdenv.mkDerivation rec {
name = "soqt-${version}";
version = "1.5.0";
pname = "soqt";
version = "1.6.0a";
src = fetchurl {
url = "https://bitbucket.org/Coin3D/coin/downloads/SoQt-${version}.tar.gz";
sha256 = "14dbh8ynzjcgwgxjc6530c5plji7vn62kbdf447w0dp53564p8zn";
src = fetchhg {
url = "https://bitbucket.org/Coin3D/soqt";
rev = "5f2afb4890e0059eb27e1671f980d10ebfb9e762";
sha256 = "0j9lsci4cx95v16l0jaky0vzh4lbdliwz7wc17442ihjaqiqmv8m";
fetchSubrepos = true;
};
buildInputs = [ coin3d qt4 ];
buildInputs = [ coin3d qt5.qtbase ];
nativeBuildInputs = [ pkgconfig ];
nativeBuildInputs = [ cmake pkgconfig ];
meta = {
homepage = https://bitbucket.org/Coin3D/coin/wiki/Home;

View File

@ -1,15 +1,18 @@
{ fetchurl, stdenv, coin3d, motif, xlibsWrapper, libGLU_combined }:
{ fetchhg, stdenv, cmake, coin3d, motif, xlibsWrapper, libXmu, libGLU_combined }:
stdenv.mkDerivation rec {
name = "soxt-${version}";
version = "1.3.0";
pname = "soxt";
version = "unstable-2019-06-14";
src = fetchurl {
url = "https://bitbucket.org/Coin3D/coin/downloads/SoXt-${version}.tar.gz";
sha256= "f5443aadafe8e2222b9b5a23d1f228bb0f3e7d98949b8ea8676171b7ea5bf013";
src = fetchhg {
url = "https://bitbucket.org/Coin3D/soxt";
rev = "85e135bb266fbb17e47fc336b876a576a239c15c";
sha256 = "0vk5cgn53yqf7csqdnlnyyhi4mbgx4wlsq70613p5fgxlvxzhcym";
fetchSubrepos = true;
};
buildInputs = [ coin3d motif xlibsWrapper libGLU_combined ];
nativeBuildInputs = [ cmake ];
buildInputs = [ coin3d motif xlibsWrapper libGLU_combined libXmu ];
meta = with stdenv.lib; {
homepage = https://bitbucket.org/Coin3D/coin/wiki/Home;

View File

@ -1,31 +1,40 @@
{ stdenv
, buildPythonPackage
, fetchhg
, pkgs
, isPy3k
}:
{ stdenv, buildPythonPackage, fetchFromGitHub, pkgs }:
buildPythonPackage rec {
version = "20101207";
pname = "pivy";
disabled = isPy3k; # Judging from SyntaxError
version = "0.6.5a2";
src = fetchhg {
url = "https://bitbucket.org/Coin3D/pivy";
rev = "8eab90908f2a3adcc414347566f4434636202344";
sha256 = "18n14ha2d3j3ghg2f2aqnf2mks94nn7ma9ii7vkiwcay93zm82cf";
src = fetchFromGitHub {
owner = "FreeCAD";
repo = "pivy";
rev = version;
sha256 = "1w03jaha36bjyfaz8hchnv8yrkm5715w15crhd3qrlagz8fs38hm";
};
nativeBuildInputs = with pkgs; [
swig1 coin3d soqt
swig qt5.qmake cmake
];
buildInputs = with pkgs; with xorg; [
coin3d soqt
coin3d soqt qt5.qtbase
libGLU_combined
libXi libXext libSM libICE libX11
];
NIX_CFLAGS_COMPILE = [
"-I${pkgs.qt5.qtbase.dev}/include/QtCore"
"-I${pkgs.qt5.qtbase.dev}/include/QtGui"
"-I${pkgs.qt5.qtbase.dev}/include/QtOpenGL"
"-I${pkgs.qt5.qtbase.dev}/include/QtWidgets"
];
doCheck = false;
postPatch = ''
substituteInPlace CMakeLists.txt --replace \$'{SoQt_INCLUDE_DIRS}' \
\$'{Coin_INCLUDE_DIR}'\;\$'{SoQt_INCLUDE_DIRS}'
'';
meta = with stdenv.lib; {
homepage = http://pivy.coin3d.org/;
description = "A Python binding for Coin";

View File

@ -0,0 +1,35 @@
{ buildPythonPackage, wrapPython, python, fetchurl, stdenv, cmake, qt5,
shiboken2, pyside2 }:
stdenv.mkDerivation rec {
pname = "pyside2-tools";
inherit (pyside2) version src;
postPatch = ''
cd sources/pyside2-tools
'';
nativeBuildInputs = [ cmake wrapPython ];
propagatedBuildInputs = [ shiboken2 pyside2 ];
buildInputs = [ python qt5.qtbase ];
cmakeFlags = [
"-DBUILD_TESTS=OFF"
];
postInstall = ''
rm $out/bin/pyside_tool.py
'';
postFixup = ''
wrapPythonPrograms
'';
meta = with stdenv.lib; {
description = "PySide2 development tools";
license = licenses.gpl2;
homepage = "https://wiki.qt.io/Qt_for_Python";
maintainers = with maintainers; [ gebner ];
};
}

View File

@ -0,0 +1,38 @@
{ buildPythonPackage, python, fetchurl, stdenv,
cmake, ninja, qt5, shiboken2 }:
stdenv.mkDerivation rec {
pname = "pyside2";
version = "5.12.3";
src = fetchurl {
url = "https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/pyside-setup-everywhere-src-${version}.tar.xz";
sha256 = "0hk89jm8pa0q6kifask5rrffa3bvx02dg2f97ibv7wds9dysnyjg";
};
patches = [
./dont_ignore_optional_modules.patch
];
postPatch = ''
cd sources/pyside2
'';
cmakeFlags = [
"-DBUILD_TESTS=OFF"
"-DPYTHON_EXECUTABLE=${python.interpreter}"
];
nativeBuildInputs = [ cmake ninja qt5.qmake shiboken2 python ];
buildInputs = with qt5; [
qtbase qtxmlpatterns qtmultimedia qttools qtx11extras qtlocation qtscript
qtwebsockets qtwebengine qtwebchannel qtcharts qtsensors qtsvg
];
meta = with stdenv.lib; {
description = "LGPL-licensed Python bindings for Qt";
license = licenses.lgpl21;
homepage = "https://wiki.qt.io/Qt_for_Python";
maintainers = with maintainers; [ gebner ];
};
}

View File

@ -0,0 +1,11 @@
--- pyside-setup-everywhere-src-5.12.3/sources/pyside2/CMakeLists.txt~ 2019-06-15 19:07:48.368704430 +0200
+++ pyside-setup-everywhere-src-5.12.3/sources/pyside2/CMakeLists.txt 2019-06-15 19:08:04.429489908 +0200
@@ -219,7 +219,7 @@
# If the module was found, and also the module path is the same as the
# Qt5Core base path, we will generate the list with the modules to be installed
set(looked_in_message ". Looked in: ${${_name_dir}}")
- if("${${_name_found}}" AND (("${found_basepath}" GREATER "0") OR ("${found_basepath}" EQUAL "0")))
+ if("${${_name_found}}")
message(STATUS "${module_state} module ${name} found (${ARGN})${looked_in_message}")
# record the shortnames for the tests
list(APPEND all_module_shortnames ${shortname})

View File

@ -0,0 +1,36 @@
{ buildPythonPackage, python, fetchurl, stdenv, pyside2,
cmake, qt5, llvmPackages }:
stdenv.mkDerivation rec {
pname = "shiboken2";
inherit (pyside2) version src;
patches = [
./nix_compile_cflags.patch
];
postPatch = ''
cd sources/shiboken2
'';
CLANG_INSTALL_DIR = "${llvmPackages.libclang.out}";
nativeBuildInputs = [ cmake ];
buildInputs = [ llvmPackages.libclang python qt5.qtbase qt5.qtxmlpatterns ];
cmakeFlags = [
"-DBUILD_TESTS=OFF"
];
postInstall = ''
rm $out/bin/shiboken_tool.py
'';
meta = with stdenv.lib; {
description = "Generator for the PySide2 Qt bindings";
license = with licenses; [ gpl2 lgpl21 ];
homepage = "https://wiki.qt.io/Qt_for_Python";
maintainers = with maintainers; [ gebner ];
};
}

View File

@ -0,0 +1,27 @@
--- pyside-setup-everywhere-src-5.12.3/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp~ 2019-06-15 10:31:04.712949189 +0200
+++ pyside-setup-everywhere-src-5.12.3/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp 2019-06-15 11:52:52.894987343 +0200
@@ -317,15 +317,15 @@
}
#endif // NEED_CLANG_BUILTIN_INCLUDES
- // Append the c++ include paths since Clang is unable to find <list> etc
- // on RHEL 7 with g++ 6.3 or CentOS 7.2.
- // A fix for this has been added to Clang 5.0, so, the code can be removed
- // once Clang 5.0 is the minimum version.
- if (needsGppInternalHeaders()) {
- const HeaderPaths gppPaths = gppInternalIncludePaths(QStringLiteral("g++"));
- for (const HeaderPath &h : gppPaths) {
- if (h.path.contains("c++"))
- headerPaths.append(h);
+ const HeaderPaths gppPaths = gppInternalIncludePaths(QStringLiteral("g++"));
+ for (const HeaderPath &h : gppPaths) {
+ // PySide2 requires that Qt headers are not -isystem
+ // https://bugreports.qt.io/browse/PYSIDE-787
+ if (!h.path.contains("-qt")) {
+ // add using -isystem
+ headerPaths.append(h);
+ } else {
+ headerPaths.append({h.path, HeaderType::Standard});
}
}
#else

View File

@ -807,6 +807,18 @@ in {
pysideTools = callPackage ../development/python-modules/pyside/tools.nix { };
pyside2 = toPythonModule (callPackage ../development/python-modules/pyside2 {
inherit (pkgs) cmake qt5 ninja;
});
shiboken2 = toPythonModule (callPackage ../development/python-modules/shiboken2 {
inherit (pkgs) cmake qt5 llvmPackages;
});
pyside2-tools = toPythonModule (callPackage ../development/python-modules/pyside2-tools {
inherit (pkgs) cmake qt5;
});
pyslurm = callPackage ../development/python-modules/pyslurm {
slurm = pkgs.slurm;
};