packaging: rename nixexpr -> lixexpr and so on

This breaks downstreams linking to us on purpose to make sure that if
someone is linking to Lix they're doing it on purpose and crucially not
mixing up Nix and Lix versions in compatibility code.

We still need to fix the internal includes to follow the same schema so
we can drop the single-level include system entirely. However, this
requires a little more effort.

This adds pkg-config for libfetchers and config.h.

Migration path:
expr.hh      -> lix/libexpr/expr.hh
nix/config.h -> lix/config.h

To apply this migration automatically, remove all `<nix/>` from
includes, so: `#include <nix/expr.hh>` -> `#include <expr.hh>`. Then,
the correct paths will be resolved from the tangled mess, and the
clang-tidy automated fix will work.

Then run the following for out of tree projects:

```
lix_root=$HOME/lix
(cd $lix_root/clang-tidy && nix develop -c 'meson setup build && ninja -C build')
run-clang-tidy -checks='-*,lix-fixincludes' -load=$lix_root/clang-tidy/build/liblix-clang-tidy.so -p build/ -fix src
```

Related: https://git.lix.systems/lix-project/nix-eval-jobs/pulls/5
Fixes: https://git.lix.systems/lix-project/lix/issues/279
Change-Id: I7498e903afa6850a731ef8ce77a70da6b2b46966
This commit is contained in:
Jade Lovelace
2024-05-23 16:45:23 -06:00
committed by Qyriad
parent 774c56094f
commit c97e17144e
26 changed files with 181 additions and 77 deletions
+1 -1
View File
@@ -4,5 +4,5 @@ libexpr_generated_headers += custom_target(
output : '@PLAINNAME@.gen.hh',
capture : true,
install : true,
install_dir : includedir / 'nix/flake',
install_dir : includedir / 'lix/libexpr/flake',
)
+10
View File
@@ -0,0 +1,10 @@
prefix=@prefix@
libdir=@libdir@
includedir=@includedir@
Name: Lix libexpr
Description: Lix Package Manager (libexpr)
Version: @PACKAGE_VERSION@
Requires: lix-base lix-util lix-fetchers lix-store bdw-gc
Libs: -L${libdir} -llixexpr
Cflags: -I${includedir}/lix/libexpr
+7 -7
View File
@@ -15,7 +15,7 @@ parser_tab = custom_target(
# NOTE(Qyriad): Meson doesn't support installing only part of a custom target, so we add
# an install script below which removes parser-tab.cc.
install : true,
install_dir : includedir / 'nix',
install_dir : includedir / 'lix/libexpr',
)
lexer_tab = custom_target(
@@ -37,7 +37,7 @@ lexer_tab = custom_target(
# NOTE(Qyriad): Meson doesn't support installing only part of a custom target, so we add
# an install script below which removes lexer-tab.cc.
install : true,
install_dir : includedir / 'nix',
install_dir : includedir / 'lix/libexpr',
)
# TODO(Qyriad): When the parser and lexer are rewritten this should be removed.
@@ -59,7 +59,7 @@ foreach header : [ 'imported-drv-to-derivation.nix', 'fetchurl.nix' ]
output : '@PLAINNAME@.gen.hh',
capture : true,
install : true,
install_dir : includedir / 'nix',
install_dir : includedir / 'lix/libexpr',
)
endforeach
subdir('flake')
@@ -127,7 +127,7 @@ libexpr_headers = files(
)
libexpr = library(
'nixexpr',
'lixexpr',
libexpr_sources,
parser_tab,
lexer_tab,
@@ -152,7 +152,7 @@ libexpr = library(
install_headers(
libexpr_headers,
subdir : 'nix',
subdir : 'lix/libexpr',
preserve_path : true,
)
@@ -164,8 +164,8 @@ liblixexpr = declare_dependency(
# FIXME: not using the pkg-config module because it creates way too many deps
# while meson migration is in progress, and we want to not include boost here
configure_file(
input : 'nix-expr.pc.in',
output : 'nix-expr.pc',
input : 'lix-expr.pc.in',
output : 'lix-expr.pc',
install_dir : libdir / 'pkgconfig',
configuration : {
'prefix' : prefix,
-10
View File
@@ -1,10 +0,0 @@
prefix=@prefix@
libdir=@libdir@
includedir=@includedir@
Name: Nix
Description: Nix Package Manager
Version: @PACKAGE_VERSION@
Requires: nix-store bdw-gc
Libs: -L${libdir} -lnixexpr
Cflags: -I${includedir}/nix -std=c++2a