From c97e17144e0d0b666d7b79d8b4b0d581bfdf373b Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Thu, 16 May 2024 17:04:05 -0700 Subject: 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 `` from includes, so: `#include ` -> `#include `. 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 --- src/libexpr/flake/meson.build | 2 +- src/libexpr/lix-expr.pc.in | 10 ++++++++++ src/libexpr/meson.build | 14 +++++++------- src/libexpr/nix-expr.pc.in | 10 ---------- 4 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 src/libexpr/lix-expr.pc.in delete mode 100644 src/libexpr/nix-expr.pc.in (limited to 'src/libexpr') diff --git a/src/libexpr/flake/meson.build b/src/libexpr/flake/meson.build index 3ecc30f4e..cce1b0c75 100644 --- a/src/libexpr/flake/meson.build +++ b/src/libexpr/flake/meson.build @@ -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', ) diff --git a/src/libexpr/lix-expr.pc.in b/src/libexpr/lix-expr.pc.in new file mode 100644 index 000000000..5e850976d --- /dev/null +++ b/src/libexpr/lix-expr.pc.in @@ -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 diff --git a/src/libexpr/meson.build b/src/libexpr/meson.build index 099279d56..fda6fde2c 100644 --- a/src/libexpr/meson.build +++ b/src/libexpr/meson.build @@ -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, diff --git a/src/libexpr/nix-expr.pc.in b/src/libexpr/nix-expr.pc.in deleted file mode 100644 index 60ffb5dba..000000000 --- a/src/libexpr/nix-expr.pc.in +++ /dev/null @@ -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 -- cgit v1.2.3