How to patch FPC Library ? lazarus / 1-Linux ---------------------------------------------------------------------- valerife · 2016-09-15 15:49 Hello everyone, I'm new to FPC and I want to patch a few things in the library fcl- web/fphttpclient.pp However all of my modifications aren't taken in consideration when the project is built. My first instinct was to guess it was a .ppu issue. The sources i am modifying are not the one getting build. I went to the /etc/fpc.cfg conf and update some path. I replace this Quote-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl by this Quote-Fu/usr/share/fpcsrc/$fpcversion/ -Fu/usr/share/fpcsrc/$fpcversion/* -Fu/usr/share/fpcsrc/$fpcversion/rtl -Fu/usr/share/fpcsrc/$fpcversion/packages/fcl- web/src/base/fphttpclient.pp (I am updating my files in /usr/share/fpcsrc/...) The compiler can't build anymore and tell me it doesn't find the fphttpclient.pp (Even if i put the path in my fpc.cfg). Error message : QuoteFree Pascal Compiler version 3.0.0 [2015/12/05] for x86_64 Copyright (c) 1993-2015 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling testupdatehttp.lpr testupdatehttp.lpr(9,22) Fatal: Can't find unit fphttpclient used by testupdatehttp Fatal: Compilation aborted Error: /usr/bin/ppcx64 returned an error exitcode i ran a strace and the interesting thing is it looks like it s opening the folder: Quote[pid   477] open("/usr/share/fpcsrc/3.0.0/packages/fcl- web/src/base/", O_RDONLY|O_LARGEFILE) = 4                                                          [pid   477] close(4) In am on a Linux neon, installed all of fpc fpcsrc and lazarus with the .deb Any pointer for where to look at would be much appreciated, Thanks ---------------------------------------------------------------------- Leledumbo · 2016-09-15 16:05 Quote from: valerife on September 15, 2016, 05:49:42 pmI replace this Quote-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl by this Quote-Fu/usr/share/fpcsrc/$fpcversion/ -Fu/usr/share/fpcsrc/$fpcversion/* -Fu/usr/share/fpcsrc/$fpcversion/rtl -Fu/usr/share/fpcsrc/$fpcversion/packages/fcl- web/src/base/fphttpclient.pp You might want to read the documentation what -Fu means. Certainly it's NOT an option to point specific unit path. And even worse, you should NEVER point it to source code, only compiled units. If you need to update certain fpc shipped source code, after modification execute make in the corresponding directory. In your case, it's fcl-web (might fail when you haven't built its dependencies as well). Or if that's too difficult, execute it in top level source directory which is /usr/share/fpcsrc. Note that you'll need to be root or chmod the whole fpcsrc as the script will build everything under that directory. If make goes fine, you'll need to install the compiled units, each is build inside their own package directory. You can simply cp them to /usr/lib/fpc/$fpcversion/units/$fpctarget/fcl-web (or use make install INSTALL_PREFIX=/usr). Note that executing make install at the top level directory will reinstall everything, which might or might not be desirable. ---------------------------------------------------------------------- MikeOnline · 2021-03-06 08:22 The steps in the previous post helped me patch FPC 3.2.0, specifically patching packages/fcl-web/src/openssl.pas, on macOS, with a code change posted at https://forum.lazarus.freepascal.org/index.php/topic, 50350.msg374104.html#msg374104.  I was unsuccessful building and copying individual packages, but doing the whole thing worked fine. The following commands worked reliably from Terminal: Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i sudo su -cd /usr/local/share/fpcsrc/packages/fcl-web/srcnano openssl.pas   # see link, above, for the fpc 3.2.0 patch needed to support https with fphttpclient and opensslsockets on newer macOS versionscd /usr/local/share/fpcsrcmake allmake install    # no prefix requiredcd /Applications/Lazarusmake clean allcd /usr/local/binunlink lazbuildln -s /Applications/Lazarus/lazbuildexit