Skip to content

Instantly share code, notes, and snippets.

@minrk
Created January 16, 2024 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minrk/c0ebc71817be1064483ac572c43936c1 to your computer and use it in GitHub Desktop.
Save minrk/c0ebc71817be1064483ac572c43936c1 to your computer and use it in GitHub Desktop.
#include <stdio.h>
// #include <zlib.h>
#include "libfoo.h"
int main() {
// printf("libz version: %s\n", zlibVersion());
printf("libz version via libfoo: %s\n", zlibv());
}
#include <zlib.h>
const char * zlibv(void) {
return zlibVersion();
}
char * zlibv(void);
package:
name: test-pkg
version: 1.0
outputs:
- name: libfoo
build:
script:
- env | sort
- mkdir -p $PREFIX/lib
- mkdir -p $PREFIX/include
- $CC $CFLAGS $LDFLAGS -lz -shared -o $PREFIX/lib/libfoo${SHLIB_EXT} ${RECIPE_DIR}/libfoo.c
requirements:
build:
- {{ compiler('c') }}
host:
- zlib
test:
commands:
- test -f $PREFIX/lib/libfoo${SHLIB_EXT}
- name: foo_exe
build:
script:
- mkdir -p $PREFIX/bin
- $CC $CFLAGS $LDFLAGS -lfoo ${RECIPE_DIR}/foo_exe.c -o $PREFIX/bin/foo
requirements:
build:
- {{ compiler('c') }}
host:
- {{ pin_subpackage('libfoo', exact=True) }}
run:
- {{ pin_subpackage('libfoo', exact=True) }}
test:
commands:
- test -f $PREFIX/lib/libfoo${SHLIB_EXT}
- test -f $PREFIX/bin/foo
- foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment