recipes: Replace 'outdir' with package hash tags
[dragora.git] / recipes / devel / gc / recipe
blob1d93e5afa64d54f65d49d0c405d8525cdf92cef7
1 # Build recipe for gc.
3 # Copyright (c) 2018-2019 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 program=gc
18 version=8.0.4
19 release=1
21 # Define hash tag to categorize the package name output
22 pkghashtag=devel
24 tarname=${program}-${version}.tar.gz
26 # Remote source(s)
27 fetch=http://github.com/ivmai/bdwgc/releases/download/v${version}/$tarname
28 #fetch=http://www.hboehm.info/gc/gc_source/$tarname
30 description="
31 A garbage collector for C and C++.
33 The gc package contains the Boehm-Demers-Weiser conservative garbage
34 collector, which can be used as a garbage collecting replacement for
35 the C malloc function or C++ new operator.  It allows you to allocate
36 memory basically as you normally would, without explicitly deallocating
37 memory that is no longer useful.  The collector automatically recycles
38 memory when it determines that it can no longer be otherwise accessed.
40 The collector is also used by a number of programming language
41 implementations that either use C as intermediate code, want to
42 facilitate easier interoperation with C libraries, or just prefer the
43 simple collector interface.  Alternatively, the garbage collector may
44 be used as a leak detector for C or C++ programs, though that is not
45 its primary goal.
48 homepage=http://www.hboehm.info/gc/
49 license=Custom
51 # Source documentation
52 docs="AUTHORS ChangeLog"        # To complement installed documentation.
53 docsdir="${docdir}/${program}-${version}"
55 build()
57     set -e
59     unpack "${tardir}/$tarname"
61     cd "$srcdir"
63     # Set sane permissions
64     chmod -R u+w,go-w,a+rX-s .
66     ./configure \
67     CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
68      $configure_args \
69      --libdir=/usr/lib${libSuffix} \
70      --mandir=$mandir \
71      --docdir=$docsdir \
72      --enable-cplusplus \
73      --enable-static=no \
74      --enable-shared=yes \
75      --enable-threads=posix \
76      --with-libatomic-ops=yes \
77      --build="$(cc -dumpmachine)"
79     make -j${jobs} V=1
80     make -j${jobs} DESTDIR="$destdir" install-strip
82     # Compress and link man pages (if needed)
83     if test -d "${destdir}/$mandir"
84     then
85         (
86             cd "${destdir}/$mandir"
87             find . -type f -exec lzip -9 '{}' +
88             find . -type l | while read -r file
89             do
90                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
91                 rm -- "$file"
92             done
93         )
94     fi
96     # Copy documentation
97     mkdir -p "${destdir}${docsdir}"
98     cp -p $docs "${destdir}${docsdir}"/