commit:     435ed81027af89851662958ee3a45aaa7ced5966
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  2 16:27:38 2021 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Mon Aug  2 16:42:44 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=435ed810

app-text/htmltidy: add subslot, instrument tests, install headers and tab2space

Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 .../files/htmltidy-5.8.0-no_static_lib.patch       | 13 ++--
 app-text/htmltidy/htmltidy-5.8.0-r1.ebuild         | 76 ++++++++++++++++++++++
 app-text/htmltidy/htmltidy-5.8.0.ebuild            | 44 -------------
 app-text/htmltidy/metadata.xml                     |  3 +
 4 files changed, 85 insertions(+), 51 deletions(-)

diff --git a/app-text/htmltidy/files/htmltidy-5.8.0-no_static_lib.patch 
b/app-text/htmltidy/files/htmltidy-5.8.0-no_static_lib.patch
index d9b1d3f5e50..476db036730 100644
--- a/app-text/htmltidy/files/htmltidy-5.8.0-no_static_lib.patch
+++ b/app-text/htmltidy/files/htmltidy-5.8.0-no_static_lib.patch
@@ -1,9 +1,10 @@
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -394,35 +394,6 @@
+@@ -393,34 +393,7 @@
+ endif ()
  
  
- #------------------------------------------------------------------------
+-#------------------------------------------------------------------------
 -# Static Library
 -#   The static library always builds.
 -#------------------------------------------------------------------------
@@ -25,14 +26,12 @@
 -        ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
 -        LIBRARY DESTINATION ${LIB_INSTALL_DIR}
 -        )
--install( FILES ${HFILES} DESTINATION ${INCLUDE_INSTALL_DIR} )
+ install( FILES ${HFILES} DESTINATION ${INCLUDE_INSTALL_DIR} )
 -if(MSVC)
 -    # install(FILES $<TARGET_PDB_FILE:${name}> DESTINATION lib OPTIONAL)
 -    INSTALL(FILES ${PROJECT_BINARY_DIR}/${name}.dir/Debug/${name}.pdb
 -    DESTINATION lib CONFIGURATIONS Debug )
 -endif()
--
--#------------------------------------------------------------------------
- # Dynamic Library
- #   If the user option is still on.
+ 
  #------------------------------------------------------------------------
+ # Dynamic Library

diff --git a/app-text/htmltidy/htmltidy-5.8.0-r1.ebuild 
b/app-text/htmltidy/htmltidy-5.8.0-r1.ebuild
new file mode 100644
index 00000000000..3ca575025b3
--- /dev/null
+++ b/app-text/htmltidy/htmltidy-5.8.0-r1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+USE_RUBY="ruby26 ruby27"
+RUBY_OPTIONAL="yes"
+
+inherit cmake ruby-ng
+
+MY_PN="tidy-html5"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Tidy the layout and correct errors in HTML and XML documents"
+HOMEPAGE="https://www.html-tidy.org/";
+SRC_URI="https://github.com/htacg/${MY_PN}/archive/refs/tags/${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/58" # subslot is SOVERSION
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 
~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
+IUSE="deprecated test"
+
+# TODO: in principle this works but the new dependencies have got WAY fewer
+# keywords at the moment, keep tests restricted until the situation has 
improved.
+#RESTRICT="!test? ( test )"
+#ruby_add_bdepend "test? ( dev-ruby/thor dev-ruby/tty-editor )"
+RESTRICT="test"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-5.8.0-no_static_lib.patch
+)
+
+DOCS=( README.md README/CHANGELOG.md )
+
+S="${WORKDIR}"/${MY_P}
+
+pkg_setup() {
+       use test && ruby-ng_pkg_setup
+}
+
+src_unpack() {
+       # suppress ruby-ng export
+       default
+}
+
+src_prepare() {
+       # suppress ruby-ng export
+       cmake_src_prepare
+}
+
+src_compile() {
+       # suppress ruby-ng export
+       cmake_src_compile
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DTIDY_CONSOLE_SHARED=ON
+       )
+       use deprecated && mycmakeargs+=(
+               -DBUILD_TAB2SPACE=ON
+               -DTIDY_COMPAT_HEADERS=ON
+       )
+       cmake_src_configure
+}
+
+src_test() {
+       cd regression_testing || die
+       rm -f Gemfile.lock
+       ${RUBY} ./test.rb test -t "${BUILD_DIR}/tidy" || die "Test execution 
failed"
+}
+
+src_install() {
+       cmake_src_install
+       use deprecated && dobin "${BUILD_DIR}"/tab2space
+}

diff --git a/app-text/htmltidy/htmltidy-5.8.0.ebuild 
b/app-text/htmltidy/htmltidy-5.8.0.ebuild
deleted file mode 100644
index 5b1dd6ce6a2..00000000000
--- a/app-text/htmltidy/htmltidy-5.8.0.ebuild
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake
-
-MY_PN="tidy-html5"
-MY_P="${MY_PN}-${PV}"
-
-DESCRIPTION="Tidy the layout and correct errors in HTML and XML documents"
-HOMEPAGE="https://www.html-tidy.org/";
-SRC_URI="https://github.com/htacg/${MY_PN}/archive/refs/tags/${PV}.tar.gz -> 
${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 
~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
-
-# TODO: get this going - needs Ruby + a bunch of gems
-RESTRICT="test"
-
-PATCHES=(
-       "${FILESDIR}"/${PN}-5.8.0-no_static_lib.patch
-)
-
-DOCS=( README.md README/CHANGELOG.md )
-
-S="${WORKDIR}"/${MY_P}
-
-src_configure() {
-       local mycmakeargs=(
-               -DBUILD_TAB2SPACE=ON    # for compatibility with W3C versions
-               -DTIDY_COMPAT_HEADERS=ON # ditto
-               -DTIDY_CONSOLE_SHARED=ON
-       )
-       cmake_src_configure
-}
-
-src_test() {
-       pushd regression_testing >/dev/null || die
-       # FIXME: use the correct Ruby interpreter
-       ./test.rb test || die "Test execution failed"
-       popd >/dev/null || die
-}

diff --git a/app-text/htmltidy/metadata.xml b/app-text/htmltidy/metadata.xml
index da7f8463f9b..d1dfd0869ca 100644
--- a/app-text/htmltidy/metadata.xml
+++ b/app-text/htmltidy/metadata.xml
@@ -9,4 +9,7 @@
                <remote-id type="cpe">cpe:/a:htacg:tidy</remote-id>
                <remote-id type="github">htacg/tidy-html5</remote-id>
        </upstream>
+       <use>
+               <flag name="deprecated">Install tools and header files which 
are now considered deprecated</flag>
+       </use>
 </pkgmetadata>

Reply via email to