luvit / luv

Bare libuv bindings for lua
Apache License 2.0
822 stars 185 forks source link

make it possible to install both headers and library #457

Closed teto closed 4 years ago

teto commented 4 years ago

Hi,

I am trying to bump the nixos package for luv and one problem I have is that I can't install both the library and headers at the same time (or I hqven't found how) because BUILD_MODULE is used for 2 distinguished actions https://github.com/luvit/luv/blob/f38ae04ce02f856566637d2a52527373a5ed61d9/CMakeLists.txt#L131 https://github.com/luvit/luv/blob/f38ae04ce02f856566637d2a52527373a5ed61d9/CMakeLists.txt#L201 On nixos once a package is installed, its folder becomes readonly so that it doesn't get tampered with so I can't rerun the installer twice. I wish there was an other boolean to install the headers (or always install them).

squeek502 commented 4 years ago

I wish there was an other boolean to install the headers (or always install them).

Sounds reasonable to me.

aiverson commented 4 years ago

The recommended way to handle having both headers and libraries is to use a nix multiple output derivation to specify the multiple outputs with the separate parts so that the include files are available as build dependencies and the libraries are a separate runtime dependency to reduce the size of the closure.

teto commented 4 years ago

@aiverson this looks orthogonal; you can arrange the folders in different outputs but this is to avoid running the nix installer twice.