[Pkg-ganeti-devel] [ganeti] 02/03: Auto-detect the cabal library version used by cabal

Apollon Oikonomopoulos apoikos at moszumanska.debian.org
Mon Jul 25 10:22:52 UTC 2016


This is an automated email from the git hooks/post-receive script.

apoikos pushed a commit to branch master
in repository ganeti.

commit cfd791f0b67b257a01311b2a8f327692f5274621
Author: Apollon Oikonomopoulos <apoikos at debian.org>
Date:   Sun Jul 24 21:50:14 2016 +0300

    Auto-detect the cabal library version used by cabal
    
    In Debian we have two versions of the cabal library:
     - The version shipped with GHC
     - The version shipped with libghc-cabal-dev
    /usr/bin/cabal is /usually/ linked with the latter, but this may not be the
    case (see Debian bug #832144). However, we need to make sure that we read
    dist/setup-config with the same library as that used by the cabal binary that
    created the file.
    
    To this end, parse the output of `cabal -v' and hide all Cabal versions
    apart from the one used by cabal itself.
---
 debian/patches/series                     |  1 +
 debian/patches/use-proper-cabal-dev.patch | 43 +++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index 406f330..0dfc233 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@ ghc-7.10-compatibility.patch
 zlib-0.6-compatibility
 fix_FTBFS_with_sphinx-1.3.5
 fix_ftbfs_with_sphinx_1.4
+use-proper-cabal-dev.patch
diff --git a/debian/patches/use-proper-cabal-dev.patch b/debian/patches/use-proper-cabal-dev.patch
new file mode 100644
index 0000000..13622d3
--- /dev/null
+++ b/debian/patches/use-proper-cabal-dev.patch
@@ -0,0 +1,43 @@
+Author: Apollon Oikonomopoulos <apoikos at debian.org>
+Description: Force runhaskell to use the proper cabal-dev version
+ In Debian we have two versions of the cabal library:
+  - The version shipped with GHC
+  - The version shipped with libghc-cabal-dev
+ /usr/bin/cabal is /usually/ linked with the latter, but this may not be the
+ case (see Debian bug #832144). However, we need to make sure that we read
+ dist/setup-config with the same library as that used by the cabal binary that
+ created the file.
+
+Last-Update: 2016-07-24
+Forwarded: not-needed (debian-specific)
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1373,6 +1373,17 @@
+ # downloading (only `cabal install` can do that).
+ HASKELL_PACKAGE_VERSIONS_FILE = cabal_macros.h
+ 
++# Debian-specific
++# In Debian we have two versions of the cabal library:
++#  - The version shipped with GHC
++#  - The version shipped with libghc-cabal-dev
++# /usr/bin/cabal is /usually/ linked with the latter, but this may not be the
++# case (see Debian bug #832144). However, we need to make sure that we read
++# dist/setup-config with the same library as that used by the cabal binary that
++# created the file.
++DEBIAN_CABAL_DEV_VERSION = \
++	$(shell $(CABAL) -V | $(AWK) '/^using version .* of the Cabal library/ { print $$3 }')
++
+ $(HASKELL_PACKAGE_VERSIONS_FILE): Makefile ganeti.cabal \
+                                   cabal/CabalDependenciesMacros.hs
+ 	touch empty-cabal-config
+@@ -1380,8 +1391,8 @@
+ 	  -f`test $(HTEST) == yes && echo "htest" || echo "-htest"` \
+ 	  -f`test $(ENABLE_MOND) == True && echo "mond" || echo "-mond"` \
+ 	  -f`test $(ENABLE_METADATA) == True && echo "metad" || echo "-metad"`
+-	runhaskell $(abs_top_srcdir)/cabal/CabalDependenciesMacros.hs \
+-	  ganeti.cabal \
++	runhaskell -hide-package=Cabal -package=Cabal-$(DEBIAN_CABAL_DEV_VERSION) \
++	  $(abs_top_srcdir)/cabal/CabalDependenciesMacros.hs ganeti.cabal \
+ 	  $(HASKELL_PACKAGE_IDS_FILE) \
+ 	  $(HASKELL_PACKAGE_VERSIONS_FILE)
+ 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git



More information about the Pkg-ganeti-devel mailing list