diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e03f2d9..ccba856 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -91,7 +91,6 @@ jobs: [ { runner: macos-14 }, { runner: macos-13 }, - { runner: macos-12 }, ] runs-on: ${{ matrix.build.runner }} env: diff --git a/nix/shell/default.nix b/nix/shell/default.nix index 9ee2af0..41d20a3 100644 --- a/nix/shell/default.nix +++ b/nix/shell/default.nix @@ -1,5 +1,9 @@ -{pkgs, config, ...}: let - shells = pkgs.callPackages ./shells.nix { inherit (config.legacyPackages) tl-optional tl-expected; }; +{ + pkgs, + config, + ... +}: let + shells = pkgs.callPackages ./shells.nix {inherit (config.legacyPackages) tl-optional tl-expected;}; in { devShells = { inherit (shells) ciGcc ciClang devGcc devClang; diff --git a/nix/shell/shells.nix b/nix/shell/shells.nix index 2610006..a673b46 100644 --- a/nix/shell/shells.nix +++ b/nix/shell/shells.nix @@ -1,5 +1,7 @@ { mkShell, + nil, + just, gcc11Stdenv, llvmPackages_16, act, @@ -18,12 +20,6 @@ # # Packages # - baseShellDeps = [ - doxygen - cmake - graphviz - ]; - devPackages = [ act ]; @@ -31,24 +27,33 @@ baseShellAttrs = { hardeningDisable = ["all"]; - packages = - [ - meson - ninja - pkg-config + nativeBuildInputs = [ + just + nil + + meson + ninja + pkg-config - catch2_3 - fmt - tl-optional - tl-expected - ] - ++ baseShellDeps; + doxygen + cmake + graphviz + ]; + + buildInputs = [ + catch2_3 + fmt + tl-optional + tl-expected + ]; }; baseDevShellAttrs = baseShellAttrs // { - packages = baseShellAttrs.packages ++ devPackages; + inherit (baseShellAttrs) buildInputs; + + nativeBuildInputs = baseShellAttrs.nativeBuildInputs ++ devPackages; }; # diff --git a/src/lib/src/dire/linux/base.cpp b/src/lib/src/dire/linux/base.cpp index b53dcb2..dd213ad 100644 --- a/src/lib/src/dire/linux/base.cpp +++ b/src/lib/src/dire/linux/base.cpp @@ -9,39 +9,40 @@ namespace dire namespace detail { -auto cache_dir_from_home(dire::Path home) -> dire::Path + +auto cache_dir_from_home(Path home) -> Path { - return dire::detail::getenv("XDG_CACHE_HOME") - .and_then(dire::detail::system_dirs::non_absolute_path_to_none) + return getenv("XDG_CACHE_HOME") + .and_then(system_dirs::non_absolute_path_to_none) .value_or(home.append(".cache")); } -auto config_dir_from_home(dire::Path home) -> dire::Path +auto config_dir_from_home(Path home) -> Path { - return dire::detail::getenv("XDG_CONFIG_HOME") - .and_then(dire::detail::system_dirs::non_absolute_path_to_none) + return getenv("XDG_CONFIG_HOME") + .and_then(system_dirs::non_absolute_path_to_none) .value_or(home.append(".config")); } -auto executable_dir_from_home(dire::Path home) -> dire::Path +auto executable_dir_from_home(Path home) -> Path { // WARNING: this is not officially supported by the xdg spec - return dire::detail::getenv("XDG_BIN_HOME") - .and_then(dire::detail::system_dirs::non_absolute_path_to_none) + return getenv("XDG_BIN_HOME") + .and_then(system_dirs::non_absolute_path_to_none) .value_or(home.append(".local/bin")); } -auto state_dir_from_home(dire::Path home) -> dire::Path +auto state_dir_from_home(Path home) -> Path { - return dire::detail::getenv("XDG_STATE_HOME") - .and_then(dire::detail::system_dirs::non_absolute_path_to_none) + return getenv("XDG_STATE_HOME") + .and_then(system_dirs::non_absolute_path_to_none) .value_or(home.append(".local/state")); } -auto data_dir_from_home(dire::Path home) -> dire::Path +auto data_dir_from_home(Path home) -> Path { - return dire::detail::getenv("XDG_DATA_HOME") - .and_then(dire::detail::system_dirs::non_absolute_path_to_none) + return getenv("XDG_DATA_HOME") + .and_then(system_dirs::non_absolute_path_to_none) .value_or(home.append(".local/share")); } diff --git a/src/lib/src/dire/mac/base.cpp b/src/lib/src/dire/mac/base.cpp index 49c019f..c8929ea 100644 --- a/src/lib/src/dire/mac/base.cpp +++ b/src/lib/src/dire/mac/base.cpp @@ -4,44 +4,44 @@ #include #include +namespace dire +{ + namespace { -auto concat_cache_dir(dire::Path const& home) -> dire::Path +auto concat_cache_dir(Path const& home) -> Path { return home / "Library" / "Caches"; } -auto concat_config_dir(dire::Path const& home) -> dire::Path +auto concat_config_dir(Path const& home) -> Path { return home / "Library" / "Application Support"; } -auto concat_config_local_dir(dire::Path const& home) -> dire::Path +auto concat_config_local_dir(Path const& home) -> Path { return concat_config_dir(home); } -auto concat_data_dir(dire::Path const& home) -> dire::Path +auto concat_data_dir(Path const& home) -> Path { return concat_config_dir(home); } -auto concat_data_local_dir(dire::Path const& home) -> dire::Path +auto concat_data_local_dir(Path const& home) -> Path { return concat_config_dir(home); } -auto concat_preference_dir(dire::Path const& home) -> dire::Path +auto concat_preference_dir(Path const& home) -> Path { return concat_config_dir(home); } } // namespace -namespace dire -{ - auto BaseDirsBundle::make() -> Optional { auto home = ::dire::home_dir(); diff --git a/src/lib/src/dire/mac/user.cpp b/src/lib/src/dire/mac/user.cpp index 2141e9e..2cb7e7a 100644 --- a/src/lib/src/dire/mac/user.cpp +++ b/src/lib/src/dire/mac/user.cpp @@ -5,53 +5,54 @@ #include #include +namespace dire +{ + namespace { -auto concat_audio_dir(dire::Path const& home) -> dire::Path +auto concat_audio_dir(Path const& home) -> Path { return home / "Music"; } -auto concat_desktop_dir(dire::Path const& home) -> dire::Path +auto concat_desktop_dir(Path const& home) -> Path { return home / "Desktop"; } -auto concat_document_dir(dire::Path const& home) -> dire::Path +auto concat_document_dir(Path const& home) -> Path { return home / "Documents"; } -auto concat_download_dir(dire::Path const& home) -> dire::Path +auto concat_download_dir(Path const& home) -> Path { return home / "Downloads"; } -auto concat_font_dir(dire::Path const& home) -> dire::Path +auto concat_font_dir(Path const& home) -> Path { return home / "Library" / "Fonts"; } -auto concat_picture_dir(dire::Path const& home) -> dire::Path +auto concat_picture_dir(Path const& home) -> Path { return home / "Pictures"; } -auto concat_public_dir(dire::Path const& home) -> dire::Path +auto concat_public_dir(Path const& home) -> Path { return home / "Public"; } -auto concat_video_dir(dire::Path const& home) -> dire::Path +auto concat_video_dir(Path const& home) -> Path { return home / "Movies"; } } // namespace -namespace dire -{ auto UserDirsBundle::make() -> Optional { diff --git a/src/lib/src/dire/windows/user.cpp b/src/lib/src/dire/windows/user.cpp index 51a3cb4..60f2822 100644 --- a/src/lib/src/dire/windows/user.cpp +++ b/src/lib/src/dire/windows/user.cpp @@ -1,3 +1,4 @@ +#include #include #include @@ -7,23 +8,23 @@ namespace dire auto UserDirsBundle::make() -> Optional { - auto home = home_dir(); + auto home = ::dire::home_dir(); if(not home) { return {}; } return UserDirsBundle { - .audio_dir = *audio_dir(), - .desktop_dir = *desktop_dir(), - .document_dir = *document_dir(), - .download_dir = *download_dir(), - .picture_dir = *picture_dir(), - .video_dir = *video_dir(), - .public_dir = *public_dir(), + .audio_dir = *::dire::audio_dir(), + .desktop_dir = *::dire::desktop_dir(), + .document_dir = *::dire::document_dir(), + .download_dir = *::dire::download_dir(), + .picture_dir = *::dire::picture_dir(), + .video_dir = *::dire::video_dir(), + .public_dir = *::dire::public_dir(), .font_dir = {}, - .template_dir = *template_dir(), + .template_dir = *::dire::template_dir(), }; }