Skip to content

shlomif/what-i-learned-from-porting-to-freebsd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 

Repository files navigation

What I learned from porting my projects to FreeBSD

Introduction

I set up a local FreeBSD VirtualBox VM to test something, and it seems to work very well. Due to the novelty factor, I decided to get my software projects to build and pass the tests there.

The Projects

What I Learned:

FreeBSD on VBox has become very reliable

Some executables on FreeBSD are in /usr/local/bin instead of /usr/bin

On Linux they are almost always in /usr/bin/ only:

make on FreeBSD is not GNU make

  • One can call gmake

  • No gmake on some older versions of Debian/Ubuntu/etc.

  • Solution for Debian:

    mkdir -p "$HOME/bin"
    ln -sf /usr/bin/make "$HOME/bin/gmake"
    export PATH="$HOME/bin:$PATH"
  • gmake alias under /usr/bin/ is present again in recent versions of Debian.

m4 on FreeBSD is not compatible with GNU m4

  • Fixed in this commit by first checking for gm4 and then falling back on plain m4.

Some CPAN Modules fail to install using local-lib there

  • No idea why.

  • Sometimes cpanm -n (“no test”) helps.

  • pkg install -y p5-Foo-Bar as root for other times.

DocBook/XSL Does Not Live Under /usr/share/sgml

FreeBSD’s grep does not have a “-P” flag by default

  • The “-P” flag is not in the POSIX’s grep specification

  • Solution:

    -        ) | grep -vP '^<\?xml ver' \
    +        ) | perl -p -0777 -e 's%\A<\?xml ver[^>]*>%%' \
  • Does not exactly do the same operation, but even more correct.

  • Perl is portable shell
    — Guy Keren

FreeBSD has no "nproc" command

What still does not work:

  • Valgrind tests fail - possibly due to this bug

  • Spellchecking tests fail, like on Ubuntu, as it seems hunspell has system-dependent dictionaries. (Workaround: export SKIP_SPELL_CHECK=",en,".)

Conclusion:

  • I ran into some cases where my scriptology was lacking and suboptimal, even for my own personal use, and fixed them.

Coverage:

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •