.. _spkg_patch:

patch: Applies diffs and patches to files
===================================================

Description
-----------

'patch' takes a patch file containing a difference listing produced by
the 'diff' program and applies those differences to one or more original
files, producing patched versions.

The version of 'patch' included is the GNU one. Some of the 'diff' files
produced by GNU 'diff' are not acceptable to some versions of the 'patch'
command, such as the 'patch' command that comes with Solaris.

License
-------

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 2, or (at your option) any
later version.


Upstream Contact
----------------

Main web site: http://savannah.gnu.org/projects/patch/

Bug database: http://savannah.gnu.org/bugs/?group=patch

Submit bugs: http://savannah.gnu.org/bugs/?func=additem&group=patch

Mailing lists: bug-patch@gnu.org

Special Update/Build Instructions
---------------------------------

In the event patches ever need to be made to this package, the method of
applying the patches should not rely on the 'patch' existing on the
system.

Type
----

standard


Dependencies
------------


Version Information
-------------------

package-version.txt::

    2.7.6


Equivalent System Packages
--------------------------

.. tab:: Alpine

   .. CODE-BLOCK:: bash

       $ apk add patch 


.. tab:: Arch Linux

   .. CODE-BLOCK:: bash

       $ sudo pacman -S patch 


.. tab:: conda-forge

   .. CODE-BLOCK:: bash

       $ conda install patch 


.. tab:: Debian/Ubuntu

   .. CODE-BLOCK:: bash

       $ sudo apt-get install patch 


.. tab:: Fedora/Redhat/CentOS

   .. CODE-BLOCK:: bash

       $ sudo dnf install patch 


.. tab:: FreeBSD

   .. CODE-BLOCK:: bash

       $ sudo pkg install devel/patch 


.. tab:: Homebrew

   .. CODE-BLOCK:: bash

       $ brew install gpatch 


.. tab:: MacPorts

   .. CODE-BLOCK:: bash

       $ sudo port install gpatch 


.. tab:: openSUSE

   .. CODE-BLOCK:: bash

       $ sudo zypper install patch 


.. tab:: Slackware

   .. CODE-BLOCK:: bash

       $ sudo slackpkg install patch 


.. tab:: Void Linux

   .. CODE-BLOCK:: bash

       $ sudo xbps-install patch 



See https://repology.org/project/patch/versions

If the system package is installed, ``./configure`` will check if it can be used.

