Last active
March 15, 2025 16:42
-
-
Save zeehio/033fc717f540a8d02a9211804d2ac91d to your computer and use it in GitHub Desktop.
Build libxp6 on Ubuntu 24.04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# WARNINGS: | |
# (1) Do not run this script with sudo permissions | |
# (2) Ideally, run this script line by line (the sed commands span multiple lines, please run all the sed commands at once) | |
# (3) You should change the NAME_EMAIL value accordingly. | |
# (4) The libxp6 package is old and unmaintained. It may have security issues. | |
# (5) The package build scripts are getting old and unmaintained as well. They are using more and more deprecated features. | |
# (6) Warning (5) means that for 26.04 this script may not work anymore without changes | |
# (7) I am not really interested in making the changes for 26.04. | |
# Feel free to comment in this gist if you like | |
# Please write here YOUR name and email in "Full Name <[email protected]>" format. | |
# This information is included in the package metadata. | |
NAME_EMAIL="Sergio Oller <[email protected]>" | |
CURRENT_DATE=`date -R` | |
# Install dependencies | |
sudo apt update | |
sudo apt install devscripts nano debhelper quilt pkg-config libx11-dev x11proto-xext-dev libxext-dev libxau-dev xutils-dev | |
# Create a directory where sources will be downloaded, extracted and compiled. Packages will be built here. | |
mkdir workdir | |
cd workdir | |
# Download x11proto-print. This is a dependency from libxp6 that was removed from the archive as well. | |
dget -xu "https://launchpad.net/~zeehio/+archive/ubuntu/libxp/+sourcefiles/x11proto-print/1.0.5-2ubuntu2~22.04/x11proto-print_1.0.5-2ubuntu2~22.04.dsc" | |
# Modify debian/changelog: | |
# sed is used here as a "find and replace" tool | |
# We use -i to specify "inline", so the file is modified in place | |
# We use -e several times with several find-replace commands: "s/<find>/<replace>/g" (the /g means globally) | |
# We finally specify the debian/changelog file, which is what we want to modify here. | |
sed -i \ | |
-e "s/jammy/noble/g" \ | |
-e "s/22.04/24.04/g" \ | |
-e "s/Sergio Oller <[email protected]>/${NAME_EMAIL}/g" \ | |
-e "s/Thu, 29 Sep 2022 07:13:17 +0200/${CURRENT_DATE}/g" \ | |
"x11proto-print-1.0.5/debian/changelog" | |
# Build. The "-us -uc" options are to skip signing the package, if I recall correctly. | |
# Since you don't plan to publish the package you can skip creating a signature and signing it | |
(cd "x11proto-print-1.0.5" && debuild -us -uc) | |
# Install it | |
sudo apt install ./*.deb | |
# Download sources for libxp6 | |
dget -xu "https://launchpad.net/~zeehio/+archive/ubuntu/libxp/+sourcefiles/libxp/1:1.0.2-2ubuntu1~22.04/libxp_1.0.2-2ubuntu1~22.04.dsc" | |
# Modify debian/changelog: | |
sed -i \ | |
-e "s/jammy/noble/g" \ | |
-e "s/22.04/24.04/g" \ | |
-e "s/Sergio Oller <[email protected]>/${NAME_EMAIL}/g" \ | |
-e "s/Mon, 19 Sep 2022 07:22:34 +0200/${CURRENT_DATE}/g" \ | |
"libxp-1.0.2/debian/changelog" | |
# Build | |
(cd "libxp-1.0.2" && debuild -us -uc) | |
# Install | |
sudo apt install ./*.deb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment