From 2048d99c476021533b0ae34e784b73330a68e6e5 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Wed, 9 Aug 2023 11:27:04 -0400 Subject: [PATCH] +mamba deps (#2741) --- projects/conda.org/README.md | 5 ++ .../github.com/DaanDeMeyer/reproc/package.yml | 58 ++++++++++++++++++ .../TartanLlama/expected/package.yml | 59 +++++++++++++++++++ projects/github.com/gabime/spdlog/package.yml | 53 +++++++++++++++++ .../github.com/jbeder/yaml-cpp/package.yml | 37 ++++++++++++ 5 files changed, 212 insertions(+) create mode 100644 projects/github.com/DaanDeMeyer/reproc/package.yml create mode 100644 projects/github.com/TartanLlama/expected/package.yml create mode 100644 projects/github.com/gabime/spdlog/package.yml create mode 100644 projects/github.com/jbeder/yaml-cpp/package.yml diff --git a/projects/conda.org/README.md b/projects/conda.org/README.md index 1f2068f3c2..adbd353f21 100644 --- a/projects/conda.org/README.md +++ b/projects/conda.org/README.md @@ -1,6 +1,11 @@ # fit & finish * pkgs are installed to `~/.conda/pkgs` +* `conda init` is called during pkging so that `conda` will work without + forcing you to install its shell hooks. + + > obv. you still need these shell hooks for `conda`’s environment system to + > work, see the [#tips](#tips) section. # tips diff --git a/projects/github.com/DaanDeMeyer/reproc/package.yml b/projects/github.com/DaanDeMeyer/reproc/package.yml new file mode 100644 index 0000000000..fba716fc55 --- /dev/null +++ b/projects/github.com/DaanDeMeyer/reproc/package.yml @@ -0,0 +1,58 @@ +distributable: + url: https://github.com/DaanDeMeyer/reproc/archive/refs/tags/v{{version}}.tar.gz + strip-components: 1 + +versions: + github: DaanDeMeyer/reproc + +build: + dependencies: + tea.xyz/gx/cc: c99 + tea.xyz/gx/make: '*' + cmake.org: ^3 + working-directory: build + script: + - cmake .. + -DCMAKE_INSTALL_PREFIX={{prefix}} + -DREPROC++=ON + -DBUILD_SHARED_LIBS=ON + -DCMAKE_BUILD_TYPE=Release + + - make --jobs {{hw.concurrency}} install + +test: + dependencies: + tea.xyz/gx/cc: c99 + script: + - fixture: | + #include + + int main(void) { + const char *args[] = { "echo", "Hello, world!", NULL }; + return reproc_run(args, (reproc_options) { 0 }); + } + run: | + mv $FIXTURE b.c + cc b.c -lreproc + out="$(./a.out)" + test "$out" = "Hello, world!" + + - fixture: | + #include + #include + + int main(void) { + int status = -1; + std::error_code ec; + + const char *args[] = { "echo", "Hello, world!", NULL }; + reproc::options options; + + std::tie(status, ec) = reproc::run(args, options); + return ec ? ec.value() : status; + } + run: | + mv $FIXTURE b.cpp + c++ b.cpp -lreproc++ -std=c++11 + out="$(./a.out)" + test "$out" = "Hello, world!" diff --git a/projects/github.com/TartanLlama/expected/package.yml b/projects/github.com/TartanLlama/expected/package.yml new file mode 100644 index 0000000000..d78130d495 --- /dev/null +++ b/projects/github.com/TartanLlama/expected/package.yml @@ -0,0 +1,59 @@ +distributable: + url: https://github.com/TartanLlama/expected/archive/refs/tags/v{{version}}.tar.gz + strip-components: 1 + +versions: + github: TartanLlama/expected + +aka: tl-expected + + +build: + dependencies: + tea.xyz/gx/cc: c99 + tea.xyz/gx/make: '*' + cmake.org: ^3 + working-directory: build + script: + - cmake .. + -DCMAKE_INSTALL_PREFIX={{prefix}} + -DCMAKE_BUILD_TYPE=Release + + - make --jobs {{ hw.concurrency }} install + +test: + dependencies: + tea.xyz/gx/cc: c99 + fixture: | + #include + #include + + tl::expected divide(int a, int b) { + if (b == 0) { + return tl::make_unexpected("Division by zero"); + } + return a / b; + } + + int main() { + auto result = divide(10, 5); + if (result) { + std::cout << "Result: " << *result << std::endl; + } else { + std::cout << "Error: " << result.error() << std::endl; + } + + result = divide(2, 0); + if (result) { + std::cout << "Result: " << *result << std::endl; + } else { + std::cout << "Error: " << result.error() << std::endl; + } + return 0; + } + script: | + mv $FIXTURE b.cpp + c++ b.cpp -std=c++17 + out="$(./a.out)" + test "$out" = "Result: 2 + Error: Division by zero" diff --git a/projects/github.com/gabime/spdlog/package.yml b/projects/github.com/gabime/spdlog/package.yml new file mode 100644 index 0000000000..38fa0d6ad0 --- /dev/null +++ b/projects/github.com/gabime/spdlog/package.yml @@ -0,0 +1,53 @@ +distributable: + url: https://github.com/gabime/spdlog/archive/v{{version}}.tar.gz + strip-components: 1 + +versions: + github: gabime/spdlog + +dependencies: + fmt.dev: ^10 + +build: + dependencies: + tea.xyz/gx/cc: c99 + tea.xyz/gx/make: '*' + cmake.org: ^3 + working-directory: build + script: + - 'sed -i.bak "s|// #define SPDLOG_FMT_EXTERNAL|#define SPDLOG_FMT_EXTERNAL|" ../include/spdlog/tweakme.h' + + - cmake .. + -DSPDLOG_BUILD_BENCH=OFF + -DSPDLOG_BUILD_TESTS=OFF + -DSPDLOG_FMT_EXTERNAL=ON + -DSPDLOG_BUILD_SHARED=ON + -DCMAKE_INSTALL_PREFIX={{prefix}} + -DCMAKE_BUILD_TYPE=Release + + - make --jobs {{ hw.concurrency }} install + +test: + dependencies: + tea.xyz/gx/cc: c99 + fixture: | + #include "spdlog/sinks/basic_file_sink.h" + #include + #include + int main() + { + try { + auto console = spdlog::basic_logger_mt("basic_logger", "basic-log.txt"); + console->info("Test"); + } + catch (const spdlog::spdlog_ex &ex) + { + std::cout << "Log init failed: " << ex.what() << std::endl; + return 1; + } + } + script: | + mv $FIXTURE b.cpp + c++ -std=c++11 b.cpp -lfmt + ./a.out + cat basic-log.txt | grep Test diff --git a/projects/github.com/jbeder/yaml-cpp/package.yml b/projects/github.com/jbeder/yaml-cpp/package.yml new file mode 100644 index 0000000000..c115532653 --- /dev/null +++ b/projects/github.com/jbeder/yaml-cpp/package.yml @@ -0,0 +1,37 @@ +distributable: + url: https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-{{version}}.tar.gz + strip-components: 1 + +versions: + github: jbeder/yaml-cpp + strip: /^yaml-cpp-/ + +build: + dependencies: + tea.xyz/gx/cc: c99 + tea.xyz/gx/make: '*' + cmake.org: ^3 + working-directory: build + script: + - cmake .. + -DCMAKE_INSTALL_PREFIX={{prefix}} + -DYAML_BUILD_SHARED_LIBS=ON + -DYAML_CPP_BUILD_TESTS=OFF + -DCMAKE_BUILD_TYPE=Release + + - make --jobs {{hw.concurrency}} install + +test: + dependencies: + tea.xyz/gx/cc: c99 + fixture: | + #include + int main() { + YAML::Node node = YAML::Load("[0, 0, 0]"); + node[0] = 1; + return 0; + } + script: | + mv $FIXTURE b.cpp + c++ -std=c++11 -lyaml-cpp b.cpp + ./a.out