Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make node-libzim packageable for GNU/Linux distributions #12

Open
OTLabs opened this issue May 16, 2019 · 7 comments
Open

Make node-libzim packageable for GNU/Linux distributions #12

OTLabs opened this issue May 16, 2019 · 7 comments

Comments

@OTLabs
Copy link

OTLabs commented May 16, 2019

The libzim package is already provided on Alpine Linux distribution. I would like to use that binary.

Is it possible to do not download libzim and made use of already installed package?

@kelson42
Copy link
Contributor

@OTLabs My short answer would be: theoretically yes, practically no.

@OTLabs
Copy link
Author

OTLabs commented May 17, 2019

@kelson42 Ok. Thank you.

Would it be possible to modify node-libzim so the rpath for .so will not include /home/... (it would be perfect to have an option to strip/prefix rpath, something like /usr/... would be great)?

I am building the mwoffliner package for Alpine Linux and post-check complains for rpath having /home/... so no flight. I already have libzim[-dev] package build right but it's no flight also.

@kelson42
Copy link
Contributor

kelson42 commented May 17, 2019

@OTLabs I think future versions of libzim binaries (new one to be released soon) won't use any rpath. @mgautierfr could you confirm?

@OTLabs
Copy link
Author

OTLabs commented May 17, 2019

Thank you.

@ISNIT0
Copy link
Contributor

ISNIT0 commented May 18, 2019

@OTLabs This is technically a simple change, the only thing is gyp is a horrible build system and it makes the config much more complicated.

The file that would need modifying is build/native/binding.gyp, and would need something like this added:

'conditions': [
    ['libzim =="external"',
        {
            'libraries': [
                "-lzim"
            ],
        },
        [
            [
                "OS=='linux'",
                {
                    "libraries": [
                        "-Wl,-rpath,<(libzim_dir)",
                        "-L<(libzim_dir)",
                        "<(libzim_dir)/libzim.so.4",
                    ],
                }
            ],
            [
                "OS=='mac'",
                {
                    "libraries": [
                        "-lzim"
                    ]
                }
            ],
        ]
    ]
]

@ISNIT0
Copy link
Contributor

ISNIT0 commented May 18, 2019

@OTLabs If you can write up something that creates a variable called libzim_external which takes into account an external flag and falls back to the current linux/mac behaviour I'd be really happy to merge it :)

@OTLabs
Copy link
Author

OTLabs commented May 18, 2019

@ISNIT0 I really appreciate a lot your kind answer.

It would be my real pleasure to submit corresponding PR as I am so exited with all openzim software but I have no any experience with gyp and what I have seen about it makes me think that the task to add an above mentioned variable is far beyond my current skills.

Meanwhile I have tried to hack build/native/binding.gyp making configuration for linux and mac identical. It was not enough as download-libzim.js is called anyway. I made a change to this file too: I put const isLinux = false; but the only effect of this change is to trigger a warning message printed to console.

I also tried to run npm run build:native ... instead of npm install ... without much luck so far.

I very hope the next release will make possible to pack mwoffliner for Alpine Linux. Meanwhile I will try more ideas.

@kelson42 kelson42 removed their assignment May 19, 2019
@kelson42 kelson42 changed the title How to do not download libzim on Linux? Make node-libzim packageable for distribution May 19, 2019
@kelson42 kelson42 changed the title Make node-libzim packageable for distribution Make node-libzim packageable for GNU/Linux distributions May 19, 2019
@kelson42 kelson42 removed the question label May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants