diff --git a/srcpkgs/autogen/patches/autogen-5.18.16-rpath.patch b/srcpkgs/autogen/patches/autogen-5.18.16-rpath.patch
new file mode 100644
index 00000000000..27c9c33cbe7
--- /dev/null
+++ b/srcpkgs/autogen/patches/autogen-5.18.16-rpath.patch
@@ -0,0 +1,66 @@
+--- agen5/Makefile.am
++++ agen5/Makefile.am
+@@ -63,7 +63,7 @@ SNV_LIB = $(top_builddir)/snprintfv/libsnprintfv.la
+ nodist_autogen_SOURCES = ag.c
+ autogen_SOURCES = $(gen_csrc)
+ autogen_LDADD = $(LO_LIB) $(SNV_LIB) $(GUILE_LIBS)
+-autogen_LDFLAGS = $(DYNAMIC_AG) $(AG_STATIC_AUTOGEN) -no-install
++autogen_LDFLAGS = $(DYNAMIC_AG) $(AG_STATIC_AUTOGEN)
+ autogen_CFLAGS = $(GUILE_CFLAGS)
+ stamp_script = $(srcdir)/mk-stamps.sh
+
+--- agen5/Makefile.in
++++ agen5/Makefile.in
+@@ -482,7 +482,7 @@ SNV_LIB = $(top_builddir)/snprintfv/libsnprintfv.la
+ nodist_autogen_SOURCES = ag.c
+ autogen_SOURCES = $(gen_csrc)
+ autogen_LDADD = $(LO_LIB) $(SNV_LIB) $(GUILE_LIBS)
+-autogen_LDFLAGS = $(DYNAMIC_AG) $(AG_STATIC_AUTOGEN) -no-install
++autogen_LDFLAGS = $(DYNAMIC_AG) $(AG_STATIC_AUTOGEN)
+ autogen_CFLAGS = $(GUILE_CFLAGS)
+ stamp_script = $(srcdir)/mk-stamps.sh
+ AM_YFLAGS = -d
+--- columns/Makefile.am
++++ columns/Makefile.am
+@@ -20,7 +20,7 @@
+ ## with this program. If not, see .
+
+ bin_PROGRAMS = columns
+-columns_LDFLAGS = -no-install
++#columns_LDFLAGS = -no-install
+ csrc = opts.h columns.c opts.c
+ nodist_columns_SOURCES = cols.c
+
+--- columns/Makefile.in
++++ columns/Makefile.in
+@@ -389,7 +389,7 @@ target_vendor = @target_vendor@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-columns_LDFLAGS = -no-install
++#columns_LDFLAGS = -no-install
+ csrc = opts.h columns.c opts.c
+ nodist_columns_SOURCES = cols.c
+ LO_LIB = $(top_builddir)/autoopts/libopts.la
+--- getdefs/Makefile.am
++++ getdefs/Makefile.am
+@@ -23,7 +23,7 @@
+ TARG = getdefs
+
+ bin_PROGRAMS = getdefs
+-getdefs_LDFLAGS = -no-install
++#getdefs_LDFLAGS = -no-install
+ gdsrcs = getdefs.h proto.h gdemit.c gdinit.c getdefs.c
+ getdefs_SOURCES = proto.h
+ BUILT_SOURCES = gd.c
+--- getdefs/Makefile.in
++++ getdefs/Makefile.in
+@@ -434,7 +434,7 @@ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ TARG = getdefs
+-getdefs_LDFLAGS = -no-install
++#getdefs_LDFLAGS = -no-install
+ gdsrcs = getdefs.h proto.h gdemit.c gdinit.c getdefs.c
+ getdefs_SOURCES = proto.h
+ BUILT_SOURCES = gd.c
diff --git a/srcpkgs/autogen/patches/build-aux.patch b/srcpkgs/autogen/patches/build-aux.patch
new file mode 100644
index 00000000000..9e5ac52deef
--- /dev/null
+++ b/srcpkgs/autogen/patches/build-aux.patch
@@ -0,0 +1,26 @@
+diff --git build-aux/run-ag.sh build-aux/run-ag.sh
+index 6ee7b85..f604462 100755
+--- build-aux/run-ag.sh
++++ build-aux/run-ag.sh
+@@ -25,7 +25,7 @@
+ # any containing directory must be created. The target is created with a
+ # very old time stamp.
+ #
+-AGexe=/u/bkorb/tools/ag/autogen-bld/agen5/.libs/autogen
++AGexe=/usr/bin/autogen
+ find_exe() {
+ eval local exe=\${$1}
+ test -x "$exe" && return 0
+diff --git getdefs/Makefile.in getdefs/Makefile.in
+index 058d0a6..7a17783 100644
+--- getdefs/Makefile.in
++++ getdefs/Makefile.in
+@@ -275,7 +275,7 @@ AG_STATIC_AUTOGEN = @AG_STATIC_AUTOGEN@
+ AG_TIMEOUT = @AG_TIMEOUT@
+ AG_VERSION = @AG_VERSION@
+ AG_XML2 = @AG_XML2@
+-AGexe = @AGexe@
++AGexe = /usr/bin/autogen
+ AGnam = @AGnam@
+ AMTAR = @AMTAR@
+ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
diff --git a/srcpkgs/autogen/patches/configure.patch b/srcpkgs/autogen/patches/configure.patch
new file mode 100644
index 00000000000..bb9ece30ce5
--- /dev/null
+++ b/srcpkgs/autogen/patches/configure.patch
@@ -0,0 +1,13 @@
+diff --git configure configure
+index f149ede..e75e3f0 100755
+--- configure
++++ configure
+@@ -17324,7 +17324,7 @@ $as_echo_n "checking whether strcspn matches prototype and works... " >&6; }
+ $as_echo_n "(cached) " >&6
+ else
+
+- if test "$cross_compiling" = yes; then :
++ if test "$cross_compiling" = xxx; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error $? "cannot run test program while cross compiling
diff --git a/srcpkgs/autogen/template b/srcpkgs/autogen/template
index fefd2a0f459..7c8242aacbe 100644
--- a/srcpkgs/autogen/template
+++ b/srcpkgs/autogen/template
@@ -1,31 +1,35 @@
# Template file for 'autogen'
pkgname=autogen
-version=5.18.4
-revision=7
+version=5.18.16
+revision=1
build_style=gnu-configure
-configure_args="--disable-static"
-hostmakedepends="pkg-config perl"
-makedepends="guile guile-devel libxml2-devel gc-devel"
+configure_args="--disable-static --disable-dependency-tracking --without-libregex"
+hostmakedepends="guile pkg-config perl"
+makedepends="guile guile-devel libatomic_ops-devel libxml2-devel gc-devel"
depends="guile perl"
-short_desc="The Automated Program Generator"
+short_desc="Automated Program Generator"
maintainer="Orphaned "
-license="GPL-3"
+license="GPL-3.0-or-later"
homepage="http://autogen.sourceforge.net/"
distfiles="${GNU_SITE}/${pkgname}/rel${version}/${pkgname}-${version}.tar.gz"
-checksum=3cd9f81a8ae7c6865bb9bbbe16c4307a243a1373d0b315a83571cbba1fff725d
-
+checksum=e23c5bbd0ac83079ae2ef6eb3fd1948fecce718ac853025607a3ab0395538406
replaces="autogen-docs>=0 autogen-devel>=0"
+_libopts=libopts-42.1.17.tar.gz
+CFLAGS="-Wno-error=format-truncation -Wno-error=format-overflow
+ -Wno-error=unused-parameter"
+
+if [ "$CROSS_BUILD" ]; then
+ hostmakedepends+=" autogen guile-devel"
+fi
post_install() {
- mv -v ${DESTDIR}/usr/share/pkgconfig ${DESTDIR}/usr/lib
-
if [ "$SOURCE_DATE_EPOCH" ]; then
# repackaging libopts to apply correct mtimes
mkdir libopts
- tar xf $DESTDIR/usr/share/autogen/libopts-41.0.16.tar.gz -C libopts
+ tar xf $DESTDIR/usr/share/autogen/${_libopts} -C libopts
find libopts -print0 | xargs -0 touch --date "@$SOURCE_DATE_EPOCH"
cd libopts
- tar cf $DESTDIR/usr/share/autogen/libopts-41.0.16.tar.gz *
+ tar cf $DESTDIR/usr/share/autogen/${_libopts} *
fi
}