salortiz / LMDB_File

Perl wrapper around the OpenLDAP's LMDB
Other
8 stars 12 forks source link

Not bundling lmdb anymore? #11

Closed hoytech closed 8 years ago

hoytech commented 8 years ago

Hi Salvador,

I just tried to install 0.09 and I got this error from cpanm:

Configuring LMDB_File-0.09
Running Makefile.PL
Warning (mostly harmless): No library found for -llmdb
Clone lmdb from its repo and put a copy/link in 'liblmdb' directory at Makefile.PL line 34.
-> N/A
-> FAIL Configure failed for LMDB_File-0.09. See /home/doug/.cpanm/work/1455036782.31765/build.log for details.

It looks like we're not bundling lmdb with the cpan distribution anymore:

$ tar tf LMDB_File-0.07.tar.gz | grep lmdb.h
LMDB_File-0.07/liblmdb/lmdb.h
$ tar tf LMDB_File-0.09.tar.gz | grep lmdb.h
$

Is this intentional? After I did apt-get install liblmdb-dev it built and tested fine.

Thanks,

Doug

salortiz commented 8 years ago

Hi Doug,

Yes, Indeed. As more distributions now has liblmdb included and the library moved to github, I prefered to reference to it for the github user, and remove from the tarball, see https://github.com/salortiz/LMDB_File/commit/090ef865dd4b1fe502826076ff107181ade8fecd

If you think that we need a more prominent announce, please send a PR.

Regards.

hoytech commented 8 years ago

I understand not wanting to bundle the lmdb source code with the LMDB_File release, but it's a bit unfortunate that we can't get all the dependencies from CPAN anymore.

Maybe we could make an Alien::LMDB package, for example with https://metacpan.org/pod/Alien::Base ? I believe Alien::Base distributions can default to using a system library if present, otherwise they can download&install it, or use a bundled copy.

I've made Alien releases before, for example:

https://metacpan.org/pod/Alien::OpenVcdiff

Would you be interested in me trying this approach?

hoytech commented 8 years ago

I went ahead and made a really simple Alien package:

https://github.com/hoytech/Alien-LMDB

I'm going to send a PR that enables liblmdb to use it. Don't worry, LMDB_File shouldn't need to depend on Alien::LMDB.

Unfortunately, the ubuntu packaged version of lmdb doesn't setup pkg-config for lmdb so it isn't using the system version even if it's installed.

hoytech commented 8 years ago

I saw you merged my PR, thanks!

After the next LMDB_File is released, I'll make a Task::LMDB that depends on Alien::LMDB as a configure-time dependency and LMDB_File as a run-time dependency. I'm hoping this means that CPAN clients will always download+install the alien package first.

Distributions that want to use the CPAN-bundled version can depend on Task::LMDB.

hoytech commented 8 years ago

Now that LMDB_File 0.10 has been released, I've released Task::LMDB to simplify CPAN dependencies:

https://metacpan.org/pod/release/FRACTAL/Task-LMDB-0.100/lib/Task/LMDB.pm