summaryrefslogtreecommitdiff
path: root/p/ghc/debian/patches/build-unlit-and-hp2ps-twice.patch
blob: 53d6ba13315b80bdeebba5c76fdc1262c25250ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Description: Build unlit and hp2ps twice
Author: Thomas Miedema <thomasmiedema@gmail.com>
        John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

Index: ghc-8.0.1/utils/ghc-pkg/ghc.mk
===================================================================
--- ghc-8.0.1.orig/utils/ghc-pkg/ghc.mk
+++ ghc-8.0.1/utils/ghc-pkg/ghc.mk
@@ -27,7 +27,7 @@ utils/ghc-pkg_PACKAGE = ghc-pkg
 # Note [Why build certain utils twice?]
 #
 # We build certain utils twice: once with stage0, and once with stage1.
-# Examples are ghc-pkg and hsc2hs.
+# Examples are ghc-pkg, hsc2hs, hp2ps and unlit.
 #
 # These tools are needed during the bootstrapping process, so we have to use
 # stage0 to build them at first (stage1 doesn't exist yet). (side note: they're
@@ -38,6 +38,11 @@ utils/ghc-pkg_PACKAGE = ghc-pkg
 # dynamically linked. But the stage0 copies are either statically linked, or
 # linked against libraries on the build machine.
 #
+# Another reason why we can't install the stage0 copies is that they are
+# built to run on the build(=host) platform, but when installing a
+# "cross-compiled stage2 compiler" we need copies that run on the target
+# platform.
+#
 # Therefore we build fresh copies, using the stage1 compiler, and install them
 # when you run 'make install'. They are not used for any other purpose.
 
Index: ghc-8.0.1/utils/hp2ps/ghc.mk
===================================================================
--- ghc-8.0.1.orig/utils/hp2ps/ghc.mk
+++ ghc-8.0.1/utils/hp2ps/ghc.mk
@@ -17,10 +17,23 @@ utils/hp2ps_dist_C_SRCS          = AreaB
                                    Utilities.c
 utils/hp2ps_dist_EXTRA_LIBRARIES = m
 utils/hp2ps_dist_PROGNAME        = $(CrossCompilePrefix)hp2ps
-utils/hp2ps_dist_INSTALL         = YES
+utils/hp2ps_dist_INSTALL         = NO
 utils/hp2ps_dist_INSTALL_INPLACE = YES
 
 utils/hp2ps_CC_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
 
 $(eval $(call build-prog,utils/hp2ps,dist,0))
 
+utils/hp2ps_dist-install_C_SRCS  = AreaBelow.c Curves.c Error.c Main.c \
+                                   Reorder.c TopTwenty.c AuxFile.c Deviation.c \
+                                   HpFile.c Marks.c Scale.c TraceElement.c \
+                                   Axes.c Dimensions.c Key.c PsFile.c Shade.c \
+                                   Utilities.c
+utils/hp2ps_dist-install_EXTRA_LIBRARIES = m
+utils/hp2ps_dist-install_PROGNAME = hp2ps
+utils/hp2ps_dist-install_TOPDIR  = YES
+utils/hp2ps_dist-install_INSTALL = YES
+utils/hp2ps_dist-install_INSTALL_INPLACE = NO
+
+# See Note [Why build certain utils twice?].
+$(eval $(call build-prog,utils/hp2ps,dist-install,1))
Index: ghc-8.0.1/utils/unlit/ghc.mk
===================================================================
--- ghc-8.0.1.orig/utils/unlit/ghc.mk
+++ ghc-8.0.1/utils/unlit/ghc.mk
@@ -13,8 +13,16 @@
 utils/unlit_dist_C_SRCS  = unlit.c
 utils/unlit_dist_PROGNAME = unlit
 utils/unlit_dist_TOPDIR  = YES
-utils/unlit_dist_INSTALL = YES
+utils/unlit_dist_INSTALL = NO
 utils/unlit_dist_INSTALL_INPLACE = YES
 
 $(eval $(call build-prog,utils/unlit,dist,0))
 
+utils/unlit_dist-install_C_SRCS  = unlit.c
+utils/unlit_dist-install_PROGNAME = unlit
+utils/unlit_dist-install_TOPDIR  = YES
+utils/unlit_dist-install_INSTALL = YES
+utils/unlit_dist-install_INSTALL_INPLACE = NO
+
+# See Note [Why build certain utils twice?].
+$(eval $(call build-prog,utils/unlit,dist-install,1))