HOME/bin/build-libcairo2.sh

121 lines
3.8 KiB
Bash
Raw Normal View History

2022-06-26 20:20:31 +02:00
#!/bin/bash
# 2011/03/08 16:28:21
#
# Copyright (C) 2010-2011 Mithat Konar
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
# Build patched libcairo packages for Debian Squeeze that enable Ubuntu-like
# font rendering.
#
# Assumes deb-src http://ftp.us.debian.org/debian/ squeeze main non-free contrib
# or similar is present in /etc/apt/sources.list
#
# Assumes you have already done
# apt-get install build-essential devscripts fakeroot
# apt-get build-dep cairo
set -e
#======================================================================#
# SET THE VERSION INFO BELOW BEFORE RUNNING SCRIPT!!!
#
UBUNTU_VERSION="1.8.10-2ubuntu1" # From http://packages.ubuntu.com/lucid/libcairo2 (e.g., "1.8.10-2ubuntu1");
# should match the version at http://packages.debian.org/squeeze/libcairo2
# You may need to look in http://archive.ubuntu.com/ubuntu/pool/main/c/cairo/
# to resolve inconsistencies.
YOUR_INITIALS="fdl" # from birth or marriage :-) no spaces allowed
#======================================================================#
###
### constanty things
###
UBUNTU_REP=http://archive.ubuntu.com/ubuntu/pool/main/c/cairo
UBUNTU_PATCH=cairo_${UBUNTU_VERSION}.debian.tar.gz
ARCH_REP=http://aur.archlinux.org/packages/cairo-ubuntu/
ARCH_PATCH=cairo-ubuntu.tar.gz
###
### GO!
###
### dir names
root_dir=`pwd`
top_dir="${root_dir}/libcairo2"
deb_sources="${top_dir}/deb-sources"
downloaded_patches="${top_dir}/downloaded-patches"
### make room
mkdir "$top_dir"
mkdir "$deb_sources"
mkdir "$downloaded_patches"
### get patches
cd "$downloaded_patches"
wget ${UBUNTU_REP}/${UBUNTU_PATCH}
wget ${ARCH_REP}/${ARCH_PATCH}
tar xzvf ${UBUNTU_PATCH}
tar xzvf ${ARCH_PATCH}
### get sources
cd "$deb_sources"
apt-get source cairo
cd ./cairo-*
### copy the patches
cp "${downloaded_patches}/cairo-ubuntu/cairo-respect-fontconfig.patch" ./debian/patches/
cp "${downloaded_patches}/debian/patches/04_lcd_filter.patch" ./debian/patches/
cp "${downloaded_patches}/debian/patches/06_Xlib-Xcb-Hand-off-EXTEND_PAD-to-XRender.patch" ./debian/patches/
### apply patches
patch -p1 -i ./debian/patches/cairo-respect-fontconfig.patch
patch -p1 -i ./debian/patches/04_lcd_filter.patch
patch -p1 -i ./debian/patches/06_Xlib-Xcb-Hand-off-EXTEND_PAD-to-XRender.patch
### modify the changelog, add version info
echo ""
echo "********************************"
echo -e "In the editor that appears next, add something like the following\n\
text after the first asterisk (*):\n\
'David Turner's ClearType-like LCD filtering patch and fix.'\n\
Then save and exit the editor."
echo ""
read -p "Press <enter> to continue..."
dch -l $YOUR_INITIALS
### build it
dpkg-buildpackage -rfakeroot -us -uc
### finito
# tell user what to do next
echo ""
echo "********************************"
echo "* DONE with compiling!"
echo "********************************"
echo -e "If all went well, you should have a bunch of new packages inside \n\
$deb_sources\n\
\n\
List of *.deb files in $deb_sources:"
cd $deb_sources
ls *.deb
echo -e "\nInstall all of them by changing into \n\
$deb_sources\n\
and do (as root):\n\
dpkg -i *.deb"