Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions projects/conda.org/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
58 changes: 58 additions & 0 deletions projects/github.com/DaanDeMeyer/reproc/package.yml
Original file line number Diff line number Diff line change
@@ -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!"
59 changes: 59 additions & 0 deletions projects/github.com/TartanLlama/expected/package.yml
Original file line number Diff line number Diff line change
@@ -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"
53 changes: 53 additions & 0 deletions projects/github.com/gabime/spdlog/package.yml
Original file line number Diff line number Diff line change
@@ -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
37 changes: 37 additions & 0 deletions projects/github.com/jbeder/yaml-cpp/package.yml
Original file line number Diff line number Diff line change
@@ -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