WHen I run the exe I get replacements.csv missing if i click ok, get index out of boundsYou are right. Windows EXE was in downloads, while CSV was supposed to be downloaded from repository. Although you figured it out at the end, I have fixed it so CSV is also in downloads now. I hope it's less confusing now. Thanks!
Thank you very much for this.You are welcome. :D I am glad people find it useful. It was time for me to give something back to the community.
what about version for linux?When I catch time again I will try to integrate it with fpcup and then I will need to make it work on Linux too. There is nothing Windows specific in it so conversion shouldn't be too hard. If you take a look at the source you can find this:
// linux: sh -c " whole commandline" (not tested yet)
// OurProcess.Executable := '/bin/sh';
// OurProcess.Parameters.Add('-c');
// OurProcess.Parameters.Add('7z -y x %COMPONENTS typhon/components/* -r -o%UNPACKDIR');
so I did think about linux. When time comes you will just need to install p7zip first with your package manager. I will probably default to 7zr instead and parameters will probably be different, but you get the picture. ct2laz should work with Wine, so I don't think that many folks will be eager for linux version and that's why it's not high on my priority list right now. If someone wants to take a bite on his own, be my guest and share a patch. ;)
Compile Project, Target: ct2laz: Exit code 256, Errors: 1, Warnings: 1
Warning: Recompiling dynlibs, checksum changed for dl {impl}
openssl.pas(85,3) Fatal: Cannot find dynlibs used by openssl. Make sure all ppu files of a package are in its output directory. ppu in wrong directory=/usr/lib/fpc/3.0.0/units/i386-linux/rtl/dynlibs.ppu..
Compile Project, Target: ct2laz: Exit code 256, Errors: 1
strings.pp(109,2) Fatal: Cannot open include file "strings.inc"
HISTORY:
0.9.5.154 Lazarus version is now default (if you want CT version then convert project with it's executable:)
0.9.5.151 removed CodeTyphon specific components, show message on CSV file missing
0.9.1.136 initial public release
I am asking for help to make this tool compile under linux.I've forked your repo. I'll see what I can do.
After removing all CodeTyphon specific components my next move was to try to compile ct2laz under linux (Mint Cinammon Debian Edition with official Laz 1.6.2 and FPC 3.0.0), but I am stuck and need help.
I've forked your repo. I'll see what I can do.Thank you very much! Any help is most appreciated. :D
Can anyone help? ;) %) ;)Yes! But damn it was a nasty one. :o
Yes! But damn it was a nasty one. :oIn fact, that's the only "error" before the project builds on Linux. Fork cancelled %)
The fundamental reason is that RTL already has a unit named "dl" in rtl/unix/dl.pp.
Thank you sooooo much! It compiles now! :) :D :)Can anyone help? ;) %) ;)Yes! But damn it was a nasty one. :o
The fundamental reason is that RTL already has a unit named "dl" in rtl/unix/dl.pp.
Just rename your unit to "mydl" or whatever and it starts to work. After renaming you can test by adding "dl" again to uses section. Ctrl-Click it and see where it jumps. :)
[Edit] I looked at your commit history. "dl.pas" was added with commit message :Yes. To make it work with just Lazarus components I had to replace some CT only visuals, and completely rewrite downloading and recursive file search to use only what's available in FCL. That was also the reason for refactoring code.
"removed CodeTyphon specific components"
although it looks like a refactoring change where code was moved out of main unit into 2 new units.
A question comes to mind: why was the error message so misleading?Indeed it was so misleading that I think I would not have found the error myself in million years. Especially since it compiled well under windows. I really felt like a dummy throwing myself at it in many ways without any progress at all. I will certainly think more careful about naming in the future, but it can be tough sometimes. I mean, I have renamed dl to downloader now but it may also conflict in the future. I guess namespaces will come to the rescue one day...
It did not say anything about unit "dl" or the units used by "dl".
The problem was especially difficult to find because clean build (Shift-F9) apparently did not clean everything. I commented out units, also "dl" but the same error still came. By luck I happened to delete the whole project lib folder.
How could such errors be found easier?
Anyway, in this case the name "dl" was a bad choice because UNIX systems have libdl.
In fact, that's the only "error" before the project builds on Linux. Fork cancelled %)Thanks a lot for your time and effort!
Worked well,Most packages work. There are few specific to Typhon IDE that won't work, there are some that run only on windows, and there are some that require trunk FPC and/or LAZ, but every package that works in CodeTyphon should also work in Lazarus if they run both on the same pc with the same operating system. There are tons of packages, really - and many have nice examples. The only thing you should check manually for every package you want to use is the license of the original package, since that is not always that clear in CodeTyphon it self. I will probably display such warning message in the future, as one of ct2laz users has already suggested.
a few packages compiles but dont work
But e.g. Cindy works really well
Tahnk you really much for your effortYou are most welcome 8)
... I guess I will try to finally make ct2laz fully work on linux too. Stay tuned... ::)It should be easy because all the code you use from FPC and Lazarus libraries is already cross-platform.
Lab task 0010 : Change Typhon Project Info file extension from "lpi" to "ctpr"
Lab task 0040 : Change Typhon Package file extension from "lpk" to "ctpkg"
Apparently two of the things of PilotLogic has planned for the next version areQuoteLab task 0010 : Change Typhon Project Info file extension from "lpi" to "ctpr"
Lab task 0040 : Change Typhon Package file extension from "lpk" to "ctpkg"
So you might want to start factoring that into your development of ct2laz, I guess?
thanks a lot.Thanks for reporting. Only CSV file with replacement pairs needs to be updated for your find. It's too late now for this so I will leave it for tomorrow.
this tool has a little bug:
it should change '{$R *.lfm}' to '{$R *.frm}' :D
it should change '{$R *.lfm}' to '{$R *.frm}' :DFixed. You only need to replace your CSV with new one. Executable is not affected.
</RequiredPackages>
<Units Count="4">
<Unit0>
<Filename Value="snipy.ppr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="formmain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="MainForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit1>
@avra = your ct2laz works pretty fine to me, so I can ensure that when I write some stuffs with CT they keep compatibility with LAZ! and it is NICE! THANK YOU avraThank you very much. :D You are too kind! :-[
in the .ctpr / .lpi file (xml project descr.) your ct2laz does not change the value I marked bold! from .lpr to .pprThank you for this bug report. From a quick look, I would need to change some things. One of the initial decisions was to use no parser but very simple string replacements, and storing these replacement pairs in a simple CSV file. As CT decided to move further from Lazarus files I had to distinguish between quoted and not quoted strings, introduce file renaming and several other things. And so far I only needed to replace strings which are looked at as a whole. Solving this bug requires a possibility to replace strings which are not looked as a whole. I have already partially implemented such possibility but never used it in main code logic. The most convenient way to solve this fully seams to expand CSV file with one boolean. That would allow me to leave code pretty generic, avoid handling such specifics in code, and leave data to CSV where it belongs.
i'm much more busy on hollidays than at workUsually that's not the case with me, but this time I have to convert one old arcade cabinet into MAME cabinet for the kids with custom electronics interfacing original joysticks, buttons and lights. They think it is for them. ::)
I'd noticed also a "adLCL" and "LCL" requirement failing sometimesPlease report details once you find a pattern. Patches are also welcome. ;)
...incompatible ppu...usually means that you have left overs from another version of Lazarus or CT. Try to clean build all, or try to build with another version of Lazarus.
Note I use Linux (Ubuntu 18.04) as my main workstation, so I was very pleased to see you have a Linux compiled option. Worked perfectly apart from the fact that it crashes right at the end with an error (Unable to create file "session.log"). Fortunately it does not appear to affect the actual conversion process. I've tried giving full read/write access rights to the install folder, but that hasn't helped, so I am not sure where it's trying to save the log file.Could you please run it with sudo and report back if anything is different? If you do not trust executable, then you can build your own from the project. It should be easy since it does not use any 3rd party components.
1 other thing to clarify: I see several times you mention that you MUST delete the ini file every time you do a conversion. Am I correct in thinking this is the ct2laz.ini file? Must this be deleted everytime before doing a conversion from Lazarus to CT or vice versa, or do you mean only whenever upgrading from one version to the next of ct2laz? It seems strange to need to delete an ini file for the program every time you use it to do a conversion.You only need to do it when you are upgrading an executable when something new is added to ct2laz.ini file structure. The reason for this behavior was to avoid complicated INI handling. I did not want to write code to detect missing INI items and then react. I simply used TIniPropStorage and let it do all the work. I will see if I can make it more clear and rephrase it to avoid further confusion.
Your conversion is not converting CodeTyphon TSQLQuery correctly, CT has an extra property 'Macros' which Lazarus has not.CT uses trunk FPC and trunk LAZ. This usually means that there are changes which do not exist yet in official Lazarus, or fpcupdeluxe based one like fixes or some older version. Even 2 trunk versions which are few months apart may have huge differences in certain areas (be it in FPC or be it in LAZ).
good work, my supportThanks! :)
ct2laz is a tool to convert in the other direction, from CT back to Laz.Although name suggests that ct2laz does only one way conversion, it can actually convert both ways since CSV file holds conversion pairs, and string replacement doesn't care much about direction. You either choose [CT => LAZ] or [LAZ => CT] button. However, for a long time [CT => LAZ] is the only one I really care and spend time testing.
hi avra, this app not work today.. i try install packages exported in lazaurs (ct 2 laz) and result an error.You have to be more specific. What packages? Yours or CT's? What CT version? What Lazarus version? Bitness?
Just a big thank you Avra for ct2lazYou're most welcome. :D
I downloaded pl_cindy from your repo and was able to convertDo you know that there is pl_cindy already converted with ct2laz/ct4laz and ready to be installed directly from OPM (Online Package Manager) so you do not even need a manual repo download? You have to use my tools directly only if you want to convert project from/to CT, or if you need a specific CT package which I do not keep in the repo.
to the latest lazarus with no problems.