[78ef36]: / scripts / pixman_repair.sh

Download this file

111 lines (98 with data), 3.0 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
 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
# Please note that we can make no guarantees regarding the use of this patch
# and provide no warranties, explicit or implied.
# It has been tested for pixman version 0.38 in Ubuntu 18.04 and 20.04
#
# Preparation:
# 1. ensure a deb-src source is uncommented
# sudo nano /etc/apt/sources.list
if grep -q ^deb-src /etc/apt/sources.list*; then
echo "deb-src found. proceeding..."
else
echo "Ensure a deb-src is available in your sources.list"
exit 1
fi
# 2. ensure dch is available for patching stuff
if ! command -v dch &> /dev/null
then
echo "COMMAND dch not be found, trying to install devscripts..."
apt install devscripts
else
echo "dch found. proceeding..."
fi
echo "Creating pixman dir within /opt/ ..."
cd /opt/
mkdir pixman
chown $(whoami):$(whoami) pixman
cd pixman
echo "Getting sources..."
apt install libpixman-1-0=0.38.4-0ubuntu1
apt-get source libpixman-1-0=0.38.4-0ubuntu1
cd ..
chown -R $(whoami):$(whoami) pixman
cd pixman/pixman-0.38.4
echo "Trying to patch..."
cd pixman
patch --verbose --ignore-whitespace -b <<EOF
--- pixman-bits-image.c.old 2021-08-03 10:51:55.099218082 +0200
+++ pixman-bits-image.c 2021-08-03 10:55:40.979818850 +0200
@@ -432,29 +432,38 @@
case PIXMAN_FILTER_CONVOLUTION:
if (wide)
+ {
bits_image_fetch_pixel_convolution (image, x, y,
get_pixel, out,
accum_float,
reduce_float);
+ }
else
+ {
bits_image_fetch_pixel_convolution (image, x, y,
get_pixel, out,
accum_32, reduce_32);
+ }
break;
case PIXMAN_FILTER_SEPARABLE_CONVOLUTION:
if (wide)
+ {
bits_image_fetch_pixel_separable_convolution (image, x, y,
get_pixel, out,
accum_float,
reduce_float);
+ }
else
+ {
bits_image_fetch_pixel_separable_convolution (image, x, y,
get_pixel, out,
accum_32, reduce_32);
+ }
break;
default:
+ assert (0);
break;
}
}
EOF
patch -b <<EOF
--- pixman-inlines.h.old 2021-08-03 10:55:54.011621896 +0200
+++ pixman-inlines.h 2021-08-03 10:56:34.175014448 +0200
@@ -231,7 +231,7 @@
argb_t r;
distxy = distx * disty;
- distxiy = distx - (1.f - distxy);
+ distxiy = distx * (1.f - distxy);
distixy = (1.f - distx) * disty;
distixiy = (1.f - distx) * (1.f - disty);
EOF
# Alternatively:
# nano pixman/pixman-inlines.h
# ... and ...
# nano pixman/pixman-bits-image.c
# to change files as in this commit:
# https://gitlab.freedesktop.org/pixman/pixman/commit/8256c235d9b3854d039242356905eca854a890ba
cd ..
dch -n "user-patch of commit 8256c235"
echo "Trying to build & install patched pixman..."
apt -y build-dep pixman
debuild
cd ..
dpkg -i libpixman-1-0_0.38.4-0ubuntu1.1_amd64.deb