On Mon, 16 Sept 2024 at 11:19, H via Users users@lists.geany.org wrote:
I had some time to continue working on this. I have now renamed the geany classbuilder.c file to symfony.c and would like to use that as a starting point for my own plugin. However, when I try to compile it using:
gcc -c symfony.c -fPIC `pkg-config --cflags geany`
it fails on not finding PACKAGE_VERSION. PACKAGE_VERSION does not seem to be defined in the files geany-devel contained. Where is that variable defined? Which other files should I make sure I have in order to compile this source file?
PACKAGE_VERSION is part of the geany_plugins collection and was set by that build system. As your symfony is not part of that collection PACKAGE_VERSION is not useful so just replace the use(s) of the PACKAGE_VERSION with a literal version you want to set for your plugin.
Thank you in advance.
On Sat, 2024-09-14 at 14:10 -0400, H wrote:
Lex, thank you for your helpful reply. I did find that my distro also has a geany-devel package which I downloaded. I then deleted the source code for geany and geany-plugins I had downloaded from github and subsequently built the helloworld.c example without any problems.
All good, now my plan is to take the classbuilder.c source code, rename it to symfony.c and tweak this code to do what I would like it to do. I quickly tried to run the same gcc command I used for helloworld.c for this symfony.c (renamed from classbuilder.c) but it failed to compile. The first error referred to PACKAGE_VERSION being undefined. It is probably defined in some other header file that I will search for later.
On Sat, 2024-09-14 at 11:21 +1000, Lex Trotman via Users wrote:
On Sat, 14 Sept 2024 at 10:43, H via Users users@lists.geany.org wrote:
Thank you. I started playing around with compiling geany and geany plugins from the git source but after some false starts I realized that several of the plugins did not build on my Rocky Linux 9 system, presumably to dependencies missing. I was too lazy to figure out all of the dependencies needed so I deleted the version of geany and geany-plugins from git I just compiled, reinstalled both geany and geany-plugins from the repository so I am back where I started.
Tomorrow I will look at writing this "separate" new plugin based on the HelloWorld sample and go from there without touching the editor and already-installed plugins.
However, a couple of things I need to be sure on before proceeding:
- I need the <geanyplugin.h> header file. Am I correct in that I need to clone the github geany-plugin git repository to have access to that? And I need to have the geany source code from github to have access to geany.pc?
No, your distro should package the headers for the plugin API, but if it is included by default or if it is a separate package, and where it is put is a decision of your distro, not the Geany project. On my Mint system those are installed with the Geany package, but IIUC your rocky distro is a redhat clone so it is unrelated to debian based systems like Ubuntu/Mint and I don't know how it is arranged. As pkg-config helpfully says if it can't find the .pc file, you can add the right path to its environment variable, but you need to find the path from the distro installation. Although I am astonished that some distros don't seem to configure their pkg-config to look where they put .pc files.
- I saw that the source code on github is the yet-to-be-released version 2.1 of geany, I have to assume that when I clone the source from github for my own plugin I need to make sure it is the 2.0 tag, not the very latest source, correct?
You should not need to clone anything to build plugins, as I said above, where headers, .pc etc are installed is distro specific.
- When I compiled geany and then geany-plugins from github I could not get the ./configure step to work correctly, specifically pkg-config kept complaining it could not find geany.pc and I had double-, and triple-checked, that I had added the correct directory to PKG_CONFIG_PATH but no go. After many tries I was able to run ./configure --prefix=/usr/local --with-geany-libdir=/usr/local/lib, a reference to which I found on the internet. The README file for geany-plugins further suggest I could use --with-geany-prefix=... but that option was not recognized. Could this be an error in the README file?
This README is for the geany-plugins package. You are going to build a single independent plugin and should follow the instructions in the plugin manual https://www.geany.org/manual/reference/howto.html "Building" section.
- After reinstalling geany and geany-plugins from my OS repository I was back where I started and tried to run gcc -c HelloWorld.c -fPIC `pkg-config --cflags geany` from the directory where I had saved the HelloWorld.c sample. That failed due to pkg-config, presumably not finding geany.pc again and now I am giving up for today.
As I said its distro specific where the .pc file is put, I know nothing about your distro but hopefully it has some method to find what files the Geany package installed, if they include the .h files and .pc file and where they are, or if you need to install another package to get the files for building plugins.
To be clear, every distro has its own tweaks for how its package is built, and the Geany project does not build those packages because we simply can't keep track of all those specific rules and processes and changes for each distro.
Pointers around any other gotchas appreciated!
On Fri, 2024-09-13 at 11:25 +1000, Lex Trotman via Users wrote:
On Fri, 13 Sept 2024 at 02:13, H via Users users@lists.geany.org wrote:
Thank you! Modifying that code would require me to build the entire codebase, or? If correct, would a plugin be an alternative approach? My understanding is that plugins could simply be downloaded and then become available to geany itself, or?
Classbuilder _is_ a plugin. But it is built as part of Geany build so its probably more complicated to figure out how to do it separately if you are going to modify that.
You could write your own plugin based on classbuilder.c and only need to build that (see https://www.geany.org/manual/reference/).
On Thu, 2024-09-12 at 10:29 +1000, Lex Trotman via Users wrote:
On Thu, 12 Sept 2024 at 09:55, H via Users users@lists.geany.org wrote:
Using geany 2.0 on Rocky Linux 9. I am spending a lot of time using Symfony and could see value in having some custom functions implemented. I just came across Create Class/PHP Class and would like to do something quite similar but for Symfony and to my specifications.
How would I go about that? I have no experience writing anything for geany so I am not sure where to start. For instance, is the Create Class/PHP Class code available somewhere and I could use that as a base for tweaking and then have e.g. Create Class/Symfony in my editor?
https://github.com/geany/geany/blob/master/plugins/classbuilder.c
Pointers/suggestions most welcome! _______________________________________________ Users mailing list -- users@lists.geany.org To unsubscribe send an email to users-leave@lists.geany.org
Users mailing list -- users@lists.geany.org To unsubscribe send an email to users-leave@lists.geany.org
Users mailing list -- users@lists.geany.org To unsubscribe send an email to users-leave@lists.geany.org
Users mailing list -- users@lists.geany.org To unsubscribe send an email to users-leave@lists.geany.org
Users mailing list -- users@lists.geany.org To unsubscribe send an email to users-leave@lists.geany.org
Users mailing list -- users@lists.geany.org To unsubscribe send an email to users-leave@lists.geany.org
Users mailing list -- users@lists.geany.org To unsubscribe send an email to users-leave@lists.geany.org