Pyra pyra-debian-cross

Discussion in 'General Discussions' started by sebt3, Nov 4, 2017.

  1. sebt3

    sebt3 homebrew player (P. & C.)

    Joined:
    Sep 9, 2008
    Messages:
    4,745
    Location:
    France
    Hello there,

    So compiling on the pyra works well, but for larger project at some point a cross-compiling toolchain will be usefull.
    This is my attempt. Sources are : https://dev.pyra-handheld.com/sebt3/pyra-debian-cross
    It is based on debian and heavyly depend on debian. but any version (from strech) and any fork (ubuntu...) should be working.

    Installation :
    The installation is done by root :
    cd /install/dir/you/want
    wget https://dev.pyra-handheld.com/sebt3/pyra-debian-cross/raw/master/install.sh
    chmod 755 install.sh
    ./install.sh install

    A log will be produced in this directory, feel free to read it/ delete it/whatever. Running the installer many time on the same destination directory is safe and wont break everything.

    It is possible to choose the install directory using the script options (see -h), although you'll use the install script to update your toolchain, so I recomand the keeping the install script in the destination directory.

    Maintenance :
    Unlike yactfeau, this toolchain doesnt come with everything installed initially. To keeps things easy, the install script have a number of usefull functions to help you install new development files and keep the rootfs up to date.
    Here are a few commands availables (see -h for more details) :
    ./install.sh pyra.update
    ./install.sh pyra.upgrade
    ./install.sh pyra.install libgtk2.0-dev
    ./install.sh pyra.build-dep audacious

    Using it :
    There's an environment-setup file available that you can load with :
    export TOOLCHAIN_ROOT=install/dir/you/used;. $TOOLCHAIN_ROOT/environment-setup
    Alternatively, you can setup your bashrc file (like yactfeu had) with :
    ./install.sh setup.bashrc

    Example usage for a dosbox dbp :
    Provided you have run setup.bashrc in your user (or used that export... just before), create the project :
    pyra_makeprj dosbox
    Get the sources :
    svn checkout https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk dosbox-svn
    cd dosbox-svn
    Configure them :
    ./autogen.sh
    pyra_addfastmath
    pyra_configure
    Compile :
    make -j 4
    Install :
    pyra_makeinstall​
    Update the default.desktop to setup the packaging information :
    vim $PRJ_TARGET/meta/default.desktop
    Build the dbp :
    pyra_makedbp
    Copy on your pyra and test ;)

    There's also available :
    pyra_cmake
    pyra_setprj

    this might evolve as I use it
     
    Last edited: Nov 4, 2017
    Farox, lukey, Swordfish II and 6 others like this.
  2. KidPaddle

    KidPaddle Member

    Joined:
    May 3, 2009
    Messages:
    100
    Location:
    Germany
    Thanks for deploying, but ..... :)

    New fresh debian 9 (stretch) in a virtual box, minimal system,

    First part is working on debian

    until "./install.sh pyra.upgrade"

    After this operation, 0 B of additional disk space will be used.
    Setting up openjdk-8-jre-headless:armhf (8u151-b12-1~deb9u1) ...
    the java command requires a mounted proc fs (/proc).
    dpkg: error processing package openjdk-8-jre-headless:armhf (--configure):
    subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of openjdk-8-jre:armhf:
    openjdk-8-jre:armhf depends on openjdk-8-jre-headless (= 8u151-b12-1~deb9u1); however:
    Package openjdk-8-jre-headless:armhf is not configured yet.

    dpkg: error processing package openjdk-8-jre:armhf (--configure):
    dependency problems - leaving unconfigured
    Errors were encountered while processing:
    openjdk-8-jre-headless:armhf
    openjdk-8-jre:armhf

    ok, whatever , check setup your dosbox sample:

    Working until "pyra_configure" ;)
    checking for arm-linux-gnueabihf-ranlib... arm-linux-gnueabihf-ranlib
    checking for sdl-config... /home/thomas/projects/pyra/bin/sdl-config
    checking for SDL - version >= 1.2.0... cross compiling; assumed OK...
    yes
    checking SDL version only being 1.2.X... no
    configure: error: Only libSDL 1.2.X supported

    Mhm, adding sdl 1.2
    sudo apt-get install libsdl1.2-dev libsdl-net1.2-dev libsdl-mixer1.2-dev libsdl-gfx1.2-dev libsdl-image1.2-dev

    but dosn't help.

    What i'm doing wrong?

    Thomas
     
  3. sebt3

    sebt3 homebrew player (P. & C.)

    Joined:
    Sep 9, 2008
    Messages:
    4,745
    Location:
    France
    Hoo, oups. I had this setup at some point, but commented out since I wasnt sure that was usefull. Fixed (just uncomment line 328)

    Hey you havent finished the installation, dont expect it to work ;)
    Once you've uncommented the line, restart the script as it actually install the missing piece in the rootfs to allow compiling with sdl.

    You're installing on your host and expect your target to see it ;)
    The correct installation would have been :
    /path/to/install.sh pyra.install libsdl1.2-dev libsdl-net1.2-dev libsdl-mixer1.2-dev libsdl-gfx1.2-dev libsdl-image1.2-dev
    But since just running the script with the install argument to the end will do it for you, just rerun the install script :p
     
  4. KidPaddle

    KidPaddle Member

    Joined:
    May 3, 2009
    Messages:
    100
    Location:
    Germany
    ok, uncomment line 328 in "install.sh"

    login in as root, rerun script "./install.sh pyra.update"
    and see

    ./install.sh: Zeile 37: resize: Kommando nicht gefunden.
    => command resize not found

    search for "resize" has too many results, what is missing?
    Thomas
     
    Last edited: Nov 5, 2017
  5. sebt3

    sebt3 homebrew player (P. & C.)

    Joined:
    Sep 9, 2008
    Messages:
    4,745
    Location:
    France
    The resize command is part of the xterm package. But as this is not realy needed, i've fixed my code again. thanks for the report.
     
  6. KidPaddle

    KidPaddle Member

    Joined:
    May 3, 2009
    Messages:
    100
    Location:
    Germany
    I start with a new minimal system, install packages ssh, wget, curl, xterm, zip and subversion

    create a directory projects in my home directory
    create a directory projects/pyra
    cd projects/pyra
    switch to root (su)
    Running all commands as root until

    "./install.sh pyra.upgrade"

    without any error.

    logout as root, login with user account and call
    "./install.sh setup.bashrc"
    logout and relogin so changes in .bashrc are active.

    running as normal user
    cd ~/projects
    pyra_makeprj dosbox -> auto cd into "~/projects/pyra/dosbox"
    svn checkout https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk dosbox-svn
    cd dosbox-svn
    ./autogen.sh

    getting some errors and after installing automake autoconf

    autogen.sh
    pyra_addfastmath
    pyra_configure
    make -j 4

    are done without any error, great.

    inside path "~/projects/pyra/dosbox/dosbox-svn" running

    pyra_makeinstall

    and got two(!) new directories

    first:
    ~/projects/pyra/dosbox/target
    with 3 directories
    -- icons
    -- meta
    -- root (but this is empty)

    second:
    ~/projects/pyra/target
    with 1 directory
    -- root
    contains
    -- root/bin/dosbox
    -- root/share/man/man1/dosbox.1

    so, i believe there is going something wrong. I copied "~/projects/pyra/dosbox/target" into "~/projects/pyra/target"

    and call "pyra_makedbp" inside "~/projects/pyra/target"

    This creates a file "~/projects/pyra/DBPs/.dbp" with 1,3MB size.

    Generally it works, but minor changes still need to be done
    -- Wrong destination directory of compiled binaries "~/projects/pyra/target" instead of "~/projects/pyra/dosbox/target"
    -- "pyra_makedbp" seems to working always in "~/projects/pyra/target" instead of local directory
    -- Missing filename in dbp - name

    Great work, sebt3

    Thomas
     
    Last edited: Nov 5, 2017
  7. sebt3

    sebt3 homebrew player (P. & C.)

    Joined:
    Sep 9, 2008
    Messages:
    4,745
    Location:
    France
    Sound like at some point $PRJ wasnt set correctly. I'll have a look at that issue. Thanks for reporting
    EDIT: yup, found&fixed
     
    Last edited: Nov 5, 2017
  8. KidPaddle

    KidPaddle Member

    Joined:
    May 3, 2009
    Messages:
    100
    Location:
    Germany
    deleted "~/projects/pyra/dosbox/target" and "~/projects/pyra/target"
    downloaded new "https://dev.pyra-handheld.com/sebt3/pyra-debian-cross/raw/master/install.sh"
    "./install.sh setup.bashrc"
    relogged in
    called pyra_setprj dosbox
    cd "~/projects/pyra/dosbox/dosbox-svn"
    make clean
    make -j 4
    pyra_makeinstall
    -- No errors visibele but i see double slahes "dosbox/target/root//bin" and "dosbox/target/root//share/man/man1"

    result:
    One directory "~/projects/pyra/dosbox/target", but only contains
    -- root
    -- root/bin/dosbox
    -- root/share/man/man1/dosbox.1

    No meta, no icon directory.

    maybe i have to setup a fresh debian installation and checking, this will done tonight

    Thomas
     
  9. sebt3

    sebt3 homebrew player (P. & C.)

    Joined:
    Sep 9, 2008
    Messages:
    4,745
    Location:
    France
    these 2 are created by pyra_makeprj not pyra_setprj, that's actually the difference between the 2 ;)
     
  10. KidPaddle

    KidPaddle Member

    Joined:
    May 3, 2009
    Messages:
    100
    Location:
    Germany
    You are right, if have setup a new system and now all works.

    Thanks for help and good job.

    Thomas
     
  11. sebt3

    sebt3 homebrew player (P. & C.)

    Joined:
    Sep 9, 2008
    Messages:
    4,745
    Location:
    France
    Thanks for your patience and tests. I'm shitty when it come to testing , so all your problems have been a great feedback and helped me to improve the thing for the next one :)
     
  12. KidPaddle

    KidPaddle Member

    Joined:
    May 3, 2009
    Messages:
    100
    Location:
    Germany
    Which files can be removed after installation?

    Thomas
     
  13. sebt3

    sebt3 homebrew player (P. & C.)

    Joined:
    Sep 9, 2008
    Messages:
    4,745
    Location:
    France
    All the install.log.* files. And you could run a :
    ./install.sh pyra.apt clean
    And that's all the can be deleted safely. But sure if you realy need space, then purging ....rootfs/usr/share will save you some space while not harming the cross-compilation. But further pyra.update/pyra.install might fail.
     
  14. KidPaddle

    KidPaddle Member

    Joined:
    May 3, 2009
    Messages:
    100
    Location:
    Germany
    There must be an fixed path "projects/pyra" or maybe a lower case inside your scripts.

    I have installed your script and root fs in "~/Projects/pyra", was a mistake by me. If i create a new project with "pyra_makeprj" the projects is created in "~/projects/pyra".

    All works inside "~/projects/pyra" fine, configure, compiling, making dbps.

    Why is the DBP create in "~/projects/pyra/DBPs" and not inside my directory like "~/projects/pyra/dosbox/DBPs"?

    If i try to create a new project in "~/MyProjects/SingleProject", i expect all files created inside directory "~/MyProjects/SingleProject", and not in a default directory "~/projects/pyra".

    Coud you change this behavior? Or, must all work be done in "~/projects/pyra/"?

    Thomas
     
  15. sebt3

    sebt3 homebrew player (P. & C.)

    Joined:
    Sep 9, 2008
    Messages:
    4,745
    Location:
    France
    You're free to set some variables according to your needs. as you said, all these have default values but can be overwritten as you please.
    This is the definition of two :
    PROJECTS_BASEDIR=${PROJECTS_BASEDIR:-"$HOME/projects/pyra"}
    DBPS_TARGETDIR=${DBPS_TARGETDIR:-"$PROJECTS_BASEDIR/DBPs"}
    Set theses 2 according to what you want before (or after) loading the environnement-setup.

    The environement-setup is built to support my workflow (I even have 2 other functions setup elsewhere : pyra_send, which send the dbp of the current project to my pyra, and pyra_publish which send the dbp on my hosting). Nothing stop you from building your own matching your own workflow.
    In fact while the installer and the environnement-setup are part of the same project, they dont depend on each other and can be used separatedly
     
    Last edited: Nov 11, 2017
  16. Linux-SWAT

    Linux-SWAT Hardcore Member

    Joined:
    Feb 13, 2010
    Messages:
    8,069
    Don't use .bashrc if you're not putting bash settings in it.
    Use .profile .
     
  17. KidPaddle

    KidPaddle Member

    Joined:
    May 3, 2009
    Messages:
    100
    Location:
    Germany
    Wow, you are fast and thanks for help.

    I changed in my ".bashrc" your commands to:

    export TOOLCHAIN_ROOT=/home/thomas/Projects/pyra
    pyra_makeprj() {
    export PROJECTS_BASEDIR="$(pwd)"
    export DBPS_TARGETDIR="$(pwd)/$@"

    . $TOOLCHAIN_ROOT/environment-setup
    pyra_makeprj "$@"
    }
    pyra_setprj() {
    export PROJECTS_BASEDIR="$(pwd)"
    export DBPS_TARGETDIR="$(pwd)/$@"

    . $TOOLCHAIN_ROOT/environment-setup
    pyra_setprj "$@"
    }

    And now it works like i expected
    ~/test/test2/dosbox
    ~/test/test2/dosbox/dosbox.dbp
    ~/test/test2/dosbox/dosbox-svn
    ~/test/test2/dosbox/target
    ~/test/test2/dosbox/target/icons
    ~/test/test2/dosbox/target/meta
    ~/test/test2/dosbox/target/root

    @Linux-SWAT
    Sorry, i delete my post, cause there was a missunderstanding by me, so now wrong post order :)

    So, sebt3 shoud move these commands from ".bashrc" to ".profile"?

    Thomas
     
    Last edited: Nov 11, 2017
  18. Linux-SWAT

    Linux-SWAT Hardcore Member

    Joined:
    Feb 13, 2010
    Messages:
    8,069
    I guess yes.
     
  19. sebt3

    sebt3 homebrew player (P. & C.)

    Joined:
    Sep 9, 2008
    Messages:
    4,745
    Location:
    France
    Seriously he is nitpicking here. While he is right in theory, in practice, even debian use bashrc (have a look at /etc/skel). Beside some shells might not like some syntax in here (like tcsh).
    So either way is fine. I'll keep to the safe side : aka do like debian does.
     
  20. KidPaddle

    KidPaddle Member

    Joined:
    May 3, 2009
    Messages:
    100
    Location:
    Germany
    I had to look into a diary for "nitpicking" :)
     

Share This Page

Loading...