recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / devel / gc / recipe
blob3af465272f325c5a6d49829ca3f7a2e728fb500e
1 # Build recipe for gc.
3 # Copyright (c) 2018-2019, 2022 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 # Exit immediately on any error
18 set -e
20 program=gc
21 version=8.0.6
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=devel
27 tarname=${program}-${version}.tar.gz
29 # Remote source(s)
30 fetch=https://github.com/ivmai/bdwgc/releases/download/v${version}/$tarname
31 #fetch=https://www.hboehm.info/gc/gc_source/$tarname
33 description="
34 A garbage collector for C and C++.
36 The gc package contains the Boehm-Demers-Weiser conservative garbage
37 collector, which can be used as a garbage collecting replacement for
38 the C malloc function or C++ new operator.  It allows you to allocate
39 memory basically as you normally would, without explicitly deallocating
40 memory that is no longer useful.  The collector automatically recycles
41 memory when it determines that it can no longer be otherwise accessed.
43 The collector is also used by a number of programming language
44 implementations that either use C as intermediate code, want to
45 facilitate easier interoperation with C libraries, or just prefer the
46 simple collector interface.  Alternatively, the garbage collector may
47 be used as a leak detector for C or C++ programs, though that is not
48 its primary goal.
51 homepage=https://www.hboehm.info/gc/
52 license=Custom
54 # Source documentation
55 docs="AUTHORS ChangeLog"        # To complement installed documentation.
56 docsdir="${docdir}/${program}-${version}"
58 build()
60     unpack "${tardir}/$tarname"
62     cd "$srcdir"
64     # Set sane permissions
65     chmod -R u+w,go-w,a+rX-s .
67     ./configure CPPFLAGS="$QICPPFLAGS" \
68     CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
69      $configure_args \
70      --libdir=/usr/lib${libSuffix} \
71      --mandir=$mandir \
72      --docdir=$docsdir \
73      --enable-cplusplus \
74      --enable-static=no \
75      --enable-shared=yes \
76      --enable-threads=posix \
77      --with-libatomic-ops=yes \
78      --build="$(gcc -dumpmachine)"
80     make -j${jobs} V=1
81     make -j${jobs} DESTDIR="$destdir" install-strip
83     # Compress and link man pages (if needed)
84     if test -d "${destdir}/$mandir"
85     then
86         (
87             cd "${destdir}/$mandir"
88             find . -type f -exec lzip -9 {} +
89             find . -type l | while read -r file
90             do
91                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
92                 rm -- "$file"
93             done
94         )
95     fi
97     # Copy documentation
98     mkdir -p "${destdir}/$docsdir"
99     cp -p $docs "${destdir}/$docsdir"