+mamba deps (#2741)

This commit is contained in:
Max Howell 2023-08-09 11:27:04 -04:00 committed by GitHub
parent be58d032aa
commit 2048d99c47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 212 additions and 0 deletions

View file

@ -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

View file

@ -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 <reproc/run.h>
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 <iostream>
#include <reproc++/run.hpp>
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!"

View file

@ -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 <iostream>
#include <tl/expected.hpp>
tl::expected<int, std::string> 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"

View file

@ -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 <iostream>
#include <memory>
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

View file

@ -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 <yaml-cpp/yaml.h>
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