pantherb / setBfree

DSP tonewheel organ
http://setbfree.org
GNU General Public License v2.0
194 stars 35 forks source link

FONTFILE is compared to a header? #54

Closed yurivict closed 6 years ago

yurivict commented 6 years ago

In this line: https://github.com/pantherb/setBfree/blob/master/common.mak#L6 you set it to some pre-existing file.

In this line: https://github.com/pantherb/setBfree/blob/master/common.mak#L120 you compare in to some header file name "verabd.h".

IMO, both lines are wrong. You should install this font under $(PREFIX)$(DATADIR) and not look for preinstalled fonts.

HAVE_US should be based on user choice, not on presence of some font.

x42 commented 6 years ago

How can HAVE_UI not depend on the presence of a font? Without text, the UI is useless.

Besides, it is a gnu/make variable (without override keyword) you can just run make HAVE_UI=no

Likewise https://github.com/pantherb/setBfree/blob/master/common.mak#L6 is just a default. You should override it at compile time make FONTFILE=/path/to/vera/ttf/on/your/system. Most GNU/Linux distros already package VeraBd.ttf. setBfree does intentionally not install it.

The second case is for the LV2 plugin. A plugin must always be self-contained and never depend on any external files (the official binaries are statically linked, for that reason, too). The font is embedded in the binary via a generated header file verabd.h see https://github.com/pantherb/setBfree/blob/master/b_synth/Makefile#L68-L69 -- Also keep in mind that the LV2 plugin runs on Windows, OSX, MacOS etc.

Using make FONTFILE=verabd.h enables embedding. FONTFILE is added as a build-dependency and b_synth/Makefile generates the include.

I hope that clears things up.

yurivict commented 6 years ago

What is the correct way to build both LV2 plugins and the UI app, in other words, everything? (assuming I have the font available.)

x42 commented 6 years ago

I just run make locally (on debian).

Most packagers just do a make PREFIX=/usr && sudo make install PREFIX=/usr DESTDIR=/packagedir Compare to https://packages.debian.org/stable/setbfree or https://aur.archlinux.org/packages/setbfree/ (both have build-recipes online).

For distributable binaries ( http://x42-plugins.com/x42/setBfree ) I use

make \
  CFLAGS="-fvisibility=hidden -DNDEBUG -msse -msse2 -mfpmath=sse -fomit-frame-pointer -O3 -fno-finite-math-only -I${PREFIX}/src -DBUILTINFONT -fdata-sections -ffunction-sections -Wno-deprecated-declarations" \
  LDFLAGS="-fvisibility=hidden -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-O1 -Wl,--strip-all" \
  ENABLE_CONVOLUTION=no \
  USEWEAKJACK=1 \
  FONTFILE=verabd.h PKG_UI_FLAGS=--static \
  STATICBUILD=yes \
  SUBDIRS="b_synth b_whirl ui src"
x42 commented 6 years ago

I assume above answered the question