[Pkg-ganeti-devel] [ganeti] 09/13: Drop GHC 7.8 and lens patches

Apollon Oikonomopoulos apoikos at moszumanska.debian.org
Fri Sep 18 11:03:58 UTC 2015


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

apoikos pushed a commit to branch debian/backports/wheezy
in repository ganeti.

commit b07385453244d4c8910f9ae05055809f1e08a376
Author: Apollon Oikonomopoulos <apoikos at debian.org>
Date:   Thu Apr 30 17:35:13 2015 +0300

    Drop GHC 7.8 and lens patches
    
    GHC 7.8 is not in Jessie and the lens patches are part of 2.12.3.
---
 ...mple-CPP-macro-for-detecting-lens-version.patch | 150 ---------------------
 ...enses-correctly-for-different-lens-versio.patch |  42 ------
 debian/patches/ghc7.8.patch                        | 138 -------------------
 debian/patches/series                              |   3 -
 4 files changed, 333 deletions(-)

diff --git a/debian/patches/0001-Create-a-simple-CPP-macro-for-detecting-lens-version.patch b/debian/patches/0001-Create-a-simple-CPP-macro-for-detecting-lens-version.patch
deleted file mode 100644
index ab05b5c..0000000
--- a/debian/patches/0001-Create-a-simple-CPP-macro-for-detecting-lens-version.patch
+++ /dev/null
@@ -1,150 +0,0 @@
-From 9dfe2cf411500478b5954e93f99c4fb27a1637d1 Mon Sep 17 00:00:00 2001
-From: Petr Pudlak <pudlak at google.com>
-Date: Tue, 10 Feb 2015 13:11:44 +0100
-Subject: [PATCH 1/2] Create a simple CPP macro for detecting lens versions
-
-.. in Haskell code.
-
-This patch should be removed starting from 2.14, as there cabal provides
-proper macros for all packages.
-
-The macro in this patch is intentionally kept compatible with the cabal
-macros.
-
-Signed-off-by: Petr Pudlak <pudlak at google.com>
----
- Makefile.am        | 20 +++++++++++++-------
- configure.ac       | 16 ++++++++++++++++
- src/Ganeti/Lens.hs |  7 ++++++-
- 3 files changed, 35 insertions(+), 8 deletions(-)
-
-diff --git a/Makefile.am b/Makefile.am
-index 2bd16e6..67368f3 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -1171,14 +1171,14 @@ Makefile.ghc: $(HS_MAKEFILE_GHC_SRCS) Makefile \
-               | $(built_base_sources) $(HS_BUILT_SRCS)
- 	$(GHC) -M -dep-makefile $@ -dep-suffix $(HPROF_SUFFIX) \
- 		-dep-suffix $(HTEST_SUFFIX) $(HFLAGS) -itest/hs \
--		$(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) $(HS_MAKEFILE_GHC_SRCS)
-+		$(HS_PARALLEL3) $(HS_LENS) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) $(HS_MAKEFILE_GHC_SRCS)
- 
- @include_makefile_ghc@
- 
- %.o:
- 	@echo '[GHC]: $@ <- $^'
- 	@$(GHC) -c $(HFLAGS) \
--		$(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) $(@:%.o=%.hs)
-+		$(HS_PARALLEL3) $(HS_LENS) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) $(@:%.o=%.hs)
- 
- # For TH+profiling we need to compile twice: Once without profiling,
- # and then once with profiling. See
-@@ -1188,14 +1188,15 @@ if HPROFILE
- 	@echo '[GHC|prof]: $@ <- $^'
- 	@$(GHC) -c $(HFLAGS) \
- 	  $(HPROFFLAGS) \
--		$(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) \
-+		$(HS_PARALLEL3) $(HS_LENS) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) \
- 		$(@:%.$(HPROF_SUFFIX)_o=%.hs)
- endif
- 
- %.$(HTEST_SUFFIX)_o:
- 	@echo '[GHC|test]: $@ <- $^'
- 	@$(GHC) -c $(HTEST_FLAGS) \
--		$(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) $(@:%.$(HTEST_SUFFIX)_o=%.hs)
-+		$(HS_PARALLEL3) $(HS_LENS) $(HS_REGEX_PCRE) \
-+		$(HEXTRA_COMBINED) $(@:%.$(HTEST_SUFFIX)_o=%.hs)
- 
- %.hi: %.o ;
- %.$(HTEST_SUFFIX)_hi: %.$(HTEST_SUFFIX)_o ;
-@@ -1209,7 +1210,8 @@ endif
- 	@echo '[GHC-link]: $@'
- 	$(GHC) $(HFLAGS) \
- 		$(HPROFFLAGS) \
--		$(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) --make $(@:%=%.hs)
-+		$(HS_PARALLEL3) $(HS_LENS) $(HS_REGEX_PCRE) \
-+		$(HEXTRA_COMBINED) --make $(@:%=%.hs)
- 	@rm -f $(notdir $@).tix
- 	@touch "$@"
- 
-@@ -1222,7 +1224,8 @@ $(HS_TEST_PROGS): %: %.$(HTEST_SUFFIX)_o \
- 	fi
- 	@echo '[GHC-link|test]: $@'
- 	$(GHC) $(HTEST_FLAGS) \
--		$(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) --make $(@:%=%.hs)
-+		$(HS_PARALLEL3) $(HS_LENS) $(HS_REGEX_PCRE) \
-+		$(HEXTRA_COMBINED) --make $(@:%=%.hs)
- 	@rm -f $(notdir $@).tix
- 	@touch "$@"
- 
-@@ -2556,6 +2559,9 @@ $(APIDOC_HS_DIR)/index.html: $(HS_LIBTESTBUILT_SRCS) Makefile
- 	if [ "$(HS_PARALLEL3)" ]; \
- 	then OPTGHC="$$OPTGHC --optghc=$(HS_PARALLEL3)"; \
- 	fi; \
-+	if [ "$(HS_LENS)" ]; \
-+	then OPTGHC="$$OPTGHC $(addprefix --optghc=,$(HS_LENS))"; \
-+	fi; \
- 	if [ "$(HS_REGEX_PCRE)" ]; \
- 	then OPTGHC="$$OPTGHC --optghc=$(HS_REGEX_PCRE)"; \
- 	fi; \
-@@ -2580,7 +2586,7 @@ TAGS: $(GENERATED_FILES)
- 		-osuf tags.o \
- 		-hisuf tags.hi \
-     -lcurl \
--	  $(HS_PARALLEL3) $(HS_REGEX_PCRE) \
-+	  $(HS_PARALLEL3) $(HS_LENS) $(HS_REGEX_PCRE) \
- 	  $(HS_LIBTEST_SRCS)
- 	find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
- 	  -path './daemons/ganeti-*' -o -path './tools/*' -o \
-diff --git a/configure.ac b/configure.ac
-index 0cf7019..114ba59 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -626,6 +626,22 @@ AC_GHC_PKG_CHECK([parallel-3.*], [HS_PARALLEL3=-DPARALLEL3],
-                  [AC_GHC_PKG_REQUIRE(parallel)], t)
- AC_SUBST(HS_PARALLEL3)
- 
-+# check for lens versions; 0 means an unknown version;
-+# this (and the corresponding code in Makefile.am) should be removed starting
-+# from 2.14, as there cabal creates proper CPP macros to distinguish package
-+# versions
-+HS_LENS="-DLENS_MAJOR=0 -DLENS_MINOR=0"
-+AC_GHC_PKG_CHECK([lens-3.*], [HS_LENS="-DLENS_MAJOR=3 -DLENS_MINOR=0"], [], t)
-+AC_GHC_PKG_CHECK([lens-4.*], [HS_LENS="-DLENS_MAJOR=4 -DLENS_MINOR=7"], [], t)
-+AC_GHC_PKG_CHECK([lens-4.0.*], [HS_LENS="-DLENS_MAJOR=4 -DLENS_MINOR=0"], [], t)
-+AC_GHC_PKG_CHECK([lens-4.1.*], [HS_LENS="-DLENS_MAJOR=4 -DLENS_MINOR=1"], [], t)
-+AC_GHC_PKG_CHECK([lens-4.2.*], [HS_LENS="-DLENS_MAJOR=4 -DLENS_MINOR=2"], [], t)
-+AC_GHC_PKG_CHECK([lens-4.3.*], [HS_LENS="-DLENS_MAJOR=4 -DLENS_MINOR=3"], [], t)
-+AC_GHC_PKG_CHECK([lens-4.4.*], [HS_LENS="-DLENS_MAJOR=4 -DLENS_MINOR=4"], [], t)
-+AC_GHC_PKG_CHECK([lens-4.5.*], [HS_LENS="-DLENS_MAJOR=4 -DLENS_MINOR=5"], [], t)
-+AC_GHC_PKG_CHECK([lens-4.6.*], [HS_LENS="-DLENS_MAJOR=4 -DLENS_MINOR=6"], [], t)
-+AC_SUBST(HS_LENS)
-+
- # and now standard modules
- AC_GHC_PKG_REQUIRE(curl)
- AC_GHC_PKG_REQUIRE(json)
-diff --git a/src/Ganeti/Lens.hs b/src/Ganeti/Lens.hs
-index b3bd69f..8f9b976 100644
---- a/src/Ganeti/Lens.hs
-+++ b/src/Ganeti/Lens.hs
-@@ -1,4 +1,4 @@
--{-# LANGUAGE RankNTypes #-}
-+{-# LANGUAGE RankNTypes, CPP #-}
- 
- {-| Provides all lens-related functions.
- 
-@@ -44,6 +44,11 @@ module Ganeti.Lens
-   , atSet
-   ) where
- 
-+-- The following macro is just a temporary solution for 2.12 and 2.13.
-+-- Since 2.14 cabal creates proper macros for all dependencies.
-+#define MIN_VERSION_lens(maj,min,rev) \
-+  (((maj)<LENS_MAJOR)||(((maj)==LENS_MAJOR)&&((min)<=LENS_MINOR)))
-+
- import Control.Applicative ((<$>), WrappedMonad(..))
- import Control.Lens
- import Control.Monad
--- 
-2.1.4
-
diff --git a/debian/patches/0002-Construct-lenses-correctly-for-different-lens-versio.patch b/debian/patches/0002-Construct-lenses-correctly-for-different-lens-versio.patch
deleted file mode 100644
index 9d89a34..0000000
--- a/debian/patches/0002-Construct-lenses-correctly-for-different-lens-versio.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 1136f1cbf85444dcd0b942545e7f4000b81befbc Mon Sep 17 00:00:00 2001
-From: Petr Pudlak <pudlak at google.com>
-Date: Tue, 10 Feb 2015 13:18:00 +0100
-Subject: [PATCH 2/2] Construct lenses correctly for different 'lens' versions
-
-As the interface of the TH code for generating lenses changed twice in
-4.*, we need to differentiate between versions accordingly.
-
-Signed-off-by: Petr Pudlak <pudlak at google.com>
----
- src/Ganeti/Lens.hs | 15 +++++++++++++--
- 1 file changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/src/Ganeti/Lens.hs b/src/Ganeti/Lens.hs
-index 8f9b976..0299e1a 100644
---- a/src/Ganeti/Lens.hs
-+++ b/src/Ganeti/Lens.hs
-@@ -69,8 +69,19 @@ makeCustomLensesFiltered :: (String -> Bool) -> Name -> Q [Dec]
- makeCustomLensesFiltered f = makeLensesWith customRules
-   where
-     customRules :: LensRules
--    customRules = set lensField (fmap lensFieldName . mfilter f . Just)
--                      defaultRules
-+    customRules = set lensField nameFun lensRules
-+#if MIN_VERSION_lens(4,5,0)
-+    nameFun :: Name -> [Name] -> Name -> [DefName]
-+    nameFun _ _ = liftM (TopName . mkName) . nameFilter . nameBase
-+#elif MIN_VERSION_lens(4,4,0)
-+    nameFun :: [Name] -> Name -> [DefName]
-+    nameFun _ = liftM (TopName . mkName) . nameFilter . nameBase
-+#else
-+    nameFun :: String -> Maybe String
-+    nameFun = nameFilter
-+#endif
-+    nameFilter :: (MonadPlus m) => String -> m String
-+    nameFilter = liftM lensFieldName . mfilter f . return
- 
- -- | Create lenses for all fields of a given data type.
- makeCustomLenses :: Name -> Q [Dec]
--- 
-2.1.4
-
diff --git a/debian/patches/ghc7.8.patch b/debian/patches/ghc7.8.patch
deleted file mode 100644
index 010b011..0000000
--- a/debian/patches/ghc7.8.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-Author: Apollon Oikonomopoulos <apoikos at debian.org>
-Description: GHC 7.8 support
- Cherry-pick the following commits from upstream's master branch:
- .
-   b78a2c3 Makefile.am: Fix wrong -dep-suffix for GHC 7.8
-   083776b Fix compiler invocation for GHC >= 7.8
-   9664aff Makefile.am: Don't use dots in -osuf
-   1ad14f3 Makefile.am: Don't use -dynamic-too for .hpc_o files
-
-Forwarded: not-needed
-Last-Update: 2015-04-30
-diff --git a/Makefile.am b/Makefile.am
-index 645577e..ac1dddf 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -728,6 +728,28 @@ endif
- HTEST_SUFFIX = hpc
- HPROF_SUFFIX = prof
- 
-+DEP_SUFFIXES =
-+if GHC_LE_76
-+DEP_SUFFIXES += -dep-suffix $(HPROF_SUFFIX) -dep-suffix $(HTEST_SUFFIX)
-+else
-+# GHC >= 7.8 stopped putting underscores into -dep-suffix by itself
-+# (https://ghc.haskell.org/trac/ghc/ticket/9749) so we have to put them.
-+# It also needs -dep-suffix "" for the .o file.
-+DEP_SUFFIXES += -dep-suffix $(HPROF_SUFFIX)_ -dep-suffix $(HTEST_SUFFIX)_ \
-+	-dep-suffix ""
-+endif
-+
-+# GHC > 7.6 needs -dynamic-too when using Template Haskell since its
-+# ghci is switched to loading dynamic libraries by default.
-+# It must only be used in non-profiling GHC invocations.
-+# We also don't use it in compilations that use HTEST_SUFFIX (which are
-+# compiled with -fhpc) because HPC coverage doesn't interact well with
-+# GHCI shared lib loading (https://ghc.haskell.org/trac/ghc/ticket/9762).
-+HFLAGS_DYNAMIC =
-+if !GHC_LE_76
-+HFLAGS_DYNAMIC += -dynamic-too
-+endif
-+
- if HPROFILE
- HPROFFLAGS = -prof -fprof-auto-top -osuf $(HPROF_SUFFIX)_o \
- 	-hisuf $(HPROF_SUFFIX)_hi -rtsopts
-@@ -740,8 +762,8 @@ HFLAGS += -DTEST
- endif
- 
- HTEST_FLAGS = $(HFLAGS) -fhpc -itest/hs \
--	-osuf .$(HTEST_SUFFIX)_o \
--	-hisuf .$(HTEST_SUFFIX)_hi
-+	-osuf $(HTEST_SUFFIX)_o \
-+	-hisuf $(HTEST_SUFFIX)_hi
- 
- # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
- HEXTRA =
-@@ -1196,8 +1218,8 @@ HS_MAKEFILE_GHC_SRCS += $(HS_TEST_PROGS:%=%.hs)
- endif
- Makefile.ghc: $(HS_MAKEFILE_GHC_SRCS) Makefile hs-pkg-versions \
-               | $(built_base_sources) $(HS_BUILT_SRCS)
--	$(GHC) -M -dep-makefile $@ -dep-suffix $(HPROF_SUFFIX) \
--		-dep-suffix $(HTEST_SUFFIX) $(HFLAGS) -itest/hs \
-+	$(GHC) -M -dep-makefile $@ $(DEP_SUFFIXES) $(HFLAGS) $(HFLAGS_DYNAMIC) \
-+		-itest/hs \
- 	  $(shell cat hs-pkg-versions) \
- 		$(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) $(HS_MAKEFILE_GHC_SRCS)
- # Since ghc -M does not generate dependency line for object files, dependencies
-@@ -1214,9 +1236,20 @@ Makefile.ghc: $(HS_MAKEFILE_GHC_SRCS) Makefile hs-pkg-versions \
- 
- @include_makefile_ghc@
- 
--%.o: hs-pkg-versions
-+# Like the %.o rule, but allows access to the test/hs directory.
-+# This uses HFLAGS instead of HTEST_FLAGS because it's only for generating
-+# object files (.o for GHC <= 7.6, .o/.so for newer GHCs) that are loaded
-+# in GHCI when evaluating TH. The actual test-with-coverage .hpc_o files
-+# are created in the `%.$(HTEST_SUFFIX)_o` rule.
-+test/hs/%.o:
-+	@echo '[GHC|test]: $@ <- test/hs/$^'
-+	@$(GHC) -c $(HFLAGS) -itest/hs $(HFLAGS_DYNAMIC) \
-+	  $(shell cat hs-pkg-versions) \
-+		$(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) $(@:%.o=%.hs)
-+
-+%.o:
- 	@echo '[GHC]: $@ <- $^'
--	@$(GHC) -c $(HFLAGS) \
-+	@$(GHC) -c $(HFLAGS) $(HFLAGS_DYNAMIC) \
- 	  $(shell cat hs-pkg-versions) \
- 		$(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) $(@:%.o=%.hs)
- 
-@@ -1233,7 +1266,11 @@ if HPROFILE
- 		$(@:%.$(HPROF_SUFFIX)_o=%.hs)
- endif
- 
--%.$(HTEST_SUFFIX)_o: hs-pkg-versions
-+# We depend on the non-test .o file here because we need the corresponding .so
-+# file for GHC > 7.6 ghci dynamic loading for TH, and creating the .o file
-+# will create the .so file since we use -dynamic-too (using the `test/hs/%.o`
-+# rule).
-+%.$(HTEST_SUFFIX)_o: hs-pkg-versions %.o
- 	@echo '[GHC|test]: $@ <- $^'
- 	@$(GHC) -c $(HTEST_FLAGS) \
- 	  $(shell cat hs-pkg-versions) \
-@@ -1245,14 +1282,16 @@ endif
- 
- if HPROFILE
- $(HS_SRC_PROGS): %: %.$(HPROF_SUFFIX)_o | stamp-directories
-+	@echo '[GHC-link]: $@'
-+	$(GHC) $(HFLAGS) $(HPROFFLAGS) \
-+		$(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) --make $(@:%=%.hs)
- else
--$(HS_SRC_PROGS): %: %.o hs-pkg-versions | stamp-directories
--endif
-+$(HS_SRC_PROGS): %: %.o | stamp-directories
- 	@echo '[GHC-link]: $@'
--	$(GHC) $(HFLAGS) \
-+	$(GHC) $(HFLAGS) $(HFLAGS_DYNAMIC) \
- 	  $(shell cat hs-pkg-versions) \
--		$(HPROFFLAGS) \
- 		$(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) --make $(@:%=%.hs)
-+endif
- 	@rm -f $(notdir $@).tix
- 	@touch "$@"
- 
-diff --git a/configure.ac b/configure.ac
-index 46a7096..422a5ff 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -619,6 +619,10 @@ if test -z "$GHC"; then
-   AC_MSG_FAILURE([ghc not found, compilation will not possible])
- fi
- 
-+# Note: Character classes ([...]) need to be double quoted due to autoconf
-+# using m4
-+AM_CONDITIONAL([GHC_LE_76], [$GHC --numeric-version | grep -q '^7\.[[0-6]]\.'])
-+
- AC_MSG_CHECKING([checking for extra GHC flags])
- GHC_BYVERSION_FLAGS=
- # check for GHC supported flags that vary accross versions
diff --git a/debian/patches/series b/debian/patches/series
index 59e1ed2..71e520b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,6 +2,3 @@ fix-startup-with-old-config.patch
 cfgupgrade12-remove-old-ssconf.patch
 0003-Disable-local-checks-during-build.patch
 do-not-backup-export-dir.patch
-0001-Create-a-simple-CPP-macro-for-detecting-lens-version.patch
-0002-Construct-lenses-correctly-for-different-lens-versio.patch
-ghc7.8.patch

-- 
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