meson: fix argp-standalone wrap and find_library
authorJames Hilliard <james.hilliard1@gmail.com>
Thu, 21 Apr 2022 20:24:01 +0000 (14:24 -0600)
committerJames Hilliard <james.hilliard1@gmail.com>
Sun, 1 May 2022 21:57:00 +0000 (15:57 -0600)
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
.github/workflows/main.yml
meson.build
subprojects/argp-standalone.wrap [new file with mode: 0644]

index c49806fb35ef863fb1fed19626603c2127ab2925..35667af8e505dafcb352b168e4e2fabbd42565da 100644 (file)
@@ -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: |
index 1c6b32db3ad90dfd16ac4c5a9bb9dc5b01dceb70..aa7dd252e3440c2e14b3c67d4b97751d1715a347 100644 (file)
@@ -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 <argp.h>\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 (file)
index 0000000..14c0b63
--- /dev/null
@@ -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