[packages/cura] - updated to 2.5.0

baggins baggins at pld-linux.org
Sun May 14 16:02:52 CEST 2017


commit bb32f111fba23419fc930012d0fc5988f8683404
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun May 14 16:02:40 2017 +0200

    - updated to 2.5.0

 cura                         |  11 +---
 cura-dont-show-nc-stls.patch | 120 -----------------------------------------
 cura-newlines.patch          |  38 -------------
 cura-no-firmware.patch       |  81 ----------------------------
 cura-system-paths.patch      |  34 ------------
 cura-version.patch           |  78 ---------------------------
 cura.desktop                 |   9 ----
 cura.spec                    | 125 ++++++++++++++++++++++++-------------------
 plugins-path.patch           |  22 ++++++++
 9 files changed, 93 insertions(+), 425 deletions(-)
---
diff --git a/cura.spec b/cura.spec
index 2e6fbd9..07e5a27 100644
--- a/cura.spec
+++ b/cura.spec
@@ -1,34 +1,40 @@
 Summary:	3D printer control software
 Name:		cura
-Version:	15.02.1
-Release:	2
+Version:	2.5.0
+Release:	1
+Epoch:		1
 Group:		Applications/Engineering
 # Code is AGPLv3
 # Icons AGPLv3 https://github.com/daid/Cura/issues/231#issuecomment-12209683
 # Example models are CC-BY-SA
 # TweakAtZ.py is CC-BY-SA
 License:	AGPLv3 and CC-BY-SA
-Source0:	https://github.com/daid/Cura/archive/%{version}.tar.gz
-# Source0-md5:	f41ba365e5b98907cf55fc70e056c2e8
+Source0:	https://github.com/Ultimaker/Cura/archive/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	ebe1b78c8b9ce77c289a266c9e732dc8
 Source1:	%{name}
-Source2:	%{name}.desktop
-Patch0:		%{name}-dont-show-nc-stls.patch
-Patch1:		%{name}-system-paths.patch
-Patch2:		%{name}-version.patch
-Patch3:		%{name}-no-firmware.patch
-Patch4:		%{name}-newlines.patch
-URL:		http://daid.github.com/Cura/
+Patch0:		plugins-path.patch
+URL:		https://ultimaker.com/en/products/cura-software
+BuildRequires:	cmake
 BuildRequires:	desktop-file-utils
 BuildRequires:	dos2unix
+BuildRequires:	gettext
 BuildRequires:	gettext-tools
+BuildRequires:	python3-Uranium = %{version}
+BuildRequires:	python3-devel
+BuildRequires:	python3-pytest
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.219
-Requires:	CuraEngine >= 14.12.1
-Requires:	python-PyOpenGL
-Requires:	python-numpy
-Requires:	python-power
-Requires:	python-serial
-Requires:	python-wxPython
+Requires:	CuraEngine = %{epoch}:%{version}
+Requires:	Qt5Quick-controls
+Requires:	fonts-TTF-OpenSans
+Requires:	python3-PyOpenGL
+Requires:	python3-PyQt5
+Requires:	python3-numpy
+Requires:	python3-power
+Requires:	python3-savitar
+Requires:	python3-serial
+Requires:	python3-Uranium = %{version}
+Requires:	python3-zeroconf
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -43,66 +49,73 @@ editable configuration settings and send this G-Code to the 3D printer
 for printing.
 
 %prep
-%setup -qn Cura-%{version}
+%setup -q -n Cura-%{version}
 %patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
 
-# Use free UltimakerHandle.stl instead of UltimakerRobot_support.stl
-FILES=$(grep -Ir "UltimakerRobot_support.stl" . | cut -f1 -d: | sort | uniq | grep -v Attribution.txt | tr '\n' ' ')
-sed -i 's/UltimakerRobot_support.stl/UltimakerHandle.stl/g' $FILES
+# The setup.py is only useful for py2exe, remove it, so noone is tempted to use it
+rm setup.py
 
-dos2unix resources/example/Attribution.txt
+# https://github.com/Ultimaker/Cura/issues/1784
+sed -i 's/Version=1/Version=1.1/' cura.desktop.in
 
-sed -i 's/REPLACE_THIS_IN_SPEC/%{version}/' Cura/util/version.py
+# Upstream installs to lib/python3/dist-packages
+# We want to install to %%{py3_sitescriptdir}
+sed -i 's|lib/python${PYTHON_VERSION_MAJOR}/dist-packages|%(echo %{py3_sitescriptdir} | sed -e s@%{_prefix}/@@)|g' CMakeLists.txt
 
-mv resources/locale/{zh,zh_CN}
-rm -rf resources/locale/{en,po}
+# Wrong end of line encoding
+dos2unix docs/How_to_use_the_flame_graph_profiler.md
+
+# Wrong shebang
+sed -i '1s=^#!%{_bindir}/\(python\|env python\)3*=#!%{__python3}=' cura_app.py
+
+# Invalid locale name ptbr
+# https://github.com/Ultimaker/Uranium/issues/246
+mv resources/i18n/{ptbr,pt_BR}
+sed -i 's/"Language: ptbr\n"/"Language: pt_BR\n"/' resources/i18n/pt_BR/*.po
+
+# Failing test, mixes sets and lists :(
+# Changed in master, not reporting to upstream
+sed -i -e '0,/set()/{s/set()/[]/}' \
+       -e 's/{/[/g' \
+       -e 's/}/]/g' \
+    tests/TestMachineAction.py
 
 %build
-# rebuild locales
-cd resources/locale
-rm *.in *.pot
-for FILE in *; do
-	msgfmt $FILE/LC_MESSAGES/Cura.po -o $FILE/LC_MESSAGES/Cura.mo
-	rm $FILE/LC_MESSAGES/Cura.po
-done
+mkdir build
+cd build
+%{cmake} .. \
+	-DCURA_VERSION:STRING=%{version}
+
+%{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{py_sitescriptdir}/Cura,%{_datadir}/%{name}/firmware,%{_pixmapsdir},%{_localedir}}
+%{__make} -C build install DESTDIR=$RPM_BUILD_ROOT
 
-cp -a Cura/* $RPM_BUILD_ROOT%{py_sitescriptdir}/Cura
-rm $RPM_BUILD_ROOT%{py_sitescriptdir}/Cura/LICENSE
-cp -a resources/* $RPM_BUILD_ROOT%{_datadir}/%{name}
-cp -a plugins $RPM_BUILD_ROOT%{_datadir}/%{name}
-cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}
-ln -s %{_datadir}/%{name} $RPM_BUILD_ROOT%{py_sitescriptdir}/Cura/resources
-ln -s %{_datadir}/%{name}/%{name}.ico $RPM_BUILD_ROOT%{_pixmapsdir}
+# Sanitize the location of locale files
+mv $RPM_BUILD_ROOT%{_datadir}/{cura/resources/i18n,locale}
+ln -s ../../locale $RPM_BUILD_ROOT%{_datadir}/cura/resources/i18n
+rm $RPM_BUILD_ROOT%{_localedir}/*/*.po
+rm $RPM_BUILD_ROOT%{_localedir}/*.pot
 
-# locales
-cp -a $RPM_BUILD_ROOT%{_datadir}/%{name}/locale/* $RPM_BUILD_ROOT%{_localedir}
-rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/locale
-ln -sf %{_localedir}/ $RPM_BUILD_ROOT%{_datadir}/%{name}/ # the app expects the locale folder in here
-
-desktop-file-install --dir=$RPM_BUILD_ROOT%{_desktopdir} %{SOURCE2}
-
-%find_lang Cura
+# Unbundle fonts
+rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/resources/themes/cura/fonts/
+ln -s %{_datadir}/fonts/open-sans/ $RPM_BUILD_ROOT%{_datadir}/%{name}/resources/themes/cura/fonts
 
 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
 %py_postclean
 
+%find_lang cura --all-name
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%files -f Cura.lang
+%files -f cura.lang
 %defattr(644,root,root,755)
-%doc Cura/LICENSE resources/example/Attribution.txt
 %attr(755,root,root) %{_bindir}/%{name}
-%{py_sitescriptdir}/Cura
-%{_pixmapsdir}/%{name}.ico
+%{py3_sitescriptdir}/cura
 %{_desktopdir}/%{name}.desktop
 %{_datadir}/%{name}
+%{_datadir}/appdata/cura.appdata.xml
+%{_datadir}/mime/packages/cura.xml
diff --git a/cura b/cura
index 738e76f..a21d361 100755
--- a/cura
+++ b/cura
@@ -1,15 +1,8 @@
 #!/usr/bin/python
 import os
-import sys
-import Cura.cura as cura
+os.environ['GDK_BACKEND'] = 'x11'
 
-# Make all paths absolute, we are gonna change the pwd
-for i in range(len(sys.argv)):
-    if os.path.exists(sys.argv[i]):
-        sys.argv[i] = os.path.abspath(sys.argv[i])
+import Cura.cura as cura
 
-# change the pwd
-os.chdir("/usr/%s/python2.7/site-packages/" % sys.lib)
 
-# start cura
 cura.main()
diff --git a/cura-dont-show-nc-stls.patch b/cura-dont-show-nc-stls.patch
deleted file mode 100644
index 2bcc0f1..0000000
--- a/cura-dont-show-nc-stls.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-# UltimakerPlatforms STLs were stripped from the tarball, don't crash because of that
-diff -urN Cura-15.02.1.org/Cura/gui/sceneView.py Cura-15.02.1/Cura/gui/sceneView.py
---- Cura-15.02.1.org/Cura/gui/sceneView.py	2015-02-18 21:22:48.000000000 +0100
-+++ Cura-15.02.1/Cura/gui/sceneView.py	2015-05-14 22:34:56.020409418 +0200
-@@ -1320,105 +1320,16 @@
- 
- 		size = [profile.getMachineSettingFloat('machine_width'), profile.getMachineSettingFloat('machine_depth'), profile.getMachineSettingFloat('machine_height')]
- 
--		machine_type = profile.getMachineSetting('machine_type')
--		if machine_type not in self._platformMesh:
--			self._platformMesh[machine_type] = None
--
--			filename = None
--			texture_name = None
--			offset = [0,0,0]
--			texture_offset = [0,0,0]
--			texture_scale = 1.0
--			if machine_type == 'ultimaker2' or machine_type == 'ultimaker2extended':
--				filename = resources.getPathForMesh('ultimaker2_platform.stl')
--				offset = [-9,-37,145]
--				texture_name = 'Ultimaker2backplate.png'
--				texture_offset = [9,150,-5]
--			elif machine_type == 'ultimaker2go':
--				filename = resources.getPathForMesh('ultimaker2go_platform.stl')
--				offset = [0,-42,145]
--				texture_offset = [0,105,-5]
--				texture_name = 'Ultimaker2backplate.png'
--				texture_scale = 0.9
--			elif machine_type == 'ultimaker_plus':
--				filename = resources.getPathForMesh('ultimaker2_platform.stl')
--				offset = [0,-37,145]
--				texture_offset = [0,150,-5]
--				texture_name = 'UltimakerPlusbackplate.png'
--			elif machine_type == 'ultimaker':
--				filename = resources.getPathForMesh('ultimaker_platform.stl')
--				offset = [0,0,2.5]
--			elif machine_type == 'Witbox':
--				filename = resources.getPathForMesh('Witbox_platform.stl')
--				offset = [0,-37,145]
--
--			if filename is not None:
--				meshes = meshLoader.loadMeshes(filename)
--				if len(meshes) > 0:
--					self._platformMesh[machine_type] = meshes[0]
--					self._platformMesh[machine_type]._drawOffset = numpy.array(offset, numpy.float32)
--					self._platformMesh[machine_type].texture = None
--					if texture_name is not None:
--						self._platformMesh[machine_type].texture = openglHelpers.loadGLTexture(texture_name)
--						self._platformMesh[machine_type].texture_offset = texture_offset
--						self._platformMesh[machine_type].texture_scale = texture_scale
--		if self._platformMesh[machine_type] is not None:
--			mesh = self._platformMesh[machine_type]
--			glColor4f(1,1,1,0.5)
--			self._objectShader.bind()
--			self._renderObject(mesh, False, False)
--			self._objectShader.unbind()
--
--			#For the Ultimaker 2 render the texture on the back plate to show the Ultimaker2 text.
--			if mesh.texture is not None:
--				glBindTexture(GL_TEXTURE_2D, mesh.texture)
--				glEnable(GL_TEXTURE_2D)
--				glPushMatrix()
--				glColor4f(1,1,1,1)
--
--				glTranslate(mesh.texture_offset[0], mesh.texture_offset[1], mesh.texture_offset[2])
--				glScalef(mesh.texture_scale, mesh.texture_scale, mesh.texture_scale)
--				h = 50
--				d = 8
--				w = 100
--				glEnable(GL_BLEND)
--				glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA)
--				glEnable(GL_ALPHA_TEST)
--				glAlphaFunc(GL_GREATER, 0.0)
--				glBegin(GL_QUADS)
--				glTexCoord2f(1, 0)
--				glVertex3f( w, 0, h)
--				glTexCoord2f(0, 0)
--				glVertex3f(-w, 0, h)
--				glTexCoord2f(0, 1)
--				glVertex3f(-w, 0, 0)
--				glTexCoord2f(1, 1)
--				glVertex3f( w, 0, 0)
--
--				glTexCoord2f(1, 0)
--				glVertex3f(-w, d, h)
--				glTexCoord2f(0, 0)
--				glVertex3f( w, d, h)
--				glTexCoord2f(0, 1)
--				glVertex3f( w, d, 0)
--				glTexCoord2f(1, 1)
--				glVertex3f(-w, d, 0)
--				glEnd()
--				glDisable(GL_TEXTURE_2D)
--				glDisable(GL_ALPHA_TEST)
--				glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
--				glPopMatrix()
--		else:
--			glColor4f(0,0,0,1)
--			glLineWidth(3)
--			glBegin(GL_LINES)
--			glVertex3f(-size[0] / 2, -size[1] / 2, 0)
--			glVertex3f(-size[0] / 2, -size[1] / 2, 10)
--			glVertex3f(-size[0] / 2, -size[1] / 2, 0)
--			glVertex3f(-size[0] / 2+10, -size[1] / 2, 0)
--			glVertex3f(-size[0] / 2, -size[1] / 2, 0)
--			glVertex3f(-size[0] / 2, -size[1] / 2+10, 0)
--			glEnd()
-+		glColor4f(0,0,0,1)
-+		glLineWidth(3)
-+		glBegin(GL_LINES)
-+		glVertex3f(-size[0] / 2, -size[1] / 2, 0)
-+		glVertex3f(-size[0] / 2, -size[1] / 2, 10)
-+		glVertex3f(-size[0] / 2, -size[1] / 2, 0)
-+		glVertex3f(-size[0] / 2+10, -size[1] / 2, 0)
-+		glVertex3f(-size[0] / 2, -size[1] / 2, 0)
-+		glVertex3f(-size[0] / 2, -size[1] / 2+10, 0)
-+		glEnd()
- 
- 		glDepthMask(False)
- 
diff --git a/cura-newlines.patch b/cura-newlines.patch
deleted file mode 100644
index 1b50441..0000000
--- a/cura-newlines.patch
+++ /dev/null
@@ -1,38 +0,0 @@
---- Cura-15.02.1/resources/locale/zh/LC_MESSAGES/Cura.po~	2015-05-14 22:40:18.934776079 +0200
-+++ Cura-15.02.1/resources/locale/zh/LC_MESSAGES/Cura.po	2015-05-14 22:40:49.762177833 +0200
-@@ -1679,7 +1679,7 @@
- "支撑结构类型。\n"
- "通常使用\"Touching buildplate\"建立支撑 \n"
- "\n"
--"选择 None 不会建立支撑\n"
-+"选择 None 不会建立支撑"
- 
- #: Cura/util/profile.py:192 Cura/util/profile.py:243
- msgid "Brim"
-@@ -1712,7 +1712,7 @@
- "(Note that enabling the brim or raft disables the skirt)"
- msgstr ""
- "Brim会在模型底边周围增加数圈薄层,推荐使用这个选项\n"
--"Raft会打印模型前打印一个网状底座\n"
-+"Raft会打印模型前打印一个网状底座"
- 
- #: Cura/util/profile.py:193
- msgid "Both"
-@@ -2565,7 +2565,7 @@
- "个\n"
- "选项会打开会则会不理会这些洞.这个选项一般是你所不需要的,除非在出现切片失败"
- "的\n"
--"情况下,你可能需要打开它.\n"
-+"情况下,你可能需要打开它."
- 
- #: Cura/util/profile.py:258
- msgid "Extensive stitching"
-@@ -2762,7 +2762,7 @@
- msgstr ""
- "GCode生成的风格\n"
- "RepRap一般是5D GCode,兼容于Marlin/Sprinter固件\n"
--"UltiGCode是一种GCode派生,把部分配置放到里机器里,而不是切片软件\n"
-+"UltiGCode是一种GCode派生,把部分配置放到里机器里,而不是切片软件"
- 
- #: Cura/util/profile.py:533
- msgid "Extruder count"
diff --git a/cura-no-firmware.patch b/cura-no-firmware.patch
deleted file mode 100644
index e3c92cb..0000000
--- a/cura-no-firmware.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-diff -urN Cura-15.02.1.org/Cura/gui/firmwareInstall.py Cura-15.02.1/Cura/gui/firmwareInstall.py
---- Cura-15.02.1.org/Cura/gui/firmwareInstall.py	2015-02-18 21:22:48.000000000 +0100
-+++ Cura-15.02.1/Cura/gui/firmwareInstall.py	2015-05-14 22:37:20.963865640 +0200
-@@ -17,47 +17,6 @@
- from Cura.util import resources
- 
- def getDefaultFirmware(machineIndex = None):
--	machine_type = profile.getMachineSetting('machine_type', machineIndex)
--	extruders = profile.getMachineSettingFloat('extruder_amount', machineIndex)
--	heated_bed = profile.getMachineSetting('has_heated_bed', machineIndex) == 'True'
--	baudrate = 250000
--	if sys.platform.startswith('linux'):
--		baudrate = 115200
--	if machine_type == 'ultimaker':
--		name = 'MarlinUltimaker'
--		if extruders > 2:
--			return None
--		if heated_bed:
--			name += '-HBK'
--		name += '-%d' % (baudrate)
--		if extruders > 1:
--			name += '-dual'
--		return resources.getPathForFirmware(name + '.hex')
--
--	if machine_type == 'ultimaker_plus':
--		name = 'MarlinUltimaker-UMOP-%d' % (baudrate)
--		if extruders > 2:
--			return None
--		if extruders > 1:
--			name += '-dual'
--		return resources.getPathForFirmware(name + '.hex')
--
--	if machine_type == 'ultimaker2':
--		if extruders > 2:
--			return None
--		if extruders > 1:
--			return resources.getPathForFirmware("MarlinUltimaker2-dual.hex")
--		return resources.getPathForFirmware("MarlinUltimaker2.hex")
--	if machine_type == 'ultimaker2go':
--		return resources.getPathForFirmware("MarlinUltimaker2go.hex")
--	if machine_type == 'ultimaker2extended':
--		if extruders > 2:
--			return None
--		if extruders > 1:
--			return resources.getPathForFirmware("MarlinUltimaker2extended-dual.hex")
--		return resources.getPathForFirmware("MarlinUltimaker2extended.hex")
--	if machine_type == 'Witbox':
--		return resources.getPathForFirmware("MarlinWitbox.hex")
- 	return None
- 
- class InstallFirmware(wx.Dialog):
-@@ -68,7 +27,7 @@
- 		if filename is None:
- 			filename = getDefaultFirmware(machineIndex)
- 		if filename is None:
--			wx.MessageBox(_("I am sorry, but Cura does not ship with a default firmware for your machine configuration."), _("Firmware update"), wx.OK | wx.ICON_ERROR)
-+			wx.MessageBox(_("I am sorry, but Cura on Fedora does not ship firmware for technical reasons. Please go download it and install it as custom firmware instead."), _("Firmware update"), wx.OK | wx.ICON_ERROR)
- 			self.Destroy()
- 			return
- 		self._machine_type = profile.getMachineSetting('machine_type', machineIndex)
-diff -urN Cura-15.02.1.org/Cura/gui/mainWindow.py Cura-15.02.1/Cura/gui/mainWindow.py
---- Cura-15.02.1.org/Cura/gui/mainWindow.py	2015-02-18 21:22:48.000000000 +0100
-+++ Cura-15.02.1/Cura/gui/mainWindow.py	2015-05-14 22:37:36.827577248 +0200
-@@ -375,7 +375,6 @@
- 			self.splitter.SetSashPosition(self.normalSashPos, True)
- 			# Enabled sash
- 			self.splitter.SetSashSize(4)
--		self.defaultFirmwareInstallMenuItem.Enable(firmwareInstall.getDefaultFirmware() is not None)
- 		if profile.getMachineSetting('machine_type').startswith('ultimaker2'):
- 			self.bedLevelWizardMenuItem.Enable(False)
- 			self.headOffsetWizardMenuItem.Enable(False)
-@@ -483,9 +482,6 @@
- 		#Add tools for machines.
- 		self.machineMenu.AppendSeparator()
- 
--		self.defaultFirmwareInstallMenuItem = self.machineMenu.Append(-1, _("Install default firmware..."))
--		self.Bind(wx.EVT_MENU, self.OnDefaultMarlinFirmware, self.defaultFirmwareInstallMenuItem)
--
- 		i = self.machineMenu.Append(-1, _("Install custom firmware..."))
- 		self.Bind(wx.EVT_MENU, self.OnCustomFirmware, i)
- 
diff --git a/cura-system-paths.patch b/cura-system-paths.patch
deleted file mode 100644
index 8e345ec..0000000
--- a/cura-system-paths.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-# Use system paths
-diff --git a/Cura/util/pluginInfo.py b/Cura/util/pluginInfo.py
-index 7290c8b..52fa14b 100644
---- a/Cura/util/pluginInfo.py
-+++ b/Cura/util/pluginInfo.py
-@@ -80,14 +80,7 @@ def setPostProcessPluginConfig(config):
- 	profile.putProfileSetting('plugin_config', pickle.dumps(config))
- 
- def getPluginBasePaths():
--	ret = []
--	if platform.system() != "Windows":
--		ret.append(os.path.expanduser('~/.cura/plugins/'))
--	if platform.system() == "Darwin" and hasattr(sys, 'frozen'):
--		ret.append(os.path.normpath(os.path.join(resources.resourceBasePath, "plugins")))
--	else:
--		ret.append(os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', 'plugins')))
--	return ret
-+	return [os.path.expanduser('~/.cura/plugins/'), '/usr/share/cura/plugins']
- 
- def getPluginList(pluginType):
- 	global _pluginList
-diff --git a/Cura/util/resources.py b/Cura/util/resources.py
-index e63230b..99bb5ce 100644
---- a/Cura/util/resources.py
-+++ b/Cura/util/resources.py
-@@ -28,7 +28,7 @@ if sys.platform.startswith('darwin'):
- 	else:
- 		resourceBasePath = os.path.join(os.path.dirname(__file__), "../../resources")
- else:
--	resourceBasePath = os.path.join(os.path.dirname(__file__), "../../resources")
-+	resourceBasePath = "/usr/share/cura"
- 
- def getPathForResource(dir, subdir, resource_name):
- 	assert os.path.isdir(dir), "{p} is not a directory".format(p=dir)
diff --git a/cura-version.patch b/cura-version.patch
deleted file mode 100644
index 8bef0e2..0000000
--- a/cura-version.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-# Rework the logic of determining the version (didn't work)
-diff --git a/Cura/util/version.py b/Cura/util/version.py
-index 56faeee..add5eb0 100644
---- a/Cura/util/version.py
-+++ b/Cura/util/version.py
-@@ -17,70 +17,12 @@ except:
- from Cura.util import resources
- 
- def getVersion(getGitVersion = True):
--	gitPath = os.path.abspath(os.path.join(os.path.split(os.path.abspath(__file__))[0], "../.."))
--	if hasattr(sys, 'frozen'):
--		versionFile = os.path.normpath(os.path.join(resources.resourceBasePath, "version"))
--	else:
--		versionFile = os.path.abspath(os.path.join(os.path.split(os.path.abspath(__file__))[0], "../version"))
--
--	if getGitVersion:
--		try:
--			gitProcess = subprocess.Popen(args = "git show -s --pretty=format:%H", shell = True, cwd = gitPath, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
--			(stdoutdata, stderrdata) = gitProcess.communicate()
--
--			if gitProcess.returncode == 0:
--				return stdoutdata
--		except:
--			pass
--
--	gitHeadFile = gitPath + "/.git/refs/heads/SteamEngine"
--	if os.path.isfile(gitHeadFile):
--		if not getGitVersion:
--			return "dev"
--		f = open(gitHeadFile, "r")
--		version = f.readline()
--		f.close()
--		return version.strip()
--	if os.path.exists(versionFile):
--		f = open(versionFile, "r")
--		version = f.readline()
--		f.close()
--		return version.strip()
--	versionFile = os.path.abspath(os.path.join(os.path.split(os.path.abspath(__file__))[0], "../../version"))
--	if os.path.exists(versionFile):
--		f = open(versionFile, "r")
--		version = f.readline()
--		f.close()
--		return version.strip()
--	return "UNKNOWN" #No idea what the version is. TODO:Tell the user.
-+	return "REPLACE_THIS_IN_SPEC"
- 
- def isDevVersion():
--	gitPath = os.path.abspath(os.path.join(os.path.split(os.path.abspath(__file__))[0], "../../.git"))
--	hgPath  = os.path.abspath(os.path.join(os.path.split(os.path.abspath(__file__))[0], "../../.hg"))
--	return os.path.exists(gitPath) or os.path.exists(hgPath)
-+	return False
- 
- def checkForNewerVersion():
--	if isDevVersion():
--		return None
--	try:
--		updateBaseURL = 'http://software.ultimaker.com'
--		localVersion = map(int, getVersion(False).split('.'))
--		while len(localVersion) < 3:
--			localVersion += [1]
--		latestFile = urllib2.urlopen("%s/latest.xml" % (updateBaseURL))
--		latestXml = latestFile.read()
--		latestFile.close()
--		xmlTree = ElementTree.fromstring(latestXml)
--		for release in xmlTree.iter('release'):
--			os = str(release.attrib['os'])
--			version = [int(release.attrib['major']), int(release.attrib['minor']), int(release.attrib['revision'])]
--			filename = release.find("filename").text
--			if platform.system() == os:
--				if version > localVersion:
--					return "%s/current/%s" % (updateBaseURL, filename)
--	except:
--		#print sys.exc_info()
--		return None
- 	return None
- 
- if __name__ == '__main__':
diff --git a/cura.desktop b/cura.desktop
deleted file mode 100644
index 9debbd2..0000000
--- a/cura.desktop
+++ /dev/null
@@ -1,9 +0,0 @@
-
-[Desktop Entry]
-Name=Cura
-GenericName=3D Printer Interface
-Exec=cura
-Icon=/usr/share/pixmaps/cura.ico
-Terminal=false
-Type=Application
-Categories=Graphics;
diff --git a/plugins-path.patch b/plugins-path.patch
new file mode 100644
index 0000000..fd7d955
--- /dev/null
+++ b/plugins-path.patch
@@ -0,0 +1,22 @@
+--- Cura-2.5.0/cura/CuraApplication.py.orig	2017-04-21 13:30:29.000000000 +0200
++++ Cura-2.5.0/cura/CuraApplication.py	2017-05-14 11:14:40.735151508 +0200
+@@ -454,7 +454,7 @@
+     def _loadPlugins(self):
+         self._plugin_registry.addType("profile_reader", self._addProfileReader)
+         self._plugin_registry.addType("profile_writer", self._addProfileWriter)
+-        self._plugin_registry.addPluginLocation(os.path.join(QtApplication.getInstallPrefix(), "lib", "cura"))
++        self._plugin_registry.addPluginLocation(os.path.join(QtApplication.getInstallPrefix(), "share", "cura"))
+         if not hasattr(sys, "frozen"):
+             self._plugin_registry.addPluginLocation(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "plugins"))
+             self._plugin_registry.loadPlugin("ConsoleLogger")
+--- Cura-2.5.0/CMakeLists.txt~	2017-05-14 00:42:31.000000000 +0200
++++ Cura-2.5.0/CMakeLists.txt	2017-05-14 11:18:14.335558709 +0200
+@@ -36,7 +36,7 @@
+ install(DIRECTORY resources
+         DESTINATION ${CMAKE_INSTALL_DATADIR}/cura)
+ install(DIRECTORY plugins
+-        DESTINATION lib/cura)
++        DESTINATION ${CMAKE_INSTALL_DATADIR}/cura)
+ if(NOT APPLE AND NOT WIN32)
+     install(FILES cura_app.py
+             DESTINATION ${CMAKE_INSTALL_BINDIR}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cura.git/commitdiff/bb32f111fba23419fc930012d0fc5988f8683404



More information about the pld-cvs-commit mailing list