Subject: Re: patches for different operating systems
To: Jeremy C. Reed <>
From: Alistair Crooks <>
List: tech-pkg
Date: 11/26/2002 13:43:46
On Mon, Nov 25, 2002 at 03:22:58PM -0800, Jeremy C. Reed wrote:
> Packages.txt says "This [patches] directory contains files that are used
> by the patch(1) command to modify the sources as distributed in the
> distribution file into a form that will compile and run perfectly on
> NetBSD."
> According to "OS-dependent patches?" thread, patches should be built to
> work under any OS.
> Why does it say "compile and run perfectly on NetBSD" but the build
> reports "Applying ${OPSYS} patches for ..."?

This was inherited from the original FreeBSD infrastructure, and has
never been deleted.
> Could it just say "Applying patches for ..."?

Yes. I suppose no-one has felt the need to do it, that's all.
> Anyways, does anyone have any suggestions or can point me to few examples
> of portable patches?
> For example, checking for OPSYS within Makefiles?

See: pkgsrc/net/socks4/patches/patch-aa

Basic idea is:

OPSYS!= uname -s

.if ${OPSYS} == "NetBSD"

The above assumes you're using bmake. If you're using gmake, then the syntax
is different:

See pkgsrc/net/rdesktop10/patches/patch-aa

Basic idea is:

OS = $(shell uname -s)

ifeq "$(OS)" "SunOS"