Mercurial > vanilla
comparison compression/libarchive/libarchive.sh @ 581:336550fef494
compression/libarchive: rename from lib/libarchive
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 08 Jul 2019 20:25:00 +0200 |
parents | core/libarchive/libarchive.sh@668a698027f2 |
children | 0194a200012b |
comparison
equal
deleted
inserted
replaced
580:668a698027f2 | 581:336550fef494 |
---|---|
1 #!/bin/sh | |
2 # | |
3 # Copyright (c) 2019 FirstName LastName <mailaddress> | |
4 # | |
5 # Permission to use, copy, modify, and/or distribute this software for any | |
6 # purpose with or without fee is hereby granted, provided that the above | |
7 # copyright notice and this permission notice appear in all copies. | |
8 # | |
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
16 # | |
17 | |
18 PKGNAME=libarchive | |
19 PKGVERSION=3.3.3 | |
20 PKGREVISION=1 | |
21 PKGLICENSE="BSD" | |
22 PKGSUMMARY="multi-format archive and compression library" | |
23 PKGDOWNLOAD="http://www.libarchive.org/downloads/$PKGNAME-$PKGVERSION.tar.gz" | |
24 PKGOPTIONS="ACL BZIP2 LZ4 LZMA LZO SSL ZLIB ZSTD XML" | |
25 | |
26 : ${CHOST:=$(uname -m)-linux-musl} | |
27 : ${CBUILD:=$(uname -m)-linux-musl} | |
28 : ${CC:=clang} | |
29 : ${CFLAGS:=-O2} | |
30 : ${CXX:=clang++} | |
31 : ${CXXFLAGS:=-O2} | |
32 : ${LDFLAGS:=} | |
33 : ${LIBS:=} | |
34 : ${ACL:=yes} | |
35 : ${BZIP2:=yes} | |
36 : ${LZ4:=yes} | |
37 : ${LZMA:=yes} | |
38 : ${LZO:=no} # upstream default as of 3.3.3 | |
39 : ${SSL:=yes} | |
40 : ${XML:=yes} | |
41 : ${ZLIB:=yes} | |
42 : ${ZSTD:=yes} | |
43 | |
44 if [ "$ACL" = "yes" ]; then | |
45 PKGDEPENDS="core/acl $PKGDEPENDS" | |
46 with_acl="--enable-acl" | |
47 else | |
48 with_acl="--disable-acl" | |
49 fi | |
50 | |
51 if [ "$BZIP2" = "yes" ]; then | |
52 PKGDEPENDS="compression/bzip2 $PKGDEPENDS" | |
53 with_bzip2="--with-bz2lib" | |
54 else | |
55 with_bzip2="--without-bz2lib" | |
56 fi | |
57 | |
58 if [ "$XML" = "yes" ]; then | |
59 PKGDEPENDS="lib/expat $PKGDEPENDS" | |
60 with_expat="--with-expat" | |
61 else | |
62 with_expat="--without-expat" | |
63 fi | |
64 | |
65 if [ "$LZ4" = "yes" ]; then | |
66 PKGDEPENDS="compression/lz4 $PKGDEPENDS" | |
67 with_lz4="--with-lz4" | |
68 else | |
69 with_lz4="--without-lz4" | |
70 fi | |
71 | |
72 if [ "$LZMA" = "yes" ]; then | |
73 PKGDEPENDS="core/xz $PKGDEPENDS" | |
74 with_lzma="--with-lzma" | |
75 else | |
76 with_lzma="--without-lzma" | |
77 fi | |
78 | |
79 if [ "$LZO" = "yes" ]; then | |
80 PKGDEPENDS="lib/lzo $PKGDEPENDS" | |
81 with_lzo="--with-lzo2" | |
82 else | |
83 with_lzo="--without-lzo2" | |
84 fi | |
85 | |
86 if [ "$NETTLE" = "yes" ]; then | |
87 PKGDEPENDS="lib/nettle $PKGDEPENDS" | |
88 with_nettle="--with-nettle" | |
89 else | |
90 with_nettle="--without-nettle" | |
91 fi | |
92 | |
93 if [ "$SSL" = "yes" ]; then | |
94 PKGDEPENDS="network/openssl $PKGDEPENDS" | |
95 with_ssl="--with-openssl" | |
96 else | |
97 with_ssl="--without-openssl" | |
98 fi | |
99 | |
100 if [ "$ZSTD" = "yes" ]; then | |
101 PKGDEPENDS="core/zstd $PKGDEPENDS" | |
102 with_zstd="--with-zstd" | |
103 else | |
104 with_zstd="--without-zstd" | |
105 fi | |
106 | |
107 build() | |
108 { | |
109 rm -rf $PKGNAME-$PKGVERSION | |
110 tar xvaf $PKGNAME-$PKGVERSION.tar.gz | |
111 pushd $PKGNAME-$PKGVERSION | |
112 | |
113 CC="$CC" \ | |
114 CFLAGS="$CFLAGS" \ | |
115 CXX="$CXX" \ | |
116 CXXFLAGS="$CXXFLAGS" \ | |
117 LDFLAGS="$LDFLAGS" \ | |
118 LIBS="$LIBS" \ | |
119 ./configure \ | |
120 --build=$CBUILD \ | |
121 --host=$CHOST \ | |
122 --prefix= \ | |
123 --disable-static \ | |
124 --enable-shared \ | |
125 --enable-bsdtar=shared \ | |
126 --enable-bsdcat=shared \ | |
127 --enable-bsdcpio=shared \ | |
128 --without-xml2 \ | |
129 $with_acl \ | |
130 $with_bzip2 \ | |
131 $with_expat \ | |
132 $with_lz4 \ | |
133 $with_lzma \ | |
134 $with_lzo \ | |
135 $with_nettle \ | |
136 $with_ssl \ | |
137 $with_zstd | |
138 | |
139 make | |
140 make install DESTDIR=$DESTDIR | |
141 rm -f $DESTDIR/lib/libarchive.la | |
142 | |
143 popd | |
144 rm -rf $PKGNAME-$PKGVERSION | |
145 } |