<div dir="ltr">Thanks, IOhannes, that sounds sensible. So in order to make it as homogenous as possible between people who build from source and those who install the package (as ultimately I would like this to be extension friendly at the C level), do you think it would be best to just have the scm files live in the same directory as the C files in the source? Or is there some suggested approach when using pd lib builder to make this simple? <div><br></div><div>thanks</div><div>iain</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 4, 2021 at 8:52 AM IOhannes m zmoelnig <<a href="mailto:zmoelnig@iem.at">zmoelnig@iem.at</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 10/4/21 5:22 PM, Iain Duncan wrote:<br>
> of the package ('s4pd') so that this can simply be put in the Pd/externals<br>
> directory? I just need to know what "normal" is for a release package.<br>
<br>
yes: ship the scm files besides your external.<br>
<br>
the easiest way is to instruct people to load your library with<br>
[declare -path s4pd -lib s4pd] (which will add .../s4pd to Pd's search <br>
paths and *also* load the s4pd.pd_linux external).<br>
in the s4pd_setup() (or better: s4pd_new()) callback, spit out a big fat <br>
wraning if the scm files cannot be found like:<br>
 > ERROR: could not find 's4pd.scm'!<br>
 > ERROR: use [declare -path s4pd -lib s4pd] to load this external<br>
<br>
and refuse to create an instance of the interpreter.<br>
<br>
to make things a bit nicer, you could *additionally* search for <br>
"s4pd/s4pd.scm", and only bail out if neither of the two can be found.<br>
<br>
<br>
you could also check how other language bindings do this, e.g. [tclpd] <br>
or [pdlua]<br>
(both of which somehow try to get the path of the library file, and then <br>
use that to load their auxiliary scripts)<br>
<br>
gfmnasdr<br>
IOhannes<br>
<br>
[tclpd] <br>
<<a href="https://svn.code.sf.net/p/pure-data/svn/trunk/externals/loaders/tclpd/tclpd.c" rel="noreferrer" target="_blank">https://svn.code.sf.net/p/pure-data/svn/trunk/externals/loaders/tclpd/tclpd.c</a>><br>
[pdlua] <br>
<<a href="https://svn.code.sf.net/p/pure-data/svn/trunk/externals/loaders/pdlua/src/pdlua.c" rel="noreferrer" target="_blank">https://svn.code.sf.net/p/pure-data/svn/trunk/externals/loaders/pdlua/src/pdlua.c</a>><br>
<br>
PS: we probably should move these to gitlab :-)<br>
<br>
_______________________________________________<br>
Pd-dev mailing list<br>
<a href="mailto:Pd-dev@lists.iem.at" target="_blank">Pd-dev@lists.iem.at</a><br>
<a href="https://lists.puredata.info/listinfo/pd-dev" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-dev</a><br>
</blockquote></div>