Re: [ITP] biosig [was: Re: newcomer issues when packaging biosig, stimfit, etc.]

2022-01-25 Thread Alois Schlögl



Am 1/22/22 um 18:52 schrieb Marco Atzeri:

On 16.01.2022 23:13, Alois Schlögl wrote:


Dear Marco,


attached is the revised version.

In addition, I'm trying also to include the python39-biosig package.
Could you please check whether this would work ?


Cheers,
   Alois



Hi Alois,

I finally had some time to work on the package.
See attachment.

Instead of complicating the cygport I decided
to adapt the Makefile.in to be Cygwin aware,
so using a much simple biosig.cygport

It is not perfect, and you could need to adopt
other parts to make the overall consistent.

A better solution will be to use not only Autoconf but also
also Automake so that all platforms will be managed in the same way,
without the need of a lot of customization.

Alternative you can use cmake to obtain a similar results.

Now the DLL's are respecting the Cygwin format
and also the Python 3.9 package is available.

$ nice cygport biosig.cygport list |grep dll
/usr/bin/cygbiosig-3.dll
/usr/bin/cygphysicalunits-3.dll
/usr/lib/libbiosig.dll.a
/usr/lib/libphysicalunits.dll.a
/usr/lib/python3.9/site-packages/biosig.cpython-39-x86_64-cygwin.dll

$ nice cygport biosig.cygport list |grep usr/bin
/usr/bin/bin2rec
/usr/bin/biosig2gdf.exe
/usr/bin/biosig_fhir.exe
/usr/bin/cygbiosig-3.dll
/usr/bin/cygphysicalunits-3.dll
/usr/bin/heka2itx
/usr/bin/physicalunits.exe
/usr/bin/rec2bin
/usr/bin/save2aecg
/usr/bin/save2gdf.exe
/usr/bin/save2scp

please check that I have not missed something
and inadvertently crippled some of the utility.

It seems that the build is unable to use the
   libcholmod-devel
   libtinyxml2-devel
libraries. I suspect the configure is missing something

I left the static libraries, but they should be superflous
as the shared libs are present.

Regards
Marco



Hi  Marco,


thanks for the improvements (especially, libb64 which enables 
biosig_fhir, and python-biosig).

Attached is a revised version. Check on playground was successful [1].


Regards,
   Alois


[1] https://github.com/cygwin/scallywag/actions/runs/1748211333

--- origsrc/biosig-2.3.3/biosig4c++/Makefile.in	2021-08-13 11:17:15.0 +0200
+++ src/biosig-2.3.3/biosig4c++/Makefile.in	2022-01-22 15:13:42.122963600 +0100
@@ -137,6 +137,7 @@ else
 endif
 
 SONAMEVERSION ?= 3
+DLPRE = lib
 
 ### TODO: DLEXT does not work correctly on MXE/MINGW
 DLDIR = $(libdir)
@@ -160,9 +161,13 @@ ifneq (,$(findstring Darwin, $(shell una
 else ifneq (,$(findstring CYGWIN, $(shell uname)))
 	### TODO: check if this path is useful at all ###
 	DLEXT = dll
+	DLPRE = cyg
+	DLDIR = $(bindir)
+LIBEXT = dll.a
+BINEXT = .exe
 	LD	   = $(CXX)
 	LDLIBS+= -liconv -lstdc++
-	FULLDLEXT  = ${SONAMEVERSION}.dll
+	FULLDLEXT  = -${SONAMEVERSION}.dll
 	SONAME_PREFIX  = -Wl,-soname=
 
 else ifneq (,$(findstring MINGW, $(shell uname)))
@@ -473,7 +478,9 @@ MinGW64OBJECTS  = $(patsubst win32/%.obj
 
 TARGET = save2gdf libbiosig.a
 LIB_OBJECTS  = libbiosig.a libgdf.a libphysicalunits.a libbiosig.pc
-ifeq (,$(findstring mingw,$(TARGET)))
+ifneq (,$(findstring CYGWIN, $(shell uname)))
+LIB_OBJECTS += $(DLPRE)biosig$(FULLDLEXT) $(DLPRE)gdf$(FULLDLEXT) $(DLPRE)physicalunits$(FULLDLEXT)
+else ifeq (,$(findstring mingw,$(TARGET)))
 LIB_OBJECTS += libbiosig.$(DLEXT) libgdf.$(DLEXT) libphysicalunits.$(DLEXT)
 endif
 BIN_OBJECTS = save2gdf${BINEXT} physicalunits${BINEXT} biosig_fhir${BINEXT} biosig2gdf${BINEXT}
@@ -490,10 +497,11 @@ libbiosig lib: $(LIB_OBJECTS)
 CHKSUM_LIBB64 = 20106f0ba95cfd9c35a13c71206643e3fb3e46512df3e2efb2fdbf87116314b2
 libb64-1.2.1.zip:
 	curl -SLO https://downloads.sourceforge.net/project/libb64/libb64/libb64/libb64-1.2.1.zip
-	test $(shell sha256sum libb64-1.2.1.zip | cut -d " " -f 1) = $(CHKSUM_LIBB64) || rm libb64-1.2.1.zip
+#	test $(shell sha256sum libb64-1.2.1.zip | cut -d " " -f 1) = $(CHKSUM_LIBB64) || rm libb64-1.2.1.zip
 
 libb64-1.2.1/src/cencode.c: libb64-1.2.1.zip
-	test $(shell sha256sum libb64-1.2.1.zip | cut -d " " -f 1) = $(CHKSUM_LIBB64) && unzip -o libb64-1.2.1.zip -d .
+#	test $(shell sha256sum libb64-1.2.1.zip | cut -d " " -f 1) = $(CHKSUM_LIBB64) && unzip -o libb64-1.2.1.zip -d .
+	unzip -o libb64-1.2.1.zip -d .
 	touch $@
 
 vpath %.c ./:./t210:./t220:./t240:./test0:./src:./mma
@@ -668,7 +676,7 @@ win32: mexw32 win32mma
 win64/%.exe: %.c
 	$(MinGW64CXX) $(DEFINES) $(MinGW64CFLAGS) "$<" $(MinGW64LIBS) -o "$@"
 win64/physicalunits.exe: pu.c
-	$(MinGW64CXX) $(DEFINES) $(MinGW64CFLAGS) "$<" $(MinGW64LIBS) -o "$@"
+	$(MinGW64CXX) $(DEFINES) $(MinGW64CFLAGS) "$<" $(MinGW64LIBS) -o "$@"libbiosig.dll
 
 win64: mexw64
 
@@ -682,16 +690,16 @@ ifeq (,$(findstring Darwin, $(shell unam
 	ln -sf "$<" "$@"
 endif
 
-libbiosig${FULLDLEXT}:$(OBJECTS)
+$(DLPRE)biosig${FULLDLEXT}:$(OBJECTS)
 	$(LD) $(LDFLAGS) ${SONAME_PREFIX}"$@" $^ $(SHAREDLIB) $(LDLIBS) -o "

Re: [ITP] biosig [was: Re: newcomer issues when packaging biosig, stimfit, etc.]

2022-01-20 Thread Alois Schlögl




Am 1/18/22 um 23:56 schrieb Brian Inglis:

On 2022-01-18 14:50, Alois Schlögl wrote:

Am 1/18/22 um 06:32 schrieb Brian Inglis:

On 2022-01-17 14:44, Alois Schlögl wrote:

Am 1/15/22 um 21:44 schrieb Achim Gratz:

Marco Atzeri writes:



add DIFF_EXCLUDES="Makefile" to avoid the artifact



DISTCLEANFILES would be more appropriate it seems.


DISTCLEANFILES is deleted immediately after downloading and 
unpacking the *UPSTREAM* source:


https://cygwin.github.io/cygport/src_prep_cygpart.html#robo112

"A list of files to be deleted immediately upon unpacking sources, 
relative to $S. This is intended to be used with 
buildsystem-generated files which are incorrectly included in the 
source tarball."


I tried this (see attachment), but I'm not sure this is what you 
meant.


DIFF_EXCLUDES is a list of files generated in $S not automatically 
excluded from the source package:


https://cygwin.github.io/cygport/pkg_pkg_cygpart.html#robo384

"A list of file names, directory names, or glob patterns in $S which 
will be excluded when creating the .src.patch file. This should be 
used for files automatically generated in $S to avoid polluting the 
patch.

NOTE
Files generated by various buildsystem infrastructures, such as 
autoconf, automake, gettext, and libtool are already excluded 
automatically and need not be listed here."


Add to DIFF_EXCLUDES the names of any files you see after the output 
header:



Creating source patches


Ok, thanks for these clear hints. I've now added these files as 
suggested. The revised version is attached.
Moreover, I've removed (commented) all aspects for building of 
python-biosig bindings, in order not to delay the inclusion of Biosig 
in Cygwin.

Is there anything else that need to be considered ?


CATEGORY is a *space* separated list in quotes.

Before SRC_URI and PATCH_URI normally comes:

HOMEPAGE=https://sourceforge.net/projects/biosig/files/

you don't need to add quotes for nonspaced strings.

You may also test your cygport and any other source patches and files 
you require by creating and committing them into a local git repo 
named the same as the package (preferably all lower case) and pushing 
to the git-cygwin-packages playground repo and branch:


git push --set-upstream ssh://cygwin/git/cygwin-packages/playground.git
playground -f

which will submit the build to the Cygwin GitHub Action CI and print 
the link for you to monitor the CI job, view the build logs for 
noarch, x86, and x86_64, and download them.





In order to use the playgroun, I guess I need to provide my ssh key. 
Here it is:


Name: Alois Schloegl
 BEGIN SSH2 PUBLIC KEY 
C3NzaC1lZDI1NTE5ILKBmNf1QN3lStTwpn46QIip7sS6zNKy0rG8WCYHv/ZU
 END SSH2 PUBLIC KEY 


Cheers,
  Alois




Re: [ITP] biosig [was: Re: newcomer issues when packaging biosig, stimfit, etc.]

2022-01-18 Thread Alois Schlögl



Am 1/18/22 um 06:32 schrieb Brian Inglis:

On 2022-01-17 14:44, Alois Schlögl wrote:

Am 1/15/22 um 21:44 schrieb Achim Gratz:

Marco Atzeri writes:



add DIFF_EXCLUDES="Makefile" to avoid the artifact



DISTCLEANFILES would be more appropriate it seems.


DISTCLEANFILES is deleted immediately after downloading and unpacking 
the *UPSTREAM* source:


https://cygwin.github.io/cygport/src_prep_cygpart.html#robo112

"A list of files to be deleted immediately upon unpacking sources, 
relative to $S. This is intended to be used with buildsystem-generated 
files which are incorrectly included in the source tarball."



I tried this (see attachment), but I'm not sure this is what you meant.


DIFF_EXCLUDES is a list of files generated in $S not automatically 
excluded from the source package:


https://cygwin.github.io/cygport/pkg_pkg_cygpart.html#robo384

"A list of file names, directory names, or glob patterns in $S which 
will be excluded when creating the .src.patch file. This should be 
used for files automatically generated in $S to avoid polluting the 
patch.

NOTE
Files generated by various buildsystem infrastructures, such as 
autoconf, automake, gettext, and libtool are already excluded 
automatically and need not be listed here."





Add to DIFF_EXCLUDES the names of any files you see after the output 
header:



Creating source patches





Ok, thanks for these clear hints. I've now added these files as 
suggested. The revised version is attached.
Moreover, I've removed (commented) all aspects for building of 
python-biosig bindings, in order not to delay the inclusion of Biosig in 
Cygwin.

Is there anything else that need to be considered ?



Cheers,
   Alois






# package name
NAME="biosig"
VERSION=2.3.3
RELEASE=1

# .hint generation
CATEGORY="Libs,Science"
SUMMARY="Tools for biomedical signal processing."
DESCRIPTION="BioSig is an open source software library for 
biomedical signal processing, featuring for example the 
analysis of biosignals such as the electroencephalogram (EEG), 
electrocorticogram (ECoG), electrocardiogram (ECG), 
electrooculogram (EOG), electromyogram (EMG), respiration, 
and so on. Major application areas are: Neuroinformatics, 
brain-computer interfaces, neurophysiology, psychology, c
ardiovascular systems and sleep research. The aim of the 
BioSig project is to foster research in biomedical signal 
processing by providing open source software tools for many 
different applications. Generally, many concerns have to be a
ddressed in this scientific field. BioSig handles this by providing 
solutions for data acquisition, artifact processing, quality control, 
feature extraction, classification, modeling, data visualization, etc. "

# source and patch files
SRC_URI="https://sourceforge.net/projects/biosig/files/BioSig%20for%20C_C%2B%2B/src/biosig-2.3.3.src.tar.gz";

# PATCH_URI="biosig-2.3.3-fix-build.patch"

# use the standard src_compile, src_install and src_test

# PKG_NAMES="libbiosig libbiosig-devel biosig-tools python3-biosig"
PKG_NAMES="libbiosig libbiosig-devel biosig-tools"

biosig_tools_CONTENTS="
  usr/bin/save2gdf.exe
  usr/bin/physicalunits.exe
  usr/bin/biosig2gdf.exe
  usr/share/man/man1/save2gdf.1.gz  
  usr/share/man/man1/biosig2gdf.1.gz
  usr/share/man/man1/biosig_fhir.1.gz  
  usr/share/man/man1/physicalunits.1.gz

  usr/share/doc/biosig/COPYING
  usr/share/doc/biosig/README
"
# not included yet, would require libb64
# usr/share/man/biosig_fhir.1  usr/share/man/sigviewer.1


libbiosig_CONTENTS="
  usr/bin/libbiosig.dll
  usr/bin/libphysicalunits.dll
"

libbiosig_devel_CONTENTS="
  usr/include/biosig-dev.h 
  usr/include/biosig.h 
  usr/include/biosig2.h 
  usr/include/gdftime.h 
  usr/include/physicalunits.h 
  usr/include/biosig-network.h
  usr/include/mdc_ecg_codes.h

  usr/lib/libbiosig.a
  usr/lib/libbiosig.dll.a 
  usr/lib/libphysicalunits.a
  usr/lib/libphysicalunits.dll.a 
  usr/lib/pkgconfig/libbiosig.pc
"

#python3-biosig_CONTENTS="
#   dist/Biosig-2.3.3-cp39-cp39-cygwin_3_3_3_x86_64.whl
#"

DIFF_EXCLUDES="depend
  Makefile
  biosig4c++/Makefile 
  biosig4c++/java/Makefile
  biosig4c++/mex/Makefile 
  biosig4c++/mma/Makefile 
"

# use not standard src_compile, src_install and src_test

src_compile() {
cd ${S}
lndirs
cd ${B}
cygautoreconf
cygconf  # --prefix=/usr
### libbiosig
cygmake lib
### biosig-tools w/o biosig_fhir
cygmake -C biosig4c++ save2gdf physicalunits biosig2gdf
### python3-biosig
# cygmake -C biosig4c++/python wheel
# cd ${B}/biosig4c++/python/
# python3_distutils_compile bdist_wheel
# python3_wheel_compile
}

src_install() {
cd ${S}

doinclude ${S}/biosig4c++/*.h

do

Re: [ITP] biosig [was: Re: newcomer issues when packaging biosig, stimfit, etc.]

2022-01-17 Thread Alois Schlögl



Am 1/15/22 um 21:44 schrieb Achim Gratz:

Marco Atzeri writes:

add DIFF_EXCLUDES="Makefile" to avoid the artifact

DISTCLEANFILES would be more appropriate it seems.


Regards,
Achim.



I tried this (see attachment), but I'm not sure this is what you meant.


Regards,
   Alois# package name
NAME="biosig"
VERSION=2.3.3
RELEASE=1

# .hint generation
CATEGORY="Libs,Science"
SUMMARY="Tools for biomedical signal processing."
DESCRIPTION="BioSig is an open source software library for 
biomedical signal processing, featuring for example the 
analysis of biosignals such as the electroencephalogram (EEG), 
electrocorticogram (ECoG), electrocardiogram (ECG), 
electrooculogram (EOG), electromyogram (EMG), respiration, 
and so on. Major application areas are: Neuroinformatics, 
brain-computer interfaces, neurophysiology, psychology, c
ardiovascular systems and sleep research. The aim of the 
BioSig project is to foster research in biomedical signal 
processing by providing open source software tools for many 
different applications. Generally, many concerns have to be a
ddressed in this scientific field. BioSig handles this by providing 
solutions for data acquisition, artifact processing, quality control, 
feature extraction, classification, modeling, data visualization, etc. "

# source and patch files
SRC_URI="https://sourceforge.net/projects/biosig/files/BioSig%20for%20C_C%2B%2B/src/biosig-2.3.3.src.tar.gz";

# PATCH_URI="biosig-2.3.3-fix-build.patch"

# use the standard src_compile, src_install and src_test


PKG_NAMES="libbiosig libbiosig-devel biosig-tools python3-biosig"
# PKG_NAMES="libbiosig libbiosig-devel biosig-tools"

biosig_tools_CONTENTS="
  usr/bin/save2gdf.exe
  usr/bin/physicalunits.exe
  usr/bin/biosig2gdf.exe
  usr/share/man/man1/save2gdf.1.gz  
  usr/share/man/man1/biosig2gdf.1.gz
  usr/share/man/man1/biosig_fhir.1.gz  
  usr/share/man/man1/physicalunits.1.gz

  usr/share/doc/biosig/COPYING
  usr/share/doc/biosig/README
"
# not included yet
# usr/share/man/biosig_fhir.1  usr/share/man/sigviewer.1


libbiosig_CONTENTS="
  usr/bin/libbiosig.dll
  usr/bin/libphysicalunits.dll
"

libbiosig_devel_CONTENTS="
  usr/include/biosig-dev.h 
  usr/include/biosig.h 
  usr/include/biosig2.h 
  usr/include/gdftime.h 
  usr/include/physicalunits.h 
  usr/include/biosig-network.h
  usr/include/mdc_ecg_codes.h

  usr/lib/libbiosig.a
  usr/lib/libbiosig.dll.a 
  usr/lib/libphysicalunits.a
  usr/lib/libphysicalunits.dll.a 
  usr/lib/pkgconfig/libbiosig.pc
"

#python3-biosig_CONTENTS="
#   dist/Biosig-2.3.3-cp39-cp39-cygwin_3_3_3_x86_64.whl
#"

DIFF_EXCLUDES="depend"

# CYGPORT_USE_UNSTABLE_API=1
# use not standard src_compile, src_install and src_test

src_prep() {
DISTCLEANFILES
}

src_compile() {
cd ${S}
lndirs
cd ${B}
cygautoreconf
cygconf  # --prefix=/usr
# libbiosig
cygmake lib
# biosig-tools w/o biosig_fhir
cygmake -C biosig4c++ save2gdf physicalunits biosig2gdf
# python3-biosig
cygmake -C biosig4c++/python wheel
# cd ${B}/biosig4c++/python/
# python3_distutils_compile bdist_wheel
# python3_wheel_compile

}

src_install() {
cd ${S}

doinclude ${S}/biosig4c++/*.h

dobin ${B}/biosig4c++/save2gdf.exe 
# dobin ${B}/biosig4c++/biosig_fhir.exe
dobin ${B}/biosig4c++/biosig2gdf.exe 
dobin ${B}/biosig4c++/physicalunits.exe 
dobin ${B}/biosig4c++/libbiosig.dll 
dobin ${B}/biosig4c++/libphysicalunits.dll 

dolib ${B}/biosig4c++/libbiosig.dll.a 
dolib ${B}/biosig4c++/libbiosig.a 
dolib ${B}/biosig4c++/libphysicalunits.dll.a 
dolib ${B}/biosig4c++/libphysicalunits.a 

dopkgconfig ${B}/biosig4c++/libbiosig.pc

# doman ${S}/biosig4c++/doc/bin2rec.1
doman ${S}/biosig4c++/doc/biosig2gdf.1
doman ${S}/biosig4c++/doc/biosig_fhir.1
doman ${S}/biosig4c++/doc/physicalunits.1
doman ${S}/biosig4c++/doc/save2gdf.1

# dowheel 
${B}/biosig4c++/python/dist/Biosig-2.3.3-cp39-cp39-cygwin_3_3_3_x86_64.whl

}

src_test() {
cd ${B}
biosig4c++/physicalunits.exe
biosig4c++/save2gdf.exe  --help
# biosig4c++/biosig_fhir.exe --help
python -c "import biosig"
check_python3_module biosigABC
}



Re: [ITP] biosig [was: Re: newcomer issues when packaging biosig, stimfit, etc.]

2022-01-16 Thread Alois Schlögl



Am 1/15/22 um 19:01 schrieb Marco Atzeri:

On 14.01.2022 22:48, Alois Schlögl wrote:



Am 1/14/22 um 11:09 schrieb Marco Atzeri:

On 12.01.2022 23:59, Alois Schlögl wrote:




I was playing with the CMakeList.txt to see if that was more easy
than your deep patch of the upstream Makefile's



I'm afraid that this "deep patch" is just an accidental artifact.
When running configure, all Makefile are rebuild from Makefile.in,
The Makefile(s) were packaged just by accident in v2.3.3.
But in fact these Makefiles should not have part of the released 
package.




add DIFF_EXCLUDES="Makefile" to avoid the artifact



Cheers,
   Alois



Dear Marco,


attached is the revised version.

In addition, I'm trying also to include the python39-biosig package.
Could you please check whether this would work ?


Cheers,
  Alois










# package name
NAME="biosig"
VERSION=2.3.3
RELEASE=1

# .hint generation
CATEGORY="Libs,Science"
SUMMARY="Tools for biomedical signal processing."
DESCRIPTION="BioSig is an open source software library for 
biomedical signal processing, featuring for example the 
analysis of biosignals such as the electroencephalogram (EEG), 
electrocorticogram (ECoG), electrocardiogram (ECG), 
electrooculogram (EOG), electromyogram (EMG), respiration, 
and so on. Major application areas are: Neuroinformatics, 
brain-computer interfaces, neurophysiology, psychology, c
ardiovascular systems and sleep research. The aim of the 
BioSig project is to foster research in biomedical signal 
processing by providing open source software tools for many 
different applications. Generally, many concerns have to be a
ddressed in this scientific field. BioSig handles this by providing 
solutions for data acquisition, artifact processing, quality control, 
feature extraction, classification, modeling, data visualization, etc. "

# source and patch files
SRC_URI="https://sourceforge.net/projects/biosig/files/BioSig%20for%20C_C%2B%2B/src/biosig-2.3.3.src.tar.gz";

# PATCH_URI="biosig-2.3.3-fix-build.patch"

# use the standard src_compile, src_install and src_test


PKG_NAMES="libbiosig libbiosig-devel biosig-tools python39-biosig"
# PKG_NAMES="libbiosig libbiosig-devel biosig-tools"

biosig_tools_CONTENTS="
  usr/bin/save2gdf.exe
  usr/bin/physicalunits.exe
  usr/bin/biosig2gdf.exe
  usr/share/man/man1/save2gdf.1.gz  
  usr/share/man/man1/biosig2gdf.1.gz
  usr/share/man/man1/biosig_fhir.1.gz  
  usr/share/man/man1/physicalunits.1.gz

  usr/share/doc/biosig/COPYING
  usr/share/doc/biosig/README
"
# not included yet
# usr/share/man/biosig_fhir.1  usr/share/man/sigviewer.1


libbiosig_CONTENTS="
  usr/bin/libbiosig.dll
  usr/bin/libphysicalunits.dll
"

libbiosig_devel_CONTENTS="
  usr/include/biosig-dev.h 
  usr/include/biosig.h 
  usr/include/biosig2.h 
  usr/include/gdftime.h 
  usr/include/physicalunits.h 
  usr/include/biosig-network.h
  usr/include/mdc_ecg_codes.h

  usr/lib/libbiosig.a
  usr/lib/libbiosig.dll.a 
  usr/lib/libphysicalunits.a
  usr/lib/libphysicalunits.dll.a 
  usr/lib/pkgconfig/libbiosig.pc
"

#python3-biosig_CONTENTS="
#   dist/Biosig-2.3.3-cp39-cp39-cygwin_3_3_3_x86_64.whl
#"

DIFF_EXCLUDES="depend Makefile"

# use not standard src_compile, src_install and src_test

src_compile() {
cd ${S}
lndirs
cd ${B}
cygautoreconf
cygconf  # --prefix=/usr
# libbiosig
cygmake lib
# biosig-tools w/o biosig_fhir
cygmake -C biosig4c++ save2gdf physicalunits biosig2gdf
# python3-biosig
cygmake -C biosig4c++/python wheel
# cd ${B}/biosig4c++/python/
# python3_distutils_compile bdist_wheel
# python3_wheel_compile

}

src_install() {
cd ${S}

doinclude ${S}/biosig4c++/*.h

dobin ${B}/biosig4c++/save2gdf.exe 
# dobin ${B}/biosig4c++/biosig_fhir.exe
dobin ${B}/biosig4c++/biosig2gdf.exe 
dobin ${B}/biosig4c++/physicalunits.exe 
dobin ${B}/biosig4c++/libbiosig.dll 
dobin ${B}/biosig4c++/libphysicalunits.dll 

dolib ${B}/biosig4c++/libbiosig.dll.a 
dolib ${B}/biosig4c++/libbiosig.a 
dolib ${B}/biosig4c++/libphysicalunits.dll.a 
dolib ${B}/biosig4c++/libphysicalunits.a 

dopkgconfig ${B}/biosig4c++/libbiosig.pc

# doman ${S}/biosig4c++/doc/bin2rec.1
doman ${S}/biosig4c++/doc/biosig2gdf.1
doman ${S}/biosig4c++/doc/biosig_fhir.1
doman ${S}/biosig4c++/doc/physicalunits.1
doman ${S}/biosig4c++/doc/save2gdf.1

# dowheel 
${B}/biosig4c++/python/dist/Biosig-2.3.3-cp39-cp39-cygwin_3_3_3_x86_64.whl

}

src_test() {
cd ${B}
biosig4c++/physicalunits.exe
biosig4c++/save2gdf.exe  --help
# biosig4c++/biosig_fhir.exe --help
python -c "import biosig"
}

# comment
sdesc: &quo

Re: [ITP] biosig [was: Re: newcomer issues when packaging biosig, stimfit, etc.]

2022-01-14 Thread Alois Schlögl




Am 1/14/22 um 11:09 schrieb Marco Atzeri:

On 12.01.2022 23:59, Alois Schlögl wrote:



Am 1/12/22 um 06:47 schrieb Marco Atzeri:
In the meantime, please find below the status for the libb64 and 
biosig packages.


Thanks that was helpful. Attached is an updated version for biosig 
and libb64.


cygport libb64.cygport all
cygport biosig.cygport all

runs now w/o error. How can I test whether result can be installed 
and used ?


One major problem.
Never build in the source directory, the final src.patch
must fit with you desired patch.
So only what you patched should come out.

For this package that does not respect the build in a
different directory than source, you shoud start
with something like:

src_compile() {
    cd ${S}
    lndirs
    cd ${B}
    cygautoreconf
    cygconf
    cygmake
} 




I've adapted biosig.cygport accordingly and addressed this in the 
attached version. It runs fine when doing


    cygport biosig.cygport all

runs w/o error. Also testing the package with

tar -C / -xvf 
biosig-2.3.3-1.x86_64/dist/biosig/biosig-tools/biosig-tools-2.3.3-1.tar.xz
tar -C / -xvf 
biosig-2.3.3-1.x86_64/dist/biosig/libbiosig/libbiosig-2.3.3-1.tar.xz
tar -C / -xvf 
biosig-2.3.3-1.x86_64/dist/biosig/libbiosig-devel/libbiosig-devel-2.3.3-1.tar.xz 



and running
    save2gdf -h
works fine.

Moreover, I understand now why my libb64.cygport file is not ready. 
ecause libb64 is not necessary for libbiosig's support of Stimfit, 
I'll omit libb64 for now.
Would you please check whether Biosig is ready to be included in 
cygwin ?



Cheers,
    Alois



Hi Alois.

it is almost fine



Hi Marco,

thanks for the feedback.




the only problem I see is that the shared library are build as

  libbiosig.dll while they should be called cygbiosig.dll
  (probably better cygbiosig-3.dll to handle the SOMANE)



I tried to do that, but run into issue. The exe-files still expect 
libbbiosig.dll, and do not recognise cygbiosig-3.dll
It seems this would require significant changes by upstream, also by 
other projects that would make use of libbiosig (e.g. stimfit, 
sigviewer, python-biosig, etc.)
Since I do not under stand the purpose of renaming libbiosig to 
cygbiosig, I'm reluctant to go that route.

What kind of problems is this renaming supposed to solve ?

Concerning SONAME-versioning, I'd like to avoid this for now, and 
introduce versioning only when its really needed.
In the foreseeable future, I do not expect any changes will be needed 
that would break the API



please also run the test in the ${B} directory


Done, this works without error. Please adapt that change accordingly.




I was playing with the CMakeList.txt to see if that was more easy
than your deep patch of the upstream Makefile's



I'm afraid that this "deep patch" is just an accidental artifact.
When running configure, all Makefile are rebuild from Makefile.in,
The Makefile(s) were packaged just by accident in v2.3.3.
But in fact these Makefiles should not have part of the released package.



Cheers,
  Alois





[ITP] biosig [was: Re: newcomer issues when packaging biosig, stimfit, etc.]

2022-01-12 Thread Alois Schlögl



Am 1/12/22 um 06:47 schrieb Marco Atzeri:
In the meantime, please find below the status for the libb64 and 
biosig packages.


Thanks that was helpful. Attached is an updated version for biosig 
and libb64.


cygport libb64.cygport all
cygport biosig.cygport all

runs now w/o error. How can I test whether result can be installed 
and used ?


One major problem.
Never build in the source directory, the final src.patch
must fit with you desired patch.
So only what you patched should come out.

For this package that does not respect the build in a
different directory than source, you shoud start
with something like:

src_compile() {
    cd ${S}
    lndirs
    cd ${B}
    cygautoreconf
    cygconf
    cygmake
} 




I've adapted biosig.cygport accordingly and addressed this in the 
attached version. It runs fine when doing


   cygport biosig.cygport all

runs w/o error. Also testing the package with

tar -C / -xvf 
biosig-2.3.3-1.x86_64/dist/biosig/biosig-tools/biosig-tools-2.3.3-1.tar.xz
tar -C / -xvf 
biosig-2.3.3-1.x86_64/dist/biosig/libbiosig/libbiosig-2.3.3-1.tar.xz
tar -C / -xvf 
biosig-2.3.3-1.x86_64/dist/biosig/libbiosig-devel/libbiosig-devel-2.3.3-1.tar.xz


and running
   save2gdf -h
works fine.

Moreover, I understand now why my libb64.cygport file is not ready. 
ecause libb64 is not necessary for libbiosig's support of Stimfit, I'll 
omit libb64 for now.

Would you please check whether Biosig is ready to be included in cygwin ?


Cheers,
   Alois
# package name
NAME="biosig"
VERSION=2.3.3
RELEASE=1

# .hint generation
CATEGORY="Libs,Science"
SUMMARY="Tools for biomedical signal processing."
DESCRIPTION="BioSig is an open source software library for 
biomedical signal processing, featuring for example the 
analysis of biosignals such as the electroencephalogram (EEG), 
electrocorticogram (ECoG), electrocardiogram (ECG), 
electrooculogram (EOG), electromyogram (EMG), respiration, 
and so on. Major application areas are: Neuroinformatics, 
brain-computer interfaces, neurophysiology, psychology, c
ardiovascular systems and sleep research. The aim of the 
BioSig project is to foster research in biomedical signal 
processing by providing open source software tools for many 
different applications. Generally, many concerns have to be a
ddressed in this scientific field. BioSig handles this by providing 
solutions for data acquisition, artifact processing, quality control, 
feature extraction, classification, modeling, data visualization, etc. "

# source and patch files
SRC_URI="https://sourceforge.net/projects/biosig/files/BioSig%20for%20C_C%2B%2B/src/biosig-2.3.3.src.tar.gz";

# PATCH_URI="biosig-2.3.3-fix-build.patch"

# use the standard src_compile, src_install and src_test


PKG_NAMES="libbiosig libbiosig-devel biosig-tools"

biosig_tools_CONTENTS="
  usr/bin/save2gdf.exe
  usr/bin/physicalunits.exe
  usr/bin/biosig2gdf.exe
  usr/share/man/man1/save2gdf.1.gz  
  usr/share/man/man1/biosig2gdf.1.gz
  usr/share/man/man1/biosig_fhir.1.gz  
  usr/share/man/man1/physicalunits.1.gz

  usr/share/doc/biosig/COPYING
  usr/share/doc/biosig/README
"
# not included yet
# usr/share/man/biosig_fhir.1  usr/share/man/sigviewer.1


libbiosig_CONTENTS="
  usr/bin/libbiosig.dll
  usr/bin/libphysicalunits.dll
"

libbiosig_devel_CONTENTS="
  usr/include/biosig-dev.h 
  usr/include/biosig.h 
  usr/include/biosig2.h 
  usr/include/gdftime.h 
  usr/include/physicalunits.h 
  usr/include/biosig-network.h
  usr/include/mdc_ecg_codes.h

  usr/lib/libbiosig.a
  usr/lib/libbiosig.dll.a 
  usr/lib/libphysicalunits.a
  usr/lib/libphysicalunits.dll.a 
  usr/lib/pkgconfig/libbiosig.pc
"

DIFF_EXCLUDES="depend"

# use not standard src_compile, src_install and src_test

src_compile() {
cd ${S}
lndirs
cd ${B}
cygautoreconf
cygconf  # --prefix=/usr
# libbiosig
cygmake lib
# biosig-tools w/o biosig_fhir
cygmake -C biosig4c++ save2gdf physicalunits biosig2gdf
# python3-biosig
}

src_install() {
cd ${S}

doinclude ${S}/biosig4c++/*.h

dobin ${B}/biosig4c++/save2gdf.exe 
# dobin ${B}/biosig4c++/biosig_fhir.exe
dobin ${B}/biosig4c++/biosig2gdf.exe 
dobin ${B}/biosig4c++/physicalunits.exe 
dobin ${B}/biosig4c++/libbiosig.dll 
dobin ${B}/biosig4c++/libphysicalunits.dll 

dolib ${B}/biosig4c++/libbiosig.dll.a 
dolib ${B}/biosig4c++/libbiosig.a 
dolib ${B}/biosig4c++/libphysicalunits.dll.a 
dolib ${B}/biosig4c++/libphysicalunits.a 

dopkgconfig ${B}/biosig4c++/libbiosig.pc

# doman ${S}/biosig4c++/doc/bin2rec.1
doman ${S}/biosig4c++/doc/biosig2gdf.1
doman ${S}/biosig4c++/doc/biosig_fhir.1
doman ${S}/biosig4c++/doc/physicalunits.1
doman ${S}/biosig4c++/doc/save2gdf.1

}

src_test() {
cd ${S}
biosig4c++/physicalunits.exe
biosig4c++/save2gdf.exe  --help
# biosig4c++/biosig_fhir.