From f96865ef5ab4c847db0a965b8beffdd63ea8ab9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 4 May 2017 18:53:39 +0200 Subject: [PATCH] Update to modern Cura 2.x (introduce Epoch) (#1393176) --- .gitignore | 1 + cura-czech-newlines.patch | 32 ------- cura-dead-object.patch | 55 ----------- cura-dont-show-nc-stls.patch | 126 ------------------------- cura-no-firmware.patch | 87 ------------------ cura-stripper.sh | 34 ------- cura-system-paths.patch | 33 ------- cura-version.patch | 77 ---------------- cura-xdg-open.patch | 50 ---------- cura.desktop | 9 -- cura.spec | 174 ++++++++++++++++++++--------------- sources | 2 +- 12 files changed, 100 insertions(+), 580 deletions(-) delete mode 100644 cura-czech-newlines.patch delete mode 100644 cura-dead-object.patch delete mode 100644 cura-dont-show-nc-stls.patch delete mode 100644 cura-no-firmware.patch delete mode 100755 cura-stripper.sh delete mode 100644 cura-system-paths.patch delete mode 100644 cura-version.patch delete mode 100644 cura-xdg-open.patch delete mode 100644 cura.desktop diff --git a/.gitignore b/.gitignore index c0a02cc..d151f3f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /Cura-14.12.1-fedora.tar.gz /Cura-15.02.1-fedora.tar.gz /Cura-95c2af21db7fdda8c4324a923fa004859f6c5b9c-fedora.tar.gz +/cura-2.5.0.tar.gz diff --git a/cura-czech-newlines.patch b/cura-czech-newlines.patch deleted file mode 100644 index 48c2e24..0000000 --- a/cura-czech-newlines.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/resources/locale/cs/LC_MESSAGES/Cura.po b/resources/locale/cs/LC_MESSAGES/Cura.po -index 670e2fd..6b8d78a 100644 ---- a/resources/locale/cs/LC_MESSAGES/Cura.po -+++ b/resources/locale/cs/LC_MESSAGES/Cura.po -@@ -147,7 +147,7 @@ msgstr "Dvojtryska (experimentální)" - msgid "If you have an Ultimaker bought after october 2012 you will have the\n" - "Extruder drive upgrade. If you do not have this upgrade,\n" - "it is highly recommended to improve reliability." --msgstr "Pokud jste zakoupil Ultimaker po říjnu 2012, budete mít upgrade extrudéru. Pokud tento upgrade nevlastníte, doporučujeme jej zakoupit pro zvýšení spolehlivosti.\n" -+msgstr "Pokud jste zakoupil Ultimaker po říjnu 2012, budete mít upgrade extrudéru. Pokud tento upgrade nevlastníte, doporučujeme jej zakoupit pro zvýšení spolehlivosti." - "" - - #: Cura/gui/configWizard.py:464 -@@ -368,7 +368,7 @@ msgstr "Nepodařilo se najít tiskárnu pro aktualizaci firmware. Je tiskárna p - - #: Cura/gui/firmwareInstall.py:107 - msgid "Uploading firmware..." --msgstr "Nahrávám firmware\n" -+msgstr "Nahrávám firmware..." - "" - - #: Cura/gui/firmwareInstall.py:110 -@@ -379,8 +379,7 @@ msgstr "Hotovo!\n" - - #: Cura/gui/firmwareInstall.py:112 - msgid "Failed to write firmware.\n" --"" --msgstr "Nepodařilo se zapsat firmware" -+msgstr "Nepodařilo se zapsat firmware.\n" - - #: Cura/gui/mainWindow.py:66 - msgid "Load model file...\tCTRL+L" diff --git a/cura-dead-object.patch b/cura-dead-object.patch deleted file mode 100644 index 33a0a30..0000000 --- a/cura-dead-object.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 6a6d7d86266c832e3c7df43976218ca2e220f501 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Mon, 6 Jul 2015 13:53:05 +0200 -Subject: [PATCH] Prevent PyDeadObjectError - -On wxPython 3, PyDeadObjectError exception was risen -when Cura was started for the first time. - -This ensures it won't happen. - -Related bug: https://bugzilla.redhat.com/show_bug.cgi?id=1230281 ---- - Cura/gui/app.py | 3 +++ - Cura/gui/splashScreen.py | 3 ++- - 2 files changed, 5 insertions(+), 1 deletion(-) - -diff --git a/Cura/gui/app.py b/Cura/gui/app.py -index 38c79fe..ebbb1e5 100644 ---- a/Cura/gui/app.py -+++ b/Cura/gui/app.py -@@ -134,6 +134,7 @@ def afterSplashCallback(self): - self.loadFiles = [exampleFile] - if self.splash is not None: - self.splash.Show(False) -+ self.splash = None - configWizard.ConfigWizard() - - if profile.getPreference('check_for_updates') == 'True': -@@ -141,6 +142,7 @@ def afterSplashCallback(self): - if newVersion is not None: - if self.splash is not None: - self.splash.Show(False) -+ self.splash = None - if wx.MessageBox(_("A new version of Cura is available, would you like to download?"), _("New version available"), wx.YES_NO | wx.ICON_INFORMATION) == wx.YES: - webbrowser.open(newVersion) - return -@@ -149,6 +151,7 @@ def afterSplashCallback(self): - self.mainWindow = mainWindow.mainWindow() - if self.splash is not None: - self.splash.Show(False) -+ self.splash = None - self.SetTopWindow(self.mainWindow) - self.mainWindow.Show() - self.mainWindow.OnDropFiles(self.loadFiles) -diff --git a/Cura/gui/splashScreen.py b/Cura/gui/splashScreen.py -index e2a2613..06e2bd7 100644 ---- a/Cura/gui/splashScreen.py -+++ b/Cura/gui/splashScreen.py -@@ -13,4 +13,5 @@ def __init__(self, callback): - - def DoCallback(self): - self.callback() -- self.Destroy() -+ if self: -+ self.Destroy() diff --git a/cura-dont-show-nc-stls.patch b/cura-dont-show-nc-stls.patch deleted file mode 100644 index e355c96..0000000 --- a/cura-dont-show-nc-stls.patch +++ /dev/null @@ -1,126 +0,0 @@ -diff --git a/Cura/gui/sceneView.py b/Cura/gui/sceneView.py -index e31bfd0..3448b3d 100644 ---- a/Cura/gui/sceneView.py -+++ b/Cura/gui/sceneView.py -@@ -1325,111 +1325,16 @@ class SceneView(openglGui.glGuiPanel): - - 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' or machine_type == 'ultimaker2+' or machine_type == 'ultimaker2+extended': -- filename = resources.getPathForMesh('ultimaker2_platform.stl') -- offset = [-9,-37,145] -- if machine_type.startswith('ultimaker2+'): -- texture_name = 'Ultimaker2plusbackplate.png' -- else: -- 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] -- elif machine_type == 'Hephestos': -- filename = resources.getPathForMesh('hephestos_platform.stl') -- offset = [0,0,-80] -- -- 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-no-firmware.patch b/cura-no-firmware.patch deleted file mode 100644 index d51a45f..0000000 --- a/cura-no-firmware.patch +++ /dev/null @@ -1,87 +0,0 @@ -diff --git a/Cura/gui/firmwareInstall.py b/Cura/gui/firmwareInstall.py -index 44c1ed5..f59b967 100644 ---- a/Cura/gui/firmwareInstall.py -+++ b/Cura/gui/firmwareInstall.py -@@ -18,51 +18,6 @@ from Cura.util import profile - 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 == 'ultimaker2+': -- return resources.getPathForFirmware("MarlinUltimaker2Plus.hex") -- if machine_type == 'ultimaker2+extended': -- return resources.getPathForFirmware("MarlinUltimaker2PlusExtended.hex") -- if machine_type == 'Witbox': -- return resources.getPathForFirmware("MarlinWitbox.hex") - return None - - class InstallFirmware(wx.Dialog): -@@ -77,7 +32,7 @@ class InstallFirmware(wx.Dialog): - else: - self._default_firmware = False - 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 --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py -index 46b009b..362c0e0 100644 ---- a/Cura/gui/mainWindow.py -+++ b/Cura/gui/mainWindow.py -@@ -384,7 +384,6 @@ class mainWindow(wx.Frame): - 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) -@@ -492,9 +491,6 @@ class mainWindow(wx.Frame): - #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-stripper.sh b/cura-stripper.sh deleted file mode 100755 index c9026ef..0000000 --- a/cura-stripper.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -VERSION="$1" - -wget "https://github.com/daid/Cura/archive/$VERSION.tar.gz" || exit 1 - -tar -xzf "Cura-$VERSION.tar.gz" || exit 1 -cd "Cura-$VERSION" - -# not needed -rm -rf scripts - -# Remove CC BY-NC content -# It cannot be shipped with/in Fedora, as it has use restrictions -rm -f resources/meshes/* -rm -f resources/example/UltimakerRobot_support.stl - -# Remove binary locales -rm -f resources/locale/*/LC_MESSAGES/*.mo - -# Drop the note about the removal -echo -e '\n\nPlease note, that files under the terms of CC BY-NC has been removed form this Fedora package for legal reasons.' >> resources/example/Attribution.txt - -# 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 - -# Remove the firmware -# It is binary, so it is prohibited in Fedora -rm -rf resources/firmware - -cd .. -# rm -f "$VERSION.tar.gz" -tar -czf Cura-$VERSION-fedora.tar.gz "Cura-$VERSION" diff --git a/cura-system-paths.patch b/cura-system-paths.patch deleted file mode 100644 index c6060eb..0000000 --- a/cura-system-paths.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/Cura/util/pluginInfo.py b/Cura/util/pluginInfo.py -index eba3770..9dcc812 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 c717850..2827bc7 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 8749999..0000000 --- a/cura-version.patch +++ /dev/null @@ -1,77 +0,0 @@ -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-xdg-open.patch b/cura-xdg-open.patch deleted file mode 100644 index 6b0dbf0..0000000 --- a/cura-xdg-open.patch +++ /dev/null @@ -1,50 +0,0 @@ -From b18336db6e109d381d1e265475adb85c8ba82357 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Fri, 29 May 2015 10:28:17 +0200 -Subject: [PATCH] Replace direct calls to Nautilus and Dolphin with xdg-open - -This will still work in GNOME and KDE, but will also enable -the functions for other Linux desktop environments, such as Xfce or MATE ---- - Cura/util/explorer.py | 16 +++++----------- - 1 file changed, 5 insertions(+), 11 deletions(-) - -diff --git a/Cura/util/explorer.py b/Cura/util/explorer.py -index 1e2a5a0..8726c56 100644 ---- a/Cura/util/explorer.py -+++ b/Cura/util/explorer.py -@@ -13,9 +13,7 @@ def hasExplorer(): - if sys.platform == 'win32' or sys.platform == 'cygwin' or sys.platform == 'darwin': - return True - if sys.platform == 'linux2': -- if os.path.isfile('/usr/bin/nautilus'): -- return True -- if os.path.isfile('/usr/bin/dolphin'): -+ if os.path.isfile('/usr/bin/xdg-open'): - return True - return False - -@@ -27,10 +25,8 @@ def openExplorer(filename): - subprocess.Popen(['open', '-R', filename]) - if sys.platform.startswith('linux'): - #TODO: On linux we cannot seem to select a certain file, only open the specified path. -- if os.path.isfile('/usr/bin/nautilus'): -- subprocess.Popen(['/usr/bin/nautilus', os.path.split(filename)[0]]) -- elif os.path.isfile('/usr/bin/dolphin'): -- subprocess.Popen(['/usr/bin/dolphin', os.path.split(filename)[0]]) -+ if os.path.isfile('/usr/bin/xdg-open'): -+ subprocess.Popen(['/usr/bin/xdg-open', os.path.split(filename)[0]]) - - def openExplorerPath(filename): - """Open a file dialog inside a directory, without selecting any file.""" -@@ -39,8 +35,6 @@ def openExplorerPath(filename): - if sys.platform == 'darwin': - subprocess.Popen(['open', filename]) - if sys.platform.startswith('linux'): -- if os.path.isfile('/usr/bin/nautilus'): -- subprocess.Popen(['/usr/bin/nautilus', filename]) -- elif os.path.isfile('/usr/bin/dolphin'): -- subprocess.Popen(['/usr/bin/dolphin', filename]) -+ if os.path.isfile('/usr/bin/xdg-open'): -+ subprocess.Popen(['/usr/bin/xdg-open', filename]) - 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/cura.spec b/cura.spec index 17f5b64..8a53acf 100644 --- a/cura.spec +++ b/cura.spec @@ -1,114 +1,136 @@ Name: cura -Version: 15.04.4 -%global commit 95c2af21db7fdda8c4324a923fa004859f6c5b9c -Release: 6%{?dist} +Version: 2.5.0 +Epoch: 1 +Release: 1%{?dist} Summary: 3D printer control software +License: AGPLv3+ -# 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 - -URL: http://daid.github.com/Cura/ - -# I've stripped the source with the script in Source3 -# To remove CC BY-NC content -# Upstream not willing to ship free package -Source0: Cura-%{commit}-fedora.tar.gz -Source1: %{name} -Source2: %{name}.desktop -Source3: %{name}-stripper.sh - -# UltimakerPlatforms STLs were stripped from the tarball, don't crash because of that -Patch0: %{name}-dont-show-nc-stls.patch - -# Use system paths -Patch1: %{name}-system-paths.patch - -# Rework the logic of determining the version (didn't work) -Patch2: %{name}-version.patch - -# Disable installation of firmwares Fedora doesn't ship -Patch3: %{name}-no-firmware.patch +URL: https://ultimaker.com/en/products/cura-software +Source0: https://github.com/Ultimaker/Cura/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz BuildArch: noarch -BuildRequires: python2-devel -BuildRequires: dos2unix + +# There are Python plugins in /usr/lib/cura +# We need to byte-compile it with Python 3 +%global __python %{__python3} + +BuildRequires: cmake BuildRequires: desktop-file-utils +BuildRequires: dos2unix BuildRequires: gettext -Requires: PyOpenGL -Requires: wxPython -Requires: pyserial -Requires: numpy -Requires: python-power -Requires: CuraEngine >= 15.04 +BuildRequires: git +BuildRequires: python3-devel +BuildRequires: python3-pytest +BuildRequires: python3-uranium == %{version} + +Requires: open-sans-fonts +Requires: python3-pyserial +Requires: python3-savitar +Requires: python3-uranium == %{version} +Requires: python3-zeroconf +Requires: CuraEngine == %{epoch}:%{version} + # So that it just works -Requires: 3dprinter-udev-rules +Requires: 3dprinter-udev-rules %description Cura is a project which aims to be an single software solution for 3D printing. While it is developed to be used with the Ultimaker 3D printer, it can be used with other RepRap based designs. -Cura helps you to setup an Ultimaker, shows your 3D model, allows for scaling / -positioning, can slice the model to G-Code, with sane editable configuration -settings and send this G-Code to the 3D printer for printing. +Cura prepares your model for 3D printing. For novices, it makes it easy to get +great results. For experts, there are over 200 settings to adjust to your +needs. As it's open source, our community helps enrich it even more. %prep -%setup -qn Cura-%{commit} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 +%autosetup -p1 -S git -n Cura-%{version} -dos2unix resources/example/Attribution.txt +# The setup.py is only useful for py2exe, remove it, so noone is tempted to use it +rm setup.py -sed -i 's/REPLACE_THIS_IN_SPEC/%{version}/' Cura/util/version.py +# https://github.com/Ultimaker/Cura/issues/1784 +sed -i 's/Version=1/Version=1.1/' cura.desktop.in + +# Upstream installs to lib/python3/dist-packages +# We want to install to %%{python3_sitelib} +sed -i 's|lib/python${PYTHON_VERSION_MAJOR}/dist-packages|%(echo %{python3_sitelib} | sed -e s@%{_prefix}/@@)|g' CMakeLists.txt + +# Wrong end of line encoding +dos2unix docs/How_to_use_the_flame_graph_profiler.md + +# Wrong shebang +sed -i '1s=^#!/usr/bin/\(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 +%{cmake} -DCURA_VERSION:STRING=%{version} . +make %{?_smp_mflags} + # 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 +cd resources/i18n +rm *.pot +for DIR in *; do + pushd $DIR + for FILE in *.po; do + msgfmt $FILE.po -o LC_MESSAGES/${FILE%po}mo || : + done + popd done cd - + %install -mkdir -p %{buildroot}%{python_sitelib}/Cura -mkdir -p %{buildroot}%{_datadir}/%{name}/firmware -mkdir -p %{buildroot}%{_datadir}/pixmaps -mkdir -p %{buildroot}%{_datadir}/locale -mkdir -p %{buildroot}%{_bindir} +make install DESTDIR=%{buildroot} -cp -apr Cura/* %{buildroot}%{python_sitelib}/Cura -rm -rf %{buildroot}%{python_sitelib}/Cura/LICENSE -cp -apr resources/* %{buildroot}%{_datadir}/%{name} -cp -apr plugins %{buildroot}%{_datadir}/%{name} -cp -ap %{SOURCE1} %{buildroot}%{_bindir} -ln -s %{_datadir}/%{name} %{buildroot}%{python_sitelib}/Cura/resources -ln -s %{_datadir}/%{name}/%{name}.ico %{buildroot}%{_datadir}/pixmaps +# Sanitize the location of locale files +pushd %{buildroot}%{_datadir} +mv cura/resources/i18n locale +ln -s ../../locale cura/resources/i18n +rm locale/*/*.po +popd -# locales -cp -ar %{buildroot}%{_datadir}/%{name}/locale/* %{buildroot}%{_datadir}/locale -rm -rf %{buildroot}%{_datadir}/%{name}/locale -ln -s -f %{_datadir}/locale/ %{buildroot}%{_datadir}/%{name}/ # the app expects the locale folder in here +# Unbundle fonts +rm -rf %{buildroot}%{_datadir}/%{name}/resources/themes/cura/fonts/ +ln -s %{_datadir}/fonts/open-sans/ %{buildroot}%{_datadir}/%{name}/resources/themes/cura/fonts -desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE2} +%find_lang cura +%find_lang fdmextruder.def.json +%find_lang fdmprinter.def.json -%{find_lang} Cura -%files -f Cura.lang -%doc Cura/LICENSE resources/example/Attribution.txt -%{python_sitelib}/Cura +%check +%{__python3} -m pytest -v +desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop + + +%files -f cura.lang -f fdmextruder.def.json.lang -f fdmprinter.def.json.lang +%license LICENSE +%doc README.md +# CHANGES is not updated since 15.x +# things in docs are developer orianted +%{python3_sitelib}/%{name} %{_datadir}/%{name} -%{_datadir}/pixmaps/%{name}.ico %{_datadir}/applications/%{name}.desktop +%{_datadir}/appdata/%{name}.appdata.xml +%{_datadir}/mime/packages/%{name}.xml %{_bindir}/%{name} +%{_prefix}/lib/%{name} %changelog +* Wed May 03 2017 Miro Hrončok - 1:2.5.0-1 +- Update to modern Cura 2.x (introduce Epoch) (#1393176) + * Fri Feb 10 2017 Fedora Release Engineering - 15.04.4-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/sources b/sources index e81c171..87e912e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -53d959e9981831f6e2b33f61dede11cd Cura-95c2af21db7fdda8c4324a923fa004859f6c5b9c-fedora.tar.gz +SHA512 (cura-2.5.0.tar.gz) = 980b0301ab08e66a3663b2c3973b801ae9f356db05eac375789e91e85c3758a3082de7988332833f5bc1a09d6b8a8b4bde2a573c0f057ddd0e9208e9b6e5668d