summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkinori Hattori <hattya@gentoo.org>2018-07-04 22:56:33 +0900
committerAkinori Hattori <hattya@gentoo.org>2018-07-04 22:56:33 +0900
commit56d9c51fe6a474950f04fe2597fc7d768c4c9d04 (patch)
tree356239e8f1dc67bda9e3e562d344db2a930beeea /www-servers/h2o
parentwww-servers/h2o: update init script (diff)
downloadgentoo-56d9c51fe6a474950f04fe2597fc7d768c4c9d04.tar.gz
gentoo-56d9c51fe6a474950f04fe2597fc7d768c4c9d04.tar.bz2
gentoo-56d9c51fe6a474950f04fe2597fc7d768c4c9d04.zip
www-servers/h2o: use system oniguruma
Closes: https://bugs.gentoo.org/655462 Package-Manager: Portage-2.3.40, Repoman-2.3.9
Diffstat (limited to 'www-servers/h2o')
-rw-r--r--www-servers/h2o/files/h2o-2.2-mruby.patch67
-rw-r--r--www-servers/h2o/files/h2o-2.3-mruby.patch73
-rw-r--r--www-servers/h2o/h2o-2.2.4.ebuild15
-rw-r--r--www-servers/h2o/h2o-9999.ebuild12
4 files changed, 162 insertions, 5 deletions
diff --git a/www-servers/h2o/files/h2o-2.2-mruby.patch b/www-servers/h2o/files/h2o-2.2-mruby.patch
new file mode 100644
index 000000000000..e542ba8b64db
--- /dev/null
+++ b/www-servers/h2o/files/h2o-2.2-mruby.patch
@@ -0,0 +1,67 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -157,6 +157,16 @@
+ SET(WSLAY_LIBRARIES -lwslay)
+ ENDIF (NOT WSLAY_FOUND)
+
++IF (PKG_CONFIG_FOUND)
++ PKG_CHECK_MODULES(ONIG oniguruma)
++ IF (ONIG_FOUND)
++ LINK_DIRECTORIES(${ONIG_LIBRARY_DIRS})
++ ENDIF (ONIG_FOUND)
++ENDIF (PKG_CONFIG_FOUND)
++IF (NOT ONIG_FOUND AND WITH_RUBY)
++ MESSAGE(FATAL_ERROR "Oniguruma not found")
++ENDIF (NOT ONIG_FOUND AND WITH_RUBY)
++
+ IF (ZLIB_FOUND)
+ INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
+ LINK_DIRECTORIES(${ZLIB_LIBRARY_DIRS})
+@@ -460,7 +470,7 @@
+ ELSE ()
+ SET(MRUBY_TOOLCHAIN "gcc")
+ ENDIF ()
+- ADD_CUSTOM_TARGET(mruby MRUBY_TOOLCHAIN=${MRUBY_TOOLCHAIN} MRUBY_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/misc/mruby_config.rb MRUBY_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mruby ruby minirake
++ ADD_CUSTOM_TARGET(mruby MRUBY_TOOLCHAIN=${MRUBY_TOOLCHAIN} MRUBY_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/misc/mruby_config.rb MRUBY_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mruby ruby minirake -v
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/deps/mruby)
+ LIST(APPEND STANDALONE_SOURCE_FILES
+ lib/handler/mruby.c
+@@ -491,7 +501,7 @@
+ # note: the paths need to be determined before libmruby.flags.mak is generated
+ TARGET_LINK_LIBRARIES(h2o
+ "${CMAKE_CURRENT_BINARY_DIR}/mruby/host/lib/libmruby.a"
+- "${CMAKE_CURRENT_BINARY_DIR}/mruby/host/mrbgems/mruby-onig-regexp/onigmo-6.1.1/.libs/libonigmo.a"
++ ${ONIG_LIBRARIES}
+ "m")
+ ADD_DEPENDENCIES(h2o mruby)
+ ENDIF (WITH_MRUBY)
+--- a/deps/mruby-onig-regexp/mrbgem.rake
++++ b/deps/mruby-onig-regexp/mrbgem.rake
+@@ -101,9 +101,7 @@
+ cc.defines += ['HAVE_ONIGMO_H']
+ end
+
+- if spec.respond_to? :search_package and spec.search_package 'onigmo'
+- spec.cc.defines += ['HAVE_ONIGMO_H']
+- elsif spec.respond_to? :search_package and spec.search_package 'oniguruma'
++ if spec.respond_to? :search_package and spec.search_package 'oniguruma'
+ spec.cc.defines += ['HAVE_ONIGURUMA_H']
+ elsif build.cc.respond_to? :search_header_path and build.cc.search_header_path 'oniguruma.h'
+ spec.linker.libraries << 'onig'
+--- a/misc/mruby_config.rb
++++ b/misc/mruby_config.rb
+@@ -15,13 +15,7 @@
+ # use mrbgems
+ Dir.glob("../mruby-*/mrbgem.rake") do |x|
+ g = File.basename File.dirname x
+- if g == 'mruby-onig-regexp'
+- conf.gem "../deps/#{g}" do |c|
+- c.bundle_onigmo
+- end
+- else
+- conf.gem "../deps/#{g}"
+- end
++ conf.gem "../deps/#{g}"
+ end
+
+ # include all the core GEMs
diff --git a/www-servers/h2o/files/h2o-2.3-mruby.patch b/www-servers/h2o/files/h2o-2.3-mruby.patch
new file mode 100644
index 000000000000..a0ad25eba279
--- /dev/null
+++ b/www-servers/h2o/files/h2o-2.3-mruby.patch
@@ -0,0 +1,73 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -174,6 +174,16 @@
+ SET(WSLAY_LIBRARIES -lwslay)
+ ENDIF (NOT WSLAY_FOUND)
+
++IF (PKG_CONFIG_FOUND)
++ PKG_CHECK_MODULES(ONIG oniguruma)
++ IF (ONIG_FOUND)
++ LINK_DIRECTORIES(${ONIG_LIBRARY_DIRS})
++ ENDIF (ONIG_FOUND)
++ENDIF (PKG_CONFIG_FOUND)
++IF (NOT ONIG_FOUND AND WITH_RUBY)
++ MESSAGE(FATAL_ERROR "Oniguruma not found")
++ENDIF (NOT ONIG_FOUND AND WITH_RUBY)
++
+ IF (ZLIB_FOUND)
+ INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
+ LINK_DIRECTORIES(${ZLIB_LIBRARY_DIRS})
+@@ -533,7 +543,7 @@
+ ELSE ()
+ SET(MRUBY_TOOLCHAIN "gcc")
+ ENDIF ()
+- ADD_CUSTOM_TARGET(mruby MRUBY_TOOLCHAIN=${MRUBY_TOOLCHAIN} MRUBY_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/misc/mruby_config.rb MRUBY_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mruby MRUBY_ADDITIONAL_CONFIG=${MRUBY_ADDITIONAL_CONFIG} ruby minirake
++ ADD_CUSTOM_TARGET(mruby MRUBY_TOOLCHAIN=${MRUBY_TOOLCHAIN} MRUBY_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/misc/mruby_config.rb MRUBY_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mruby MRUBY_ADDITIONAL_CONFIG=${MRUBY_ADDITIONAL_CONFIG} ruby minirake -v
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/deps/mruby)
+ LIST(APPEND STANDALONE_SOURCE_FILES
+ lib/handler/mruby.c
+@@ -560,7 +570,7 @@
+ # note: the paths need to be determined before libmruby.flags.mak is generated
+ TARGET_LINK_LIBRARIES(h2o
+ "${CMAKE_CURRENT_BINARY_DIR}/mruby/host/lib/libmruby.a"
+- "${CMAKE_CURRENT_BINARY_DIR}/mruby/host/mrbgems/mruby-onig-regexp/onigmo-6.1.2/.libs/libonigmo.a"
++ ${ONIG_LIBRARIES}
+ "m")
+ ADD_DEPENDENCIES(h2o mruby)
+ ENDIF (WITH_MRUBY)
+--- a/deps/mruby-onig-regexp/mrbgem.rake
++++ b/deps/mruby-onig-regexp/mrbgem.rake
+@@ -101,15 +101,9 @@
+ file "#{dir}/src/mruby_onig_regexp.c" => [:mruby_onig_regexp_with_compile_option, oniguruma_lib]
+ end
+
+- if spec.respond_to? :search_package and spec.search_package 'onigmo'
+- spec.cc.defines += ['HAVE_ONIGMO_H']
+- spec.linker.libraries << 'onig'
+- elsif spec.respond_to? :search_package and spec.search_package 'oniguruma'
++ if spec.respond_to? :search_package and spec.search_package 'oniguruma'
+ spec.cc.defines += ['HAVE_ONIGURUMA_H']
+ spec.linker.libraries << 'onig'
+- elsif build.cc.respond_to? :search_header_path and build.cc.search_header_path 'onigmo.h'
+- spec.cc.defines += ['HAVE_ONIGMO_H']
+- spec.linker.libraries << 'onigmo'
+ elsif build.cc.respond_to? :search_header_path and build.cc.search_header_path 'oniguruma.h'
+ spec.cc.defines += ['HAVE_ONIGURUMA_H']
+ spec.linker.libraries << 'onig'
+--- a/misc/mruby_config.rb
++++ b/misc/mruby_config.rb
+@@ -15,13 +15,7 @@
+ # use mrbgems
+ Dir.glob("../mruby-*/mrbgem.rake") do |x|
+ g = File.basename File.dirname x
+- if g == 'mruby-onig-regexp'
+- conf.gem "../deps/#{g}" do |c|
+- c.bundle_onigmo
+- end
+- else
+- conf.gem "../deps/#{g}"
+- end
++ conf.gem "../deps/#{g}"
+ end
+
+ # include all the core GEMs
diff --git a/www-servers/h2o/h2o-2.2.4.ebuild b/www-servers/h2o/h2o-2.2.4.ebuild
index 449ca5e67118..25c1690eeeb3 100644
--- a/www-servers/h2o/h2o-2.2.4.ebuild
+++ b/www-servers/h2o/h2o-2.2.4.ebuild
@@ -5,7 +5,7 @@ EAPI="6"
CMAKE_MAKEFILE_GENERATOR="emake"
USE_RUBY="ruby23 ruby24"
-inherit cmake-utils ruby-single systemd user
+inherit cmake-utils ruby-single systemd toolchain-funcs user
DESCRIPTION="H2O - the optimized HTTP/1, HTTP/2 server"
HOMEPAGE="https://h2o.examp1e.net/"
@@ -22,11 +22,16 @@ RDEPEND="dev-lang/perl
libressl? ( dev-libs/libressl:0= )"
DEPEND="${RDEPEND}
mruby? (
- sys-devel/bison
${RUBY_DEPS}
+ dev-libs/oniguruma
+ sys-devel/bison
+ virtual/pkgconfig
)"
-PATCHES=( "${FILESDIR}"/${P}-libressl.patch )
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.2-mruby.patch
+ "${FILESDIR}"/${P}-libressl.patch
+)
pkg_setup() {
enewgroup ${PN}
@@ -50,6 +55,10 @@ src_prepare() {
sed -i \
-e "s: ruby: ${ruby}:" \
CMakeLists.txt
+
+ sed -i "s:pkg-config:$(tc-getPKG_CONFIG):g" deps/mruby/lib/mruby/gem.rb
+ tc-export CC
+ export LD="$(tc-getCC)"
}
src_configure() {
diff --git a/www-servers/h2o/h2o-9999.ebuild b/www-servers/h2o/h2o-9999.ebuild
index 0d21e4e8bee1..89f63062ca99 100644
--- a/www-servers/h2o/h2o-9999.ebuild
+++ b/www-servers/h2o/h2o-9999.ebuild
@@ -5,7 +5,7 @@ EAPI="6"
CMAKE_MAKEFILE_GENERATOR="emake"
USE_RUBY="ruby23 ruby24"
-inherit cmake-utils git-r3 ruby-single systemd user
+inherit cmake-utils git-r3 ruby-single systemd toolchain-funcs user
DESCRIPTION="H2O - the optimized HTTP/1, HTTP/2 server"
HOMEPAGE="https://h2o.examp1e.net/"
@@ -22,10 +22,14 @@ RDEPEND="dev-lang/perl
libressl? ( dev-libs/libressl:0= )"
DEPEND="${RDEPEND}
mruby? (
- sys-devel/bison
${RUBY_DEPS}
+ dev-libs/oniguruma
+ sys-devel/bison
+ virtual/pkgconfig
)"
+PATCHES=( "${FILESDIR}"/${PN}-2.3-mruby.patch )
+
pkg_setup() {
enewgroup ${PN}
enewuser ${PN} -1 -1 -1 ${PN}
@@ -48,6 +52,10 @@ src_prepare() {
sed -i \
-e "s: ruby: ${ruby}:" \
CMakeLists.txt
+
+ sed -i "s:pkg-config:$(tc-getPKG_CONFIG):g" deps/mruby/lib/mruby/gem.rb
+ tc-export CC
+ export LD="$(tc-getCC)"
}
src_configure() {