Skip to content

Build edbrowse from source on Raspberry Pi OS

David-Apps edited this page Dec 27, 2021 · 13 revisions

Commands to type at the terminal begin "$ ". Do not type "$ ". This is only here to help distinguish between commands and comments.

Install packages

Before installing packages, it is a good idea to update the package list:

$ sudo apt update

Install the GCC compiler:

$ sudo apt install gcc -y

Install the git version control system:

$ sudo apt install git -y

Install packages that edbrowse uses:

$ sudo apt install libpcre2-dev -y

$ sudo apt install libcurl4-gnutls-dev -y

$ sudo apt install libreadline-dev -y

$ sudo apt install unixodbc-dev -y

Install the packages that we need to build tidy-html5:

$ sudo apt install cmake -y

$ sudo apt install xsltproc -y

Copy the source files for tidy-html5, quickjs, and edbrowse

Create a copy of the files in the tidy-html5 repository:

$ git clone https://github.com/htacg/tidy-html5

Create a copy of the files in the quickjs repository:

$ git clone https://github.com/bellard/quickjs

Create a copy of the files in the edbrowse repository:

$ git clone https://github.com/CMB/edbrowse

Build and install tidy-html5

Change to the tidy-html5/build/cmake subdirectory:

$ cd tidy-html5/build/cmake

Use the cmake command to start building tidy-html5:

$ cmake ../..

Use the make command to continue building tidy-html5:

$ make

Install the newly built tidy-html5 package:

$ sudo make install

Return to the parent directory:

$ cd ../../..

Prepare quickjs to work with edbrowse

Change to the edbrowse subdirectory:

$ cd edbrowse

Run a Bash script to change a quickjs source file:

$ tools/quickjobfixup

Return to the parent directory:

$ cd ..

Build and install quickjs

Change to the quickjs subdirectory:

$ cd quickjs

Check whether the build process uses the atomic library:

$ grep "^LIBS=.*-latomic" Makefile

If this command gives no output, make the build process use the atomic library by adding " -latomic" to the end of the line that starts "LIBS=" in the file "Makefile":

$ sed -i '/^LIBS=/s/$/ -latomic/' Makefile

Build quickjs:

$ make

Install quickjs:

$ sudo make install

Return to the parent directory:

$ cd ..

Build and install edbrowse

Change to the edbrowse/src subdirectory:

$ cd edbrowse/src

Build edbrowse:

$ make BUILD_EDBR_ODBC=on

Install edbrowse:

$ sudo make install

Return to the parent directory:

$ cd ../..

Start edbrowse:

$ edbrowse

If this gives a library linking error, reconfigure the dynamic linker run time bindings (you should not need to do this often):

$ sudo ldconfig

Update edbrowse

Update the package list:

$ sudo apt update

Upgrade installed packages:

$ sudo apt full-upgrade -y

Change to the tidy-html5 subdirectory:

$ cd tidy-html5

Get the latest files from the tidy-html5 repository:

$ git pull

If no files have changed, you need not build and install tidy-html5 again.

If files have changed, build and install tidy-html5:

$ cd build/cmake

$ cmake ../..

$ make

$ sudo make install

$ cd ../..

Return to the parent directory:

$ cd ..

Change to the quickjs subdirectory:

$ cd quickjs

Get the latest files from the quickjs repository:

$ git pull

If no files have changed, you need not build and install quickjs again.

If files have changed, build and install quickjs:

$ make

$ sudo make install

Return to the parent directory:

$ cd ..

Change to the edbrowse subdirectory:

$ cd edbrowse

Get the latest files from the edbrowse repository:

$ git pull

If no files have changed, you need not build and install edbrowse again.

If files have changed, build and install edbrowse:

$ cd src

$ make BUILD_EDBR_ODBC=on

$ sudo make install

$ cd ..

Return to the parent directory:

$ cd ..

Start edbrowse:

$ edbrowse