#!/bin/sh # Build script for unzip (Info-ZIP hand-rolled unix/Makefile, not # autotools/cmake/meson). Upstream's own auto-detect step ("flags" target) # runs a battery of trial one-line compiles with a bare $CC and, on # Hammerhead's GCC 14 (which makes -Wimplicit-function-declaration a hard # error by default), every one of those trial compiles fails - so the # detector falls back to "unavailable" for fchmod/fchown/lchown/ # nl_langinfo/dirent/valloc/etc, which then generates broken substitute # macros (e.g. redefining opendir()/readdir() in terms of fopen()/fread()) # that don't even compile. Fix: run the "flags" detection step itself with # -Wno-implicit-function-declaration and -D__EXTENSIONS__ so the trial # compiles succeed and the real capabilities get detected correctly, then # build with that same flags file. set -e cd "$SRCDIR" # NOTE: coral runs build.sh under zsh, not /bin/sh despite the shebang - # zsh's nomatch aborts on a glob with no match (see project gotcha: # never use bare globs under zsh). find+xargs is glob-match-safe. find . -maxdepth 1 -name "*.o" -delete rm -f flags conftest conftest.c unzip funzip unzipsfx zipgrep gmake -f unix/Makefile flags CC="gcc -Wno-implicit-function-declaration -D__EXTENSIONS__" eval gmake -f unix/Makefile unzips ACONF_DEP=flags `cat flags` mkdir -p "$PKGDIR$PREFIX/bin" "$PKGDIR$PREFIX/share/man/man1" install -m 755 unzip funzip unzipsfx "$PKGDIR$PREFIX/bin/" [ -f unzip.1 ] && install -m 644 unzip.1 "$PKGDIR$PREFIX/share/man/man1/" || true [ -f funzip.1 ] && install -m 644 funzip.1 "$PKGDIR$PREFIX/share/man/man1/" || true # unzip - Info-ZIP unzip (needed: coral's own source-extraction step shells # out to "unzip" for .zip source archives, e.g. base/dejavu-fonts). No # unzip binary existed anywhere on Hammerhead prior to this port. # http://www.info-zip.org/UnZip.html [package] name = "unzip" version = "6.0" release = 1 description = "Info-ZIP unzip" url = "http://www.info-zip.org/UnZip.html" license = "Info-ZIP" maintainer = "Chris Tusa " arch = "x86_64" [dependencies] runtime = [] build = [] [[source]] file = "unzip60.tar.gz" urls = ["https://downloads.sourceforge.net/project/infozip/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"] checksum = "036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37" [build] parallel = false