[Groonga-commit] groonga/groonga at 615cacd [master] Add update-nfkc target

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Apr 9 14:34:17 JST 2018


Kouhei Sutou	2018-04-09 14:34:17 +0900 (Mon, 09 Apr 2018)

  New Revision: 615cacd2c41dede5923be108d462ae702d108e6e
  https://github.com/groonga/groonga/commit/615cacd2c41dede5923be108d462ae702d108e6e

  Message:
    Add update-nfkc target

  Modified files:
    lib/Makefile.am
    lib/nfkc.rb

  Modified: lib/Makefile.am (+28 -0)
===================================================================
--- lib/Makefile.am    2018-04-09 13:10:49 +0900 (c5cfd966f)
+++ lib/Makefile.am    2018-04-09 14:34:17 +0900 (c1b11553c)
@@ -106,3 +106,31 @@ EXTRA_DIST =					\
 	CMakeLists.txt
 
 CLEANFILES = *.gcno *.gcda
+
+
+ICU_VERSION_DOT = $$(echo $(ICU_VERSION) | sed -e 's/_/./g')
+
+icu4c-$(ICU_VERSION)-src.tgz:
+	if [ -z "$(ICU_VERSION)" ]; then	\
+	  echo "Must define ICU_VERSION";	\
+	  false;				\
+	fi
+	wget \
+	  http://download.icu-project.org/files/icu4c/$(ICU_VERSION_DOT)/icu4c-$(ICU_VERSION)-src.tgz
+	rm -rf tmp/icu/
+
+tmp/icu/: icu4c-$(ICU_VERSION)-src.tgz
+	tar xvf
+
+tmp/icu-$(ICU_VERSION)/local/: icu4c-$(ICU_VERSION)-src.tgz
+	rm -rf tmp/icu/
+	mkdir -p tmp
+	cd tmp && tar xf ../icu4c-$(ICU_VERSION)-src.tgz
+	cd tmp/icu/source && \
+	  ./configure --prefix=$$PWD/../../icu-$(ICU_VERSION)/local
+	cd tmp/icu/source && $(MAKE) $(MAKEFLAGS)
+	cd tmp/icu/source && $(MAKE) $(MAKEFLAGS) install
+
+update-nfkc: tmp/icu-$(ICU_VERSION)/local/
+	ICU_HOME=$$PWD/tmp/icu-$(ICU_VERSION)/local \
+	  $(RUBY) nfkc.rb

  Modified: lib/nfkc.rb (+16 -4)
===================================================================
--- lib/nfkc.rb    2018-04-09 13:10:49 +0900 (96e34e7df)
+++ lib/nfkc.rb    2018-04-09 14:34:17 +0900 (97eb7622c)
@@ -1,7 +1,7 @@
 #!/usr/bin/env ruby
 # -*- coding: utf-8 -*-
 #
-# Copyright(C) 2010-2016 Brazil
+# Copyright(C) 2010-2018 Brazil
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -840,8 +840,20 @@ ARGV.each{|arg|
   end
 }
 
-STDERR.puts('compiling icudump')
-system('cc -Wall -O3 -o icudump -I/tmp/local/include -L/tmp/local/lib icudump.c -licuuc -licui18n')
+icu_home = ENV["ICU_HOME"] || "/tmp/local"
+STDERR.puts("compiling icudump on #{icu_home}")
+system("cc",
+       "-Wall",
+       "-O3",
+       "-o", "icudump",
+       "-I#{icu_home}/include",
+       "-L#{icu_home}/lib",
+       "icudump.c",
+       "-licuuc",
+       "-licui18n",
+       "-licudata") or exit(false)
+
+ENV["LD_LIBRARY_PATH"] = "#{icu_home}/lib:#{ENV["LD_LIBRARY_PATH"]}"
 
 STDERR.puts('getting Unicode version')
 unicode_version = `./icudump --version`.strip.gsub(".", "")
@@ -859,7 +871,7 @@ File.open("nfkc#{unicode_version}.c", "w") do |output|
   output.puts(<<-HEADER)
 /* -*- c-basic-offset: 2 -*- */
 /*
-  Copyright(C) 2010-2016 Brazil
+  Copyright(C) #{Time.now.year} Brazil
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180409/fec82cc2/attachment-0001.htm 



More information about the Groonga-commit mailing list
Back to archive index