diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 11c2b53..20c410c 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -43,10 +43,3 @@ FetchContent_Declare( GIT_TAG 10.1.0 ) FetchContent_MakeAvailable( fmt ) - -FetchContent_Declare( - ctre - GIT_REPOSITORY https://github.com/hanickadot/compile-time-regular-expressions - GIT_TAG v3.8.1 -) -FetchContent_MakeAvailable( ctre ) diff --git a/nix/dependencies/default.nix b/nix/dependencies/default.nix index d40f1c4..9e7b377 100644 --- a/nix/dependencies/default.nix +++ b/nix/dependencies/default.nix @@ -1,4 +1,4 @@ {pkgs}: { - tl-optional = pkgs.callPackage ./tl-optional {version = "1.1.0";}; - tl-expected = pkgs.callPackage ./tl-expected {version = "1.1.0";}; + tl-optional = pkgs.callPackage ./tl-optional {}; + tl-expected = pkgs.callPackage ./tl-expected {}; } diff --git a/nix/dependencies/tl-expected/default.nix b/nix/dependencies/tl-expected/default.nix index b5949f6..a8f42a5 100644 --- a/nix/dependencies/tl-expected/default.nix +++ b/nix/dependencies/tl-expected/default.nix @@ -1,23 +1,30 @@ { - pkgs, - version, + stdenv, + cmake, + fetchFromGitHub }: -pkgs.stdenv.mkDerivation { +stdenv.mkDerivation (self: { pname = "expected"; - inherit version; + version = "1.1.0"; - src = pkgs.fetchFromGitHub { + src = fetchFromGitHub { owner = "TartanLlama"; repo = "expected"; - rev = "v${version}"; + rev = "v${self.version}"; sha256 = "sha256-AuRU8VI5l7Th9fJ5jIc/6mPm0Vqbbt6rY8QCCNDOU50="; }; - nativeBuildInputs = [pkgs.cmake]; + strictDeps = true; - strictDeps = true; + nativeBuildInputs = [cmake]; postInstall = '' - install -Dm644 ${./expected.pc} $out/lib/pkgconfig/expected.pc + mkdir -p $out/lib/pkgconfig + + substitute \ + ${./expected.pc} \ + $out/lib/pkgconfig/expected.pc \ + --subst-var out \ + --subst-var version ''; -} + }) diff --git a/nix/dependencies/tl-expected/expected.pc b/nix/dependencies/tl-expected/expected.pc index 45f6643..1624b1d 100644 --- a/nix/dependencies/tl-expected/expected.pc +++ b/nix/dependencies/tl-expected/expected.pc @@ -3,5 +3,5 @@ includedir=${prefix}/include Name: expected Description: TartanLlama's expected -Version: 1.1.0 +Version: @version@ Cflags: -I${includedir}/ diff --git a/nix/dependencies/tl-optional/default.nix b/nix/dependencies/tl-optional/default.nix index dcc5c6b..f1ae2ad 100644 --- a/nix/dependencies/tl-optional/default.nix +++ b/nix/dependencies/tl-optional/default.nix @@ -1,23 +1,30 @@ { - pkgs, - version, + stdenv, + cmake, + fetchFromGitHub }: -pkgs.stdenv.mkDerivation { +stdenv.mkDerivation (self: { pname = "optional"; - inherit version; + version = "1.1.0"; - src = pkgs.fetchFromGitHub { + src = fetchFromGitHub { owner = "TartanLlama"; repo = "optional"; - rev = "v${version}"; + rev = "v${self.version}"; sha256 = "sha256-WPTXTQmzJjAIJI1zM6svZZTO8gP/jt5xDHHRCCu9cmI="; }; strictDeps = true; - nativeBuildInputs = [pkgs.cmake]; + nativeBuildInputs = [cmake]; postInstall = '' - install -Dm644 ${./optional.pc} $out/lib/pkgconfig/optional.pc + mkdir -p $out/lib/pkgconfig + + substitute \ + ${./optional.pc} \ + $out/lib/pkgconfig/optional.pc \ + --subst-var out \ + --subst-var version ''; -} +}) diff --git a/nix/dependencies/tl-optional/optional.pc b/nix/dependencies/tl-optional/optional.pc index 3226647..352bcf5 100644 --- a/nix/dependencies/tl-optional/optional.pc +++ b/nix/dependencies/tl-optional/optional.pc @@ -3,5 +3,5 @@ includedir=${prefix}/include Name: optional Description: TartanLlama's optional -Version: 1.1.0 +Version: @version@ Cflags: -I${includedir}/ diff --git a/nix/package/package.nix b/nix/package/package.nix index 5498634..26dcbbf 100644 --- a/nix/package/package.nix +++ b/nix/package/package.nix @@ -1,11 +1,11 @@ { rootDir, version, + stdenv, meson, ninja, pkg-config, - ctre, catch2_3, tl-optional, tl-expected, @@ -29,7 +29,6 @@ stdenv.mkDerivation { ]; buildInputs = [ - ctre catch2_3 fmt tl-optional @@ -51,15 +50,8 @@ stdenv.mkDerivation { "-Dstrip=true" ]; - buildPhase = '' - meson compile dire - ''; - - installPhase = '' - mkdir -p {$dev,$out}/lib $dev/lib/pkgconfig $dev/include - - cp src/lib/libdire.a $out/lib - cp src/lib/libdire.a $dev/lib + postInstall = '' + mkdir -p $dev/lib/pkgconfig $dev/include cp -r $src/src/lib/include/* $dev/include diff --git a/nix/shell/shells.nix b/nix/shell/shells.nix index 502c641..1d6cdac 100644 --- a/nix/shell/shells.nix +++ b/nix/shell/shells.nix @@ -11,7 +11,6 @@ meson, ninja, pkg-config, - ctre, catch2_3, fmt, tl-optional, @@ -39,7 +38,6 @@ ninja pkg-config - ctre catch2_3 fmt tl-optional diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 9dd46ce..dbae51b 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -44,8 +44,6 @@ if(WIN32) target_compile_definitions(dire-common INTERFACE WIN32_LEAN_AND_MEAN NOMINMAX) endif() -target_link_libraries(dire-common INTERFACE ctre) - if (DIRE_USE_TL_LIBS) target_compile_definitions(dire-common INTERFACE DIRE_USE_TL_LIBS) target_link_libraries(dire-common INTERFACE tl::optional tl::expected) diff --git a/src/lib/meson.build b/src/lib/meson.build index 1df97a7..1dc4a5c 100644 --- a/src/lib/meson.build +++ b/src/lib/meson.build @@ -3,17 +3,7 @@ cmake = import('cmake') build_type_opts = cmake.subproject_options() build_type_opts.add_cmake_defines( { 'CMAKE_BUILD_TYPE': get_option('buildtype').to_upper() } ) -ctre = dependency('ctre', version: '3.8.1', required: false) -if not ctre.found() - ctre_sub = cmake.subproject('ctre', options: build_type_opts, required: true) - message('ctre targets:\n - ' + '\n - '.join(ctre_sub.target_list())) - - ctre = ctre_sub.dependency('ctre') -endif - -local_deps = [ - ctre, -] +local_deps = [ ] if(get_option('use_tl_libs')) add_project_arguments('-DDIRE_USE_TL_LIBS', language: 'cpp') diff --git a/src/lib/src/dire/detail/system_dirs/xdg_user_dirs.cpp b/src/lib/src/dire/detail/system_dirs/xdg_user_dirs.cpp index fe3201d..602f7ab 100644 --- a/src/lib/src/dire/detail/system_dirs/xdg_user_dirs.cpp +++ b/src/lib/src/dire/detail/system_dirs/xdg_user_dirs.cpp @@ -3,8 +3,6 @@ #include #include -#include - #include #include