aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/mecab-variable-param.patch
blob: 4457cf3f44ee11f1faff9483a1111e2dd6b8e473 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 2396e90056706ef897acab3aaa081289c7336483 Mon Sep 17 00:00:00 2001
From: LEPILLER Julien <julien.lepiller@irisa.fr>
Date: Fri, 19 Apr 2019 11:48:39 +0200
Subject: [PATCH] Allow variable parameters

---
 mecab/src/param.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/mecab/src/param.cpp b/mecab/src/param.cpp
index 65328a2..006b1b5 100644
--- a/mecab/src/param.cpp
+++ b/mecab/src/param.cpp
@@ -79,8 +79,12 @@ bool Param::load(const char *filename) {
     size_t s1, s2;
     for (s1 = pos+1; s1 < line.size() && isspace(line[s1]); s1++);
     for (s2 = pos-1; static_cast<long>(s2) >= 0 && isspace(line[s2]); s2--);
-    const std::string value = line.substr(s1, line.size() - s1);
+    std::string value = line.substr(s1, line.size() - s1);
     const std::string key   = line.substr(0, s2 + 1);
+
+    if(value.find('$') == 0) {
+        value = std::getenv(value.substr(1).c_str());
+    }
     set<std::string>(key.c_str(), value, false);
   }
 
-- 
2.20.1

plet), * gnu/packages/mail.scm (libetpan), * gnu/packages/man.scm (ronn), * gnu/packages/music.scm (tascam-gtk, artyfx), * gnu/packages/networking.scm (srt, lksctp-tools, nng, nanomsg), * gnu/packages/python-crypto.scm (pure-python-otr), * gnu/packages/qt.scm (qtspell), * gnu/packages/raspberry-pi.scm (raspi-gpio, raspi-open-firmware), * gnu/packages/rdp.scm (freerdp), * gnu/packages/ruby.scm (ruby-prawn-templates, ruby-treetop, ruby-gimme, ruby-standard, ruby-rubocop-ast, ruby-rexml, ruby-range-compressor, ruby-regexp-property-values, ruby-regexp-parser, ruby-rubocop, ruby-pdf-reader, ruby-pdf-inspector, ruby-prawn), * gnu/packages/syncthing.scm (syncthing-gtk), * gnu/packages/video.scm (svt-hevc, mediasdk, libvideogfx, libde265, tslib), * gnu/packages/xml.scm (libxmlb, libxmlplusplus)[source]: Same. Efraim Flashner 2020-10-29gnu: raspi-arm64-chainloader: Remove unnecessary internal copy-file call....* gnu/packages/raspberry-pi.scm (raspi-arm64-chainloader)[arguments]<#:phases>[chdir]: Remove unnecessary copy-file call. Danny Milosavljevic 2020-10-29gnu: raspi-arm64-chainloader: End phase in #t....* gnu/packages/raspberry-pi.scm (raspi-arm64-chainloader)[arguments]<#:phases>[install]: End phase in #t. Danny Milosavljevic 2020-10-29gnu: raspi-arm-chainloader: Install arm_chainloader.bin....* gnu/packages/raspberry-pi.scm (raspi-arm-chainloader)[arguments]<#:phases>[setenv]: Add objcopy. [install]: Install arm_chainloader.bin. Danny Milosavljevic 2020-10-29gnu: raspi-arm64-chainloader: Install arm64.bin....* gnu/packages/raspberry-pi.scm (raspi-arm64-chainloader)[arguments]<#:phases>[setenv]: Add objcopy. [install]: Install arm64.bin. Danny Milosavljevic 2020-10-29gnu: Add raspi-arm64-chainloader....* gnu/packages/raspberry-pi.scm (raspi-arm64-chainloader): New variable. Danny Milosavljevic 2020-10-29gnu: raspi-arm-chainloader: Fix build....* gnu/packages/raspberry-pi.scm (raspi-arm-chainloader)[arguments]<#:phases>[build-tlsf]: Modify. [build-common]: Modify. Danny Milosavljevic 2020-10-29gnu: Add raspi-arm-chainloader....* gnu/packages/raspberry-pi.scm (%rpi-open-firmware-version): New variable. (%rpi-open-firmware-origin): New variable. (raspi-arm-chainloader): New variable. Danny Milosavljevic 2020-10-29gnu: Add raspi-gpio....* gnu/packages/raspberry-pi.scm (raspi-gpio): New variable. Danny Milosavljevic 2020-10-29gnu: Add bcm2835....* gnu/packages/raspberry-pi.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. Danny Milosavljevic