libyal / libpff

Library and tools to access the Personal Folder File (PFF) and the Offline Folder File (OFF) format
GNU Lesser General Public License v3.0
289 stars 74 forks source link

Generating pypff.dll Python module on Cygwin #19

Closed deisner closed 8 years ago

deisner commented 8 years ago

I know the Python bindings are a work in progress. On Cygwin, after following the build instructions, only the static pypff.a module was installed. I was able to get what I needed using setup.py. I mention it here to help others who run into the same problem. It might be worth including something in the Building instructions.

$ python setup.py install
$ ...
build/temp.cygwin-2.4.1-i686-2.7/libpff/libpff_compression.o: In function `libpff_decompress_data':
/home/XXXX/libpff/libpff/libpff/libpff_compression.c:127: undefined reference to `uncompress'
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

To get past this link error, I edited setup.py and added libz to the libraries argument for setup():

setup(
    name=project_information.package_name,
    # ...
    ext_modules=[
        Extension(
            project_information.module_name,
            # ...
            libraries=['z'],
            # ...
)

Now I get /usr/lib/python2.7/site-packages/pypff.dll installed, and I can import the module in python. I realize this is probably not the right way to fix it in general; I just needed something to get it working for me.

Thanks for making this library available, by the way.

joachimmetz commented 8 years ago

So a deflate (inflate) fallback implementation is work in progress. That should solve deployment issues around missing zlib or equivalents.