diff --git a/libs/lapack/0002-Fix-mingw-build.patch b/libs/lapack/0002-Fix-mingw-build.patch new file mode 100644 --- /dev/null +++ b/libs/lapack/0002-Fix-mingw-build.patch @@ -0,0 +1,24 @@ +diff -u -r lapack-3.9.0/LAPACKE/src/lapacke_cgesvdq.c lapack-3.9.0_fixed/LAPACKE/src/lapacke_cgesvdq.c +--- lapack-3.9.0/LAPACKE/src/lapacke_cgesvdq.c 2019-11-21 08:57:43.000000000 +0100 ++++ lapack-3.9.0_fixed/LAPACKE/src/lapacke_cgesvdq.c 2020-04-03 20:57:33.763699314 +0200 +@@ -71,7 +71,7 @@ + goto exit_level_0; + } + liwork = (lapack_int)iwork_query; +- lcwork = (lapack_int)cwork_query; ++ lcwork = LAPACK_C2INT(cwork_query); + lrwork = (lapack_int)rwork_query; + /* Allocate memory for work arrays */ + iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork ); +diff -u -r lapack-3.9.0/LAPACKE/src/lapacke_zgesvdq.c lapack-3.9.0_fixed/LAPACKE/src/lapacke_zgesvdq.c +--- lapack-3.9.0/LAPACKE/src/lapacke_zgesvdq.c 2019-11-21 08:57:43.000000000 +0100 ++++ lapack-3.9.0_fixed/LAPACKE/src/lapacke_zgesvdq.c 2020-04-03 20:57:33.763699314 +0200 +@@ -71,7 +71,7 @@ + goto exit_level_0; + } + liwork = (lapack_int)iwork_query; +- lcwork = (lapack_int)cwork_query; ++ lcwork = LAPACK_C2INT(cwork_query); + lrwork = (lapack_int)rwork_query; + /* Allocate memory for work arrays */ + iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork ); diff --git a/libs/lapack/lapack.py b/libs/lapack/lapack.py --- a/libs/lapack/lapack.py +++ b/libs/lapack/lapack.py @@ -9,6 +9,7 @@ self.displayName = "lapack" self.patchToApply['3.9.0'] = [ ("0001-Restore-Missing-Prototypes.patch", 1), # https://github.com/Reference-LAPACK/lapack/commit/87536aa3.patch + ("0002-Fix-mingw-build.patch", 1), ] def setDependencies(self): @@ -20,4 +21,8 @@ class Package(CMakePackageBase): def __init__(self): CMakePackageBase.__init__(self) - self.subinfo.options.configure.args = "-DCMAKE_SKIP_RPATH=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DLAPACKE_WITH_TMG=ON -DCBLAS=ON -DBUILD_DEPRECATED=ON" + self.subinfo.options.configure.args = "-DCMAKE_SKIP_RPATH=ON -DBUILD_TESTING=OFF -DLAPACKE_WITH_TMG=ON -DCBLAS=ON -DBUILD_DEPRECATED=ON" + if OsUtils.isWin(): # mingw-w64 (gfortran) 8.1 includes only static libgfortran and fails to build dll + self.subinfo.options.configure.args = " -DBUILD_SHARED_LIBS=OFF" + else: + self.subinfo.options.configure.args = " -DBUILD_SHARED_LIBS=ON" diff --git a/libs/pocketsphinx/0001-fix-static-lapack-link.patch b/libs/pocketsphinx/0001-fix-static-lapack-link.patch new file mode 100755 --- /dev/null +++ b/libs/pocketsphinx/0001-fix-static-lapack-link.patch @@ -0,0 +1,12 @@ +diff -w -r -u pocketsphinx/src/libpocketsphinx/Makefile.am pocketsphinx-fixed/src/libpocketsphinx/Makefile.am +--- pocketsphinx/src/libpocketsphinx/Makefile.am 2020-04-04 22:53:22.058341700 +0200 ++++ pocketsphinx-fixed/src/libpocketsphinx/Makefile.am 2020-04-04 22:53:38.836995900 +0200 +@@ -2,7 +2,7 @@ + + lib_LTLIBRARIES = libpocketsphinx.la + +-libpocketsphinx_la_LDFLAGS = -version-info 3:0:0 -lm ++libpocketsphinx_la_LDFLAGS = -version-info 3:0:0 -lm -no-undefined + + libpocketsphinx_la_SOURCES = \ + acmod.c \ diff --git a/libs/pocketsphinx/pocketsphinx.py b/libs/pocketsphinx/pocketsphinx.py --- a/libs/pocketsphinx/pocketsphinx.py +++ b/libs/pocketsphinx/pocketsphinx.py @@ -7,6 +7,9 @@ self.description = "Lightweight speech recognition engine." self.webpage = "http://cmusphinx.sourceforge.net/" self.displayName = "PocketSphinx" + self.patchToApply['e40da77a85edbb5d79b92bf1dcb927d94e43e07d'] = [ + ("0001-fix-static-lapack-link.patch", 1), + ] def setDependencies(self): self.buildDependencies["virtual/base"] = None diff --git a/libs/sphinxbase/0001-fix-static-lapack-link.patch b/libs/sphinxbase/0001-fix-static-lapack-link.patch new file mode 100755 --- /dev/null +++ b/libs/sphinxbase/0001-fix-static-lapack-link.patch @@ -0,0 +1,24 @@ +diff -w -r -u sphinxbase/src/libsphinxad/Makefile.am sphinxbase-fixed/src/libsphinxad/Makefile.am +--- sphinxbase/src/libsphinxad/Makefile.am 2020-04-04 22:41:28.462747600 +0200 ++++ sphinxbase-fixed/src/libsphinxad/Makefile.am 2020-04-04 22:41:36.767949100 +0200 +@@ -5,7 +5,7 @@ + + # Confusing libtool version info means: + # +-libsphinxad_la_LDFLAGS = -version-info 3:0:0 ++libsphinxad_la_LDFLAGS = -version-info 3:0:0 -no-undefined + + libsphinxad_la_SOURCES = + +diff -w -r -u sphinxbase/src/libsphinxbase/Makefile.am sphinxbase-fixed/src/libsphinxbase/Makefile.am +--- sphinxbase/src/libsphinxbase/Makefile.am 2020-04-04 22:41:28.572116000 +0200 ++++ sphinxbase-fixed/src/libsphinxbase/Makefile.am 2020-04-04 22:41:36.846087300 +0200 +@@ -4,7 +4,7 @@ + + libsphinxbase_la_SOURCES = + +-libsphinxbase_la_LDFLAGS = -version-info 3:0:0 ++libsphinxbase_la_LDFLAGS = -version-info 3:0:0 -no-undefined + libsphinxbase_la_LIBADD = $(LTLIBICONV) \ + util/libsphinxutil.la \ + fe/libsphinxfe.la \ diff --git a/libs/sphinxbase/sphinxbase.py b/libs/sphinxbase/sphinxbase.py --- a/libs/sphinxbase/sphinxbase.py +++ b/libs/sphinxbase/sphinxbase.py @@ -7,6 +7,9 @@ self.description = "Common library for sphinx speech recognition." self.webpage = "http://cmusphinx.sourceforge.net/" self.displayName = "SphinxBase" + self.patchToApply['057d423ddddea2351678abd0d29b5f1463a343c7'] = [ + ("0001-fix-static-lapack-link.patch", 1), + ] def setDependencies(self): self.buildDependencies["virtual/base"] = None