File: genpackages

package info (click to toggle)
mali-midgard-driver 0.1-3
  • links: PTS
  • area: non-free
  • in suites: buster
  • size: 230,768 kB
  • sloc: sh: 77; makefile: 13
file content (111 lines) | stat: -rwxr-xr-x 3,006 bytes parent folder | download
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/sh

#script to generate control file for set of binary driver packages
#call it as debian/rules control

set -e
#set -x


rm debian/*.install || true

EGLDEPS="libegl1, libgles1, libgles2, libopencl1"
WAYLANDDEPS="libgbm1, libwayland-egl1-mesa"

# find build-deps from Mali driver object headers. strip build-essential libs.
echo "Checking linked libraries"
BUILDDEPS=$(for lib in $(find t* -name libmali.so); do dpkg -S $(objdump -x $lib | awk '/NEEDED/ { print $2 }') | cut -d: -f1 | sort | uniq; done | sort | uniq | egrep -v "libgcc|libstdc++|libc6" | sed ':loop;N;s/\n/, /;t loop')
#echo "Found builddeps: $BUILDDEPS"

# make install file and control entry for each platform/arch/gpu/display flavour
mkpkg() {
  # $1 is driver dirname
  # $2 is window system name
  # $3 is architecture list
  echo creating mali-${1}-${2}-driver
  echo for arches $3
  # generate dh_install file
  installfile=debian/mali-${1}-${2}-driver.install
  echo "#! /usr/bin/dh-exec" > ${installfile}
  echo "${1}/\${DEB_HOST_ARCH}/${2}/* /usr/lib/\${DEB_HOST_MULTIARCH}/" >> ${installfile}
  chmod +x ${installfile}
  #generate lintian overrides for each package
  #we can't fix things upstream did...
  echo "mali-${1}-${2}-driver binary: sharedobject-in-library-directory-missing-soname" > debian/mali-${1}-${2}-driver.lintian-overrides
  echo "mali-${1}-${2}-driver binary: hardening-no-relro" >> debian/mali-${1}-${2}-driver.lintian-overrides
  
  #then add control entry
  DEPS="${EGLDEPS}"
  case "$1" in
      450)
	  CODENAME="utgard"
	  ;;
      t60x|t62x|t76x)
	  CODENAME="midgard"
	  ;;
      g8xx)
	  CODENAME="bifrost"
	  ;;
  esac
  case "$2" in
      fbdev)
	  TYPE="framebuffer"
	  DESC="the kernel framebuffer"
	  ;;
      x11)
	  TYPE="x11"
	  DESC="x11"
	  ;;
      wayland|wayland-drm)
	  TYPE="wayland"
	  DESC="wayland"
	  DEPS="${EGLDEPS}, ${WAYLANDDEPS}"
	  ;;
      fbdev-wayland)
	  TYPE="fbdev-wayland"
	  DESC="wayland with framebuffer"
	  ;;
      wayland-fbdev)
	  TYPE="wayland"
	  DESC="wayland"
	  DEPS="${EGLDEPS}, ${WAYLANDDEPS}"
	  ;;

  esac

  cat >> debian/control <<EOF

Package: mali-${1}-${2}-driver
Architecture: ${3}
Multi-Arch: same
Depends: \${shlibs:Depends}, \${misc:Depends}, mali-midgard-dkms
Provides: ${DEPS}
Conflicts: ${DEPS}
Replaces: ${DEPS}
Description: Mali binary ${TYPE} driver for ${1}
 This is a binary graphics driver for Arm Mali GPU hardware. It
 provides optimized hardware acceleration of OpenGL applications using
 ${DESC}, on Mali ${1} (${CODENAME}) GPU hardware.
EOF
  
}

#put in start of control file
sed -e "s/@BUILDDEPS@/${BUILDDEPS}/" debian/control-header > debian/control


ARCHLIST="armhf arm64"
mkpkg t62x fbdev "${ARCHLIST}"
mkpkg t62x wayland "${ARCHLIST}"

ARCHLIST=arm64
mkpkg t62x wayland-fbdev ${ARCHLIST}
mkpkg t62x fbdev-wayland ${ARCHLIST}

ARCHLIST=armhf
#mkpkg t60x fbdev ${ARCHLIST}
#mkpkg t60x x11 ${ARCHLIST}
mkpkg t62x x11 ${ARCHLIST}
mkpkg t76x fbdev ${ARCHLIST}
mkpkg t76x x11 ${ARCHLIST}
mkpkg t76x wayland ${ARCHLIST}