summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororbea <orbea@riseup.net>2022-05-04 10:48:20 -0700
committerSam James <sam@gentoo.org>2022-05-05 05:05:48 +0100
commite155af013558a4a3164fb9867ef1d65d34c6ed3a (patch)
treecaac241c703a7fe0eddd5f593e8c785b046226c2 /dev-util
parentapp-text/zathura-cb: Stabilize 0.1.9 x86, #841620 (diff)
downloadgentoo-e155af013558a4a3164fb9867ef1d65d34c6ed3a.tar.gz
gentoo-e155af013558a4a3164fb9867ef1d65d34c6ed3a.tar.bz2
gentoo-e155af013558a4a3164fb9867ef1d65d34c6ed3a.zip
dev-util/ragel: Fix patch for slibtool
Upstream-PR: https://github.com/adrian-thurston/ragel/pull/85 Bug: https://bugs.gentoo.org/820260 Bug: https://bugs.gentoo.org/839048 Closes: https://bugs.gentoo.org/832391 Closes: https://github.com/gentoo/gentoo/pull/25322 Signed-off-by: orbea <orbea@riseup.net> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/ragel/files/ragel-7.0.4-r2-link-colm-properly.patch64
-rw-r--r--dev-util/ragel/ragel-7.0.4-r2.ebuild66
2 files changed, 130 insertions, 0 deletions
diff --git a/dev-util/ragel/files/ragel-7.0.4-r2-link-colm-properly.patch b/dev-util/ragel/files/ragel-7.0.4-r2-link-colm-properly.patch
new file mode 100644
index 000000000000..82ff98b5a15e
--- /dev/null
+++ b/dev-util/ragel/files/ragel-7.0.4-r2-link-colm-properly.patch
@@ -0,0 +1,64 @@
+From ad49af2601018298478af6ea6f8ae0ce323d7b28 Mon Sep 17 00:00:00 2001
+From: orbea <orbea@riseup.net>
+Date: Wed, 4 May 2022 10:23:51 -0700
+Subject: [PATCH] Fix build without .la files
+
+Many distros do no ship .la files which breaks the build
+and additionally when using slibtool instead of GNU libtool
+the .la files are not installed by default.
+
+This fixes the build to use the linker flags -lcolm and -lfsm
+instead.
+---
+ configure.ac | 16 ++++++++++++----
+ src/Makefile.am | 1 -
+ 2 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 6b3a5b4b..9cee5e5f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -44,16 +44,24 @@ AC_ARG_WITH(colm,
+ [
+ COLM="$withval/bin/colm"
+ COLM_WRAP="$withval/bin/colm-wrap"
+- CPPFLAGS="-I$withval/include ${CPPFLAGS}"
+ CPPFLAGS="-I$withval/include/aapl ${CPPFLAGS}"
+- LDFLAGS="-L$withval/lib ${LDFLAGS}"
+- LIBCOLM_LA="$withval/lib/libcolm.la"
+- LIBFSM_LA="$withval/lib/libfsm.la"
+ COLM_SHARE="$withval/share"
+ ],
+ []
+ )
+
++AC_CHECK_LIB(
++ [colm],
++ [colm_run_program],
++ [LIBCOLM_LA=-lcolm],
++ [AC_ERROR([libcolm is required to build ragel])]
++)
++AC_CHECK_LIB(
++ [fsm],
++ [hostLangAsm],
++ [LIBFSM_LA=-lfsm],
++ [AC_ERROR([libfsm is required to build ragel])]
++)
+ AC_CHECK_FILES(
+ [$COLM],
+ [],
+diff --git a/src/Makefile.am b/src/Makefile.am
+index c4fe531c..377f7aa4 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -39,7 +39,6 @@ nodist_ragel_SOURCES = \
+ parse.c rlreduce.cc
+
+ ragel_LDADD = $(LIBFSM_LA) $(LIBCOLM_LA) libragel.la
+-ragel_DEPENDENCIES = $(LIBFSM_LA) $(LIBCOLM_LA) libragel.la
+
+ BUILT_SOURCES = \
+ version.h \
+--
+2.35.1
+
diff --git a/dev-util/ragel/ragel-7.0.4-r2.ebuild b/dev-util/ragel/ragel-7.0.4-r2.ebuild
new file mode 100644
index 000000000000..b83f4136930d
--- /dev/null
+++ b/dev-util/ragel/ragel-7.0.4-r2.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="Compiles finite state machines from regular languages into executable code"
+HOMEPAGE="https://www.colm.net/open-source/ragel/"
+SRC_URI="https://www.colm.net/files/ragel/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="doc"
+
+# Notes from bug #766090
+# dev-libs/libxml2's xmllint ends up being called by asciidoc here
+# app-text/dblatex too
+# app-text/ghostscript-gpl too
+BDEPEND="
+ doc? (
+ || ( app-text/asciidoc dev-ruby/asciidoctor )
+ app-text/dblatex
+ app-text/ghostscript-gpl
+ dev-libs/libxml2
+ dev-texlive/texlive-latex
+ dev-python/pygments
+ media-gfx/transfig
+ )
+"
+DEPEND=">=dev-util/colm-0.14.7-r1"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-7.0.4-drop-julia-check.patch
+ "${FILESDIR}"/${PN}-7.0.4-r2-link-colm-properly.patch
+)
+
+src_prepare() {
+ default
+
+ # Fix hardcoded search dir
+ sed -i -e "s:\$withval/lib:\$withval/$(get_libdir):" configure.ac || die
+
+ # Allow either asciidoctor or asciidoc
+ # bug #733426
+ sed -i -e 's/(\[ASCIIDOC\], \[asciidoc\], \[asciidoc\]/S([ASCIIDOC], [asciidoc asciidoctor]/' configure.ac || die
+
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --with-colm="${EPREFIX}/usr" \
+ $(use_enable doc manual)
+}
+
+src_install() {
+ default
+
+ insinto /usr/share/vim/vimfiles/syntax
+ doins ragel.vim
+
+ find "${ED}" -name '*.la' -delete || die
+}