From 473c97cda44b95f5cea08a0cdd566e602df564db Mon Sep 17 00:00:00 2001 From: James Hilliard Date: Thu, 21 Apr 2022 14:24:01 -0600 Subject: [PATCH] meson: fix argp-standalone wrap and find_library Signed-off-by: James Hilliard [james.hilliard1@gmail.com: backport from upstream commit 473c97cda44b95f5cea08a0cdd566e602df564db] --- .github/workflows/main.yml | 27 --------------------------- meson.build | 6 +++--- subprojects/argp-standalone.wrap | 7 +++++++ 3 files changed, 10 insertions(+), 30 deletions(-) create mode 100644 subprojects/argp-standalone.wrap diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c49806f..35667af 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,25 +35,11 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/checkout@v2 - with: - repository: wolfv/argp-standalone - path: argp-standalone - - name: Install mamba uses: mamba-org/provision-with-micromamba@main with: environment-file: .github/environment.yml - - name: Compile argp-standalone - shell: cmd /C CALL {0} - run: | - CALL micromamba activate zchunk_test_env - cd argp-standalone - meson setup builddir - meson compile -C builddir --prefix=%CONDA_PREFIX%\Library - meson install -C builddir - - name: Compile zchunk shell: cmd /C CALL {0} run: | @@ -75,11 +61,6 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/checkout@v2 - with: - repository: wolfv/argp-standalone - path: argp-standalone - - uses: actions/setup-python@v1 with: python-version: '3.x' @@ -87,14 +68,6 @@ jobs: - name: Install meson and ninja run: pip install meson ninja - - name: Compile argp-standalone - shell: cmd /C CALL {0} - run: | - cd argp-standalone - meson setup builddir - meson compile -C builddir - meson install -C builddir - - name: Compile zchunk shell: cmd /C CALL {0} run: | diff --git a/meson.build b/meson.build index 1c6b32d..aa7dd25 100644 --- a/meson.build +++ b/meson.build @@ -58,10 +58,10 @@ endif # argp-standalone dependency (if required) if build_machine.system() == 'windows' or build_machine.system() == 'darwin' or build_machine.system() == 'freebsd' or not cc.links('#include \nstatic error_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}') - if fs.is_dir(join_paths([get_option('prefix'), 'include'])) - inc += include_directories(join_paths([get_option('prefix'), 'include'])) + argplib = cc.find_library('argp', has_headers : ['argp.h'], required: false) + if not argplib.found() + argplib = dependency('argp-standalone') endif - argplib = cc.find_library('argp', dirs : join_paths([get_option('prefix'), 'lib'])) else argplib = dependency('', required : false) endif diff --git a/subprojects/argp-standalone.wrap b/subprojects/argp-standalone.wrap new file mode 100644 index 0000000..14c0b63 --- /dev/null +++ b/subprojects/argp-standalone.wrap @@ -0,0 +1,7 @@ +[wrap-git] +directory = argp-standalone-1.4.1 +url = https://github.com/argp-standalone/argp-standalone.git +revision = 21855f34ec9997c37e1a08cd69497336513a5800 + +[provide] +dependency_names = argp-standalone -- 2.25.1