how to publish a package requiring an external library

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

how to publish a package requiring an external library

douglas mcpherson
Hi All,

Is there a preferred/best practice way to publish a package together with its required external libraries? I've developed a package for accessing hardware peripherals such as GPIO and I2C from single board linux platforms such as Raspberry Pi. It uses FFI to access external libraries which I've assembled for use with Squeak. I would like to make binaries as well as source available.

I was considering ss3 but I'm not sure it can store anything other than .mcz files. Any advice much appreciated.

Thanks!

Doug
Reply | Threaded
Open this post in threaded view
|

Re: how to publish a package requiring an external library

timrowledge

On 09-07-2014, at 10:01 AM, Douglas McPherson <[hidden email]> wrote:
> Is there a preferred/best practice way to publish a package together with its required external libraries? I've developed a package for accessing hardware peripherals such as GPIO and I2C from single board linux platforms such as Raspberry Pi. It uses FFI to access external libraries which I've assembled for use with Squeak. I would like to make binaries as well as source available.

Are these libraries ones you wrote and have all the source for? If so, we should most likely simply add them to the squeakvm.org world. Binaries could be put there too, perhaps on a separate pseudo-platform page?


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
A sad tale that brings a lump to the eye and a tear to the throat.



Reply | Threaded
Open this post in threaded view
|

Re: how to publish a package requiring an external library

Chris Muller-3
In reply to this post by douglas mcpherson


On Wed, Jul 9, 2014 at 12:01 PM, Douglas McPherson <[hidden email]> wrote:
Hi All,

Is there a preferred/best practice way to publish a package together with its required external libraries? I've developed a package for accessing hardware peripherals such as GPIO and I2C from single board linux platforms such as Raspberry Pi. It uses FFI to access external libraries which I've assembled for use with Squeak. I would like to make binaries as well as source available.

I was considering ss3 but I'm not sure it can store anything other than .mcz files. Any advice much appreciated.

Thanks!

Doug



Reply | Threaded
Open this post in threaded view
|

Re: how to publish a package requiring an external library

douglas mcpherson
In reply to this post by timrowledge

On Jul 9, 2014, at 11:00 , tim Rowledge wrote:

>
> On 09-07-2014, at 10:01 AM, Douglas McPherson <[hidden email]> wrote:
>> Is there a preferred/best practice way to publish a package together with its required external libraries? I've developed a package for accessing hardware peripherals such as GPIO and I2C from single board linux platforms such as Raspberry Pi. It uses FFI to access external libraries which I've assembled for use with Squeak. I would like to make binaries as well as source available.
>
> Are these libraries ones you wrote and have all the source for? If so, we should most likely simply add them to the squeakvm.org world. Binaries could be put there too, perhaps on a separate pseudo-platform page?
>
>

Well it's a bit complicated and I'll appreciate help sorting out the best course of action. At this point there are two external libraries. I did some work to compile them into usable libraries for squeak, but most of the code was re-used from other non-squeak projects.

One was made by using the .c and .h files from a project that provides python access to RPi peripherals by simply compiling them into a shared library. The python project does not create the shared library but rather bundles them up with some additional python goo.

The other library provides access to the so-called smbus on linux  which is essentially a way to access i2c from linux userspace. The necessary c functions are defined (somewhat bizarrely) in a linux .h file and all declared as static inline. I wrapped this in a .c file with a couple of helper functions and necessary hackage to get the functions exported when compiled as shared library.

So there is a small amount of code and compile scripts written by me, and some code gladly borrowed from other open-source projects.

Thanks,
Doug

> tim
> --
> tim Rowledge; [hidden email]; http://www.rowledge.org/tim
> A sad tale that brings a lump to the eye and a tear to the throat.
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: how to publish a package requiring an external library

douglas mcpherson
In reply to this post by Chris Muller-3

On Jul 9, 2014, at 11:11 , Chris Muller wrote:



Thank you. I'll look into this.

Naturally I was hoping to provide a SqueakMap entry for the package, which IIUC can point to external repositories such as source.squeak.org, squeaksource.com, and ss3. But SqueakMap can also serve the files directly, is that correct? If I use the .sar approach is it true that I would not be able to publish on ss3? I'm not saying that's a bad thing, I'm just trying to understand. 

Thanks,
Doug


On Wed, Jul 9, 2014 at 12:01 PM, Douglas McPherson <[hidden email]> wrote:
Hi All,

Is there a preferred/best practice way to publish a package together with its required external libraries? I've developed a package for accessing hardware peripherals such as GPIO and I2C from single board linux platforms such as Raspberry Pi. It uses FFI to access external libraries which I've assembled for use with Squeak. I would like to make binaries as well as source available.

I was considering ss3 but I'm not sure it can store anything other than .mcz files. Any advice much appreciated.

Thanks!

Doug





Reply | Threaded
Open this post in threaded view
|

Re: how to publish a package requiring an external library

Tobias Pape
In reply to this post by douglas mcpherson
Hi Doug,


On 09.07.2014, at 19:01, Douglas McPherson <[hidden email]> wrote:

> Hi All,
>
> Is there a preferred/best practice way to publish a package together with its required external libraries? I've developed a package for accessing hardware peripherals such as GPIO and I2C from single board linux platforms such as Raspberry Pi. It uses FFI to access external libraries which I've assembled for use with Squeak. I would like to make binaries as well as source available.
>
> I was considering ss3 but I'm not sure it can store anything other than .mcz files. Any advice much appreciated.
>

In that case, I would recommend the whole Metacello-Workflow, in this case with
hosting on Github (where you obviously can store other things than monticello).

You can use the installation instructions on https://github.com/dalehenrich/metacello-work
and be sure to read the documentation linked at the bottom of the page
(User Guide, Installation instructions, etc…)

I myself use Metacello (in its 1.0 form and in the form as advertised in
the link I sent you) and I know nothing better for Configuration- and Depencency-Managment
in the Smalltalk world.

In case of questions, you'll find support here on squeak-dev but as well
on the metacello list[1], or the glass list[2].

HTH

best
        -Tobias
[1]: https://groups.google.com/forum/#!forum/metacello
[2]: http://forum.world.st/GLASS-f1460844.html



signature.asc (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: how to publish a package requiring an external library

Chris Muller-3
In reply to this post by douglas mcpherson
On Wed, Jul 9, 2014 at 2:27 PM, Douglas McPherson <[hidden email]> wrote:

On Jul 9, 2014, at 11:11 , Chris Muller wrote:



Thank you. I'll look into this.

Naturally I was hoping to provide a SqueakMap entry for the package, which IIUC can point to external repositories such as source.squeak.org, squeaksource.com, and ss3. But SqueakMap can also serve the files directly, is that correct?

Yes.
 
If I use the .sar approach is it true that I would not be able to publish on ss3? I'm not saying that's a bad thing, I'm just trying to understand. 

SS3 is about SCM, not publishing.  If you are just talking about simply publishing a software application for safe consumption, SAR files contain everything an application needs in one single file, which can be installed into base Squeak straight from the file-manager.  The file represents one specific version of the app, so once you test that it works in a particular Squeak release, then you can feel comfortable that it will _always_ work, forever, guaranteed.

SqueakMap is just a catalog of Smalltalk SAR and .st script files, so you can do absolutely anything like check SS3 to see if there are updated MC packages / configs for the app and load them, for example.  You could even look for updated resources from another place like Git or SqueakMap.  You would want to be sure to have proper error-handling in your install script, though, in case the user doesn't have a network connection.  Plus, the danger of doing this is that it is no longer _fixed_ so a problem might develop someday.  That's why, for publishing an app with resources, I prefer to just pump out a new SAR file (and why I use a streamlined the SARBuilder, so its easy).

If you want to set up a complex development project where multiple remote developers are able to work on the code AND resources on an on-going and incremental basis, then the Metacello / Git combination would be the most powerful and sophisticated solution for that.  For _only_ publishing, it's probably overkill, and nothing as safe as a fixed SAR file, but definitely powerful for development.

HTH,
  Chris

PS -- I made a SARBuilder with a Maui-based UI that allows one to drag-n-drop resources straight in, and one-click to create a valid SAR.


Reply | Threaded
Open this post in threaded view
|

Re: how to publish a package requiring an external library

Chris Muller-3
In reply to this post by douglas mcpherson
Oh, I found that SarBuilder GUI in case you're interested.  It's in SqueakMap as "MaSarPackageWithGui" (http://map.squeak.org/package/725e8847-2954-443d-91dc-93df33684954).  It's been a few years since I ran it, but it published itself as a fixed SAR, so still loads and runs fine in its designated release Squeak 4.1.  After installing, open the gui by:

  (MaSarPackage named: 'NameOfApp') maui

(attached screenshot)

Inline image 1

Visit the tabs left-to-right as needed.  Hovering over the messages shows contextual help.  Rightmost tab to finally generate the valid SAR file.



On Wed, Jul 9, 2014 at 2:27 PM, Douglas McPherson <[hidden email]> wrote:

On Jul 9, 2014, at 11:11 , Chris Muller wrote:



Thank you. I'll look into this.

Naturally I was hoping to provide a SqueakMap entry for the package, which IIUC can point to external repositories such as source.squeak.org, squeaksource.com, and ss3. But SqueakMap can also serve the files directly, is that correct? If I use the .sar approach is it true that I would not be able to publish on ss3? I'm not saying that's a bad thing, I'm just trying to understand. 

Thanks,
Doug


On Wed, Jul 9, 2014 at 12:01 PM, Douglas McPherson <[hidden email]> wrote:
Hi All,

Is there a preferred/best practice way to publish a package together with its required external libraries? I've developed a package for accessing hardware peripherals such as GPIO and I2C from single board linux platforms such as Raspberry Pi. It uses FFI to access external libraries which I've assembled for use with Squeak. I would like to make binaries as well as source available.

I was considering ss3 but I'm not sure it can store anything other than .mcz files. Any advice much appreciated.

Thanks!

Doug









Reply | Threaded
Open this post in threaded view
|

Re: how to publish a package requiring an external library

marcel.taeumel (old)
In reply to this post by Tobias Pape
+1
Reply | Threaded
Open this post in threaded view
|

Re: how to publish a package requiring an external library

Bert Freudenberg
In reply to this post by douglas mcpherson

On 09.07.2014, at 21:27, Douglas McPherson <[hidden email]> wrote:

>
> On Jul 9, 2014, at 11:00 , tim Rowledge wrote:
>
>>
>> On 09-07-2014, at 10:01 AM, Douglas McPherson <[hidden email]> wrote:
>>> Is there a preferred/best practice way to publish a package together with its required external libraries? I've developed a package for accessing hardware peripherals such as GPIO and I2C from single board linux platforms such as Raspberry Pi. It uses FFI to access external libraries which I've assembled for use with Squeak. I would like to make binaries as well as source available.
>>
>> Are these libraries ones you wrote and have all the source for? If so, we should most likely simply add them to the squeakvm.org world. Binaries could be put there too, perhaps on a separate pseudo-platform page?
>>
>>
>
> Well it's a bit complicated and I'll appreciate help sorting out the best course of action. At this point there are two external libraries. I did some work to compile them into usable libraries for squeak, but most of the code was re-used from other non-squeak projects.
>
> One was made by using the .c and .h files from a project that provides python access to RPi peripherals by simply compiling them into a shared library. The python project does not create the shared library but rather bundles them up with some additional python goo.
>
> The other library provides access to the so-called smbus on linux  which is essentially a way to access i2c from linux userspace. The necessary c functions are defined (somewhat bizarrely) in a linux .h file and all declared as static inline. I wrapped this in a .c file with a couple of helper functions and necessary hackage to get the functions exported when compiled as shared library.
>
> So there is a small amount of code and compile scripts written by me, and some code gladly borrowed from other open-source projects.
>
> Thanks,
> Doug

If you're writing C code anyway, why not just make it into a proper Squeak plugin, so you don't even need FFI?

- Bert -






smime.p7s (5K) Download Attachment