Skip to content

Commit

Permalink
Improvements to asciidoctor build. (msys2#3350)
Browse files Browse the repository at this point in the history
* 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 (msys2#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.
  • Loading branch information
JPeterMugaas authored and Alexpux committed Feb 7, 2018
1 parent 6fa9d40 commit cf79277
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions mingw-w64-asciidoctor/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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" \
Expand Down

0 comments on commit cf79277

Please sign in to comment.