How to create a .patch file?

Creating a patch file is a basic operation during the building of the packages. You seem to know how to do it. If so, this article lets you visualize a stage where I built the Omarine operating system. If you are a beginner, this article provides detailed instructions on how to create patch files and to patch code.

The Poppler package contains a PDF rendering library and command line tools that are used to manipulate PDF files. Version 0.71.0 of Poppler does not define the GBool data type and the gTrue, gFalse Boolean values. Therefore dependent packages that use old code such as Libreoffice need to be patched.
First, you rename the libreoffice- directory to libreoffice-

mv libreoffice- libreoffice-

Then create a replica directory

cp -r libreoffice-

The file needs to be modified by adding the definition for GBool, gTrue, gFalse, inserting them into line 23:

sed -i '23 i typedef bool GBool;\n#define gTrue true\n#define gFalse false\n' \

Now we create the libreoffice- file:

diff -Naur libreoffice- \ > libreoffice-

The contents of the patch file are as follows:

--- libreoffice- 2018-10-30 02:55:29.000000000 +0700
+++ 2018-12-02 09:55:57.250834967 +0700
@@ -20,6 +20,10 @@

+typedef bool GBool;
+#define gTrue true
+#define gFalse false
#include <sal/types.h>
#include <config_poppler.h>

Performing the patch
Patches can be applied to build package multiple times from the source code. You run the following command:

patch -Np1 -i ../libreoffice-

Secret: Omarine 6.0 will be released tomorrow (03/Dec/2018).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.