Jump to content


Photo

Distpnd


  • Please log in to reply
25 replies to this topic

#16 Tempel

Tempel

    GP Mania

  • GP32 Hardcore
  • PipPipPipPipPip
  • 416 posts
  • Gender:Male
  • Interests:You, you wonderful person.

Posted 07 March 2011 - 06:26 PM

I figure it deserves its own post: I fixed distPND to no longer rely on run_setup. I found a hacky solution in this old mailing list thread; they all seem to agree that run_setup is generally poor and should be avoided. The latest commit in my develop branch has the fix, so reinstall distPND from there and RedNotebook will build.

#17 quartercast

quartercast

    Mega GP Mania

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 856 posts

Posted 08 March 2011 - 03:58 AM

I figure it deserves its own post: I fixed distPND to no longer rely on run_setup. I found a hacky solution in this old mailing list thread; they all seem to agree that run_setup is generally poor and should be avoided. The latest commit in my develop branch has the fix, so reinstall distPND from there and RedNotebook will build.


Thanks so much, I will try it tonight :)

#18 Esn

Esn

    (:\

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 2758 posts
  • Gender:Male
  • Location:Toronto, Canada
  • Interests:Art, Classical Music, Biology, Fantasy/Sci-Fi (books, art, movies, games), Crosscountry skiing, adventuring to foreign parts, and of course, handheld gaming machines. ;)

Posted 08 June 2011 - 06:44 PM

Ok... I downloaded this and installed it by opening a terminal in its directory (using Thunar file browser) and typing "sudo python setup.py install". Then I navigated to the directory of the Python program I'm hoping to port, opened a terminal and typed in "python setup.py --command-packages distpnd bdist_pnd"

I got the following:
Traceback (most recent call last):
  File "setup.py", line 50, in <module>
    from cx_Freeze import setup, Executable
ImportError: No module named cx_Freeze

What did I do wrong?

#19 Tempel

Tempel

    GP Mania

  • GP32 Hardcore
  • PipPipPipPipPip
  • 416 posts
  • Gender:Male
  • Interests:You, you wonderful person.

Posted 08 June 2011 - 10:19 PM

You did absolutely nothing wrong. The problem lies in the setup script. Many setup scripts are very simple; all of mine contain a single call to the setup function, and nothing else. But they are full Python programs, and can be arbitrarily complex.

It looks like this setup script you have expects to find cx_Freeze, used to turn Python scripts into standalone executables. A potential solution is just to install cx_Freeze in the same manner you installed distPND: just download and unpack the cx_Freeze source, navigate to its directory, and run "python setup.py install". But if that isn't enough to get your PND working, direct me to the program you're trying to port. Then I can take a look at its setup script to see what other tricks it might be trying to pull.

Good luck!

#20 Esn

Esn

    (:\

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 2758 posts
  • Gender:Male
  • Location:Toronto, Canada
  • Interests:Art, Classical Music, Biology, Fantasy/Sci-Fi (books, art, movies, games), Crosscountry skiing, adventuring to foreign parts, and of course, handheld gaming machines. ;)

Posted 08 June 2011 - 11:26 PM

Thanks... I'm not sure that installing cx_Freeze worked as it should have. Here's a copy+paste of the terminal:

Spoiler


There seem to be some errors at the end, concerning arm-angstrom-linux-gnueabi-gcc.

The program still acts like it's not installed (I'll say what program it is if I get really stuck; I'm just trying to motivate myself to learn how this coding stuff works first).

#21 Tempel

Tempel

    GP Mania

  • GP32 Hardcore
  • PipPipPipPipPip
  • 416 posts
  • Gender:Male
  • Interests:You, you wonderful person.

Posted 09 June 2011 - 01:13 AM

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 .

#22 Esn

Esn

    (:\

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 2758 posts
  • Gender:Male
  • Location:Toronto, Canada
  • Interests:Art, Classical Music, Biology, Fantasy/Sci-Fi (books, art, movies, games), Crosscountry skiing, adventuring to foreign parts, and of course, handheld gaming machines. ;)

Posted 09 June 2011 - 03:35 AM

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:

Spoiler

Edited by Esn, 09 June 2011 - 03:40 AM.


#23 Tempel

Tempel

    GP Mania

  • GP32 Hardcore
  • PipPipPipPipPip
  • 416 posts
  • Gender:Male
  • Interests:You, you wonderful person.

Posted 09 June 2011 - 04:43 PM

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.

#24 Esn

Esn

    (:\

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 2758 posts
  • Gender:Male
  • Location:Toronto, Canada
  • Interests:Art, Classical Music, Biology, Fantasy/Sci-Fi (books, art, movies, games), Crosscountry skiing, adventuring to foreign parts, and of course, handheld gaming machines. ;)

Posted 09 June 2011 - 08:26 PM

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)?

#25 Tempel

Tempel

    GP Mania

  • GP32 Hardcore
  • PipPipPipPipPip
  • 416 posts
  • Gender:Male
  • Interests:You, you wonderful person.

Posted 10 June 2011 - 05:25 PM

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.

#26 Esn

Esn

    (:\

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 2758 posts
  • Gender:Male
  • Location:Toronto, Canada
  • Interests:Art, Classical Music, Biology, Fantasy/Sci-Fi (books, art, movies, games), Crosscountry skiing, adventuring to foreign parts, and of course, handheld gaming machines. ;)

Posted 12 June 2011 - 02:49 AM

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.