Compiling the surf browser on Debian

As an aside, a reasonably modern browser that can run nicely on fairly crappy hardware is surf, but the version that comes with Debian is not great. For example, it seemed to load websites, but did not render anything. Here is how to compile it yourself:

At least, this worked for me…

Note:

$ cat /etc/apt/sources.list
deb http://mirror.aarnet.edu.au/debian/ bookworm main non-free-firmware non-free contrib
deb-src http://mirror.aarnet.edu.au/debian/ bookworm main non-free-firmware

deb http://security.debian.org/debian-security bookworm-security main non-free-firmware
deb-src http://security.debian.org/debian-security bookworm-security main non-free-firmware

deb http://mirror.aarnet.edu.au/debian/ bookworm-updates main non-free-firmware
deb-src http://mirror.aarnet.edu.au/debian/ bookworm-updates main non-free-firmware

Installed the version from the repo:

$ sudo apt install surf dwm stterm

Tried it:

$ surf ecosia.com

Seemed to load, but nothing rendered. And threw lots of ‘file not found’ errors in the X terminal I ran it from.

Used links2 to find out how to install it!

It complained the default.css was missing, so I created an empty one:

$ touch .surf/styles/default.css

Removed the official package, but left dmenu and the other little tools:

$ sudo apt remove surf

Created an installation folder:

$ mkdir installs
$ cd installs/

Had to install git

$ sudo apt install git

Cloned the source code:

$ git clone https://git.suckless.org/surf
$ cd surf/

Install the build dependencies — I find this a bit magical, because I did not get the source from Debian, but I guess the files a really well packaged.

$ sudo apt build-dep surf

Try to make it, but find out some more stuff is missing:

$ make

Install the extra stuff — I don’t even have the Linux headers installed!

$ sudo apt install linux-headers-$(uname -r)

Version 4.1 of this is installed, but it seems to need 4.0:

$ sudo apt install libwebkit2gtk-4.0-dev
$ make -j$(nproc)

Yay! Can just run it from where it is:

$ ./surf google.com

Now, can make a soft link to my personal bin folder:

$ ln -s /home/goossens/installs/surf/surf /home/goossens/bin/surf

$ cd
$ which surf
/home/goossens/bin/surf

OK, good. But for some reason when I ran it it tried to load /usr/bin/surf and then barfed. I had removed the official package already, but for some reason it went looking for it. Maybe after a reboot? Anyway.

Well, copied ~/bin/surf to ~/bin/mysurf and all is well.

Looks nice.

 

Author: Darren

I'm a scientist by training, currently working as a writer, trainer and editor.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.