Code Monkey home page Code Monkey logo

Comments (4)

bdon avatar bdon commented on May 23, 2024

Is the convention for Nix packages to use dynamic linking instead of static? I have preferred doing as much static linking as possible because it makes my own builds easier.

We can parameterize the CMake file to do one or both of 1) letting the OS defaults handle header search/link paths and 2) prefer dynamic builds for libraries https://github.com/protomaps/OSMExpress/blob/master/CMakeLists.txt#L12

Ideally this isn't specific to NixOS though and works the same way for Debian, for example.

Also, the way the build works is it does depend on a specific minor version of LMDB and capn' proto in order to ensure the binary format is the same across languages. Is that something that NixOS allows?

from osmexpress.

das-g avatar das-g commented on May 23, 2024

Is the convention for Nix packages to use dynamic linking instead of static?

Dynamic, as with AFAIK most Linux distributions.

We can parameterize the CMake file to do one or both of 1) letting the OS defaults handle header search/link paths and 2) prefer dynamic builds for libraries https://github.com/protomaps/OSMExpress/blob/master/CMakeLists.txt#L12

That'd be great!

Ideally this isn't specific to NixOS though and works the same way for Debian, for example.

I'm pretty sure all distributions would appreciate the possibility of such parametrization. Specifically Debian AFAIK also prefers dynamic linking and system libraries instead of upstream-vendored ones. Which distributions are at all interested in providing a package for OSM Express I don't know. But the parametrization option might also help unofficial packagers (e.g. Debian/Ubuntu PPAs) to provide and maintain clean packages.

from osmexpress.

das-g avatar das-g commented on May 23, 2024

Also, the way the build works is it does depend on a specific minor version of LMDB and capn' proto in order to ensure the binary format is the same across languages.

Ah, that's good to know.

Is that something that NixOS allows?

Yes, NixOS can provide several variants of a software, e.g. several versions, even when they provide binaries of the same name, and other software can depend on specific variants. It's usually avoided to maintain several variants or versions when it can be avoided, but when there's a good reason (such as here), it can be done.

from osmexpress.

bdon avatar bdon commented on May 23, 2024

If you comment out most of the include_directories https://github.com/protomaps/OSMExpress/blob/master/CMakeLists.txt#L23

then CMake should look for headers in your system header paths like /usr/local/include, /usr/include, etc I believe. It may be easier to write a new CMakeLists.txt following Nix-specific conventions - maybe using this as a starting point - https://nixos.wiki/wiki/C and then we can figure out how to combine them later.

from osmexpress.

Related Issues (20)

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.