Giter Site home page Giter Site logo

alien-hunspell's Introduction

Alien::Hunspell linux macos windows cygwin msys2-mingw

Install hunspell

SYNOPSIS

In your Makefile.PL:

use ExtUtils::MakeMaker;
use Alien::Base::Wrapper ();

WriteMakefile(
  Alien::Base::Wrapper->new('Alien::Hunspell')->mm_args2(
    # MakeMaker args
    NAME => 'My::XS',
    ...
  ),
);

In your Build.PL:

use Module::Build;
use Alien::Base::Wrapper qw( Alien::Hunspell !export );

my $builder = Module::Build->new(
  ...
  configure_requires => {
    'Alien::Hunspell' => '0',
    ...
  },
  Alien::Base::Wrapper->mb_args,
  ...
);

$build->create_build_script;

In your FFI::Platypus script or module:

use FFI::Platypus;
use Alien::Hunspell;

my $ffi = FFI::Platypus->new(
  lib => [ Alien::Hunspell->dynamic_libs ],
);

DESCRIPTION

This module provides the spelling library Hunspell. It will either detect it as provided by the operating system, or download the source from the Internet and install it for you. It uses Alien::Base.

AUTHOR

Graham Ollis [email protected]

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Graham Ollis.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

alien-hunspell's People

Contributors

plicease avatar

Watchers

 avatar  avatar

Forkers

hatorikibble

alien-hunspell's Issues

Alienize autopoint

This is a new build dependency so it would be good to either turn it off or alienize autopoint.

Upgrade to 1.3.4 breaks windows!

D:\home\ollisg\dev\Alien-Hunspell\Alien-Hunspell-0.06>Build
Building Alien-Hunspell
+ pkg-config --modversion hunspell
Downloading File: v1.3.4.tar.gz ... Done
Extracting Archive ... No such file in archive: 'usr/share/automake-1.15/compile' at d:/lang/perl/strawberry/x86/5.22.1/perl/vendor/lib/Archive/Extract.pm li
ne 897.
Could not find file '/usr/share/automake-1.15/compile' in memory. at d:/lang/perl/strawberry/x86/5.22.1/perl/vendor/lib/Archive/Extract.pm line 897.
Making symbolic link 'D:\home\ollisg\dev\Alien-Hunspell\Alien-Hunspell-0.06\_alien\hunspell-1.3.4\compile' to '/usr/share/automake-1.15/compile' failed at d:
/lang/perl/strawberry/x86/5.22.1/perl/vendor/lib/Archive/Extract.pm line 897.
Unable to read 'D:\home\ollisg\dev\Alien-Hunspell\Alien-Hunspell-0.06\_alien\hunspell-1.3.4.tar.gz': Making symbolic link 'D:\home\ollisg\dev\Alien-Hunspell\
Alien-Hunspell-0.06\_alien\hunspell-1.3.4\compile' to '/usr/share/automake-1.15/compile' failed at D:\home\ollisg\perl5\strawberry\x86\5.22.1\lib\perl5/Alien
/Base/ModuleBuild.pm line 330.
No '/bin/tar' program found at D:\home\ollisg\perl5\strawberry\x86\5.22.1\lib\perl5/Alien/Base/ModuleBuild.pm line 330.
Extract failed due to errors at D:\home\ollisg\perl5\strawberry\x86\5.22.1\lib\perl5/Alien/Base/ModuleBuild.pm line 330.
Archive extraction failed! at Build line 61.

This should block any release we do before using 1.3.4

Solaris support

Builds and installs okay, but the produced .a file seems to have non-PIC code in it:

t/05-core.t ............ Can't load '/home/ollisg/.cpanm/work/1450979435.12693/Text-Hunspell-2.12/blib/arch/auto/Text/Hunspell/Hunspell.so' for module Text::Hunspell: ld.so.1: perl: fatal: relocation error: R_AMD64_PC32: file /home/ollisg/.cpanm/work/1450979435.12693/Text-Hunspell-2.12/blib/arch/auto/Text/Hunspell/Hunspell.so: symbol main: value 0x228000b18de4 does not fit at /home/ollisg/opt/perl/5.20.1/lib/5.20.1/i86pc-solaris-64/DynaLoader.pm line 193.
 at t/05-core.t line 6.

despite the --with-pic flag being passed to configure

Upgrade to 1.3.4 breaks FreeBSD

libtool: link: c++ -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -Wl,-E -fstack-protector -o chmorph chmorph.o  -L/usr/local/lib ../parsers/libparsers.a ../hunspell/.libs/libhunspell-1.3.a
c++ -DHAVE_CONFIG_H -I. -I../.. -I../../src/hunspell -I../../src/parsers   -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_THREAD_SAFE  -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -MT hunspell.o -MD -MP -MF .deps/hunspell.Tpo -c -o hunspell.o hunspell.cxx
hunspell.cxx:268:19: error: no matching function for call to 'iconv'
    while ((res = iconv(conv, &source, &c1, &dest, &c2)) == size_t(-1)) {
                  ^~~~~
/usr/include/iconv.h:56:8: note: candidate function not viable: no known conversion from 'char **' to 'const char **' for 2nd argument
size_t  iconv(iconv_t, const char ** __restrict,
        ^
1 error generated.
*** Error code 1

Stop.
make[3]: stopped in /usr/home/ollisg/dev/Alien-Hunspell/.build/VI52D0w67K/_alien/hunspell-1.3.4/src/tools
*** Error code 1

Stop.
make[2]: stopped in /usr/home/ollisg/dev/Alien-Hunspell/.build/VI52D0w67K/_alien/hunspell-1.3.4/src
*** Error code 1

Stop.
make[1]: stopped in /usr/home/ollisg/dev/Alien-Hunspell/.build/VI52D0w67K/_alien/hunspell-1.3.4
*** Error code 1

Stop.
make: stopped in /usr/home/ollisg/dev/Alien-Hunspell/.build/VI52D0w67K/_alien/hunspell-1.3.4
External command (make) failed! Error: 256
 at Build line 60.
Failed
Build not completed at Build line 60.
error running /usr/home/ollisg/opt/perl/5.20.2/bin/perl Build
freebsd64% git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

Strawberry support

There is a mingw port here:

https://github.com/zdenop/hunspell-mingw

But I would rather get it working with the original source if possible. This gets it to compile under whatever strawberry that I am using:

https://github.com/plicease/hunspell/commit/48ecac66b929f77215ac89c5f9528556f6e1945f

But then it barfs on link like this:

straw-N:\home\ollisg\dev\hunspell\src\hunspell>gmake
gmake
N:/home/ollisg/perl5/strawberry/x86/5.20.1/lib/perl5/auto/share/dist/Alien-MSYS/msys/1.0/bin/sh.exe ../../libtool  --tag=CXX   --mode=link g++ -fvisibility=hidden -DBUILDING_LIBHUNSPELL -g -O2 -no-undefined  -o libhunspell-1.3.la -rpath /usr/local/lib affentry.lo affixmgr.lo csutil.lo dictmgr.lo hashmgr.lo hunspell.lo suggestmgr.lo phonet.lo filemgr.lo hunzip.lo replist.lo  
libtool: link: warning: library `n:/lang/perl/strawberry/x86/5.20.1/c/bin/../lib/gcc/i686-w64-mingw32/4.8.3/libstdc++.la' was moved.
libtool: link: g++ -shared -nostdlib n:/lang/perl/strawberry/x86/5.20.1/c/bin/../lib/gcc/i686-w64-mingw32/4.8.3/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o n:/lang/perl/strawberry/x86/5.20.1/c/bin/../lib/gcc/i686-w64-mingw32/4.8.3/crtbegin.o  .libs/affentry.o .libs/affixmgr.o .libs/csutil.o .libs/dictmgr.o .libs/hashmgr.o .libs/hunspell.o .libs/suggestmgr.o .libs/phonet.o .libs/filemgr.o .libs/hunzip.o .libs/replist.o   -L/opt/build/i686-483-posix-sjlj-rt_v3/mingw32/opt/lib -L/opt/build/prerequisites/i686-zlib-static/lib -L/opt/build/prerequisites/i686-w64-mingw32-static/lib' -Ln:/lang/perl/strawberry/x86/5.20.1/c/bin/../lib/gcc/i686-w64-mingw32/4.8.3 -Ln:/lang/perl/strawberry/x86/5.20.1/c/bin/../lib/gcc -Ln:/lang/perl/strawberry/x86/5.20.1/c/bin/../lib/gcc/i686-w64-mingw32/4.8.3/../../../../i686-w64-mingw32/lib/../lib -Ln:/lang/perl/strawberry/x86/5.20.1/c/bin/../lib/gcc/i686-w64-mingw32/4.8.3/../../../../lib -Ln:/lang/perl/strawberry/x86/5.20.1/c/bin/../lib/gcc/i686-w64-mingw32/4.8.3/../../../../i686-w64-mingw32/lib -Ln:/lang/perl/strawberry/x86/5.20.1/c/bin/../lib/gcc/i686-w64-mingw32/4.8.3/../../.. n:/lang/perl/strawberry/x86/5.20.1/c/bin/../lib/gcc/i686-w64-mingw32/4.8.3/libstdc++.dll.a -L/opt/build/i686-483-posix-sjlj-rt_v3/build/gcc-4.8.3/i686-w64-mingw32/libstdc++-v3/src -L/opt/build/i686-483-posix-sjlj-rt_v3/build/gcc-4.8.3/i686-w64-mingw32/libstdc++-v3/src/.libs -L/mingw32/i686-w64-mingw32/lib -L/mingw32/mingw/lib -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -liconv -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt n:/lang/perl/strawberry/x86/5.20.1/c/bin/../lib/gcc/i686-w64-mingw32/4.8.3/crtend.o    -o .libs/libhunspell-1.3-0.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libhunspell-1.3.dll.a
../../libtool: eval: line 7860: unexpected EOF while looking for matching `''
../../libtool: eval: line 7861: syntax error: unexpected end of file
Makefile:492: recipe for target 'libhunspell-1.3.la' failed
gmake: *** [libhunspell-1.3.la] Error 1

The underlying problem seems to be is that it is creating a libtool for the MSYS (using the Alien::MSYS share version) rather than the gcc/g++ that came with Strawberry. So once again the incomplete strawberry toolkit strikes again. Or fails to strike.

make t/xs.t work without specifying C++

xs_ok fails on build from source in travis (at least probably others) with this error:

Can't load '/tmp/4XAVf2Aeks/auto/My/Hunspell/Hunspell.so' for module My::Hunspell: /tmp/4XAVf2Aeks/auto/My/Hunspell/Hunspell.so: undefined symbol: __gxx_personality_v0 at /home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/DynaLoader.pm line 226.

I don't get the same error for the system provided hunspell, so obviously debian must be doing something right that I am not.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.