Recent

Author Topic: [SOLVED] Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD  (Read 4686 times)

dbannon

  • Hero Member
  • *****
  • Posts: 2196
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #15 on: March 04, 2022, 02:41:10 am »
After your one successful build of FPC, did you test it on some thing simple before tackling Lazarus ?

Never try to script something you cannot do by hand.  Small steps, test if possible after each step.

You have a message about not being able to build FPC322 with FPC322, maybe that is the case ? Worth looking into.

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Superdisk

  • Jr. Member
  • **
  • Posts: 73
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #16 on: March 05, 2022, 03:04:03 am »
I'm currently running into the same exact issue as TCH. I think it must be some sort of misconfiguration in `fpc.cfg` or something-- I can see that `db.ppu` is installed, so there shouldn't be a problem loading it.

Code: [Select]
$ pkg_info -L fpc | grep db.ppu
/usr/local/lib/fpc/3.2.2/units/x86_64-openbsd/fcl-db/db.ppu
/usr/local/lib/fpc/3.2.2/units/x86_64-openbsd/fcl-db/sqldb.ppu
/usr/local/lib/fpc/3.2.2/units/x86_64-openbsd/fcl-net/netdb.ppu
/usr/local/lib/fpc/3.2.2/units/x86_64-openbsd/fpindexer/fbindexdb.ppu
/usr/local/lib/fpc/3.2.2/units/x86_64-openbsd/fpindexer/memindexdb.ppu
/usr/local/lib/fpc/3.2.2/units/x86_64-openbsd/fpindexer/pgindexdb.ppu
/usr/local/lib/fpc/3.2.2/units/x86_64-openbsd/fpindexer/sqldbindexdb.ppu
/usr/local/lib/fpc/3.2.2/units/x86_64-openbsd/fpindexer/sqliteindexdb.ppu
/usr/local/lib/fpc/3.2.2/units/x86_64-openbsd/sqlite/sqlite3db.ppu
/usr/local/lib/fpc/3.2.2/units/x86_64-openbsd/sqlite/sqlitedb.ppu

But when I try to compile a simple program, I get this error:

Code: [Select]
$ more asdf.pas
program asdf;
uses db;
begin
        writeln('yeah');
end.

$ fpc asdf.pas
Free Pascal Compiler version 3.2.2 [2021/09/27] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: OpenBSD for x86-64
Compiling asdf.pas
asdf.pas(2,6) Fatal: Can't find unit db used by asdf
Fatal: Compilation aborted
Error: /usr/local/bin/ppcx64 returned an error exitcode
« Last Edit: March 05, 2022, 03:05:56 am by Superdisk »

Superdisk

  • Jr. Member
  • **
  • Posts: 73
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #17 on: March 05, 2022, 03:36:57 am »
I found the issue. I had a stray fpc.cfg laying around in my home dir, called `~/.fpc.cfg` from some other install, and this was causing problems for some reason.

You don't need to build fpc from source yourself, you can use the one from the package manager.

Code: Bash  [Select][+][-]
  1. $ doas pkg_add fpc
  2. $ doas cp /usr/local/share/examples/fpc-3.2.2/fpc.cfg.sample /etc/fpc.cfg
  3. $ rm ~/.fpc.cfg

Then you can build lazarus and it'll work (at least it did for me!)

dbannon

  • Hero Member
  • *****
  • Posts: 2196
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #18 on: March 05, 2022, 04:33:54 am »
I found the issue. I had a stray fpc.cfg laying around in my home dir, called `~/.fpc.cfg` from some other install, and this was causing problems for some reason.

From memory, FPC looks for a config file first in your working dir, then your home dir then in /etc.

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

nsunny

  • Full Member
  • ***
  • Posts: 117
  • Code is magic
    • LazPlanet
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #19 on: March 16, 2022, 01:28:03 pm »
It is also possible to build Lazarus 2.2.0 through ports and the best thing is, it's not that hard this way at all.

1. Install the ports on /usr/ports
2. Then:

Code: [Select]
# git clone --depth 1 https://github.com/ibara/openbsd-ports-wip /tmp/obsd-wip
# cp -r /tmp/obsd-wip/devel/lazarus /usr/ports/devel
# cd /usr/ports/devel/lazarus
# pkg_add fpc gmake libiconv gtk+2
# pkg_delete lazarus
# make install

It should install it as a package and removing it is very easy with a "pkg_delete lazarus" if needed.

Details here: https://lazplanet.gitlab.io/2022/03/install-lazarus-openbsd.html
Lazarus TTS Tutorial | LazPlanet
Lazarus 2.2.0 | FPC 3.2.2 | Linux/OpenBSD/ReactOS

TCH

  • Full Member
  • ***
  • Posts: 184
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #20 on: March 21, 2022, 11:57:21 am »
@dbannon:
This script has worked for years with earlier FPC/Lazarus versions.

@Superdisk:
I had no stray fpc.cfg anywhere and even when i removed everything and started it from scratch, building Lazarus has failed with the message in the OP.

@Superdisk, @nsunny:
Thank you very much, with your examples, i was able to install Lazarus from the ports.

Update: It appears, that the bug reported in this thread still persists.
« Last Edit: March 21, 2022, 12:11:44 pm by TCH »

 

TinyPortal © 2005-2018