aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ruby-mathematical/use-system-mtex2mml.patch
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-03-25 17:30:01 +0100
committerJakub Jirutka <jakub@jirutka.cz>2017-03-25 18:19:19 +0100
commit89e2aa91489374709e020525b8229ad0f3d6b670 (patch)
treedfe0f7e9e8b8f9d5efe2dea9b596303f035d5b4e /testing/ruby-mathematical/use-system-mtex2mml.patch
parent9ff5cc74f2b28fa0bc9987d14d8464243462cf42 (diff)
downloadaports-89e2aa91489374709e020525b8229ad0f3d6b670.tar.bz2
aports-89e2aa91489374709e020525b8229ad0f3d6b670.tar.xz
testing/ruby-mathematical: new aport
https://www.gjtorikian.com/mathematical/ Convert mathematical equations to SVGs, PNGs, or MathML This gem has quite problematic native extension, so it's worth to make an aport for it. It's used e.g. by asciidoctor-pdf.
Diffstat (limited to 'testing/ruby-mathematical/use-system-mtex2mml.patch')
-rw-r--r--testing/ruby-mathematical/use-system-mtex2mml.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/testing/ruby-mathematical/use-system-mtex2mml.patch b/testing/ruby-mathematical/use-system-mtex2mml.patch
new file mode 100644
index 0000000000..8cfbf99aad
--- /dev/null
+++ b/testing/ruby-mathematical/use-system-mtex2mml.patch
@@ -0,0 +1,59 @@
+From 9810816577a18e844fd21eb0f7fa73b1e5e71b8a Mon Sep 17 00:00:00 2001
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Sat, 25 Mar 2017 01:10:36 +0100
+Subject: [PATCH] Allow to compile against system-provided mtex2MML
+
+I'm writing package for Alpine Linux and want to compile mathematical
+against system-provided mtex2MML instead of bundled one.
+
+Upstream-Issue: https://github.com/gjtorikian/mathematical/pull/71
+---
+ ext/mathematical/extconf.rb | 21 ++++++++++++++-------
+ 1 file changed, 14 insertions(+), 7 deletions(-)
+
+diff --git a/ext/mathematical/extconf.rb b/ext/mathematical/extconf.rb
+index eb6a8d8..04993aa 100644
+--- a/ext/mathematical/extconf.rb
++++ b/ext/mathematical/extconf.rb
+@@ -21,6 +21,10 @@ def using_system_lasem?
+ arg_config('--use-system-lasem', !!ENV['MATHEMATICAL_USE_SYSTEM_LASEM'])
+ end
+
++def using_system_mtex2mml?
++ arg_config('--use-system-mtex2MML', !!ENV['MATHEMATICAL_USE_SYSTEM_MTEX2MML'])
++end
++
+ ROOT_TMP = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'tmp'))
+
+ LASEM_DIR = File.expand_path(File.join(File.dirname(__FILE__), 'lasem'))
+@@ -57,10 +61,16 @@ end
+ clean_dir(MTEX2MML_BUILD_DIR)
+ clean_dir(LASEM_BUILD_DIR)
+
+-# build mtex2MML library
+-Dir.chdir(MTEX2MML_BUILD_DIR) do
+- system 'cmake ..'
+- system 'make libmtex2MML_static'
++if !using_system_mtex2mml?
++ # build mtex2MML library
++ Dir.chdir(MTEX2MML_BUILD_DIR) do
++ system 'cmake ..'
++ system 'make libmtex2MML_static'
++ end
++ FileUtils.mkdir_p(MTEX2MML_LIB_DIR)
++ FileUtils.cp_r(File.join(MTEX2MML_BUILD_DIR, 'libmtex2MML.a'), MTEX2MML_LIB_DIR)
++else
++ dir_config('mtex2MML').any? || pkg_config('libmtex2MML') || system('dpkg -s libmtex2MML >/dev/null')
+ end
+
+ if !using_system_lasem?
+@@ -76,9 +86,6 @@ else
+ dir_config('lasem').any? || pkg_config('liblasem') || system('dpkg -s liblasem >/dev/null')
+ end
+
+-FileUtils.mkdir_p(MTEX2MML_LIB_DIR)
+-FileUtils.cp_r(File.join(MTEX2MML_BUILD_DIR, 'libmtex2MML.a'), MTEX2MML_LIB_DIR)
+-
+ LIB_DIRS = [MTEX2MML_LIB_DIR, LASEM_LIB_DIR]
+ HEADER_DIRS = [MTEX2MML_SRC_DIR, LASEM_SRC_DIR]
+