mORMot2 icon indicating copy to clipboard operation
mORMot2 copied to clipboard

.dkp package file for Delphi

Open vennexedu opened this issue 1 year ago • 5 comments

Is there a future plan to create a .dpk package file for Delphi? Or does anyone know how to create one? I am not sure I can just use the .pas file for Lazarus. I tried to mimic what the .lpk file does in Delphi 11.3, but ran into a whole lot of dependency issues. For instance, I needed to install BDE and NexusDB locally. I'd like to use mORMot2 in a .bpl file. Great library, btw!

vennexedu avatar Nov 12 '24 16:11 vennexedu

AFAIR Delphi packages are not the same thing as Lazarus packages. What is wrong with adding the paths to the project? Or do you have any trouble when compiling mORMot in a bpl?

There may be some problems at runtime, due to some global/shared memory structures like RTTI cache. Perhaps more a topic for discussion in our forum. I guess some users have already experimented running mORMot 2 within packages. Even if I doubt the few hunderth KB saved by using package is worth it nowadays.

synopse avatar Nov 12 '24 16:11 synopse

Thank you for the quick reply. I wanted to use mORMot 2 in a commercial environment and my company requires all the libraries we use to be centralized. We use .bpl files for that. Using environmental variables worked fine, but inside our system it's not possible to do that. I wanted to start in the synopse.info forum, but my account (made it yesterday) has been banned. No idea why. Btw, the problem was that mormot.db.raw.sqlite3.static.pas couldn't be used by Delphi when trying to package it somehow.

vennexedu avatar Nov 12 '24 18:11 vennexedu

Let's ask for feedback at https://synopse.info/forum/viewtopic.php?id=7064

synopse avatar Nov 13 '24 07:11 synopse

Here are some advices when creating a package

  • use LIBSSUFFIX Auto
  • create a seperate package for Design-Time components (TSynLabeledEdit), the most of the sources should be in the runtime package. May seperate IDE-Modification in an seperate package too.
  • use inc file to control which variant you want to build (BDE, Firedac, etc.)
  • maybe the deprecation warning of should be suspressed when installing the packages
 WARNING: deprecated SQLite3 engine
------------------------------------

Static SQLite3 library as included within C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\bds.exe is outdated!
Linked version is 3.44.2 whereas the current/expected is 3.46.1.

Please download latest SQLite3 3.46.1 revision from
https://synopse.info/files/mormot2static.7z

Here is a cleaned up variant of https://gist.github.com/JavierusTk/04abe4ee298620ef4100b747f7344ef8

package mORMot2;

{$R *.res}
{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
{$ALIGN 8}
{$ASSERTIONS ON}
{$BOOLEVAL OFF}
{$DEBUGINFO OFF}
{$EXTENDEDSYNTAX ON}
{$IMPORTEDDATA ON}
{$IOCHECKS ON}
{$LOCALSYMBOLS ON}
{$LONGSTRINGS ON}
{$OPENSTRINGS ON}
{$OPTIMIZATION OFF}
{$OVERFLOWCHECKS ON}
{$RANGECHECKS ON}
{$REFERENCEINFO ON}
{$SAFEDIVIDE OFF}
{$STACKFRAMES ON}
{$TYPEDADDRESS OFF}
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$DEFINE DEBUG}
{$DEFINE PACKAGECOMPILE}
{$ENDIF IMPLICITBUILDING}
{$DESCRIPTION 'mORMot2 nucleus - will not use any mORMor package, but be used by all other packages'}
{$LIBSUFFIX AUTO}
{$IMPLICITBUILD OFF}

requires
  rtl,
  vcl,
  dbrtl;

contains
  mormot.core.base in '..\src\core\mormot.core.base.pas',
  mormot.core.buffers in '..\src\core\mormot.core.buffers.pas',
  mormot.core.collections in '..\src\core\mormot.core.collections.pas',
  mormot.core.data in '..\src\core\mormot.core.data.pas',
  mormot.core.datetime in '..\src\core\mormot.core.datetime.pas',
  mormot.core.interfaces in '..\src\core\mormot.core.interfaces.pas',
  mormot.core.json in '..\src\core\mormot.core.json.pas',
  mormot.core.log in '..\src\core\mormot.core.log.pas',
  mormot.core.mustache in '..\src\core\mormot.core.mustache.pas',
  mormot.core.os in '..\src\core\mormot.core.os.pas',
  mormot.core.perf in '..\src\core\mormot.core.perf.pas',
  mormot.core.rtti in '..\src\core\mormot.core.rtti.pas',
  mormot.core.search in '..\src\core\mormot.core.search.pas',
  mormot.core.test in '..\src\core\mormot.core.test.pas',
  mormot.core.text in '..\src\core\mormot.core.text.pas',
  mormot.core.threads in '..\src\core\mormot.core.threads.pas',
  mormot.core.unicode in '..\src\core\mormot.core.unicode.pas',
  mormot.core.variants in '..\src\core\mormot.core.variants.pas',
  mormot.core.zip in '..\src\core\mormot.core.zip.pas',
  mormot.net.acme in '..\src\net\mormot.net.acme.pas',
  mormot.net.async in '..\src\net\mormot.net.async.pas',
  mormot.net.client in '..\src\net\mormot.net.client.pas',
  mormot.net.dns in '..\src\net\mormot.net.dns.pas',
  mormot.net.http in '..\src\net\mormot.net.http.pas',
  mormot.net.ldap in '..\src\net\mormot.net.ldap.pas',
  mormot.net.relay in '..\src\net\mormot.net.relay.pas',
  mormot.net.rtsphttp in '..\src\net\mormot.net.rtsphttp.pas',
  mormot.net.server in '..\src\net\mormot.net.server.pas',
  mormot.net.sock in '..\src\net\mormot.net.sock.pas',
  mormot.net.ws.async in '..\src\net\mormot.net.ws.async.pas',
  mormot.net.ws.client in '..\src\net\mormot.net.ws.client.pas',
  mormot.net.ws.core in '..\src\net\mormot.net.ws.core.pas',
  mormot.net.ws.server in '..\src\net\mormot.net.ws.server.pas',
  mormot.crypt.core in '..\src\crypt\mormot.crypt.core.pas',
  mormot.crypt.ecc in '..\src\crypt\mormot.crypt.ecc.pas',
  mormot.crypt.ecc256r1 in '..\src\crypt\mormot.crypt.ecc256r1.pas',
  mormot.crypt.jwt in '..\src\crypt\mormot.crypt.jwt.pas',
  mormot.crypt.openssl in '..\src\crypt\mormot.crypt.openssl.pas',
  mormot.crypt.secure in '..\src\crypt\mormot.crypt.secure.pas',
  mormot.crypt.x509 in '..\src\crypt\mormot.crypt.x509.pas',
  mormot.soa.client in '..\src\soa\mormot.soa.client.pas',
  mormot.soa.codegen in '..\src\soa\mormot.soa.codegen.pas',
  mormot.soa.core in '..\src\soa\mormot.soa.core.pas',
  mormot.soa.server in '..\src\soa\mormot.soa.server.pas',
  mormot.rest.client in '..\src\rest\mormot.rest.client.pas',
  mormot.rest.core in '..\src\rest\mormot.rest.core.pas',
  mormot.rest.http.client in '..\src\rest\mormot.rest.http.client.pas',
  mormot.rest.http.server in '..\src\rest\mormot.rest.http.server.pas',
  mormot.rest.memserver in '..\src\rest\mormot.rest.memserver.pas',
  mormot.rest.mvc in '..\src\rest\mormot.rest.mvc.pas',
  mormot.rest.server in '..\src\rest\mormot.rest.server.pas',
  mormot.db.core in '..\src\db\mormot.db.core.pas',
  mormot.db.proxy in '..\src\db\mormot.db.proxy.pas',
  mormot.db.rad in '..\src\db\mormot.db.rad.pas',
  mormot.db.rad.ui.orm in '..\src\db\mormot.db.rad.ui.orm.pas',
  mormot.db.rad.ui in '..\src\db\mormot.db.rad.ui.pas',
  mormot.db.rad.ui.sql in '..\src\db\mormot.db.rad.ui.sql.pas',
  mormot.orm.base in '..\src\orm\mormot.orm.base.pas',
  mormot.orm.client in '..\src\orm\mormot.orm.client.pas',
  mormot.orm.core in '..\src\orm\mormot.orm.core.pas',
  mormot.orm.rest in '..\src\orm\mormot.orm.rest.pas',
  mormot.orm.server in '..\src\orm\mormot.orm.server.pas',
  mormot.orm.sql in '..\src\orm\mormot.orm.sql.pas',
  mormot.orm.storage in '..\src\orm\mormot.orm.storage.pas',
  mormot.db.sql in '..\src\db\mormot.db.sql.pas',
  mormot.ui.controls in '..\src\ui\mormot.ui.controls.pas',
  mormot.ui.core in '..\src\ui\mormot.ui.core.pas',
  mormot.ui.gdiplus in '..\src\ui\mormot.ui.gdiplus.pas',
  mormot.ui.grid.orm in '..\src\ui\mormot.ui.grid.orm.pas',
  mormot.ui.pdf in '..\src\ui\mormot.ui.pdf.pas',
  mormot.lib.curl in '..\src\lib\mormot.lib.curl.pas',
  mormot.lib.gdiplus in '..\src\lib\mormot.lib.gdiplus.pas',
  mormot.lib.gssapi in '..\src\lib\mormot.lib.gssapi.pas',
  mormot.lib.lizard in '..\src\lib\mormot.lib.lizard.pas',
  mormot.lib.openssl11 in '..\src\lib\mormot.lib.openssl11.pas',
  mormot.lib.quickjs in '..\src\lib\mormot.lib.quickjs.pas',
  mormot.lib.sspi in '..\src\lib\mormot.lib.sspi.pas',
  mormot.lib.static in '..\src\lib\mormot.lib.static.pas',
  mormot.lib.uniscribe in '..\src\lib\mormot.lib.uniscribe.pas',
  mormot.lib.win7zip in '..\src\lib\mormot.lib.win7zip.pas',
  mormot.lib.winhttp in '..\src\lib\mormot.lib.winhttp.pas',
  mormot.lib.z in '..\src\lib\mormot.lib.z.pas',
  mormot.crypt.rsa in '..\src\crypt\mormot.crypt.rsa.pas',
  mormot.db.raw.odbc in '..\src\db\mormot.db.raw.odbc.pas',
  mormot.db.raw.oledb in '..\src\db\mormot.db.raw.oledb.pas',
  mormot.db.raw.sqlite3 in '..\src\db\mormot.db.raw.sqlite3.pas',
  mormot.db.sql.odbc in '..\src\db\mormot.db.sql.odbc.pas',
  mormot.db.sql.oledb in '..\src\db\mormot.db.sql.oledb.pas',
  mormot.db.sql.sqlite3 in '..\src\db\mormot.db.sql.sqlite3.pas',
  mormot.rest.sqlite3 in '..\src\rest\mormot.rest.sqlite3.pas',
  mormot.orm.sqlite3 in '..\src\orm\mormot.orm.sqlite3.pas',
  mormot.db.raw.sqlite3.static in '..\src\db\mormot.db.raw.sqlite3.static.pas',
  mormot.core.os.security in '..\src\core\mormot.core.os.security.pas';

end.

pustekuchen91 avatar Jan 20 '25 11:01 pustekuchen91

The deprecation message comes from an incorrect local setup. You need to download the proper static content, corresponding to the sources.

synopse avatar Jan 20 '25 13:01 synopse

Not a real issue.

Please use the forum for further discussion, or reopen with more content. Thanks for the feedback.

synopse avatar Nov 20 '25 14:11 synopse