treewide: Run refresh on all packages
[feed/packages.git] / libs / libgd / patches / 010-getlib.patch
1 From 635dd9a3065ed88e1741e6b963044b80e913f96a Mon Sep 17 00:00:00 2001
2 From: Remi Collet <remi@remirepo.net>
3 Date: Tue, 24 Mar 2020 08:01:01 +0100
4 Subject: [PATCH] distribute getlib.sh
5
6 ---
7 config/getlib.sh | 42 ++++++++++++++++++++++++++++++++++++++++++
8 1 file changed, 42 insertions(+)
9 create mode 100755 config/getlib.sh
10
11 --- /dev/null
12 +++ b/config/getlib.sh
13 @@ -0,0 +1,42 @@
14 +#!/bin/sh
15 +
16 +GETVER="${0%/*}/getver.pl"
17 +GDLIB_MAJOR=$("${GETVER}" MAJOR)
18 +GDLIB_MINOR=$("${GETVER}" MINOR)
19 +GDLIB_REVISION=$("${GETVER}" RELEASE)
20 +
21 +# Dynamic library version information
22 +# See http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
23 +
24 +GDLIB_LT_CURRENT=3
25 +# This is the version where the soname (current above) changes. We use it
26 +# to reset the revision base back to zero. It's a bit of a pain, but some
27 +# systems restrict the revision range below to [0..255] (like OS X).
28 +GDLIB_PREV_MAJOR=2
29 +GDLIB_PREV_MINOR=2
30 +# This isn't 100% correct, but it tends to be a close enough approximation
31 +# for how we manage the codebase. It's rare to do a release that doesn't
32 +# modify the library since this project is centered around the library.
33 +GDLIB_LT_REVISION=$(( ((GDLIB_MAJOR - GDLIB_PREV_MAJOR) << 6) | ((GDLIB_MINOR - GDLIB_PREV_MINOR) << 3) | GDLIB_REVISION ))
34 +GDLIB_LT_AGE=0
35 +
36 +# The first three fields we feed into libtool and the OS target determines how
37 +# they get used. The last two fields we feed into cmake. We use the same rules
38 +# as Linux SONAME versioning in libtool, but cmake should handle it for us.
39 +case $1 in
40 +CURRENT)
41 + printf '%s' "${GDLIB_LT_CURRENT}"
42 + ;;
43 +REVISION)
44 + printf '%s' "${GDLIB_LT_REVISION}"
45 + ;;
46 +AGE)
47 + printf '%s' "${GDLIB_LT_AGE}"
48 + ;;
49 +VERSION)
50 + printf '%s' "$(( GDLIB_LT_CURRENT - GDLIB_LT_AGE )).${GDLIB_LT_AGE}.${GDLIB_LT_REVISION}"
51 + ;;
52 +SONAME)
53 + printf '%s' "$(( GDLIB_LT_CURRENT - GDLIB_LT_AGE ))"
54 + ;;
55 +esac