vrybant / unboundbible

Unbound Bible is an open source and a free, multilingual Bible-reader program for Mac, Linux and Windows.
https://unboundbible.net
GNU General Public License v3.0
33 stars 10 forks source link

[GUIDE] Build instructions for FreeBSD #21

Open hellium6 opened 2 weeks ago

hellium6 commented 2 weeks ago

Recently had a successful build on FreeBSD 14.1 x86_64 so thought I'd share the instructions. There is no Discussions/Wiki tab, so I'm posting this as an issue.

btw thanks for creating the project. It's lightweight enough to keep running on low end machines.

$ doas pkg install subversion lazarus-gtk2
$ doas find /usr/local/share -name 'fpc-source*' -type d
/usr/local/share/fpc-source-3.2.3

Take a note of the fpc-source path you get on your system not this one.

Run lazarus and on the welcome screen set FPC sources (tab should be marked with red icon) to your noted path (in my case it was /usr/local/share/fpc-source-3.2.3) and GDB debugger (also with red icon) to /usr/local/bin/gdb. Submit the info and close Lazarus.

Now the real build begins:

$ git clone --depth 1 https://github.com/vrybant/unboundbible.git
$ cd unboundbible

$ cd components
$ svn co http://svn.code.sf.net/p/zeoslib/code-0/trunk
$ mv trunk zeosdb
$ cd ..

For components/zeosdb/src/dbc/ZDbcInterbaseFirebirdMetadata.pas(457,33) Error: (5000) Identifier not found "L" after lazbuild zcomponent command below, you may need to uncomment L: NativeUInt; line around the line it shows on the error. It was ln 454 in my copy but this should do it:

$ sed -i_backup -e 's|//L: NativeUInt|L: NativeUInt|' \
components/zeosdb/src/dbc/ZDbcInterbaseFirebirdMetadata.pas

To continue with build:

$ lazbuild components/zeosdb/packages/lazarus/zcomponent.lpk
$ lazbuild components/richmemo/richmemopackage.lpk
$ lazbuild components/unboundmemo/unboundmemopackage.lpk

$ lazbuild unboundbible.lpr

$ ./unboundbible_freebsd

Last command should launch Unbound Bible. If it works as expected, install it systemwide:

$ doas cp unboundbible_freebsd /usr/local/bin/unboundbible

Now you should be able to run unboundbible from terminal no matter the directory.

To make it easier to launch from application menu, we can make a .desktop file. For that we need an icon:

$ doas cp unboundbible.png /usr/local/share/pixmaps/

Create a file /usr/local/share/applications/UnboundBible.desktop and put:

[Desktop Entry]
Name=Unbound Bible
Comment=Bible-reader program
Exec=unboundbible
Icon=unboundbible
Type=Application
Categories=Office;Utility;

Now you should be able to open your application menu and under Office or Utility category you'd see Unbound Bible.

To install modules:

Clicking Help -> Modules Downloads will open https://unboundbible.net/goto/ubdownload.php It has link (e.g. https://www.ph4.org/b4_index.php for MyBible format) and it has these instructions:

  1. Download bible module.
  2. Unzip it if necessary.
  3. Run Unbound Bible. Open Меню and choose «Help»-«Bible Folder».
  4. Move downloaded module from download folder to «Unbound Bible» folder.
  5. Restart Unbound Bible program.

Bible files are stored in: /home/myusername/Unbound Bible

This is where you'll have to extract and put the files in and restart Unbound Bible to see them.

If needed to troubleshoot, config is stored in: /home/myusername/.config/unboundbible