Re: [ITA} fluidsynth

2023-09-18 Thread Takashi Yano via Cygwin-apps
On Mon, 18 Sep 2023 17:49:45 +0100
Jon Turney wrote:
> On 17/09/2023 14:14, Takashi Yano via Cygwin-apps wrote:
> > I'd like adopt the fluidsynth package.
> > Thanks in advance.
> 
> Thanks.
> 
> I added this to your packages.
> 
> > 
> > fluidsynth.cygport
> > 
> > inherit cmake
> > 
> > NAME="fluidsynth"
> > VERSION=2.3.2
> > RELEASE=1
> > LICENSE="LGPL-2.1-or-later"
> > CATEGORY="Audio"
> > SUMMARY="SoundFont software synthesizer"
> > DESCRIPTION="FluidSynth is a real-time software synthesizer based on the
> > SoundFont 2 specifications."
> > HOMEPAGE="http://www.fluidsynth.org/;
> > SRC_URI="https://github.com/FluidSynth/fluidsynth/archive/v${VERSION}/fluidsynth-${VERSION}.tar.gz;
> > 
> > PKG_NAMES="${NAME} lib${NAME}3 lib${NAME}-devel"
> > fluidsynth_CONTENTS="usr/bin/*.exe usr/share/"
> > libfluidsynth3_CATEGORY="Libs"
> > libfluidsynth3_SUMMARY="${SUMMARY} library"
> > libfluidsynth3_CONTENTS="usr/bin/cygfluidsynth-3.dll"
> > libfluidsynth_devel_CATEGORY="Libs"
> > libfluidsynth_devel_SUMMARY="${SUMMARY} library"
> > libfluidsynth_devel_CONTENTS="
> > usr/include/fluidsynth*
> > usr/lib/libfluidsynth.dll.a
> > usr/lib/pkgconfig/fluidsynth.pc
> > "
> > 
> > PKG_IGNORE="usr/lib/cmake/fluidsynth/*.cmake"
> 
> It would be normal to include these files in the libfluidsynth_devel 
> package, for use by cmake's find_package command.

Yeah, I have includes them in devel package.

> Is there some reason to exclude them? If so, a comment explaining why 
> would be a good idea.
> 
> > # dbus: only for RealtimeKit
> > # portaudio: playback is just static
> 
> Maybe the last line in this comment is no longer accurate?

I confirmed that fluidsynth works properly with latest portaudio package.
So, I enabled the support for portaudio. I forgot to delete this line.
Thanks.

I have revised the project files. Could you please recheck them?

-- 
Takashi Yano 
inherit cmake

NAME="fluidsynth"
VERSION=2.3.2
RELEASE=1
LICENSE="LGPL-2.1-or-later"
CATEGORY="Audio"
SUMMARY="SoundFont software synthesizer"
DESCRIPTION="FluidSynth is a real-time software synthesizer based on the
SoundFont 2 specifications."
HOMEPAGE="http://www.fluidsynth.org/;
SRC_URI="https://github.com/FluidSynth/fluidsynth/archive/v${VERSION}/fluidsynth-${VERSION}.tar.gz;

PKG_NAMES="${NAME} lib${NAME}3 lib${NAME}-devel"
fluidsynth_CONTENTS="usr/bin/*.exe usr/share/"
libfluidsynth3_CATEGORY="Libs"
libfluidsynth3_SUMMARY="${SUMMARY} library"
libfluidsynth3_CONTENTS="usr/bin/cygfluidsynth-3.dll"
libfluidsynth_devel_CATEGORY="Libs"
libfluidsynth_devel_SUMMARY="${SUMMARY} library"
libfluidsynth_devel_CONTENTS="
usr/include/fluidsynth*
usr/lib/libfluidsynth.dll.a
usr/lib/pkgconfig/fluidsynth.pc
usr/lib/cmake/fluidsynth/*.cmake
"

# dbus: only for RealtimeKit
CYGCMAKE_ARGS="
-Denable-dbus=OFF
-Denable-midishare=OFF
-Denable-portaudio=ON
"
--- origsrc/fluidsynth-2.3.2/src/drivers/fluid_dsound.c 2023-04-03 
00:54:17.0 +0900
+++ src/fluidsynth-2.3.2/src/drivers/fluid_dsound.c 2023-09-16 
00:02:53.038824600 +0900
@@ -28,6 +28,7 @@
 #if DSOUND_SUPPORT
 
 
+#include 
 #include 
 #include 
 #include 
--- origsrc/fluidsynth-2.3.2/src/drivers/fluid_oss.c2023-04-03 
00:54:17.0 +0900
+++ src/fluidsynth-2.3.2/src/drivers/fluid_oss.c2023-09-16 
12:35:49.965676900 +0900
@@ -109,6 +109,22 @@ fluid_oss_audio_driver_settings(fluid_se
 fluid_settings_register_str(settings, "audio.oss.device", "/dev/dsp", 0);
 }
 
+#ifdef __CYGWIN__
+#include 
+static int get_cygwin_version(void);
+static int cygwin_version;
+static int get_cygwin_version(void)
+{
+int cygwin_version = 3004006;
+char *ver = (char *) (intptr_t) cygwin_internal(CW_GETVERSIONINFO);
+int major, minor;
+if (2 == sscanf(ver, "%*s\n%% Cygwin dll major: %d\n"
+"%% Cygwin dll minor: %d", , ))
+cygwin_version = major * 1000 + minor;
+return cygwin_version;
+}
+#endif
+
 /*
  * new_fluid_oss_audio_driver
  */
@@ -133,6 +149,10 @@ new_fluid_oss_audio_driver(fluid_setting
 return NULL;
 }
 
+#ifdef __CYGWIN__
+cygwin_version = get_cygwin_version();
+#endif
+
 FLUID_MEMSET(dev, 0, sizeof(fluid_oss_audio_driver_t));
 
 fluid_settings_getint(settings, "audio.periods", );
@@ -306,6 +326,10 @@ new_fluid_oss_audio_driver2(fluid_settin
 return NULL;
 }
 
+#ifdef __CYGWIN
+cygwin_version = get_cygwin_version();
+#endif
+
 FLUID_MEMSET(dev, 0, sizeof(fluid_oss_audio_driver_t));
 
 fluid_settings_getint(settings, "audio.periods", );
@@ -540,6 +572,19 @@ fluid_oss_audio_run(void *d)
 {
 dev->read(synth, len, buffer, 0, 2, buffer, 1, 2);
 
+#ifdef __CYGWIN__
+for (;;)
+{
+audio_buf_info info;
+ioctl(dev->dspfd, SNDCTL_DSP_GETOSPACE, );
+/* Reduce latency in cygwin before 3.5.0. */
+if (cygwin_version < 3005000)
+info.bytes -= info.fragsize * 

Re: [ITA] lv2

2023-09-18 Thread Takashi Yano via Cygwin-apps
On Mon, 18 Sep 2023 17:49:21 +0100
Jon Turney wrote:
> On 17/09/2023 14:13, Takashi Yano via Cygwin-apps wrote:
> > I'd like to adopt the lv2 package.
> > Thanks in advance.
> 
> Thanks.
> 
> I added this to your packages.
> 
> > lv2.cygport
> > 
> > inherit meson
> > 
> > NAME="lv2"
> > VERSION=1.18.10
> > RELEASE=1
> > LICENSE="ISC"
> > CATEGORY="Audio"
> > SUMMARY="LV2 audio plugin specification"
> > DESCRIPTION="LV2 is a portable plugin standard for audio systems, similar in
> > scope to LADSPA, VST, AU, and others. It defines a C API for code and a 
> > format
> > for data files which collectively describe a plugin. LV2 consists of a 
> > simple
> > core (roughly equivalent in power to LADSPA) which can be extended to 
> > support
> > more advanced functionality. This allows the interface to be grown to
> > accommodate the needs of real software as they arise."
> > HOMEPAGE="http://lv2plug.in/;
> > SRC_URI="https://lv2plug.in/spec/lv2-${VERSION}.tar.xz;
> > 
> > PKG_NAMES="lv2 lv2-devel lv2-examples"
> 
> Looks like there's a pre-existing historical error here and lv2-docs 
> isn't listed (so when we actually generate the documentation, it ends up 
> in the main lv2 package, which isn't really what's wanted).
> 
> > lv2_OBSOLETES="lv2core"
> > lv2_DOCS="usr/share/doc/"
> > lv2_CONTENTS="--exclude=eg-*.lv2 etc/ usr/lib/lv2/"
> > lv2_devel_REQUIRES="lv2"
> > lv2_devel_CONTENTS="usr/bin/lv2specgen.py usr/bin/lv2_validate
> > usr/include/lv2* usr/lib/pkgconfig/ usr/share/lv2specgen/"
> > lv2_examples_SUMMARY="Sample LV2 audio plugins"
> > lv2_examples_DOCS="plugins/README.txt"
> > lv2_examples_CONTENTS="--exclude=*.dll.a usr/lib/lv2/eg-*.lv2/"
> > 
> > PKG_IGNORE="usr/lib/lv2/eg-*/*.dll.a"
> 
> Keeping the comment these are implibs for modules, so installing them is 
> useless would be good.
> 
> > 
> > CYGMESON_ARGS="
> > -D docs=enabled
> > -D old_headers=true
> > -D tests=disabled
> > "
> > 
> > src_install() {
> > cd ${S}
> > meson_install
> > doenv LV2_PATH "/usr/lib/lv2"
> > }
> > 
> > BUILD_REQUIRES="python39-rdflib python39-markdown 
> > python39-importlib-metadata"
> 
> I think that 'libsamplerate-devel' also needs to be here.

Thanks for the advices. The cygport file is revised.
Could you please check again?

-- 
Takashi Yano 
inherit meson

NAME="lv2"
VERSION=1.18.10
RELEASE=1
LICENSE="ISC"
CATEGORY="Audio"
SUMMARY="LV2 audio plugin specification"
DESCRIPTION="LV2 is a portable plugin standard for audio systems, similar in
scope to LADSPA, VST, AU, and others. It defines a C API for code and a format
for data files which collectively describe a plugin. LV2 consists of a simple
core (roughly equivalent in power to LADSPA) which can be extended to support
more advanced functionality. This allows the interface to be grown to
accommodate the needs of real software as they arise."
HOMEPAGE="http://lv2plug.in/;
SRC_URI="https://lv2plug.in/spec/lv2-${VERSION}.tar.xz;

PKG_NAMES="lv2 lv2-docs lv2-devel lv2-examples"
lv2_OBSOLETES="lv2core"
lv2_CONTENTS="--exclude=eg-*.lv2 etc/ usr/lib/lv2/"
lv2_docs_CONTENTS="usr/share/doc/"
lv2_devel_REQUIRES="lv2"
lv2_devel_CONTENTS="usr/bin/lv2specgen.py usr/bin/lv2_validate
usr/include/lv2/ usr/include/lv2.h
usr/lib/pkgconfig/ usr/share/lv2specgen/"
lv2_examples_SUMMARY="Sample LV2 audio plugins"
lv2_examples_CONTENTS="--exclude=*.dll.a usr/lib/lv2/eg-*.lv2/"

# These are implibs for example modules, so installing them is useless.
PKG_IGNORE="usr/lib/lv2/eg-*/*.dll.a"

CYGMESON_ARGS="
-D docs=enabled
-D old_headers=true
-D tests=disabled
"

src_install() {
   cd ${S}
   meson_install
   doenv LV2_PATH "/usr/lib/lv2"
}

BUILD_REQUIRES="python39-rdflib python39-markdown python39-importlib-metadata 
libsamplerate-devel"


Re: cygport may not create debug info if top directory contains a symlink

2023-09-18 Thread Brian Inglis via Cygwin-apps

On 2023-09-18 04:41, Christian Franke via Cygwin-apps wrote:

Brian Inglis wrote:

On 2023-09-17 08:01, Jon Turney via Cygwin-apps wrote:

On 16/09/2023 15:17, Christian Franke via Cygwin wrote:

Found during tests of busybox package:
If the path of the top build directory contains a symlink and the project's 
build scripts normalize pathnames, no debug info is created by cygport.


This is because options like
  -fdebug-prefix-map=${B}=/usr/src/debug/${PF}
have no effect because ${B} contains a symlink but the compiler is run with 
the real source path.


I think that there was some historical bug with gcc where a relative path for 
the old path in this mapping wasn't correctly handled, which is why were 
using an absolute path here at all.


So changing it to something like [1] (if that works), might be better.

[1] 
https://github.com/jon-turney/cygport/commit/4175d456a9184c5cdebd8bfb4b5ba30583cedd66


Should bin/cygport.in:534: not have $B between the == as in line 531:

declare ${flags}+=" -fdebug-prefix-map=${B}=/usr/src/debug/${PF}"
...
declare ${flags}+=" -fdebug-prefix-map==/usr/src/debug/${PF}"

or be hoist above the condition if identical, unless that is some undocumented 
default for cwd?


Sidenote: we should probably also be using file-prefix-map, now we're on a 
gcc which supports it.


... also macro-prefix-map, although it looks like changing to -ffile-prefix-map 
is equivalent to -f*-prefix-map which future proofs the options!


The postinstall code then does not find any line number info with source 
path /usr/src/debug/${PF}/...


Could be fixed easily in line 414 of /bin/cygport:

-declare -r top=$(cd ${_topdir}; pwd);
+declare -r top=$(cd ${_topdir}; /bin/pwd);


Can you explain why this makes a difference?


In cygport, pwd is a bash builtin defaulting to -L; /bin/pwd defaults to -P.
Both commands support both options and we might expect the same output.
It would be better to use builtin `pwd -P` if that produces the correct result.



It does.


An STC script which creates test dirs to demonstrate the issue and show the 
alternative outputs would be nice so anyone can see.



$ ln -s /usr/src /tmp/source

$ cd /tmp/source

$ pwd
/tmp/source

$ /bin/pwd
/usr/src

$ pwd -P
/usr/src

$ /bin/pwd -L
/tmp/source


Thanks, looks good - care to submit a patch, including above suggestions, to 
cover all bases?


--
Take care. Thanks, Brian Inglis  Calgary, Alberta, Canada

La perfection est atteinte   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut
-- Antoine de Saint-Exupéry


Re: [ITA} fluidsynth

2023-09-18 Thread Jon Turney via Cygwin-apps

On 17/09/2023 14:14, Takashi Yano via Cygwin-apps wrote:

I'd like adopt the fluidsynth package.
Thanks in advance.


Thanks.

I added this to your packages.



fluidsynth.cygport

inherit cmake

NAME="fluidsynth"
VERSION=2.3.2
RELEASE=1
LICENSE="LGPL-2.1-or-later"
CATEGORY="Audio"
SUMMARY="SoundFont software synthesizer"
DESCRIPTION="FluidSynth is a real-time software synthesizer based on the
SoundFont 2 specifications."
HOMEPAGE="http://www.fluidsynth.org/;
SRC_URI="https://github.com/FluidSynth/fluidsynth/archive/v${VERSION}/fluidsynth-${VERSION}.tar.gz;

PKG_NAMES="${NAME} lib${NAME}3 lib${NAME}-devel"
fluidsynth_CONTENTS="usr/bin/*.exe usr/share/"
libfluidsynth3_CATEGORY="Libs"
libfluidsynth3_SUMMARY="${SUMMARY} library"
libfluidsynth3_CONTENTS="usr/bin/cygfluidsynth-3.dll"
libfluidsynth_devel_CATEGORY="Libs"
libfluidsynth_devel_SUMMARY="${SUMMARY} library"
libfluidsynth_devel_CONTENTS="
usr/include/fluidsynth*
usr/lib/libfluidsynth.dll.a
usr/lib/pkgconfig/fluidsynth.pc
"

PKG_IGNORE="usr/lib/cmake/fluidsynth/*.cmake"


It would be normal to include these files in the libfluidsynth_devel 
package, for use by cmake's find_package command.


Is there some reason to exclude them? If so, a comment explaining why 
would be a good idea.



# dbus: only for RealtimeKit
# portaudio: playback is just static


Maybe the last line in this comment is no longer accurate?


CYGCMAKE_ARGS="
-Denable-dbus=OFF
-Denable-midishare=OFF
-Denable-portaudio=ON
"




Re: [ITA] lv2

2023-09-18 Thread Jon Turney via Cygwin-apps

On 17/09/2023 14:13, Takashi Yano via Cygwin-apps wrote:

I'd like to adopt the lv2 package.
Thanks in advance.


Thanks.

I added this to your packages.


lv2.cygport

inherit meson

NAME="lv2"
VERSION=1.18.10
RELEASE=1
LICENSE="ISC"
CATEGORY="Audio"
SUMMARY="LV2 audio plugin specification"
DESCRIPTION="LV2 is a portable plugin standard for audio systems, similar in
scope to LADSPA, VST, AU, and others. It defines a C API for code and a format
for data files which collectively describe a plugin. LV2 consists of a simple
core (roughly equivalent in power to LADSPA) which can be extended to support
more advanced functionality. This allows the interface to be grown to
accommodate the needs of real software as they arise."
HOMEPAGE="http://lv2plug.in/;
SRC_URI="https://lv2plug.in/spec/lv2-${VERSION}.tar.xz;

PKG_NAMES="lv2 lv2-devel lv2-examples"


Looks like there's a pre-existing historical error here and lv2-docs 
isn't listed (so when we actually generate the documentation, it ends up 
in the main lv2 package, which isn't really what's wanted).



lv2_OBSOLETES="lv2core"
lv2_DOCS="usr/share/doc/"
lv2_CONTENTS="--exclude=eg-*.lv2 etc/ usr/lib/lv2/"
lv2_devel_REQUIRES="lv2"
lv2_devel_CONTENTS="usr/bin/lv2specgen.py usr/bin/lv2_validate
usr/include/lv2* usr/lib/pkgconfig/ usr/share/lv2specgen/"
lv2_examples_SUMMARY="Sample LV2 audio plugins"
lv2_examples_DOCS="plugins/README.txt"
lv2_examples_CONTENTS="--exclude=*.dll.a usr/lib/lv2/eg-*.lv2/"

PKG_IGNORE="usr/lib/lv2/eg-*/*.dll.a"


Keeping the comment these are implibs for modules, so installing them is 
useless would be good.




CYGMESON_ARGS="
-D docs=enabled
-D old_headers=true
-D tests=disabled
"

src_install() {
cd ${S}
meson_install
doenv LV2_PATH "/usr/lib/lv2"
}

BUILD_REQUIRES="python39-rdflib python39-markdown python39-importlib-metadata"


I think that 'libsamplerate-devel' also needs to be here.



Re: cygport may not create debug info if top directory contains a symlink

2023-09-18 Thread Achim Gratz via Cygwin-apps

Am 18.09.2023 um 12:41 schrieb Christian Franke via Cygwin-apps:

$ pwd -P
/usr/src

$ /bin/pwd -L
/tmp/source


Generally speaking, if you really need to mess with /usr/src (which is a 
packaged directory, so any Cygwin application can assume it's existence 
as a directory) you should do that via a (bind) mount.



--
Achim.

(on the road :-)




Re: cygport may not create debug info if top directory contains a symlink

2023-09-18 Thread Christian Franke via Cygwin-apps

Brian Inglis wrote:

On 2023-09-17 08:01, Jon Turney via Cygwin-apps wrote:

On 16/09/2023 15:17, Christian Franke via Cygwin wrote:

Found during tests of busybox package:
If the path of the top build directory contains a symlink and the 
project's build scripts normalize pathnames, no debug info is 
created by cygport.


This is because options like
  -fdebug-prefix-map=${B}=/usr/src/debug/${PF}
have no effect because ${B} contains a symlink but the compiler is 
run with the real source path.


I think that there was some historical bug with gcc where a relative 
path for the old path in this mapping wasn't correctly handled, which 
is why were using an absolute path here at all.


So changing it to something like [1] (if that works), might be better.

[1] 
https://github.com/jon-turney/cygport/commit/4175d456a9184c5cdebd8bfb4b5ba30583cedd66


Sidenote: we should probably also be using file-prefix-map, now we're 
on a gcc which supports it.


Definitely. in particular useful in conjunction with reproducible builds 
and this cygport patch:

https://sourceware.org/pipermail/cygwin-apps/2023-August/043108.html
The related newlib-cygwin patch has been pushed already:
https://cygwin.com/git/?p=newlib-cygwin.git;a=commit;h=f5e37b93





The postinstall code then does not find any line number info with 
source path /usr/src/debug/${PF}/...


Could be fixed easily in line 414 of /bin/cygport:

-declare -r top=$(cd ${_topdir}; pwd);
+declare -r top=$(cd ${_topdir}; /bin/pwd);


Can you explain why this makes a difference?


In cygport, pwd is a bash builtin defaulting to -L; /bin/pwd defaults 
to -P.

Both commands support both options and we might expect the same output.
It would be better to use builtin `pwd -P` if that produces the 
correct result.


It does.




An STC script which creates test dirs to demonstrate the issue and 
show the alternative outputs would be nice so anyone can see.


$ ln -s /usr/src /tmp/source

$ cd /tmp/source

$ pwd
/tmp/source

$ /bin/pwd
/usr/src

$ pwd -P
/usr/src

$ /bin/pwd -L
/tmp/source

--
Regards,
Christian