unifdef: add recipe

This commit is contained in:
Gerasim Troeglazov
2022-12-18 00:11:01 +10:00
parent ab146e595c
commit 6caaf8be77
2 changed files with 75 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
From 2a4cb3da67bd26284d32abeb7d699d70ce7646d5 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sun, 18 Dec 2022 00:03:45 +1000
Subject: Fix build
diff --git a/unifdef.h b/unifdef.h
index 2cd706d..f61749c 100644
--- a/unifdef.h
+++ b/unifdef.h
@@ -27,6 +27,7 @@
#include <ctype.h>
#include <err.h>
+#include <errno.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
@@ -34,6 +35,8 @@
#include <string.h>
#include <unistd.h>
+#define _getprogname() "unifdef"
+
/* portability stubs */
#define fbinmode(fp) (fp)
--
2.37.3

View File

@@ -0,0 +1,45 @@
SUMMARY="Selectively remove C preprocessor conditionals"
DESCRIPTION="The unifdef utility selectively processes conditional C \
preprocessor #if and #ifdef directives. It removes from a file both \
the directives and the additional text that they delimit, while \
otherwise leaving the file alone."
HOMEPAGE="https://dotat.at/prog/unifdef/"
COPYRIGHT="Tony Finch"
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://github.com/fanf2/unifdef/archive/refs/tags/unifdef-$portVersion.tar.gz"
CHECKSUM_SHA256="030369db9ff917acfae7fa4e90bcc1dff8a8dc534d82d1c72c12ef698d2f20e4"
SOURCE_DIR="unifdef-unifdef-$portVersion"
PATCHES="unifdef-$portVersion.patchset"
ARCHITECTURES="all"
PROVIDES="
unifdef = $portVersion
cmd:unifdef
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
BUILD_PREREQUIRES="
cmd:gcc
cmd:make
"
BUILD()
{
chmod +x scripts/reversion.sh
scripts/reversion.sh
gcc -o unifdef unifdef.c FreeBSD/err.c -I.
}
INSTALL()
{
mkdir -p $binDir
cp unifdef $binDir
}