[SailfishDevel] Building non Qt Libraries (autotools) - Trying to build pocketsphinx (voice recognition library) for Sailfish

Nicolas Cisco ncis20 at gmail.com
Sat Feb 14 18:18:21 UTC 2015


Someone called Yuri  came across with this converstation and sent me an
email, because
he was having the same issue. I though that it would be better to answer in
the conversation.

The problem was that the sdk's tool mb2 when targeting SailfishOS-i486, was
generating i586 packages.
I found the problem on 7/6/14, the official sdk at that time had this bug
(i don't remember what sdk
version was). Then the bug was corrected, i can't remember exactly in what
update, but last sdk fixies it.

I wrote a guide on how to package a library:
- http://nckweb.com.ar/sailing-code/2015/01/02/packaging/
- http://nckweb.com.ar/sailing-code/2015/01/03/packaging-pocketsphinx/
(example of how to package pocket sphinx)


2014-06-07 5:51 GMT-03:00 Nicolas Cisco <ncis20 at gmail.com>:

> After researching a little more, i could find the root of the problem.
> Apparently the error:
>     '_tmpRPMcache_:{pkgname}={pkg-version}' not found in package names.
> Trying capabilities.
> is caused when you are trying to install a package that is not of the cpu
> architecture of your machine. I don't know why mb2 when the setted target
> machine is "SailfishOS-i486" creates a i586 package.
> If I create packages for "SailfishOS-armv7hl", this "not found ... Trying
> capabilities" problem doesnt' appear, I don't have problems when trying to
> install the builded packages with `sb2 -t SailfishOS-armv7hl -m skd-install
> -R zypper in <package>`.
>
> I'm building the packages using spectacle (as the mer wiki suggest
> https://wiki.merproject.org/wiki/Packaging_guidelines ) for the .spec
> file, and then with mb2 ( `mb2 -t <Nemo target> -s <.spec file>` ).
>
> Any help with this?.
>
> These are my sphinxbase.yaml and sphinxbase.spec files:
> https://gist.github.com/NickCis/8d0043273511b3f62319
>
>
> 2014-06-04 4:28 GMT-03:00 Nicolas Cisco <ncis20 at gmail.com>:
>
> I'm trying to build sphinxbase and pocketsphinx for Sailfish, i could find
>> this topic (
>> https://together.jolla.com/question/22379/porting-sdl-20-game-to-sailfish/
>> ) which involves building non qt apps, but i'm having some problems.
>>
>> First of all, i'm using sphinxbase 0.8 and pocketsphinx 0.8 packages
>> which can be downloaded from here (
>> http://cmusphinx.sourceforge.net/wiki/download/ ). I could build these
>> packages without having to make any modifications to the source code.
>> I'm using these .specs files:
>>
>> sphinixbase.spec:
>>     Name: sphinxbase
>>     Summary: SphinxBase
>>     Version: 0.8
>>     Release: 1
>>     Group: Libraries
>>     License: LICENSE
>>     URL: http://example.org/
>>     Source0: %{name}-%{version}.tar.bz2
>>
>>     %description
>>     Short description of my SailfishOS Application
>>
>>     %prep
>>     %setup -q -n %{name}-%{version}
>>
>>     %build
>>     # Command used to compile the application
>>     ./autogen.sh --enable-fixed --prefix=/usr/
>>     make
>>
>>     %install
>>     rm -rf %{buildroot}
>>     # Command used to install files into %{buildroot}
>>     %make_install
>>
>>     %files
>>     %defattr(-,root,root,-)
>>     %{_bindir}/sphinx*
>>     %{_libdir}/*
>>     %{_libdir}/pkgconfig/*
>>     %{_includedir}/%{name}/*
>>
>> pocketsphinx.spec:
>>     Name: pocketsphinx
>>     Summary: PocketSphinx
>>     Version: 0.8
>>     Release: 1
>>     Group: Libraries
>>     License: LICENSE
>>     URL: http://example.org/
>>     Source0: %{name}-%{version}.tar.bz2
>>     BuildRequires: pkgconfig(sphinxbase)
>>
>>     %description
>>     Short description of my SailfishOS Application
>>
>>     %prep
>>     %setup -q -n %{name}-%{version}
>>
>>     %build
>>     # Command used to compile the application
>>     ./autogen.sh --enable-fixed --prefix=/usr/
>>     make
>>
>>     %install
>>     rm -rf %{buildroot}
>>     # Command used to install files into %{buildroot}
>>     %make_install
>>
>>     %files
>>     %defattr(-,root,root,-)
>>     %{_bindir}/%{name}*
>>     %{_libdir}/lib*
>>     %{_libdir}/pkgconfig/*
>>     %{_includedir}/%{name}
>>     %{_datadir}/man
>>     %{_datadir}/%{name}
>>
>> Connection to the build engine though ssh, I could build correctly
>> sphinxbase using this command: `mb2 -t SailfishOS-i486 -s sphinxbase.spec
>> build`.
>>
>> Then, i tryed to install this package the build engine, but i couldn't:
>>     [mersdk at SailfishSDK sphinxbase-0.8]$ sb2 -t SailfishOS-i486 -m
>> sdk-install -R pkcon install     RPMS/sphinxbase-0.8-1.i586.rpm
>>     [mersdk at SailfishSDK sphinxbase-0.8]$ sb2 -t SailfishOS-i486 -m
>> sdk-install -R zypper install     ./RPMS/sphinxbase-0.8-1.i586.rpm
>>     Loading repository data...
>>     Reading installed packages...
>>     '_tmpRPMcache_:sphinxbase=0:0.8-1' not found in package names. Trying
>> capabilities.
>>     No provider of 'sphinxbase = 0:0.8-1' found.
>>     Resolving package dependencies...
>>
>>     Nothing to do.
>>
>> If then, i try to build pocketsphinx, i can't, since my .spec file has
>> pkgconfig(sphinxbase) in the BuildRequires:
>>
>>     [mersdk at SailfishSDK sphinxbase-0.8]$ mb2 -t SailfishOS-i486 -s
>> pocketsphinx.spec build
>>     Fatal: 'pocketsphinx.spec' doesn't exist (and could not be made from
>> a yaml)
>>
>> If i comment out the BuildRequires, i'm able to build pocketsphinx with
>> this command: `mb2 -t SailfishOS-i486 -s pocketsphinx.spec build`. Again,
>> trying to install the package to the build engine throws me errors:
>>     [mersdk at SailfishSDK pocketsphinx-0.8]$ sb2 -t SailfishOS-i486 -m
>> sdk-install -R pkcon install     RPMS/pocketsphinx-0.8-1.i586.rpm
>>     [mersdk at SailfishSDK pocketsphinx-0.8]$ sb2 -t SailfishOS-i486 -m
>> sdk-install -R zypper install ./RPMS/pocketsphinx-0.8-1.i586.rpm
>>     Loading repository data...
>>     Reading installed packages...
>>     '_tmpRPMcache_:pocketsphinx=0:0.8-1' not found in package names.
>> Trying capabilities.
>>     No provider of 'pocketsphinx = 0:0.8-1' found.
>>     Resolving package dependencies...
>>
>>     Nothing to do.
>>
>> As i can't install pocketsphinx nor sphinxbase, i can't build any
>> application using this libraries (if i explore /usr/include,
>> /usr/lib,/usr/lib/pkgconfig, I can't find any sphinx's file).
>>
>> If i execute pkg-config, i get this output:
>>     [mersdk at SailfishSDK pocketsphinx-0.8]$ sb2 -t SailfishOS-i486 -m
>> sdk-install -R pkg-config --libs --cflags pocketsphinx
>>     Package pocketsphinx was not found in the pkg-config search path.
>>     Perhaps you should add the directory containing `pocketsphinx.pc'
>>     to the PKG_CONFIG_PATH environment variable
>>     No package 'pocketsphinx' found
>>
>> Sending the rpm packages to the nemo user and then installing them with
>> `pkcon install-local` gives me a successfull output. In addittion,
>> pkg-config gives me the correct output:
>>     [nemo at SailfishEmul ~]$ pkg-config --libs --cflags pocketsphinx
>>     -I/usr/include/sphinxbase -I/usr/include/pocketsphinx  -lpocketsphinx
>> -lsphinxbase -lsphinxad -lpthread -lm
>>
>> I'm a bit lost with this, any help?.
>> Thanks in advance!
>>
>>
>> --
>> Nicolas Cisco
>> www.nckweb.com.ar
>>
>
>
>
> --
> Nicolas Cisco
> www.nckweb.com.ar
>



-- 
Nicolas Cisco
www.nckweb.com.ar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20150214/620574bc/attachment.html>


More information about the Devel mailing list