Re: [Sugar-devel] compiled to .XO

2012-07-09 Thread S Page
On Fri, Jun 29, 2012 at 8:48 PM, Mikus Grinbergs mi...@bga.com wrote:

 Am attaching an copy of an email I sent earlier to someone with a question
 similar to yours.  IMHO that email provides a concise how-to guide to
 fashioning a bare-bones .xo package.

Great stuff.  Someone, be brave and aggressively update
http://wiki.sugarlabs.org/go/Running_Linux_Applications_Under_Sugar

--
=S Page
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] compiled to .XO

2012-06-30 Thread Sameer Verma
On Fri, Jun 29, 2012 at 7:39 PM, Gonzalo Odiard gonz...@laptop.org wrote:
 You need do only make (and not make install),
 copy the generated binaries in a bin directory inside the activity
 directory,
 and probably you will need start the acivity with a .sh file and set env
 variables.
 You can look at the Tuxmath activity as a example.

OK. Will take a look.

Sameer


 Gonzalo


 On Fri, Jun 29, 2012 at 10:59 PM, Sameer Verma sve...@sfsu.edu wrote:

 On Fri, Jun 29, 2012 at 5:37 PM, Alan Jhonn Aguiar Schwyn
 alan...@hotmail.com wrote:
 
  Maybe I don't understand all..
  When activity launs, calls a sh with the commands that you need to make
  the
  binary. After, only calls the binary and start.
 
  Alan

 I was thinking about how we would package the binaries, given that the
 .xo activity isn't supposed to install in /usr/local/bin and other
 locations. If we bundle the RPM, the olpc user does not have rights to
 install the binary.

 Sameer

 
  From: sve...@sfsu.edu
  Date: Fri, 29 Jun 2012 17:35:07 -0700
  Subject: compiled to .XO
  To: sugar-devel@lists.sugarlabs.org; de...@lists.laptop.org
 
 
  We are looking at an app that goes through the classic ./configure,
  make, make install to compile from source. The compile process runs
  ok (this is on a XO-1). We are also able to run the binary, but I am
  unclear about how we would package this into a .xo activity. Any
  pointers?
 
  cheers,
  Sameer
  ___
  Devel mailing list
  de...@lists.laptop.org
  http://lists.laptop.org/listinfo/devel
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel


___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] compiled to .XO

2012-06-30 Thread Sameer Verma
On Fri, Jun 29, 2012 at 8:48 PM, Mikus Grinbergs mi...@bga.com wrote:
 We are also able to run the binary, but I am unclear about
 how we would package this into a .xo activity. Any pointers?


 Am attaching an copy of an email I sent earlier to someone with a question
 similar to yours.  IMHO that email provides a concise how-to guide to
 fashioning a bare-bones .xo package.

 [Obviously, your 'exec' line must be appropriate to your binary.]

 [The example had a library which was explicitly linked-to from within that
 binary.  If your binary does not need any special library, just leave out
 the library part from the attached instructions.]

 [If your binary *does* need to be supplied with a specific library, move
 that library into (for example) the subdirectory itself, then add this line
 (without the ) before your 'exec' line
    export LD_LIBRARY_PATH=$SUGAR_BUNDLE_PATH/your-library-name
 to indicate *where* that library can be accessed.]



 To produce the .xo file, just 'pack' the subdirectory you created.

 mikus


Thanks, Mikus. Will take a look.

Sameer
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] compiled to .XO

2012-06-29 Thread Sameer Verma
We are looking at an app that goes through the classic ./configure,
make, make install to compile from source. The compile process runs
ok (this is on a XO-1). We are also able to run the binary, but I am
unclear about how we would package this into a .xo activity. Any
pointers?

cheers,
Sameer
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel



Re: [Sugar-devel] compiled to .XO

2012-06-29 Thread Alan Jhonn Aguiar Schwyn


Maybe I don't understand all..When activity launs, calls a sh with the commands 
that you need to make thebinary. After, only calls the binary and start.

Alan
 From: sve...@sfsu.edu
 Date: Fri, 29 Jun 2012 17:35:07 -0700
 Subject: compiled to .XO
 To: sugar-devel@lists.sugarlabs.org; de...@lists.laptop.org
 
 We are looking at an app that goes through the classic ./configure,
 make, make install to compile from source. The compile process runs
 ok (this is on a XO-1). We are also able to run the binary, but I am
 unclear about how we would package this into a .xo activity. Any
 pointers?
 
 cheers,
 Sameer
 ___
 Devel mailing list
 de...@lists.laptop.org
 http://lists.laptop.org/listinfo/devel
  ___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] compiled to .XO

2012-06-29 Thread Sameer Verma
On Fri, Jun 29, 2012 at 5:37 PM, Alan Jhonn Aguiar Schwyn
alan...@hotmail.com wrote:

 Maybe I don't understand all..
 When activity launs, calls a sh with the commands that you need to make the
 binary. After, only calls the binary and start.

 Alan

I was thinking about how we would package the binaries, given that the
.xo activity isn't supposed to install in /usr/local/bin and other
locations. If we bundle the RPM, the olpc user does not have rights to
install the binary.

Sameer


 From: sve...@sfsu.edu
 Date: Fri, 29 Jun 2012 17:35:07 -0700
 Subject: compiled to .XO
 To: sugar-devel@lists.sugarlabs.org; de...@lists.laptop.org


 We are looking at an app that goes through the classic ./configure,
 make, make install to compile from source. The compile process runs
 ok (this is on a XO-1). We are also able to run the binary, but I am
 unclear about how we would package this into a .xo activity. Any
 pointers?

 cheers,
 Sameer
 ___
 Devel mailing list
 de...@lists.laptop.org
 http://lists.laptop.org/listinfo/devel
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] compiled to .XO

2012-06-29 Thread Gonzalo Odiard
You need do only make (and not make install),
copy the generated binaries in a bin directory inside the activity
directory,
and probably you will need start the acivity with a .sh file and set env
variables.
You can look at the Tuxmath activity as a example.

Gonzalo


On Fri, Jun 29, 2012 at 10:59 PM, Sameer Verma sve...@sfsu.edu wrote:

 On Fri, Jun 29, 2012 at 5:37 PM, Alan Jhonn Aguiar Schwyn
 alan...@hotmail.com wrote:
 
  Maybe I don't understand all..
  When activity launs, calls a sh with the commands that you need to make
 the
  binary. After, only calls the binary and start.
 
  Alan

 I was thinking about how we would package the binaries, given that the
 .xo activity isn't supposed to install in /usr/local/bin and other
 locations. If we bundle the RPM, the olpc user does not have rights to
 install the binary.

 Sameer

 
  From: sve...@sfsu.edu
  Date: Fri, 29 Jun 2012 17:35:07 -0700
  Subject: compiled to .XO
  To: sugar-devel@lists.sugarlabs.org; de...@lists.laptop.org
 
 
  We are looking at an app that goes through the classic ./configure,
  make, make install to compile from source. The compile process runs
  ok (this is on a XO-1). We are also able to run the binary, but I am
  unclear about how we would package this into a .xo activity. Any
  pointers?
 
  cheers,
  Sameer
  ___
  Devel mailing list
  de...@lists.laptop.org
  http://lists.laptop.org/listinfo/devel
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] compiled to .XO

2012-06-29 Thread Alan Jhonn Aguiar Schwyn

 I was thinking about how we would package the binaries, given that the
 .xo activity isn't supposed to install in /usr/local/bin and other
 locations. If we bundle the RPM, the olpc user does not have rights to
 install the binary.

Easy: no install the binaries.. only use them,,You can compile (make), and 
after use the binaries into the same folder..
Which you want to compile?___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] compiled to .XO

2012-06-29 Thread Mikus Grinbergs

We are also able to run the binary, but I am unclear about
how we would package this into a .xo activity. Any pointers?


Am attaching an copy of an email I sent earlier to someone with a 
question similar to yours.  IMHO that email provides a concise how-to 
guide to fashioning a bare-bones .xo package.


[Obviously, your 'exec' line must be appropriate to your binary.]

[The example had a library which was explicitly linked-to from within 
that binary.  If your binary does not need any special library, just 
leave out the library part from the attached instructions.]


[If your binary *does* need to be supplied with a specific library, move 
that library into (for example) the subdirectory itself, then add this 
line (without the ) before your 'exec' line

   export LD_LIBRARY_PATH=$SUGAR_BUNDLE_PATH/your-library-name
to indicate *where* that library can be accessed.]



To produce the .xo file, just 'pack' the subdirectory you created.

mikus


Here is one way to package your stuff so it can be launched from an icon 
in the XO's Home View:

   DISCLAIMER:  To set this up, I used my templates from 2009 (for
   sugarizing a Linux executable).  I have __NOT__ referenced (nor
   incorporated) any SugarLabs advances from any intervening years.


   1) Create a directory (either in /home/olpc/Activities, or linked-to
  from there).  Mine was called Evil.activity.

  In 'Evil.activity', create subdirectories 'activity' and 'bin'


   2) Move your binary into 'Evil.activity/'  [I called it 'evil.eng'}

  Move your 'id1' directory into 'Evil activity/'

Note:  'Evil.activity' now contains:
 activity{a directory}
 evil.eng{a binary}
 bin {a directory}
 id1 {a directory}

  Move your 'icon.svg' into 'Evil.activity/activity/'


   3) Add file 'Evil.activity/activity/activity.info' with content:
   [Activity]
   name = Evil
   service_name = com.atphalix.evil
   exec = runevil
   icon = icon
   activity_version = 1
   host_version = 1

  [Note:  This is how it was in 2009.  I have not looked at whether
   activity.info lines have been added/removed since then.]

  [In the above, you get to choose name and service name]

  'runevil' is the name of the script in 'Evil.activity/bin/'


   4) Copy 'libsugarize.so' into 'Evil.activity/bin/'

  Add file 'Evil.activity/bin/runevil' with content:
   #!/bin/bash
   while [ -n $2 ] ; do
 echo OO: $1 $2
 case $1 in
 -b | --bundle-id) export SUGAR_BUNDLE_ID=$2 ;;
 -a | --activity-id)   export SUGAR_ACTIVITY_ID=$2 ;;
 -o | --object-id) export SUGAR_OBJECT_ID=$2 ;;
 -u | --uri)   export SUGAR_URI=$2 ;;
 *) echo unknown argument $1 $2 ;;
 esac
 shift;shift
   done
   export LD_PRELOAD=$SUGAR_BUNDLE_PATH/bin/libsugarize.so
   export NET_WM_NAME=Evil
   exec ./evil.eng -mem 64 -width 1200 -height 900 +map start
   exit

 Obviously, the names/locations specified in this script must
 correspond to what is in your Evil.activity directory.

 [And when you create the two files whose content is shown above,
  please leave off the(they're for clarity in the printout).]


For me, the above worked.  [With an old libsugarize.so, there might be a 
redundant launch screen (with error message) left over.  It's harmless, 
and can eventually be closed.]

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel