Skip to content

Commit

Permalink
Update gzrt to v0.9.1 (#52870)
Browse files Browse the repository at this point in the history
* Update gzrt to v0.9.1

* Fix patch

* Update meta.yaml

* Update build.sh
  • Loading branch information
mencian authored Dec 18, 2024
1 parent 7d1818a commit f621b02
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 31 deletions.
13 changes: 13 additions & 0 deletions recipes/gzrt/0001-Makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/Makefile b/Makefile
index 939947c..df5fb6a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
all: gzrecover

gzrecover: gzrecover.o
- cc -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 gzrecover.c -lz -o gzrecover
+ $(CC) -O3 -Wall -Wno-format -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 gzrecover.c -o gzrecover -lz

clean:
rm gzrecover
31 changes: 9 additions & 22 deletions recipes/gzrt/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
# Exit on error
set -xe

export INCLUDE_PATH="${PREFIX}/include"
export LIBRARY_PATH="${PREFIX}/lib"
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"

mkdir -p "${PREFIX}/bin"

if [ -z "$PREFIX" ]; then
echo "PREFIX environment variable not set"
exit 1
fi

export CFLAGS="${CFLAGS:-} -I${PREFIX}/include"
export CFLAGS="${CFLAGS:-} -O3 -I${PREFIX}/include"
export LDFLAGS="${LDFLAGS:-} -L${PREFIX}/lib"
export CPATH="${PREFIX}/include"

Expand All @@ -35,24 +41,5 @@ if [ ! -f "$(command -v cc)" ]; then
export PATH="${SRC_DIR}/bin:${PATH}"
fi

if ! make -j"${CPU_COUNT}"; then
echo "Build failed"
exit 1
fi

if [ ! -f gzrecover ]; then
echo "Build did not produce gzrecover binary"
exit 1
fi

chmod 755 gzrecover

if ! mkdir -p "$PREFIX/bin"; then
echo "Failed to create bin directory"
exit 1
fi

if ! cp gzrecover "$PREFIX/bin/"; then
echo "Failed to install gzrecover"
exit 1
fi
make CC="${CC}" -j"${CPU_COUNT}"
install -v -m 0755 gzrecover "${PREFIX}/bin"
22 changes: 13 additions & 9 deletions recipes/gzrt/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{% set version = "0.8" %} # latest release on 2013-10-03
{% set sha256 = "b0b7dc53dadd8309ad9f43d6d6be7ac502c68ef854f1f9a15bd7f543e4571fee" %}
{% set version = "0.9.1" %}
{% set sha256 = "97543b5c11bcbfd1fd42671c61fae11fa3040ba8235641ae77ce3fb91c2d5863" %}

package:
name: gzrt
version: {{ version }}

source:
url: https://www.urbanophile.com/arenn/hacking/gzrt/gzrt-{{ version }}.tar.gz
url: https://github.com/arenn/gzrt/archive/refs/tags/v{{ version }}.tar.gz
sha256: {{ sha256 }}
patches:
- 0001-Makefile.patch

build:
number: 1
number: 0
run_exports:
- {{ pin_subpackage('gzrt', max_pin="x.x") }}

Expand All @@ -31,18 +33,20 @@ test:
- gzrecover test.gz || [[ $? -eq 1 ]]

about:
home: https://www.urbanophile.com/arenn/hacking/gzrt
summary: "Unofficial build of the gzip Recovery Toolkit aka gzrecover"
license: GPL-2.0-only
home: "https://www.urbanophile.com/arenn/hacking/gzrt"
summary: "Unofficial build of the gzip Recovery Toolkit aka gzrecover."
license: "GPL-2.0-only"
license_family: GPL
license_file: gpl-2.0.txt
license_file: "gpl-2.0.txt"
description: |
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
dev_url: "https://github.com/arenn/gzrt"
doc_url: "https://github.com/arenn/gzrt/blob/v{{ version }}/README"

extra:
additional-platforms:
- linux-aarch64
- osx-arm64
recipe-maintainers:
- mazzalab

0 comments on commit f621b02

Please sign in to comment.