hoehermann / purple-gowhatsapp

Pidgin/libpurple plug-in for WhatsApp Web.
GNU General Public License v3.0
290 stars 34 forks source link

Per-user plugin dir? #196

Closed brianjmurrell closed 7 months ago

brianjmurrell commented 7 months ago

I believe that pidgin/purple support per-user plugin dirs in ~/.purple/plugins/.

Would it be terribly difficult to have the install/strip make target install to the per-user plugin dir if the caller is not root?

I'd submit a PR but cmake is something I have never really taken the time to learn and understand.

hoehermann commented 7 months ago

Would it be terribly difficult to have the install/strip make target install to the per-user plugin dir if the caller is not root?

According to my knowledge of CMake, an automated switch during installation time would be "annoyingly difficult". However, a switch during configuration time is "easy". It would look like this:

cmake -DPURPLE_PLUGIN_DIR=~/.purple/plugins ..

Would that be okay for you?

brianjmurrell commented 7 months ago

But ultimately, the build/install instructions say:

sudo make install/strip

So I don't invoke cmake directly in this case. If it's any easier to put the test for root/use per-user dir into Makefile rather than the CMakefile, that's fine with me. I don't really care where it goes.

hoehermann commented 7 months ago

CMake is always necessary, and is used before make. I try to make it more clear:

For users with root access, it currently is:

git submodule update --init
mkdir build
cd build
cmake ..
cmake --build .
sudo make install/strip

For users without root access, it would be:

git submodule update --init
mkdir build
cd build
cmake -DPURPLE_PLUGIN_DIR=~/.purple/plugins .. # This explicitly enables running `make install/strip` as non-root
cmake --build .
make install/strip
brianjmurrell commented 7 months ago

Oh, I see. It's more clear now. Yes, I suppose that is more useful than what exists. Would be good to include the new option in the README for those that don't want to use root to install to the system plugin dir.

hoehermann commented 7 months ago

This is now available in the default branch and mentioned in the readme. :)

brianjmurrell commented 7 months ago

Added in 172fe6d65695fba9c04612970ab182830b7269c3, for anyone coming along here and wants the gory details.