Indy for Lazarus

A new attempt at converting Indy is being undertaken by the Indy core team. FPC developer Marco van de Voort is working with Indy core to get Indy fully working with FPC/Lazarus. Specially Indy's JP Mugaas did a lot of good work in getting Indy10 to work with FPC. The native unixrtl backend is mostly his work too.

Currently Indy10 is nearly fully working, and end-user usability has been improved a lot. Only special topics like OpenSSL and compression might need additional knowledge. 64-bit support hasn't entirely been validated either.

Hint: I'm not very interested in support the Kylix side of Indy. (anything that uses unit libc). I ported it only as step up to native Unix RTL using Indy apps.

Requirements

Currently, FPC 2.0.4 is very close to being able to use indy in all its facets, except for the server bug on FreeBSD/Mac OS X (which requires 2.1.1)

Since Indy10 now works for all major targets, we focus on this version. While conversion to Indy9 might be simpler for people, keep in mind that it only works on win32. (and theoretically could be ported to Linux/x86).

Therefore we recommend people to work with 10 as much as possible.

(For indy9, you might need to remove the overriding of tmemorystream.setsize method (Marcov: ???) to get telnet components working, but Indy9 hasn't been tested in a while)

The port is fairly stable, and JP Mugaas has done a great deal to improve the quality of the release, a set of makefiles inclusive

What works, what not

Windows and Unix: clients work and servers should work fine in principle.

The main work for native Unix RTL done. Servers Clients seem to work with FreeBSD and OS X

All: secure versions not tested yet.

Short term plans

Convert demos to demonstrate/test workings.

Fix bugs and enter them back into FPC or Indy RCS.

Problems

Indy9 and Indy10 are mutually exclusive, which causes problems for deployment, even the default is a problem:

Indy9 is more used and proven in the industry.

Indy10 is more portable, and better long term. However uptake seems to be low, and there is not much movement at Indy anymore.

How to deploy? Parts belong to Lazarus, parts to FPC.

Lot of pkgs and demos have paths in them. How to centrally fix them so that inexperienced users can build them?

Lazarus problems

Transparency problems of icons

component tabs don't scroll, if you put a lot of components in one tab, they are not selectable. workaround implemented: JP Mugaas separated them into Indy clients A-M and N-Z etc. Also, meanwhile Lazarus changed to two rows of components per tab.

Indy demos (specially Indy10's) are not very suitable for multiplatform usage. Their setup is awfully windows specific, with spaces in paths, deep nested dirs, and useless baggage (C# code). A short working set of demos will have to be created.

Bugs

Indy10 servers didn't work before due to an exception occurring during startup, which shut everything down. You need FPC 2.2(.0) or later to fix this (pthread_kill problem). This probably also affects Mac OS X.

During demo conversion, the bindings property is often wrongly converted. This can result in strange errors, specially because Indy seems to bind to the same port using both IPV4 and IPV6 at the same time.

copy the *.pas, *.lrs and *.inc of the \Lib\System, \Lib\Core, and \Lib\Protocols subdirectories into a new directory of your choosing

copy the indylaz.lpk in the \Lib directory to the directory you created above

from within Lazarus do a Package -> Open package file, open the indylaz.lpk

in the Package Options dialog, add the path to the directory you created above to the "Unit" field.

compile then install (will rebuild Lazarus). EDIT: Currently, due to a know bug in FPC, you must compile the Indy package TWICE before installing it.

In order to write & compile Indy10 applications, you need to put the path to the Indy directory in the "Other Unit files" textbox of every project that you write. You'll find "Other Unit files" under Project Options -> Compiler Options -> Paths.

=== How to install (confirmed) on Windows - Indy 10.2.03 ===
/* How to install [3] Windows, Indy 10.5.8.0 and above */
For a lot of users, I'm sure that the information given above won't work, or will be somewhat confusing given the differences between versions and inconsistent explanations.

The website points you to download the latest version from the snapshots page.

This wiki tells you to copy a lot of files over into directories.

For me, neither worked, and ended up making a mess of my Lazarus installations.

Firstly, the page I would retrieve this from is here. Other sites I tried had problems with some files inside the archive.

When you open up the archive above, you will see there are folders: "fpc" and "lazarus".

You can copy the contents of "fpc" into: LAZARUS_DIR\fpc\2.6.0\source\packages\indylaz if you want to have things neat and tidy.

The "lazarus" folder, you copy into LAZARUS_DIR\components\indylaz

With both of these, make sure that there isn't a sub-directory inside the folders given. i.e. LAZARUS_DIR\components\indylaz\lazarus\

Go into Lazarus and go to "Package" -> "Open package file" and point it to the "indylaz.lpk" inside the LAZARUS_DIR\components\indylaz directory.

Once the package loads inside your project, click on the "options" button, which resembles an image of a parcel with a cog next to it.

Click the "Compiler Options" on the left-hand side and Click on the ".." button next to "Other unit files (-Fu) (delimiter is semicolon)".

Select the "fpc" then "lazarus" folders you created above and click OK.
Lazarus will sort out the relative path for you. Don't change it.

Click OK and compile and then direct angry bile towards the individual who has steered you wrong with the previous, unhelpful, instructions.

Issue on Windows 64bits

On Windows 64bits, the compilation of the archive mentioned above will not work.
This can be fixed by editing IdAntiFreeze.pas, replacing :