Pandora Distpnd


Consider that cx_Freeze is designed to turn a Python script into a standalone binary executable (and that's what it does to itself when it installs). To do so, it needs to compile something. So it's complaining that it can't find a compiler. Since I'm way too into Python, I don't know how to install one on a Pandora, but I've seen instructions around.

But it might be easier to just modify the setup script so that it doesn't it doesn't bother compiling with cx_Freeze. The Python scripts should be able to run without compilation, though they might be faster when compiled. I'm not sure exactly what would need to be changed; the "from cx_Freeze import..." line will need to be replaced with "from distutils.core import setup", and there is probably a line starting with "executables = ..." that would need to be replaced with "scripts = ...". But if you're not familiar with distutils or Python, this might be a challenge, depending on how complicated the setup script is.

But I'd still like to look at the code of the program you're porting so I can figure out why they had to use cx_Freeze, and if there's anything I need to change about distPND to work with it. I promise I won't offer any assistance unless you ask :p .
 
Well, of course, I'm just following instructions IKEA-style; I'm hoping that if I follow enough of them successfully, I'll eventually figure out a little about how things work. This seems like it's more complex, though, so I can't do it with the instructions I know right now.

If you do manage to get things to work, please tell me what you did, so I can use the info for next time! :) (or tell me what to do, that works too)

The program is called EasyABC; it's a musical notation program that uses the text-based notation from http://abcnotation.com

Here are the contents of its setup.py file:

Code:
# setup.py
from distutils.core import setup
import sys
import glob
import os.path

version = '1.3.0'
options = {}
executables = []

include_files = [os.path.join('locale', 'sv', 'LC_MESSAGES', 'easyabc.po'),
                 os.path.join('locale', 'sv', 'LC_MESSAGES', 'easyabc.mo')] + \
                 glob.glob(os.path.join('img', '*.*')) + glob.glob(os.path.join('sound', '*.*'))

if sys.platform == "darwin":
    import py2app
    import bdist_mpkg
    buildstyle = 'app'
    options["py2app"] = {"argv_emulation" : True,
    #                     'iconfile'       : "editor_icon.icns",
        #                 'optimize'       : 1,  #2
                         'compressed'     : 0,
                         'excludes': ['Tkinter','tcl','tk','_ssl', 'email'], 
                         'includes': ['mechanize', 'urllib', 'socket', 'pygame.pypm' ],
                            
                         }
    data_files = [('.', ['abc2midi_osx', 'abcm2ps_osx', 'abc2abc_osx', 'generalmidi.txt', 'reference.txt']),
                  ('img', glob.glob(os.path.join('img', '*.*'))),
                  ('sound', glob.glob(os.path.join('sound', '*.*'))),
                  ('locale', []),
                  ('locale/sv', []),
                  ('locale/sv/LC_MESSAGES', glob.glob(os.path.join('locale/sv/LC_MESSAGES/*'))),                  
                  ]
    
    setup(name="EasyABC",
      version=version,
      description = "ABC Editor and Converter",
      long_description = "Nils Liberg's EasyABC 1.3 RC1",
      url='http://www.nilsliberg.se/ksp/easyabc/',
      author='Nils Liberg',      
      options=options,
      data_files=data_files,
      #executables=executables,
      **{buildstyle : [{'script' : 'easy_abc.py',
                     'icon_resources' : [(0, 'img\\logo.ico')]}
                       ]}
      )

else:
    from cx_Freeze import setup, Executable
    base = "Win32GUI"
    icon = 'img\\logo.ico'
    include_files = include_files + \
                    ['abc2midi.exe',
                     'abcm2ps.exe',
                     'midi2abc.exe',
                     'abc2abc.exe',
                     'generalmidi.txt',
                     'reference.txt',
                     'Microsoft.VC90.CRT\\Microsoft.VC90.CRT.manifest',
                     'Microsoft.VC90.CRT\\msvcm90.dll',
                     'Microsoft.VC90.CRT\\msvcp90.dll',
                     'Microsoft.VC90.CRT\\msvcr90.dll',]
    options["build_exe"] = {'excludes': ['Tkinter','tcl','tk','_ssl', 'email'],   #, 'numpy.linalg.lapack_lite',  'numpy.random.mtrand.pyd', 'numpy.fft.fftpack_lite.pyd'],
                        'includes': ['mechanize', 'urllib', 'socket', 'win32api', 'win32process'],
                        'optimize': 1,
                        'include_files': include_files, }

    executables = [Executable(
        script="easy_abc.py",
        base=base,
        icon=icon,
        copyDependentFiles = True,
        appendScriptToExe = False,
        appendScriptToLibrary = False,
    )]
    
            
    setup(name="EasyABC",
          version=version,
          description = "ABC Editor and Converter",
          long_description = "Nils Liberg's EasyABC",
          url='http://nilsliberg.se/ksp/easyabc/',
          author='Nils Liberg',      
          options=options,
          executables=executables,      
          )
 
Yep, this looks like you skipped IKEA and wandered into a carpentry class. Take a look at the using_EasyABC_in_Linux.txt file: between that and the setup.py file, it looks like this wasn't designed to be installed in the traditional Python way of which distPND takes advantage; it only uses the setup script to create Windows and Mac binaries. Furthermore, it has a couple dependencies, abcm2ps and wxPython, which you have to get working first.

If you're intent on turning this into a PND, first make sure you can get it running on your Pandora as-is. Then, for purposes of being thorough and learning, try manually assembling it (and its dependencies) into a PND. Only after that would it be a good idea to try to modify setup.py to use distPND.
 
A carpentry workshop, more like. Are there any instructions I can look at to learn how to do those things you're suggesting (1. getting it to run on the Pandora "as is", 2. getting those dependencies working, 3. manually assembling all that into a PND)?
 
Ah, that's the right analogy! Anyway, those three steps will require a bunch of disparate knowledge, so I doubt it could be picked up all in one place.

First, getting the dependencies working simply requires looking over their sites to find instructions on how to build and install. You'll need standard development tools (like a compiler) to make that happen. Check around the boards and wiki to find out how to get that installed on your Pandora (and I hope you're booting from SD to fit it all). It looks like abcm2ps follows the common "./configure; make; make install" pattern (this seems like some straightforward info on that), while wxPython has its own build script. Getting these working will probably be the trickiest part.

Second, running EasyABC without installing should be really simple. As long as the dependencies are installed, you can follow the instructions in using_EasyABC_in_Linux.txt, which basically boils down to running "python easy_abc.py" from inside its source directory. If errors appear, I expect them to be caused by issues with the dependencies; read those errors to figure out what might be wrong with them.

Third, making a PND from working software isn't too difficult. Everything you need to know is on the wiki (PND quickstart says most of what you need to know, you might need to look over the PXML spec, and the libpnd hub contains a lot more detail that you probably won't need just yet). The process mainly involves putting all the files you need (including dependencies and a PXML) into a folder, then running pnd_make.sh on that folder. Of course, if you have any trouble on this step, lots of people in this forum can help.

But if you'd rather just package up something quickly and painlessly, a lot of software on the Python Package Index should work with distPND with almost no problem at all. Maybe you can find an interesting game there.
 
Tempel, thank you very much for pointing me in the right direction. I've had some problems so far that don't have anything to do with Distpnd, so I'm going to start a separate thread in the next few days to ask about those (once I'm back on my normal computer and can type quicker). Overall, I have to say that opkg on the Pandora doesn't work as it should because the two-year-old firmware isn't compatible with the feed it uses, so doing such work on the Pandora can be difficult.
 
Back
Top