commit:     9de2814211ceca4a2b501584b815defa6cea11fe
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 16 22:04:15 2021 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Fri Apr 16 22:11:37 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9de28142

dev-haskell/wxc: switch to WX_GTK_VER="3.0-gtk3"

Reported-by: David Seifert
Closes: https://bugs.gentoo.org/781038
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 dev-haskell/wxc/files/wxc-0.92.3.0-cabal-3.2.patch | 27 +++++++++
 dev-haskell/wxc/wxc-0.92.3.0-r1.ebuild             | 68 ++++++++++++++++++++++
 2 files changed, 95 insertions(+)

diff --git a/dev-haskell/wxc/files/wxc-0.92.3.0-cabal-3.2.patch 
b/dev-haskell/wxc/files/wxc-0.92.3.0-cabal-3.2.patch
new file mode 100644
index 00000000000..096e971de4b
--- /dev/null
+++ b/dev-haskell/wxc/files/wxc-0.92.3.0-cabal-3.2.patch
@@ -0,0 +1,27 @@
+--- a/Setup.hs
++++ b/Setup.hs
+@@ -81,7 +81,12 @@ rawShellSystemStdInOut :: Verbosity                     -- 
Verbosity level
+                        -> FilePath                      -- Path to command
+                        -> [String]                      -- Command arguments
+                        -> IO (String, String, ExitCode) -- (Command result, 
Errors, Command exit status)
+-#if MIN_VERSION_Cabal(2,2,0)
++
++#if MIN_VERSION_Cabal(3,2,0)
++rawShellSystemStdInOut v f as = do
++  (so, se, c) <- rawSystemStdInOut v "sh" (f:as) Nothing Nothing Nothing 
DSU.IODataModeText
++  return (so, se, c)
++#elif MIN_VERSION_Cabal(2,2,0)
+ rawShellSystemStdInOut v f as = do
+   (~(DSU.IODataText so), se, c) <- rawSystemStdInOut v "sh" (f:as) Nothing 
Nothing Nothing DSU.IODataModeText
+   return (so, se, c)
+@@ -444,7 +449,9 @@ deMsysPaths bi = do
+     if b
+     then do
+         let cor ph = do
+-#if MIN_VERSION_Cabal(2,2,0)
++#if MIN_VERSION_Cabal(3,2,0)
++            (r, e, c) <- rawSystemStdInOut normal "sh" ["-c", "cd " ++ ph ++ 
"; pwd -W"] Nothing Nothing Nothing DSU.IODataModeText
++#elif MIN_VERSION_Cabal(2,2,0)
+             (~(DSU.IODataText r), e, c) <- rawSystemStdInOut normal "sh" 
["-c", "cd " ++ ph ++ "; pwd -W"] Nothing Nothing Nothing DSU.IODataModeText
+ #else
+             (r, e, c ) <- rawSystemStdInOut normal "sh" ["-c", "cd " ++ ph ++ 
"; pwd -W"] Nothing Nothing Nothing False

diff --git a/dev-haskell/wxc/wxc-0.92.3.0-r1.ebuild 
b/dev-haskell/wxc/wxc-0.92.3.0-r1.ebuild
new file mode 100644
index 00000000000..d9c666dfcca
--- /dev/null
+++ b/dev-haskell/wxc/wxc-0.92.3.0-r1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+# ebuild generated by hackport 0.5.3.9999
+
+WX_GTK_VER="3.0-gtk3"
+
+CABAL_FEATURES="lib profile" # ho docs as it has no haskell files
+inherit haskell-cabal multilib wxwidgets
+
+DESCRIPTION="wxHaskell C++ wrapper"
+HOMEPAGE="https://wiki.haskell.org/WxHaskell";
+SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz";
+
+LICENSE="wxWinLL-3.1"
+SLOT="${WX_GTK_VER}/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE="gstreamer"
+
+RDEPEND=">dev-haskell/split-0:=[profile?]
+       >=dev-haskell/wxdirect-0.90.1.1:${WX_GTK_VER}=[profile?]
+       x11-libs/wxGTK:${WX_GTK_VER}=[X,gstreamer?,opengl]
+       >=dev-lang/ghc-7.6.1:=
+       !!dev-haskell/wxc:3.0
+"
+DEPEND="${RDEPEND}
+       >=dev-haskell/cabal-1.23
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.92.3.0-cabal-2.2.patch
+       "${FILESDIR}"/${PN}-0.92.3.0-cabal-3.patch
+       "${FILESDIR}"/${PN}-0.92.3.0-cabal-3.2.patch
+)
+
+src_prepare() {
+       default
+
+       setup-wxwidgets
+
+       sed -e "s@\"wx-config\"@\"${WX_CONFIG}\"@g" \
+               -i "${S}/Setup.hs" || die "Could not specify wx-config in 
Setup.hs"
+}
+
+src_configure() {
+       local cgcc=()
+       for i in ${CXXFLAGS}
+       do
+               cgcc+=( --gcc-option="${i}" )
+       done
+       # Trying to specify the LDFLAGS in --ld-option does not work, as ld does
+       # not understand ld options prefixed with -Wl,
+       # The linker that is used to link the libwxc.so shared library is hard 
coded
+       # in Setup.hs.  So the --with-ld would not change the linker used when
+       # linking libwxc.so.  --with-ld="gcc" does not help, as then cabal 
passes
+       # ld options like -x to gcc which then returns a non-zero exit status, 
then
+       # cabal ignores all the --ld-option parameters.
+       # So I place all the LDFLAGS in --gcc-option parameters. They are 
ignored
+       # when building .o files.
+       local cld=()
+       for i in ${LDFLAGS}
+       do
+               cld+=( --gcc-option="${i}" )
+       done
+       cabal_src_configure ${cgcc[*]} ${cld[*]} --verbose=3
+}

Reply via email to