From cf7927788a5e6b9c97bfc919cbe8faafe6c1e29b Mon Sep 17 00:00:00 2001 From: "J. Peter Mugaas" Date: Wed, 7 Feb 2018 01:55:40 -0500 Subject: [PATCH] Improvements to asciidoctor build. (#3350) * Improvements to asciidoctor build. 1) Fix hardcoded pathes causing bug report ( https://github.com/Alexpux/MINGW-packages/issues/3338 ) 2) Along similar lines, added .install files that fix the batch files to use DOS path references that should be valid. This has to be done on the uer's system. 3) Add testing from the ruby gem. * update QPDF to version 7.1.1 (#3349) * Redo the path fixups that are required for distribution. *.bat files, drop path refs. For the .sh scripts, may sure that they are not hard-coded to the installation dirs. Just use something like /mingw64/bin/ruby and /mingw32/bin/ruby are used to that we calling the correct interpretter in an MSYS environment. * Improvements to asciidoctor build. 1) Fix hardcoded pathes causing bug report ( https://github.com/Alexpux/MINGW-packages/issues/3338 ) 2) Along similar lines, added .install files that fix the batch files to use DOS path references that should be valid. This has to be done on the uer's system. 3) Add testing from the ruby gem. * Redo the path fixups that are required for distribution. *.bat files, drop path refs. For the .sh scripts, may sure that they are not hard-coded to the installation dirs. Just use something like /mingw64/bin/ruby and /mingw32/bin/ruby are used to that we calling the correct interpretter in an MSYS environment. * Improvements to asciidoctor build. 1) Fix hardcoded pathes causing bug report ( https://github.com/Alexpux/MINGW-packages/issues/3338 ) 2) Along similar lines, added .install files that fix the batch files to use DOS path references that should be valid. This has to be done on the uer's system. 3) Add testing from the ruby gem. --- mingw-w64-asciidoctor/PKGBUILD | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/mingw-w64-asciidoctor/PKGBUILD b/mingw-w64-asciidoctor/PKGBUILD index 5cddaeeaae6c8..8281f84b3ef3b 100644 --- a/mingw-w64-asciidoctor/PKGBUILD +++ b/mingw-w64-asciidoctor/PKGBUILD @@ -4,7 +4,7 @@ _realname=asciidoctor pkgbase="mingw-w64-${_realname}" pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=1.5.5 -pkgrel=2 +pkgrel=3 pkgdesc="An implementation of AsciiDoc in Ruby (mingw-w64)" arch=('any') url='http://asciidoctor.org' @@ -14,14 +14,41 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-gcc") source=(https://rubygems.org/downloads/${_realname}-${pkgver}.gem) sha256sums=('87effa3de95919df880aab04c6c29c89255ce671abce361da476208734a5424e') -package() { +check() { local _gemdir="$(ruby -e 'puts Gem.default_dir')" _gemdir="$(cygpath -u ${_gemdir})" - gem install --ignore-dependencies --no-user-install --verbose \ + ${MINGW_PREFIX}/bin/gem check --verbose \ + "${_realname}-${pkgver}.gem" +} + +package() { + local _gemdir="$(${MINGW_PREFIX}/bin/ruby -e 'puts Gem.default_dir')" + _gemdir="$(cygpath -u ${_gemdir})" + + ${MINGW_PREFIX}/bin/gem install --ignore-dependencies --no-user-install --verbose \ -i "${pkgdir}/${_gemdir}" -n "${pkgdir}${MINGW_PREFIX}/bin" \ "${_realname}-${pkgver}.gem" + local _ruby_exe=$(cygpath -m ${MINGW_PREFIX}/bin/ruby.exe) + + #for this conversion, we want the fully qualified ruby .exe path + #so that we can be sure that we are calling the correct one. + sed -e "s|${_ruby_exe}|${MINGW_PREFIX}/bin/ruby|g" \ + -i ${pkgdir}${MINGW_PREFIX}/bin/asciidoctor \ + -i ${pkgdir}${MINGW_PREFIX}/bin/asciidoctor-safe + + #for Win32 .bat files, we want to drop the path references as the path + #refs are not needed since it's involved from the same dir. If we did + #need fully-qualified pathes, they would have to be fully-qualified and + # in DOS format. + local _inst_dir=$(cygpath -m ${pkgdir}/${MINGW_PREFIX}/bin/) + local _w_ruby_exe=$(cygpath -w ${MINGW_PREFIX}/bin/ruby.exe | sed 's/\\/\\\\/g') + sed -e "s|${_w_ruby_exe}|ruby.exe|g" \ + -e "s|${_inst_dir}||g" \ + -i ${pkgdir}${MINGW_PREFIX}/bin/asciidoctor.bat \ + -i ${pkgdir}${MINGW_PREFIX}/bin/asciidoctor-safe.bat + install -Dm644 "${pkgdir}/$_gemdir/gems/${_realname}-${pkgver}/LICENSE.adoc" \ "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE.adoc" install -Dm644 "${pkgdir}/${_gemdir}/gems/${_realname}-${pkgver}/man/asciidoctor.1" \