Re: [racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-18 Thread James Platt
On Nov 16, 2019, at 3:49 AM, Bogdan Popa wrote:

> 
> James Platt writes:
> 
>> Would this now be the preferred method to include a copy of the SQLite
>> library. required by the DB module, to your distribution?  The
>> software I am working on requires a newer version of SQLite than is
>> included in at least some of the operating systems we want to support
>> and it's too much to expect end users to install it themselves.
> 
> I released two packages[1][2] that distribute more recent versions of
> SQLite3 to Linux and macOS a couple of months ago.  I build the shared
> libraries in CI (using GitHub Actions) then add the .so and .dylib files
> to each package, using #lang info's `copy-foreign-libs'[3] to tell
> Racket that it should add the libs to a folder where the ffi library
> will know to look them up.  The source code is here[4].  I'd be happy to
> add more architectures and OSs if you need them.

Thanks.  I think this is exactly what I need.  Linux and macOS are good for 
now.  We will need to add Windows support later but that won't be for a while 
yet.   Eventually, we will want to support some NAS devices and limited mobile 
apps (Android and iOS) but these are not a priority.  


James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/856973E6-6074-4A1F-8DEA-A4302F893D5F%40biomantica.com.


Re: [racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-16 Thread Bogdan Popa


James Platt writes:

> Would this now be the preferred method to include a copy of the SQLite
> library. required by the DB module, to your distribution?  The
> software I am working on requires a newer version of SQLite than is
> included in at least some of the operating systems we want to support
> and it's too much to expect end users to install it themselves.

I released two packages[1][2] that distribute more recent versions of
SQLite3 to Linux and macOS a couple of months ago.  I build the shared
libraries in CI (using GitHub Actions) then add the .so and .dylib files
to each package, using #lang info's `copy-foreign-libs'[3] to tell
Racket that it should add the libs to a folder where the ffi library
will know to look them up.  The source code is here[4].  I'd be happy to
add more architectures and OSs if you need them.

Here's an example[5] where I use the linux package to get the tests for
`deta' passing on the package build server.

I hope that helps!

[1]: https://pkgd.racket-lang.org/pkgn/package/libsqlite3-x86_64-linux
[2]: https://pkgd.racket-lang.org/pkgn/package/libsqlite3-x86_64-macosx
[3]: 
https://docs.racket-lang.org/raco/setup-info.html?q=copy-foreign-libs#%28idx._%28gentag._22._%28lib._scribblings%2Fraco%2Fraco..scrbl%29%29%29
[4]: https://github.com/Bogdanp/racket-libsqlite3
[5]: https://github.com/Bogdanp/deta/blob/master/deta-test/info.rkt#L5

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/m2mucwi4tq.fsf%40192.168.0.139.


Re: [racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-15 Thread James Platt


On Nov 12, 2019, at 10:13 PM, Matthew Flatt wrote:

>> Although you can find the files using `find-share-dir` and/or
>> `find-user-share-dir`, adding a 'share mode to `define-runtime-path`
>> would make it possible for `raco distribute` to find and carry along a
>> directory/file when it's present, the same as 'so mode does.
> 
> Added.


Would this now be the preferred method to include a copy of the SQLite library. 
required by the DB module, to your distribution?  The software I am working on 
requires a newer version of SQLite than is included in at least some of the 
operating systems we want to support and it's too much to expect end users to 
install it themselves.  

https://docs.racket-lang.org/db/notes.html?q=sqlite#%28part._sqlite3-requirements%29

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/5F0EC3D9-1D58-426D-9D00-984560CF85B4%40biomantica.com.


Re: [racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-12 Thread Jon Zeppieri
On Tue, Nov 12, 2019 at 10:13 PM Matthew Flatt  wrote:
>
> At Tue, 12 Nov 2019 19:46:01 -0700, Matthew Flatt wrote:
> > Although you can find the files using `find-share-dir` and/or
> > `find-user-share-dir`, adding a 'share mode to `define-runtime-path`
> > would make it possible for `raco distribute` to find and carry along a
> > directory/file when it's present, the same as 'so mode does.
>
> Added.
>

Wow, that was fast. Thanks!

- Jon

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAKfDxxxJKhaVzgG68dA5X2Pas8W5dR8VMG_H5_KNuV-Pe9nOug%40mail.gmail.com.


Re: [racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-12 Thread Matthew Flatt
At Tue, 12 Nov 2019 19:46:01 -0700, Matthew Flatt wrote:
> Although you can find the files using `find-share-dir` and/or
> `find-user-share-dir`, adding a 'share mode to `define-runtime-path`
> would make it possible for `raco distribute` to find and carry along a
> directory/file when it's present, the same as 'so mode does.

Added.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/5dcb74d9.1c69fb81.90474.1a14SMTPIN_ADDED_MISSING%40gmr-mx.google.com.


Re: [racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-12 Thread Matthew Flatt
At Tue, 12 Nov 2019 21:29:44 -0500, Jon Zeppieri wrote:
> I like the idea of installing the data to a "share" directory. I see
> that the `info.rkt` file for a collection has a `copy-shared-files`
> key. In my case, both the `tzinfo` package and the `tzdata` package
> contribute to the `tzinfo` collection. So, two questions: (1) Would it
> work just to add this to the collection-level `info.rkt` in the
> `tzdata` package? 

Yes. I think you'd want to copy the "zoneinfo" directory that way.

> (2) How do I locate these files after they're
> copied? Is this what the (notional) 'share mode for
> `define-runtime-path` would do?

Yes. Although you can find the files using `find-share-dir` and/or
`find-user-share-dir`, adding a 'share mode to `define-runtime-path`
would make it possible for `raco distribute` to find and carry along a
directory/file when it's present, the same as 'so mode does.

(I confused 'lib mode with 'so mode before. I think you want something
like 'so mode.)

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/5dcb6e6c.1c69fb81.19b8e.5cceSMTPIN_ADDED_MISSING%40gmr-mx.google.com.


Re: [racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-12 Thread Jon Zeppieri
On Tue, Nov 12, 2019 at 2:09 PM Matthew Flatt  wrote:
>
> I'd say the problem is that "info.rkt" and `find-relevant-directories`
> are set up as Racket-installation concepts. They're not made to play
> well with standalone applications.
>
> The most similar concept that plays well with standard applications is
> libraries in the Racket "lib" directory. Having packages that supply
> timezone information install the timezone files to Racket's "lib" (in
> the same way that a package like "db-win32-x86_64" installs a library)
> might be a better approach in the long run.
>
> If I understand, these files would make more sense in a "share"
> directory than in the "lib" directory. If that distinction seems
> important, we could add a 'share mode to `define-runtime-path` that is
> similar to 'lib mode.
>
>
> I think your solution so far, which relies on compile-time checks, will
> not work right with packages that are distributed in "built" form. That
> creates a problem, in turn, for building a Racket distribution.
>

I hadn't thought of built packages, but, yes, that sounds like a problem.

I like the idea of installing the data to a "share" directory. I see
that the `info.rkt` file for a collection has a `copy-shared-files`
key. In my case, both the `tzinfo` package and the `tzdata` package
contribute to the `tzinfo` collection. So, two questions: (1) Would it
work just to add this to the collection-level `info.rkt` in the
`tzdata` package? (2) How do I locate these files after they're
copied? Is this what the (notional) 'share mode for
`define-runtime-path` would do?

- Jon

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAKfDxxz%3D6H1X0hTSXczu9_PeLEhr_JrOC4QdJJYhkBPFJ0ybTQ%40mail.gmail.com.


Re: [racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-12 Thread Matthew Flatt
At Sun, 10 Nov 2019 15:26:58 -0500, Jon Zeppieri wrote:
> That is, the tzdata package defines, in an info.rkt file, a key named
> `tzdata-zoneinfo-module-path`. I use that to determine if the package
> is installed, and, if so, I create a runtime path for it and add that
> path to the head of a list of paths to search for zoneinfo files.

At Mon, 11 Nov 2019 00:00:37 -0500, Jon Zeppieri wrote:
> I found a version that works, though I still wonder if there'a a
> better approach:

I'd say the problem is that "info.rkt" and `find-relevant-directories`
are set up as Racket-installation concepts. They're not made to play
well with standalone applications.

The most similar concept that plays well with standard applications is
libraries in the Racket "lib" directory. Having packages that supply
timezone information install the timezone files to Racket's "lib" (in
the same way that a package like "db-win32-x86_64" installs a library)
might be a better approach in the long run.

If I understand, these files would make more sense in a "share"
directory than in the "lib" directory. If that distinction seems
important, we could add a 'share mode to `define-runtime-path` that is
similar to 'lib mode.


I think your solution so far, which relies on compile-time checks, will
not work right with packages that are distributed in "built" form. That
creates a problem, in turn, for building a Racket distribution.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/5dcb035f.1c69fb81.7aec9.9a95SMTPIN_ADDED_MISSING%40gmr-mx.google.com.