forked from intel/ipu6-camera-bins
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (80 loc) · 2.5 KB
/
dfsg-ize.yml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: "DFSG-ize"
on:
push:
pull_request:
permissions: {}
jobs:
dfsg-checks:
strategy:
matrix:
strip: [strip, nostrip]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Install prerequisites"
env:
DEBIAN_FRONTEND: "noninteractive"
run: |
sudo apt-get update --quiet
sudo apt-get install --no-install-recommends --yes \
build-essential \
pkg-config
- name: "Strip binaries"
if: ${{ matrix.strip == 'strip' }}
run: |
for lib in $(find . -type f -name lib\*.so.\*); do
strip "${lib}";
done
- name: "Install files"
run: |
sudo mkdir -p /lib/firmware/intel
cat README.md | \
awk 'BEGIN { \
FS="/"; \
} \
/^```/ { \
getline; \
if ($1 == "# Runtime files") { \
while ($1 != "```") { \
print $0; \
getline; \
} \
} \
}' | \
sed 's,ipu6-camera-bins/,./,' | \
sudo sh -x
- name: "Test linking with ld-linux.so"
run: |
ld_linux=$(which /lib/*/ld-linux*)
for lib in $(find . -type f -name lib\*.so.\*); do
echo "Verifying ${lib}"
rm -f ret; LD_DEBUG=all "${ld_linux}" --verify "${lib}" || echo $? >ret
if [ -e ret ]; then
echo "Return value: $(<ret)"
test "$(<ret)" != "1"
fi
done
- name: "Test linking with pkg-config"
run: |
echo "int main() {return 0;}" | tee test.c
for pc in $(find . -type f -name \*.pc -printf "%f\n"); do
pc=${pc%.pc}
echo "Compiling against $pc"
gcc test.c -o a.out \
-Wl,--no-as-needed -Wl,--no-undefined \
$(pkg-config --cflags --libs $pc)
ldd a.out
done
- name: "Test linking with a single shared lib directly"
run: |
echo "int main() {return 0;}" | tee test.c
for lib in $(find . -type f -name lib\*.so.\*); do
soname=${lib##*/}
libname=${soname#lib}
libname=${libname%.so.*}
echo "Compiling against ${soname}"
gcc test.c -o a.out \
-Wl,--no-as-needed -Wl,--no-undefined \
-L${lib%/*} -l${libname}
ldd a.out
done