diff --git a/recipes/gzrt/build.sh b/recipes/gzrt/build.sh index 7108f5a7656cd..c912bc43c9d6e 100644 --- a/recipes/gzrt/build.sh +++ b/recipes/gzrt/build.sh @@ -8,23 +8,33 @@ if [ -z "$PREFIX" ]; then exit 1 fi -# Ensure that the CC environment variable is set (for compiler) -if [ -z "$CC" ]; then - echo "CC environment variable not set, but it is required." - exit 1 +export CFLAGS="${CFLAGS:-} -I${PREFIX}/include" +export LDFLAGS="${LDFLAGS:-} -L${PREFIX}/lib" +export CPATH="${PREFIX}/include" + +# If-body reserved to docker build +if [ ! -f "$(command -v cc)" ]; then + # Ensure that the CC environment variable is set (for compiler) + if [ -z "$CC" ]; then + echo "CC environment variable not set, but it is required." + exit 1 + fi + + # Create a temporary directory + mkdir -p "$SRC_DIR/bin" + + # Create a symlink named cc that points to $CC + CC_PATH="$(which "${CC}")" + if [ ! -x "${CC_PATH}" ]; then + echo "Could not find compiler at: ${CC_PATH}" + exit 1 + fi + ln -sf "${CC_PATH}" "${SRC_DIR}/bin/cc" + + # Prepend the temporary directory to the PATH + export PATH="${SRC_DIR}/bin:${PATH}" fi -export CPATH=${PREFIX}/include - -# Create a temporary directory -mkdir -p $SRC_DIR/bin - -# Create a symlink named cc that points to $CC -ln -sf $(which $CC) $SRC_DIR/bin/cc - -# Prepend the temporary directory to the PATH -export PATH=$SRC_DIR/bin:$PATH - if ! make; then echo "Build failed" exit 1 diff --git a/recipes/gzrt/meta.yaml b/recipes/gzrt/meta.yaml index 7b33204eaec43..703c3fd209dcb 100644 --- a/recipes/gzrt/meta.yaml +++ b/recipes/gzrt/meta.yaml @@ -25,6 +25,10 @@ requirements: test: commands: - gzrecover -h + # Create and test with a corrupted gzip file + - echo "test" | gzip > test.gz + - dd if=/dev/zero of=test.gz bs=1 count=1 seek=5 conv=notrunc + - gzrecover test.gz || [[ $? -eq 1 ]] about: home: https://www.urbanophile.com/arenn/hacking/gzrt @@ -36,3 +40,7 @@ about: gzrecover is a program that will attempt to extract any readable data out of a gzip file that has been corrupted. dev_url: https://github.com/arenn/gzrt + +extra: + recipe-maintainers: + - mazzalab