×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

cross-compile of kstars

  • Posts: 2877
  • Thank you received: 812
P.S. Be careful of spaces and tabs, python is ridiculously picky about those. Python uses indenting to determine what code is inside or outside of a code block. For example, if you try to indent the same way as the code above using tabs when the code above it used spaces, it will complain that the file has syntax errors. So try to match the syntax that already exists in the python file when you change it.
5 years 3 months ago #33323

Please Log in or Create an account to join the conversation.

  • Posts: 95
  • Thank you received: 14
Thanks for sticking with this, Rob..

My blueprint file is actually at :

etc\blueprints\locations\craft-blueprints-kde\kde\applications\kstars

The top part of the file is :
class subinfo(info.infoclass):
    def setTargets(self):
        self.versionInfo.setDefaultValues()
        self.description = 'a desktop planetarium'
        for ver in ['3.0.0']:
            self.targets[ver] = 'http://download.kde.org/stable/kstars/kstars-%s.tar.xz' % ver
            self.targetInstSrc[ver] = 'kstars-%s' % ver
        self.defaultTarget = '3.0.0'
        self.displayName = "KStars Desktop Planetarium"

When I replace after "def setTargets(self):" with (only using spaces as the indent)

class subinfo(info.infoclass):
    def setTargets(self):
        self.description = 'a desktop planetarium'
	self.svnTargets = " github.com/KDE/kstars.git "
	self.targetInstSrc = ""
	self.displayName = "KStars Desktop Planetarium"
	self.defaultTarget = 'Latest'


I get :

'in <string>' requires string as left operand, not NoneType
Traceback (most recent call last):
  File "C:\CraftRoot\craft\bin\craft.py", line 250, in <module>
    success = main()
  File "C:\CraftRoot\craft\bin\craft.py", line 238, in main
    if not CraftCommands.run(package, action, tempArgs):
  File "C:\CraftRoot\craft\bin\CraftCommands.py", line 246, in run
    depList = depPackage.getDependencies(depType=depType)
  File "C:\CraftRoot\craft\bin\Blueprints\CraftDependencyPackage.py", line 105, in getDependencies
    self.depenendencyType = depType
  File "C:\CraftRoot\craft\bin\Blueprints\CraftDependencyPackage.py", line 45, in depenendencyType
    self.__resolveDependencies()
  File "C:\CraftRoot\craft\bin\Blueprints\CraftDependencyPackage.py", line 58, in __resolveDependencies
    self.dependencies.extend(self.__readDependenciesForChildren([(x, None) for x in self.children.values()]))
  File "C:\CraftRoot\craft\bin\Blueprints\CraftDependencyPackage.py", line 74, in __readDependenciesForChildren
    p.depenendencyType = self.depenendencyType
  File "C:\CraftRoot\craft\bin\Blueprints\CraftDependencyPackage.py", line 45, in depenendencyType
    self.__resolveDependencies()
  File "C:\CraftRoot\craft\bin\Blueprints\CraftDependencyPackage.py", line 50, in __resolveDependencies
    subinfo = self.subinfo
  File "C:\CraftRoot\craft\bin\Blueprints\CraftPackageObject.py", line 319, in subinfo
    return self.instance.subinfo
  File "C:\CraftRoot\craft\bin\Blueprints\CraftPackageObject.py", line 307, in instance
    pack = mod.Package()
  File "C:\CraftRoot\etc\blueprints\locations\craft-blueprints-kde\kde\applications\kstars\kstars.py", line 53, in __init__
    CMakePackageBase.__init__(self)
  File "C:\CraftRoot\craft\bin\Package\CMakePackageBase.py", line 15, in __init__
    PackageBase.__init__(self)
  File "C:\CraftRoot\craft\bin\Package\PackageBase.py", line 32, in __init__
    CraftBase.__init__(self)
  File "C:\CraftRoot\craft\bin\CraftBase.py", line 38, in inner
    return fun(*args, **kwargs)
  File "C:\CraftRoot\craft\bin\CraftBase.py", line 58, in __init__
    self.subinfo = mod.subinfo(self)
  File "C:\CraftRoot\craft\bin\info.py", line 68, in __init__
    self.setBuildTarget()
  File "C:\CraftRoot\craft\bin\info.py", line 116, in setBuildTarget
    self.buildTarget = self.defaultTarget
  File "C:\CraftRoot\craft\bin\info.py", line 91, in defaultTarget
    if target in self.targets or target in self.svnTargets:
TypeError: 'in <string>' requires string as left operand, not NoneType
Last edit: 5 years 3 months ago by Phil Shepherd.
5 years 3 months ago #33332

Please Log in or Create an account to join the conversation.

  • Posts: 2877
  • Thank you received: 812
I think that is likely the error I was telling you about. Probably the easiest way to fix this is instead of just copying and pasting the code that I gave you, start with the file the way it was and just edit each line appropriately. Then you won't have any syntax errors. Watch those spaces and tabs, they are not the same.
5 years 3 months ago #33333

Please Log in or Create an account to join the conversation.

  • Posts: 95
  • Thank you received: 14
In the original, there are no tabs... I use the same spaces and indent exactly the same
5 years 3 months ago #33334

Please Log in or Create an account to join the conversation.

  • Posts: 2877
  • Thank you received: 812
Do you have a text editor that shows you the hidden characters so that you can make sure it is all the same? To be honest, this is what I hate the most about python.
5 years 3 months ago #33335

Please Log in or Create an account to join the conversation.

  • Posts: 95
  • Thank you received: 14
It's exactly how I pasted the code above - with spaces
5 years 3 months ago #33337

Please Log in or Create an account to join the conversation.

  • Posts: 95
  • Thank you received: 14
I just used my local copy of emacs (I've been using that editor for 25 yrs!) - no tabs... all spaces.... in fact, Emacs has a python mode which is showing me the correct indents
5 years 3 months ago #33338

Please Log in or Create an account to join the conversation.

  • Posts: 2877
  • Thank you received: 812
Hmm, see if this works. Just remember to change the .txt to .py


File Attachment:

File Name: kstars.txt
File Size:4 KB
5 years 3 months ago #33339
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 95
  • Thank you received: 14
That seems to be working now! Nice 1

Phil
5 years 3 months ago #33340

Please Log in or Create an account to join the conversation.

  • Posts: 2877
  • Thank you received: 812
Yeah, as I said, stupid python and its syntax issues.
The following user(s) said Thank You: Phil Shepherd
5 years 3 months ago #33341

Please Log in or Create an account to join the conversation.

  • Posts: 2877
  • Thank you received: 812
Python is really easy to use as long as it doesn't have syntax problems. . ..
5 years 3 months ago #33342

Please Log in or Create an account to join the conversation.

  • Posts: 95
  • Thank you received: 14
LOL - that just about covers all the other languages I use day-to-day :woohoo:

Thanks for the help, Rob - appreciated

Phil
5 years 3 months ago #33343

Please Log in or Create an account to join the conversation.

Time to create page: 1.255 seconds