Bug 213285 - [NEW PORT] audio/lv2: an open standard for audio plugins
Summary: [NEW PORT] audio/lv2: an open standard for audio plugins
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Jan Beich
URL:
Keywords:
: 197126 212751 (view as bug list)
Depends on:
Blocks: 213288 213289 213290
  Show dependency treegraph
 
Reported: 2016-10-07 19:57 UTC by Michael Beer
Modified: 2016-11-05 03:00 UTC (History)
3 users (show)

See Also:


Attachments
new port (update) (10.33 KB, text/plain)
2016-10-07 19:57 UTC, Michael Beer
no flags Details
switch consumers (WIP) (4.34 KB, patch)
2016-10-31 20:42 UTC, Jan Beich
no flags Details | Diff
Update of LV2 port (9.44 KB, text/plain)
2016-11-04 20:41 UTC, Michael Beer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Beer 2016-10-07 19:57:52 UTC
Created attachment 175509 [details]
new port (update)

An update for the already submitted new port!

First port of a series to support using FreeBSD as a DAW with latest ardour version.
This port conflicts with lv2core, which is quite outdated!

LV2 is a standard for plugins and matching host applications, mainly targeted at
audio processing and generation.
LV2 is a simple but extensible successor of LADSPA, intended to address the
limitations of LADSPA which many applications have outgrown.

WWW: http://lv2plug.in/
Comment 1 Jan Beich freebsd_committer freebsd_triage 2016-10-31 05:25:47 UTC
Comment on attachment 175509 [details]
new port (update)

$ portlint -AC
FATAL: Makefile: [15]: use a tab (not space) after a variable name
FATAL: Makefile: [19]: use a tab (not space) after a variable name
FATAL: Makefile: [21]: use a tab (not space) after a variable name
FATAL: Makefile: [23]: use a tab (not space) after a variable name
FATAL: Makefile: [25]: use a tab (not space) after a variable name
5 fatal errors and 0 warnings found.

> XCOMMENT=	LV2 Package

Can you give a better description of what the package is about? Perhaps, extract and reword parts of pkg-descr or take/mix description(s) from other distributions (e.g. Arch Linux, Gentoo, PkgSrc, Debian).

https://www.freebsd.org/doc/en/books/porters-handbook/makefile-comment.html

> XLIB_DEPENDS=    libsndfile.so:audio/libsndfile libfontconfig.so:x11-fonts/fontconfig libfreetype.so:print/freetype2

Wrap long lines to be readable on 80 column terminal. Auto-wrapping in text editors often looks ugly while long lines are hard to review.

Also, sort dependencies by package origin (i.e. port directory).

> XUSES=		pkgconfig python:build tar:bzip2 waf gettext-runtime
[...]
> XUSE_GNOME=      gtk20 pango atk cairo gdkpixbuf2 glib20

Prefer alphabetic sorting in USE* variables unless you have a rationale to do otherwise.

> XCONFLICTS_INSTALL= lv2core

For better visibility maybe move just under _DEPENDS section.

> XCONFIGURE_TARGET=  configure

This is already the default value.

> XNLS_USES=       gettext

This is nop unless OPTIONS_DEFINE contains NLS and the build is somehow instructed to disable gettext dependency if the option is disabled.

> XUSE_GNOME=      gtk20 pango atk cairo gdkpixbuf2 glib20

To avoid confusion don't place global variables *after* those tied to a specific option such as NLS i.e.,

   USES=	...
   USE_BAR=	...
   USE_QUX=	...
   
   OPTIONS_DEFINE=  ...

   TEST_USES=	...

vs.

   USES=	...
   
   OPTIONS_DEFINE=  ...

   TEST_USES=	...

   USE_BAR=	...
   USE_QUX=	...

> X.if defined(BATCH) || defined(PACKAGE_BUILDING)
> XMAKE_ARGS+=	--verbose
> X.endif

No longer necessary after ports r421635 + ports r423928.

> X	@${REINPLACE_CMD} -e 's/autowaf\.build_pc(bld, '\''LV2CORE'\'', LV2CORE_VERSION,.*/bld\(features = '\''subst'\'',source = '\''lv2core\.pc\.in'\'',target = '\''lv2core\.pc'\'',install_path = '\''\$$\{LIBDIR\}data\/pkgconfig'\'',PREFIX = bld\.env\.PREFIX,INCLUDEDIR = bld\.env\.INCLUDEDIR,VERSION = LV2CORE_VERSION\)/g' ${WRKSRC}/lv2/lv2plug.in/ns/lv2core/wscript

This line is hard to read. Use a patch under files/ directory unless the line changes on every release. Any text editor that handles diff(1) output (e.g. Emacs, Vim) should be able to highlight changes within and facilitate edits.

> Xpost-install:
> X	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lv2/eg-amp.lv2/amp.so
> X	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lv2/eg-fifths.lv2/fifths.so
> X	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lv2/eg-metro.lv2/metro.so
> X	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lv2/eg-midigate.lv2/midigate.so
> X	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lv2/eg-params.lv2/params.so
> X	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lv2/eg-sampler.lv2/sampler.so
> X	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lv2/eg-sampler.lv2/sampler_ui.so
> X	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lv2/eg-scope.lv2/examploscope.so
> X	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lv2/eg-scope.lv2/examploscope_ui.so

This can be simplified to a bit more future-proof variant:

  post-install:
  # Waf doesn't have built-in strip support
	  @${FIND} ${STAGEDIR}${PREFIX}/lib/lv2/ \
		  -name '*.so' -exec ${STRIP_CMD} {} +

>Xbin/lv2specgen.py

If the file uses python you need USES=python:run, or in this case just USES=python (without arguments).
And you may need USES=shebang as "python" from lang/python may not be installed.

https://www.freebsd.org/doc/en/books/porters-handbook/uses-shebangfix.html
Comment 2 Jan Beich freebsd_committer freebsd_triage 2016-10-31 05:32:38 UTC
*** Bug 212751 has been marked as a duplicate of this bug. ***
Comment 3 Jan Beich freebsd_committer freebsd_triage 2016-10-31 05:35:18 UTC
*** Bug 197126 has been marked as a duplicate of this bug. ***
Comment 4 Jan Beich freebsd_committer freebsd_triage 2016-10-31 07:03:07 UTC
$ lv2specgen.py
Error importing pygments, syntax highlighting disabled
Error importing rdflib
Comment 5 Shane 2016-10-31 08:57:13 UTC
Rather than conflicting with the old port from this project I would suggest replacing it.

The audio/lv2core port only provides a small subset of the files from the lv2 project that are needed to compile lv2 plugins, all of which are included in this new port.

Considering this new port would be a change from installing a small subset of the project to the whole project, I think renaming audio/lv2core to audio/lv2 and then expanding it to this new proposal would better track the history.

Only a few ports - audio/calf audio/slv2 and audio/linuxsampler depend on audio/lv2core so updating them to the project rename is a small task.
Comment 6 Jan Beich freebsd_committer freebsd_triage 2016-10-31 09:35:12 UTC
Assuming the submitter does basic runtime regression testing and fixes audio/calf build:

  /bin/sh ../libtool  --tag=CXX   --mode=link c++ -ffast-math -I/usr/local/include    -I/usr/local/include/gtk-2.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -I/usr/local/include/harfbuzz -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/atk-1.0 -pthread -D_THREAD_SAFE   -I/usr/local/include   -I/usr/local/include/lash-1.0 -I/usr/local/include   -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -pthread   -O2 -pipe -fstack-protector -fno-strict-aliasing  -Wall -avoid-version -module -export-symbols-regex "lv2_descriptor" -L/usr/local/lib -fstack-protector -o calf.la -rpath /calf.lv2 audio_fx.lo analyzer.lo metadata.lo modules_tools.lo modules_delay.lo modules_comp.lo modules_limit.lo modules_dist.lo modules_filter.lo modules_mod.lo fluidsynth.lo giface.lo monosynth.lo organ.lo osctl.lo plugin.lo preset.lo synth.lo utils.lo wavetable.lo modmatrix.lo -L/usr/local/lib -lfluidsynth   -L/usr/local/lib -lgthread-2.0 -pthread -lglib-2.0 -lintl   -lexpat 
  [...]
  c++: warning: argument unused during compilation: '-pthread'
  c++: warning: argument unused during compilation: '-pthread'
  c++: warning: argument unused during compilation: '-pthread'
  c++: warning: argument unused during compilation: '-pthread'
  /usr/bin/ld:.libs/calf.so-ver:2: syntax error in VERSION script
  c++: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 7 commit-hook freebsd_committer freebsd_triage 2016-10-31 20:40:52 UTC
A commit references this bug:

Author: jbeich
Date: Mon Oct 31 20:40:44 UTC 2016
New revision: 425024
URL: https://svnweb.freebsd.org/changeset/ports/425024

Log:
  audio/lv2: add new port

  PR:		197126, 213285 (based on)
  Submitted by:	Radim Kolar <hsn@sendmail.cz>, Michael Beer <beerml@sigma6audio.de>

  LV2 is an open standard for audio plugins, used by hundreds of plugins
  and other projects. At its core, LV2 is a simple stable interface,
  accompanied by extensions which add functionality to support the needs
  of increasingly powerful audio software.

  http://lv2plug.in/

Changes:
  head/audio/Makefile
  head/audio/lv2/
  head/audio/lv2/Makefile
  head/audio/lv2/distinfo
  head/audio/lv2/files/
  head/audio/lv2/files/patch-pkgconf
  head/audio/lv2/pkg-descr
  head/audio/lv2/pkg-plist
  head/audio/lv2core/Makefile
Comment 8 Jan Beich freebsd_committer freebsd_triage 2016-10-31 20:42:53 UTC
Created attachment 176353 [details]
switch consumers (WIP)

Apologies, I gave up on review due to ENOTIME to process consumers.
Comment 9 Michael Beer 2016-11-03 09:29:03 UTC
Don't understand what you are saying here!?

I will send a new revision of the the LV2 which fixes building the calf (and linuxsampler with lv2 option) port and therefore is able to replace the lv2core port completely.
Comment 10 Michael Beer 2016-11-04 20:41:15 UTC
Created attachment 176643 [details]
Update of LV2 port

Thanks for your hints.
Please find attached the updated port. 
All ports which depend on lv2core should
now work with the lv2 port (as a lv2core replacement) aswell,
if you change their dependency from lv2core to lv2.
I tested this locally with calf and with linuxsampler and audacity
which support lv2 optionally.
Comment 11 commit-hook freebsd_committer freebsd_triage 2016-11-05 01:19:53 UTC
A commit references this bug:

Author: jbeich
Date: Sat Nov  5 01:19:19 UTC 2016
New revision: 425366
URL: https://svnweb.freebsd.org/changeset/ports/425366

Log:
  audio/lv2: fix substitution in lv2core.pc

  Only noticed by broken -export-symbols-regex (libtool) in audio/calf.

    --- /usr/local/libdata/pkgconfig/lv2core.pc	before
    +++ /usr/local/libdata/pkgconfig/lv2core.pc	after
    @@ -1,10 +1,10 @@
     prefix=/usr/local
    -exec_prefix=
    -libdir=/usr/local/lib
    -includedir=/usr/local/include
    +exec_prefix=${prefix}
    +libdir=${exec_prefix}/lib
    +includedir=${prefix}/include

     Name: lv2core
    -Version:
    +Version: 12.0
     Description: An audio plugin interface specification.
     Libs:
     Cflags: -I${includedir}

  PR:		213285
  Submitted by:	Michael Beer <beerml@sigma6audio.de> (maintainer)

Changes:
  head/audio/lv2/Makefile
  head/audio/lv2/files/
Comment 12 commit-hook freebsd_committer freebsd_triage 2016-11-05 01:19:59 UTC
A commit references this bug:

Author: jbeich
Date: Sat Nov  5 01:19:48 UTC 2016
New revision: 425367
URL: https://svnweb.freebsd.org/changeset/ports/425367

Log:
  audio/lv2core: deprecate in favor of audio/lv2

  - Switch existing consumers to audio/lv2

  PR:		197126, 213285 (for tracking)

Changes:
  head/audio/calf/Makefile
  head/audio/linuxsampler/Makefile
  head/audio/linuxsampler/pkg-plist
  head/audio/lv2core/Makefile
  head/audio/slv2/Makefile
Comment 13 Jan Beich freebsd_committer freebsd_triage 2016-11-05 01:25:10 UTC
Comment on attachment 176643 [details]
Update of LV2 port

Please, re-submit as a diff against existing audio/lv2 in the ports tree.
Comment 14 commit-hook freebsd_committer freebsd_triage 2016-11-05 03:00:09 UTC
A commit references this bug:

Author: jbeich
Date: Sat Nov  5 02:59:29 UTC 2016
New revision: 425373
URL: https://svnweb.freebsd.org/changeset/ports/425373

Log:
  audio/lv2core: deprecate in favor of audio/lv2 (try#2)

  - Switch existing consumers to audio/lv2

  PR:		197126, 213285 (for tracking)

Changes:
  head/audio/calf/Makefile
  head/audio/linuxsampler/Makefile
  head/audio/lv2core/Makefile
  head/audio/slv2/Makefile