Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FONTFILE is compared to a header? #54

Closed
yurivict opened this issue Mar 28, 2018 · 4 comments
Closed

FONTFILE is compared to a header? #54

yurivict opened this issue Mar 28, 2018 · 4 comments

Comments

@yurivict
Copy link

yurivict commented Mar 28, 2018

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
Copy link
Collaborator

x42 commented Mar 28, 2018

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
Copy link
Author

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
Copy link
Collaborator

x42 commented Mar 28, 2018

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
Copy link
Collaborator

x42 commented Aug 3, 2018

I assume above answered the question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants