From 133654b02054b7a797f10aff6244b98c4d1e7e50 Mon Sep 17 00:00:00 2001 From: Mars Date: Mon, 5 Aug 2024 15:28:15 -0400 Subject: [PATCH] updates and stuff --- _sources/generated.json | 122 ++++++++++++++++++++++++++++++++++++++++ _sources/generated.nix | 70 +++++++++++++++++++++++ flake.nix | 35 ++++++------ meson.build | 5 +- nvfetcher.toml | 19 +++++++ 5 files changed, 230 insertions(+), 21 deletions(-) create mode 100644 _sources/generated.json create mode 100644 _sources/generated.nix create mode 100644 nvfetcher.toml diff --git a/_sources/generated.json b/_sources/generated.json new file mode 100644 index 0000000..7dbb035 --- /dev/null +++ b/_sources/generated.json @@ -0,0 +1,122 @@ +{ + "curl": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "curl", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "curl", + "repo": "curl", + "rev": "curl-8_9_1", + "sha256": "sha256-b+Giv6n3LCjOIvUeQawR9qrMBTuz8emRRdhbb2XO5ZU=", + "type": "github" + }, + "version": "curl-8_9_1" + }, + "fmt": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "fmt", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "fmtlib", + "repo": "fmt", + "rev": "11.0.2", + "sha256": "sha256-IKNt4xUoVi750zBti5iJJcCk3zivTt7nU12RIf8pM+0=", + "type": "github" + }, + "version": "11.0.2" + }, + "reflect-cpp": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "reflect-cpp", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "getml", + "repo": "reflect-cpp", + "rev": "v0.13.0", + "sha256": "sha256-dEqdPk5ixnNILxTcdSAOhzP8fzeefMu6pqrL/WgnPlE=", + "type": "github" + }, + "version": "v0.13.0" + }, + "sdbus-cpp": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "sdbus-cpp", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "kistler-group", + "repo": "sdbus-cpp", + "rev": "v2.0.0", + "sha256": "sha256-W8V5FRhV3jtERMFrZ4gf30OpIQLYoj2yYGpnYOmH2+g=", + "type": "github" + }, + "version": "v2.0.0" + }, + "tomlplusplus": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "tomlplusplus", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "marzer", + "repo": "tomlplusplus", + "rev": "v3.4.0", + "sha256": "sha256-h5tbO0Rv2tZezY58yUbyRVpsfRjY3i+5TPkkxr6La8M=", + "type": "github" + }, + "version": "v3.4.0" + }, + "yyjson": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "yyjson", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "ibireme", + "repo": "yyjson", + "rev": "0.10.0", + "sha256": "sha256-mp9Oz08qTyhj3P6F1d81SX96vamUY/JWpD2DTYR+v04=", + "type": "github" + }, + "version": "0.10.0" + } +} \ No newline at end of file diff --git a/_sources/generated.nix b/_sources/generated.nix new file mode 100644 index 0000000..738696d --- /dev/null +++ b/_sources/generated.nix @@ -0,0 +1,70 @@ +# This file was generated by nvfetcher, please do not modify it manually. +{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }: +{ + curl = { + pname = "curl"; + version = "curl-8_9_1"; + src = fetchFromGitHub { + owner = "curl"; + repo = "curl"; + rev = "curl-8_9_1"; + fetchSubmodules = false; + sha256 = "sha256-b+Giv6n3LCjOIvUeQawR9qrMBTuz8emRRdhbb2XO5ZU="; + }; + }; + fmt = { + pname = "fmt"; + version = "11.0.2"; + src = fetchFromGitHub { + owner = "fmtlib"; + repo = "fmt"; + rev = "11.0.2"; + fetchSubmodules = false; + sha256 = "sha256-IKNt4xUoVi750zBti5iJJcCk3zivTt7nU12RIf8pM+0="; + }; + }; + reflect-cpp = { + pname = "reflect-cpp"; + version = "v0.13.0"; + src = fetchFromGitHub { + owner = "getml"; + repo = "reflect-cpp"; + rev = "v0.13.0"; + fetchSubmodules = false; + sha256 = "sha256-dEqdPk5ixnNILxTcdSAOhzP8fzeefMu6pqrL/WgnPlE="; + }; + }; + sdbus-cpp = { + pname = "sdbus-cpp"; + version = "v2.0.0"; + src = fetchFromGitHub { + owner = "kistler-group"; + repo = "sdbus-cpp"; + rev = "v2.0.0"; + fetchSubmodules = false; + sha256 = "sha256-W8V5FRhV3jtERMFrZ4gf30OpIQLYoj2yYGpnYOmH2+g="; + }; + }; + tomlplusplus = { + pname = "tomlplusplus"; + version = "v3.4.0"; + src = fetchFromGitHub { + owner = "marzer"; + repo = "tomlplusplus"; + rev = "v3.4.0"; + fetchSubmodules = false; + sha256 = "sha256-h5tbO0Rv2tZezY58yUbyRVpsfRjY3i+5TPkkxr6La8M="; + }; + }; + yyjson = { + pname = "yyjson"; + version = "0.10.0"; + src = fetchFromGitHub { + owner = "ibireme"; + repo = "yyjson"; + rev = "0.10.0"; + fetchSubmodules = false; + sha256 = "sha256-mp9Oz08qTyhj3P6F1d81SX96vamUY/JWpD2DTYR+v04="; + }; + }; +} diff --git a/flake.nix b/flake.nix index c0bf522..fcd9f3c 100644 --- a/flake.nix +++ b/flake.nix @@ -25,17 +25,23 @@ then pkgs.stdenvAdapters.useMoldLinker pkgs.llvmPackages_18.stdenv else pkgs.llvmPackages_18.stdenv; - reflect-cpp = stdenv.mkDerivation rec { - name = "reflect-cpp"; - version = "0.13.0"; + sources = import ./_sources/generated.nix { + inherit (pkgs) fetchFromGitHub fetchgit fetchurl dockerTools; + }; - src = pkgs.fetchFromGitHub { - owner = "getml"; - repo = "reflect-cpp"; - rev = "v${version}"; - hash = "sha256-dEqdPk5ixnNILxTcdSAOhzP8fzeefMu6pqrL/WgnPlE="; + mkPkg = name: + pkgs.pkgsStatic.${name}.overrideAttrs { + inherit (sources.${name}) pname version src; }; + fmt = mkPkg "fmt"; + sdbus-cpp = mkPkg "sdbus-cpp"; + tomlplusplus = mkPkg "tomlplusplus"; + yyjson = mkPkg "yyjson"; + + reflect-cpp = stdenv.mkDerivation { + inherit (sources.reflect-cpp) pname version src; + nativeBuildInputs = with pkgs; [cmake ninja pkg-config]; cmakeFlags = [ @@ -45,20 +51,10 @@ ]; }; - sdbus-cpp = pkgs.sdbus-cpp.overrideAttrs rec { - version = "2.0.0"; - src = pkgs.fetchFromGitHub { - owner = "kistler-group"; - repo = "sdbus-cpp"; - rev = "v${version}"; - hash = "sha256-W8V5FRhV3jtERMFrZ4gf30OpIQLYoj2yYGpnYOmH2+g="; - }; - }; - deps = with pkgs.pkgsStatic; [ curl - fmt_11 + fmt libiconv tomlplusplus yyjson @@ -134,6 +130,7 @@ lldb meson ninja + nvfetcher pkg-config unzip nixvim.packages.${system}.default diff --git a/meson.build b/meson.build index 2da64c5..074043d 100644 --- a/meson.build +++ b/meson.build @@ -28,6 +28,7 @@ if host_machine.system() == 'darwin' '-Wno-pre-c++20-compat-pedantic', '-Wno-switch-default', '-Wunused-function', + '-fvisibility=hidden' ]), language: 'objcpp' ) @@ -43,7 +44,8 @@ common_cpp_args = [ '-Wno-padded', '-Wno-pre-c++20-compat-pedantic', '-Wno-switch-default', - '-Wunused-function' + '-Wunused-function', + '-fvisibility=hidden' ] if host_machine.system() == 'windows' @@ -111,4 +113,3 @@ executable( link_args: link_args, dependencies: deps ) - diff --git a/nvfetcher.toml b/nvfetcher.toml new file mode 100644 index 0000000..ed810dd --- /dev/null +++ b/nvfetcher.toml @@ -0,0 +1,19 @@ +[fmt] +src.github = "fmtlib/fmt" +fetch.github = "fmtlib/fmt" + +[reflect-cpp] +src.github = "getml/reflect-cpp" +fetch.github = "getml/reflect-cpp" + +[sdbus-cpp] +src.github = "kistler-group/sdbus-cpp" +fetch.github = "kistler-group/sdbus-cpp" + +[tomlplusplus] +src.github = "marzer/tomlplusplus" +fetch.github = "marzer/tomlplusplus" + +[yyjson] +src.github = "ibireme/yyjson" +fetch.github = "ibireme/yyjson"