|
root / devel / unzip
unzip Plain Text 57 lines 2.3 KB
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/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 <chris.tusa@leafscale.com>"
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