diff --git a/projects/github.com/argp-standalone/argp-standalone/package.yml b/projects/github.com/argp-standalone/argp-standalone/package.yml new file mode 100644 index 0000000000..49638e7778 --- /dev/null +++ b/projects/github.com/argp-standalone/argp-standalone/package.yml @@ -0,0 +1,29 @@ +distributable: + url: https://github.com/argp-standalone/argp-standalone/archive/refs/tags/{{version}}.tar.gz + strip-components: 1 + +versions: + github: argp-standalone/argp-standalone/tags + +# Standalone GNU argp argument parser, for systems whose libc does not provide +# argp.h (macOS, FreeBSD, musl). On glibc Linux it is not needed but the build +# is harmless. + +build: + dependencies: + mesonbuild.com: "*" + ninja-build.org: "*" + freedesktop.org/pkg-config: "*" + script: + - meson setup build $ARGS + - meson compile -C build --jobs {{ hw.concurrency }} + - meson install -C build + env: + ARGS: + - --prefix={{prefix}} + - --buildtype=release + - --default-library=static + +test: + - cc test.c -I{{prefix}}/include -L{{prefix}}/lib -largp -o test + - ./test --version | grep -F 1.0 diff --git a/projects/github.com/argp-standalone/argp-standalone/test.c b/projects/github.com/argp-standalone/argp-standalone/test.c new file mode 100644 index 0000000000..f27e8b847e --- /dev/null +++ b/projects/github.com/argp-standalone/argp-standalone/test.c @@ -0,0 +1,10 @@ +#include +#include + +const char *argp_program_version = "argp-standalone-test 1.0"; + +int main(int argc, char **argv) +{ + error_t err = argp_parse(0, argc, argv, 0, 0, 0); + return err ? 1 : 0; +} diff --git a/projects/github.com/zchunk/zchunk/package.yml b/projects/github.com/zchunk/zchunk/package.yml new file mode 100644 index 0000000000..38e4a73a6d --- /dev/null +++ b/projects/github.com/zchunk/zchunk/package.yml @@ -0,0 +1,67 @@ +distributable: + url: https://github.com/zchunk/zchunk/archive/refs/tags/{{version}}.tar.gz + strip-components: 1 + +versions: + github: zchunk/zchunk/tags + +# Reference C implementation of the zchunk container format used by Fedora's +# DNF/librepo for delta-downloaded repository metadata. + +dependencies: + openssl.org: ^1.1 + facebook.com/zstd: ^1 + curl.se: ^8 + +build: + dependencies: + mesonbuild.com: "*" + ninja-build.org: "*" + freedesktop.org/pkg-config: "*" + script: + # macOS' libc has no , so zchunk's meson build falls back to + # the `argp-standalone` subproject shipped in upstream's tarball. The + # upstream wrap file is `wrap-git`, which needs git+network at build + # time; rewrite it as `wrap-file` so meson can fetch a verified + # tarball via curl (already available in our build env) and build the + # sources from source as a meson subproject. Linux glibc provides + # argp.h directly and never touches the subproject. + - run: | + cat > subprojects/argp-standalone.wrap <<'WRAP' + [wrap-file] + directory = argp-standalone-1.5.0 + source_url = https://github.com/argp-standalone/argp-standalone/archive/refs/tags/1.5.0.tar.gz + source_filename = argp-standalone-1.5.0.tar.gz + source_hash = c29eae929dfebd575c38174f2c8c315766092cec99a8f987569d0cad3c6d64f6 + + [provide] + dependency_names = argp-standalone + WRAP + if: darwin + - meson setup build $ARGS + - meson compile -C build --jobs {{ hw.concurrency }} + - meson install -C build + env: + ARGS: + - --prefix={{prefix}} + - --buildtype=release + - -Ddocs=false + - -Dtests=false + - --wrap-mode=default + - --force-fallback-for=argp-standalone + +provides: + - bin/zck + - bin/unzck + - bin/zck_delta_size + - bin/zck_gen_zdict + - bin/zck_read_header + - bin/zckdl + +test: + - echo "hello zchunk roundtrip" > greeting.txt + - zck greeting.txt + - test -f greeting.txt.zck + - rm greeting.txt + - unzck greeting.txt.zck + - test "$(cat greeting.txt)" = "hello zchunk roundtrip"