Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to install? #1169

Closed
CouldBeThis opened this issue Mar 11, 2022 · 15 comments
Closed

how to install? #1169

CouldBeThis opened this issue Mar 11, 2022 · 15 comments

Comments

@CouldBeThis
Copy link

Hi, I am on an older version of ubuntu so the repos are not up to date. I installed geany from source to be up to date and was hoping to get the plugins. I can't make sense of the install instructions. I tried both cloning and getting the release files, tried running autogen.sh and ./configure but not sure what the exact procedure is supposed to be? Also tried moving the releases into ~/.config/geany/plugins/ but geany does not pick them up.

Also saw #1063 and #1163, not sure of the implications. Is it not possible to obtain these in this manner?

@elextr
Copy link
Member

elextr commented Mar 11, 2022

If you built Geany then you should have the basic tools to build the plugins. If you built Geany with all defaults then the plugins should also build with defaults. If you set any options when configuring Geany (particularly --prefix=) you have to also set it on plugins configure and set --with-geany-libdir= to the prefix directory/lib.

But as #1063 notes, beyond the basic build tools some of the plugins have other dependencies, and if configure can't find them they will be configured as "no" and that plugin will not be built, but any configured as "yes" should still build.

As noted in #1168 there is not a good list of these other dependencies for plugins, you need to read each plugins documentation (and sadly sometimes code).

PS #1163 is about the github test builds for pull requests, it doesn't affect you building, so don't worry about it :-)

@nomadbyte
Copy link
Contributor

Geany loads plugins from a number of default locations (on Linux <geany-configdir>/plugins, <geany-libdir>/geany), but also you can specify a custom one in Geany Preferences.

The default Geany plugins (as packaged with Geany app) are installed in /usr/lib/x86_64-linux-gnu/geany/, which is basically per the distribution specific <geany-libdir> (in this case it's Ubuntu).

@hupeng111
Copy link

I built a bin/geany .exe from the wiki https://wiki.geany.org/howtos/win32/msys2 and followed this document https://www.geany.org/manual/reference/howto.html. Use it as an example, but compile with a prompt that geoyplugin.h cannot be found, and when I link to the include directory, there will be a new header file that cannot be found. Is this a lack of dependency at build time, or something else, expect a reply.

@elextr
Copy link
Member

elextr commented Jul 20, 2022

@hupeng111 geoyplugin.h is not part of Geany.

Are you compiling your own plugin? Is it part of your plugin? If so you need to setup your build right, which is not part of Geany.

@hupeng111
Copy link

I misspelled, this is my problem, I mean geanyplugin.h, this problem arises when I build my helloworld plugin according to the two wikis above, I'm not sure which step I'm wrong, or what is missing

@elextr
Copy link
Member

elextr commented Jul 20, 2022

I presume your Geany built and runs?

The pkg-config subcommand (the part inside backquotes) of the compile command given in the Building section of the howto should extract the relevant include directories from the Geany install and pass them to the compile, but that is a Linux command.

  1. Is geanyplugin.h actually present in the install of Geany?
  2. Is geany.pc actually present in the install of Geany?
  3. does pkg-config find the installed Geany? Try running pkg-config --cflags geany as a standalone command and see what it returns, one of the -I options should point to a directory which contains geanyplugin.h.
  4. do backquoted subcommands work on the Windows command line?

@hupeng111
Copy link

hupeng111 commented Jul 20, 2022

  1. Is actually present in the install of Geany?geanyplugin.h
    yes,in my C:\geany\include\geany

2. Is actually present in the install of Geany?geany.pc
yes ,in C:\geany\lib\pkgconfig

3. does find the installed Geany? Try running as a standalone command and see what it returns, one of the options should point to a directory which contains .pkg-config pkg-config --cflags geany -I geanyplugin.h

Are you referring to running this command on cmd, it gives the following results

C:\Users\hp>pkg-config --cflags geany
Package geany was not found in the pkg-config search path.
Perhaps you should add the directory containing `geany.pc'
to the PKG_CONFIG_PATH environment variable
Package 'geany', required by 'virtual:world', not found

This is what I looked at at msys2

hp@DESKTOP-I3CBN8V MINGW64 ~
$ echo $PKG_CONFIG_PATH
/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig

4. do backquoted subcommands work on the Windows command line?

gcc -c "plugin.c" -fPIC `pkg-config --cflags geany` (in C:\geany\code ) 
gcc: error: unrecognized command-line option '--cflags' 

Cflags error is prompted under my windows.But when I downloaded and used gtk3, cflags didn't get a similar error

@elextr
Copy link
Member

elextr commented Jul 20, 2022

Please do a github preview before you post the comment, your copying and pasting on Windows seems to have converted the text you copied from my post to non-utf-8 so it shows as Asian characters.

Your subsequent edits show that the problem is pkg-config can't find Geany and tells you what to do, add the directory containing the geany.pc file to the environment variable.

Are you running the gcc command in the mingw shell, not the Windows cmd?

@nomadbyte
Copy link
Contributor

nomadbyte commented Jul 20, 2022

@hupeng111: At this point, this issue appears as a very confusing mix of platforms, options, versions, shells, and most crucially, user's intention.

This issue started from building Geany and its plugins under Ubuntu. If you're dealing with problems in different context, it would make sense to start a different issue, to avoid the confusion.

I understand that you successfully built and installed the Geany binary. So, given all dependencies are in-place, you should be equally able to similarly build and install the plugins. In fact, you could do this just for a simple plugin that needs no extra dependencies (e.g. lineoperations).

To configure geany-plugins to build only a given plugin (e.g. lineoperations):

../configure --no-create --no-recursion --disable-all-plugins --enable-lineoperations --prefix="<same-prefix-as-geany-install>" --with-geany-libdir="<same-prefix-as-geany-install>/lib"

Then just build and install:

make
make install  ## sudo,  if needed

If this works for a single plugin, and the plugins is visible in the Geany, then the other plugins can be built at once (provided all needed dependencies are set up). Reconfigure to allow building all plugins, basically it's a default. Just pass --prefix and --with-geany-libdir options respectively. Rebuild and install.

@hupeng111
Copy link

hupeng111 commented Jul 21, 2022

Please do a github preview before you post the comment, your copying and pasting on Windows seems to have converted the text you copied from my post to non-utf-8 so it shows as Asian characters.

Your subsequent edits show that the problem is pkg-config can't find Geany and tells you what to do, add the directory containing the geany.pc file to the environment variable.

Are you running the gcc command in the mingw shell, not the Windows cmd?

As you said I successfully compiled the helloworld plugin and can use it. Now I'm trying to build the installed version, but I'm having some problems.
I didn't find the official version of signcode, so I downloaded it from the web. But I'm not sure if it works properly, and when I execute a python script, the following issue arises

D:\DevelopTools\msys64\home\hp\geany>python ..\geany-release.py
Execute command: git pull
hint: core.useBuiltinFSMonitor=true is deprecated;please set core.fsmonitor=true instead
hint: Disable this message with "git config advice.useCoreFSMonitorConfig false"
Already up to date.
Execute command: d:/DevelopTools/msys64/mingw64/bin/strip.exe geany-1.38/bin/geany.exe
Execute command: d:/DevelopTools/msys64/mingw64/bin/strip.exe geany-1.38/bin\libgeany-0.dll
Execute command: d:/DevelopTools/msys64/mingw64/bin/strip.exe geany-1.38/lib/geany\classbuilder.dll
Execute command: d:/DevelopTools/msys64/mingw64/bin/strip.exe geany-1.38/lib/geany\export.dll
Execute command: d:/DevelopTools/msys64/mingw64/bin/strip.exe geany-1.38/lib/geany\filebrowser.dll
Execute command: d:/DevelopTools/msys64/mingw64/bin/strip.exe geany-1.38/lib/geany\htmlchars.dll
Execute command: d:/DevelopTools/msys64/mingw64/bin/strip.exe geany-1.38/lib/geany\saveactions.dll
Execute command: d:/DevelopTools/msys64/mingw64/bin/strip.exe geany-1.38/lib/geany\splitwindow.dll
Execute command: c:/signcode/signcode.exe -sha1 1ae7e5af8ab57e16d22cdf9bb3a7e6d2a43703ec -a md5 -i http://www.geany.org -n Geany Binary -t http://timestamp.verisign.com/scripts/timstamp.dll -tr 5 geany-1.38/bin/geany.exe
Usage:  SignCode [options] FileName
Options:
 -spc  <file>      Spc file containing software publishing certificates
 -v    <pvkFile>   Pvk file name containing the private key
 -k    <KeyName>   Key container name
 -n    <name>      Text name representing content of the file to be signed
 -i    <info>      Place to get more info on content (usually a URL)
 -p    <provider>  Name of the cryptographic provider on the system
 -y    <type>      Cryptographic provider type to use
 -ky   <keytype>   Key type
                      <signature|exchange|<integer>>
 -$    <authority> Signing authority of the certificate
                      <individual|commercial>
                      Default to using certificate's highest capability
 -a    <algorithm> Hashing algorithm for signing
                      <md5|sha1>. Default to md5
 -t    <URL>       TimeStamp server's http address
 -tr   <number>    The # of timestamp trial until succeeds. Default to 1
 -tw   <number>    The # of seconds delay between each timestamp. Default to 0
 -j    <dllName>   Name of the dll that provides attributes of the signature
 -jp   <param>     Parameter to be passed to the dll
 -c    <file>      X509 file containing encoded software publishing certificate
 -s    <store>     Cert store containing certs. Default to my store
 -r    <location>  Location of the cert store in the registry
                      <localMachine|currentUser>. Default to currentUser
 -sp   <policy>    Add all the certificates in the chain or add until one cert
                   in the chain is from the spc store.
                      <chain|spcstore>. Default to spcstore
 -cn   <name>      The common name of the certificate
 -x                Do not sign the file.  Only Timestamp the file

Note:   To sign with a SPC file, the required options are -spc and -v if
        your private key is in a PVK file. If your private key is in a
        registry key container, then -spc and -k are the required options.
Traceback (most recent call last):
  File "D:\DevelopTools\msys64\home\hp\geany-release.py", line 121, in <module>
    make_release()
  File "D:\DevelopTools\msys64\home\hp\geany-release.py", line 102, in make_release
    sign_files(*binary_files)
  File "D:\DevelopTools\msys64\home\hp\geany-release.py", line 77, in sign_files
    run_command(
  File "D:\DevelopTools\msys64\home\hp\geany-release.py", line 37, in run_command
    check_call(cmd, **kwargs)
  File "D:\DevelopTools\msys64\mingw64\lib\python3.10\subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('c:/signcode/signcode.exe', '-sha1', '1ae7e5af8ab57e16d22cdf9bb3a7e6d2a43703ec', '-a', 'md5', '-i', 'http://www.geany.org', '-n', 'Geany Binary', '-t', 'http://timestamp.verisign.com/scripts/timstamp.dll', '-tr', '5', 'geany-1.38/bin/geany.exe')' returned non-zero exit status 4294967295.

Can you provide this installation route?

@eht16
Copy link
Member

eht16 commented Jul 23, 2022

The information in the howto on https://wiki.geany.org/howtos/win32/msys2 were pretty old and also partly outdated. Some months ago, I started to rewrite the howto to be more accurate and recent. It took some time but I could finally finish it (except the release.py scripts, I forgot to copy them from my Windows machine, will do in a few days).

The updated howto now also uses osslsigncode for code signing which is easier to install and use than the Microsoft SignCode tool.

Some remarks regarding your mentioned problems above:

  • it's way easier to do anything regarding compilation and installation from within a MSYS2 shell - using the native Windows command prompt is not been tested and supported and probably makes things just more complicated
  • the release scripts and especially the code signing is not important for you, these steps are only necessary if you would build a full binary release for distribution but for local development I recommend to skip these steps

@jklouz
Copy link

jklouz commented Aug 6, 2022

i try:
./configure --enable-all-plugins
its results:
configure: error: cannot find required auxiliary files: compile missing install-sh,
how to fix this ???
on debian

@elextr
Copy link
Member

elextr commented Aug 6, 2022

@jklouz are you building from tarball or git?

If git you need need to run autogen.sh first.

@jklouz
Copy link

jklouz commented Aug 7, 2022

@elextr i dont exactly remember it, but just say i build it from tarball, what i suppose to do? and one more things its possible to add third party plug-in such compiler explorer?

@frlan
Copy link
Member

frlan commented Apr 14, 2024

I'm closing this issue now as the Windows build system was updated quiet heavy and this issue really is a colorful mixture between a lot of different platforms - unfortunately not really helpful, too.

@frlan frlan closed this as completed Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants