forked from OpenVVC/OpenVVC
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion.sh
More file actions
executable file
·47 lines (39 loc) · 1.11 KB
/
Copy pathversion.sh
File metadata and controls
executable file
·47 lines (39 loc) · 1.11 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
#!/bin/bash
VERSION_FILE=$1
VERSION_HEADER=$2
BUILDDIR=$3
# Parse file given in $1 argument
VERSION=($(sed 's/\./\ /g' ${VERSION_FILE}))
MAJOR=${VERSION[0]}
MINOR=${VERSION[1]}
REVISION=${VERSION[2]}
# Try to recover short SHA1 of current commit
BUILD=$(git rev-parse --short HEAD 2>/dev/null || echo "")
cat > ${BUILDDIR}${VERSION_HEADER} << EOF
#ifndef OVVERSION_H
#define OVVERSION_H
#define VER_MAJOR ${MAJOR}
#define VER_MINOR ${MINOR}
#define VER_REVISION ${REVISION}
#define VER_BUILD "${BUILD}"
#endif // OVVERSION_H
EOF
source ${BUILDDIR}config.sh
prefix=${INSTALL_PREFIX}
libdir=${prefix}/lib
includedir=${prefix}/include
cat > ${BUILDDIR}libopenvvc.pc << EOF
prefix=${INSTALL_PREFIX}
libdir=${prefix}/lib
includedir=${prefix}/include
extra_ld_flags=${EXTRA_LD_FLAGS}
extra_cflags=${EXTRA_CFLAGS}
Name: OpenVVC Library
Description: Open Source VVC Decoder Library
Version: ${MAJOR}.${MINOR}.${REVISION}
Requires:
Conflicts:
Libs: -L\${libdir}/libopenvvc -Wl,-rpath=\${libdir}/libopenvvc -lovvc \${extra_ld_flags}
Libs.private: -lpthreads
Cflags: -I\${includedir}/libopenvvc -I\${libdir}/libopenvvc \${extra_cflags}
EOF