#!/bin/sh
#
# Copyright 2023-2026  Sasa Ostrouska <saxa@droplinegnome.org>
# Available under the terms of the GNU GPL.
#

NAME="unifdef"
VERSION="2.12"
REVISION="2"

PKG_SOURCEURL='https://dotat.at/prog/${NAME}/${NAME}-${VERSION}.tar.xz'
PKG_PATCH[0]='unifdef_fix_prefix.patch'
PKG_PATCH[1]='unifdef-2-12-constexpr-fix.patch'
PKG_PATCH[2]='unifdef-2-12-uninstalling-fix.patch'

. $DLG_ROOT/etc/config
. $DLG_ROOT/lib/dl-base

cflags
cxxflags
prepare

applypatch 0 1
applypatch 1 1
applypatch 2 1

analyzesource
#configure is not used in this package, but to 
#install it correctly we need to set prefix=/usr during make install phase
#but it was easier to fix it by adding the above partch.

make
makeinstall
tidydocumentation
analyzebinaries
finalizepackage
packagize
cleanup
