[PD-dev] loading classes: search by directory rather than extension

IOhannes m zmölnig zmoelnig at iem.at
Sun Sep 27 21:30:02 CEST 2015


On 09/26/2015 02:25 PM, Miller Puckette wrote:
> On Sat, Sep 26, 2015 at 06:44:54PM +0800, Chris McCormick wrote:
>> On 25/09/15 23:04, Miller Puckette wrote:
>>> I think the best "default" default would be to put things in ~/pd/extra,
>>> assuming there's no problem writing to that (and, I suppose, assuming it
>>> isn't shared among multiple users of the same machine).
>>
>> I guess it's customary to put per-user application specific configurations
>> and other data in a hidden folder, so e.g. ~/.pd or ~/.pd-externals or
>> ~/.local/share/pd/ etc.

+1 (see below)

>>
>> To my mind ~/pd/extra is not that different to ~/pd-externals in that it
>> still forces the user to have a non-hidden folder in their home directory.
>> Whenever applications do this I find it mildly annoying.

+1 (see belower)

here's a few disadvantages of ~/pd/extra compared to ~/pd-externals:

- it is yet *another* Pd-related directory cluttering my home-directory.

- it is a two-level directory where the lower level (extra/) doesn't
discriminate against anything. this is confusing at best
(the only thing i can think of is that ~/pd/ is meant to hold other
Pd-related stuff that isn't meant to be loaded as
external/abstraction/footage/...)


- it breaks compatibility for no good reason (well "pd" is a slightly
more pleasing directory name than "pd-externals", but that's about it)



> I thing for "settings" a hidden file is appropriate (e.g., ".pdsettings") but 
> for libraries you want them visible - but precisely where would depend how you
> organize your files so should be settable.

i see the point (and iirc it's the same as hc's original arguing for
~/pd-externals), though i don't follow it.

also, other applications already use hidden directories for libraries.

e.g. using `pip` to install python-packages on a per-user path will put
them into
   ~/.local/lib/pythonXY/site-packages/

e.g. installing extensions to firefox will put them into
   ~/.mozilla/firefox/<ID>/extensions/

e.g. installing extensions to thunderbird will similarily install them into
  ~/.thunderbird/<ID>/extensions/

e.g installing entire games with Steam will install them somewhere into
  ~/.steam/


so i *do* think that a hidden directly is a sensible place to install
libraries to.


> My reason for suggesting putting them in "pd/extra" is that you already put 
> "pd" somewhere (and presumably chose where to put it) and
> if you relocate pd later the extra files will follow.  Also, you can then
> have different versions of Pd with different libraries loaded.

reading this it seems that you really mean Pd's "internal" extra folder
(the one besides the "tcl/" folder containing e.g. pd-gui.tcl), rather
than ${HOME}/pd/extra.

because if I have a current Pd in ~/src/pd-0.47-2/ and copy that to
~/projects/hellowien/pd, this won't touch ~/pd/extra in any way (so
doesn't help with relocating).


now this scheme *only* makes sense if the user has full control over the
directory containing Pd.

i honestly don't think that this is the case for most users of Pd on linux.
instead I do think that the usual use of Pd is to either install Pd into
/usr/local by running `sudo make install` after building or to simply
install a package for my distributions (since i maintain the Pd package
for Debian and derivates, i'm highly biased towards the latter).
both ways take away the capability from the user to install random stuff
into extra/ from within Pd.

so i still believe that it is a good idea to have a place where the user
can install libraries to without any special permissions, regardless
where the Pd binary is installed.

i think those people who do want run Pd from a non-standard directory
(~/projects/shneider/pd/bin) and how want to be able to relocate this Pd
with all libraries to a different computer (including all libraries),
are somewhat "power-users".
it should be easy enough to setup a symlink from ~/pd-externals to
~/projects/shneider/pd/extra, and all deken-install externals will
magically end-up within the local Pd's extra folder.

an even better solution would be to add a "embed needed libraries into
Pd" action (from some menu), that would iterate over all dependencies
(e.g. as declared with [declare]) within the currently loaded patch(es)
and copy those found in ~/pd-externals/ into pd/extra.

mdsar
IOhannes




-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20150927/d6b4ed1b/attachment.sig>


More information about the Pd-dev mailing list