test
OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=34
This commit is contained in:
parent
d8a41c4f79
commit
55072c6a02
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 17 06:46:23 UTC 2018 - adrian@suse.de
|
||||
|
||||
- fix crash in Draft module with python 3
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 16 06:51:06 UTC 2018 - adrian@suse.de
|
||||
|
||||
|
@ -33,6 +33,8 @@ Source3: FreeCAD_shared_mimeinfo
|
||||
Patch1: fix-build.diff
|
||||
# support for openmpi2 suse package
|
||||
Patch2: 0001-find-openmpi2-include-files.patch
|
||||
# runtime fix, submitted upstream
|
||||
Patch3: fix-draft-module-with-python3.patch
|
||||
BuildRequires: Coin-devel
|
||||
#BuildRequires: SoQt-devel
|
||||
BuildRequires: libmed-devel
|
||||
@ -146,6 +148,7 @@ This package contains the files needed for development with FreeCAD.
|
||||
%setup -q
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
|
||||
# fix env-script-interpreter
|
||||
sed -i '1c#!%{__python2}' \
|
||||
@ -276,6 +279,10 @@ ln -s -t %{buildroot}/usr/bin %{x_prefix}/bin/FreeCADCmd
|
||||
|
||||
%fdupes -s %{buildroot}
|
||||
|
||||
%check
|
||||
cd build
|
||||
./bin/FreeCAD --run-test 0 || exit 1
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
%mime_database_post
|
||||
|
37
fix-draft-module-with-python3.patch
Normal file
37
fix-draft-module-with-python3.patch
Normal file
@ -0,0 +1,37 @@
|
||||
diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py
|
||||
index 4c27018c4..f48c11528 100644
|
||||
--- a/src/Mod/Draft/Draft.py
|
||||
+++ b/src/Mod/Draft/Draft.py
|
||||
@@ -6133,8 +6133,7 @@ class _ShapeString(_DraftObject):
|
||||
ff8 = obj.FontFile.encode('utf8') # 1947 accents in filepath
|
||||
# TODO: change for Py3?? bytes?
|
||||
# Part.makeWireString uses FontFile as char* string
|
||||
-# CharList = Part.makeWireString(obj.String,obj.FontFile,obj.Size,obj.Tracking)
|
||||
- CharList = Part.makeWireString(obj.String,ff8,obj.Size,obj.Tracking)
|
||||
+ CharList = Part.makeWireString(obj.String,obj.FontFile,obj.Size,obj.Tracking)
|
||||
if len(CharList) == 0:
|
||||
msg(translate("draft","ShapeString: string has no wires\n"), 'warning')
|
||||
return
|
||||
@@ -6142,8 +6141,7 @@ class _ShapeString(_DraftObject):
|
||||
|
||||
# test a simple letter to know if we have a sticky font or not
|
||||
sticky = False
|
||||
-# testWire = Part.makeWireString("L",obj.FontFile,obj.Size,obj.Tracking)[0][0]
|
||||
- testWire = Part.makeWireString("L",ff8,obj.Size,obj.Tracking)[0][0]
|
||||
+ testWire = Part.makeWireString("L",obj.FontFile,obj.Size,obj.Tracking)[0][0]
|
||||
if testWire.isClosed:
|
||||
try:
|
||||
testFace = Part.Face(testWire)
|
||||
diff --git a/src/Mod/Draft/DraftTools.py b/src/Mod/Draft/DraftTools.py
|
||||
index a007d03e6..1de205bbf 100644
|
||||
--- a/src/Mod/Draft/DraftTools.py
|
||||
+++ b/src/Mod/Draft/DraftTools.py
|
||||
@@ -2204,7 +2204,7 @@ class ShapeString(Creator):
|
||||
#print("debug: D_T ShapeString.createObject type(self.SString): " str(type(self.SString)))
|
||||
|
||||
dquote = '"'
|
||||
- if type(self.SString) == unicode: # Python3: no more unicode
|
||||
+ if sys.version_info.major < 3: # Python3: no more unicode
|
||||
String = 'u' + dquote + self.SString.encode('unicode_escape') + dquote
|
||||
else:
|
||||
String = dquote + self.SString + dquote
|
Loading…
x
Reference in New Issue
Block a user