git: 64fb6a8ba0ba - main - lang/ghc: Remove custom UserSettings.hs
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 01 Sep 2025 19:11:03 UTC
The branch main has been updated by arrowd:
URL: https://cgit.FreeBSD.org/ports/commit/?id=64fb6a8ba0ba6f932f7a5532c041bac6ea0a2f08
commit 64fb6a8ba0ba6f932f7a5532c041bac6ea0a2f08
Author: Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2025-08-17 09:20:08 +0000
Commit: Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-09-01 19:10:54 +0000
lang/ghc: Remove custom UserSettings.hs
We're going to use flavour transformers instead
---
lang/ghc/Makefile | 12 +------
lang/ghc/files/UserSettings.hs | 75 ------------------------------------------
2 files changed, 1 insertion(+), 86 deletions(-)
diff --git a/lang/ghc/Makefile b/lang/ghc/Makefile
index 88cf3f8c2f3f..5c3345e35bd7 100644
--- a/lang/ghc/Makefile
+++ b/lang/ghc/Makefile
@@ -59,8 +59,6 @@ DYNAMIC_CONFIGURE_WITH= system-libffi \
ffi-includes=${LOCALBASE}/include \
ffi-libraries=${LOCALBASE}/lib
DYNAMIC_LIB_DEPENDS= libffi.so:devel/libffi
-DYNAMIC_VARS= hadrian_setting_dynamic=True
-DYNAMIC_VARS_OFF= hadrian_setting_dynamic=False
# do not replace this with GMP_CONFIGURE_WITH
# it adds "--without-gmp-*" when the option is OFF, which results in "no" value
@@ -70,9 +68,6 @@ GMP_CONFIGURE_ON= --with-gmp-includes=${LOCALBASE}/include \
GMP_LIB_DEPENDS= libgmp.so:math/gmp
GMP_VARS_OFF= hadrian_gmp_arg=--bignum=native
-PROFILE_VARS= hadrian_setting_profile=True
-PROFILE_VARS_OFF= hadrian_setting_profile=False
-
GHC_VERSION?= 9.8.4
LLVM_VERSION?= 15
BOOT_GHC_VERSION?= 9.6.7
@@ -118,7 +113,7 @@ LIB_DEPENDS+= libffi.so:devel/libffi
.undef DYNAMIC_CONFIGURE_WITH
CONFIGURE_ARGS+= --with-system-libffi --with-ffi-includes=${LOCALBASE}/include --with-ffi-libraries=${LOCALBASE}/lib
HADRIAN_CMD= ${WRKSRC}/hadrian/bootstrap/_build/bin/hadrian ${HADRIAN_DOCS_ARG} ${HADRIAN_GMP_ARG}
-DO_MAKE_BUILD= ${SETENVI} ${WRK_ENV} ${HADRIAN_CMD} ${_MAKE_JOBS} --flavour=ports
+DO_MAKE_BUILD= ${SETENVI} ${WRK_ENV} ${HADRIAN_CMD} ${_MAKE_JOBS}
ALL_TARGET= binary-dist-dir
INSTALL_WRKSRC= ${WRKSRC}/_build/bindist/ghc-${GHC_VERSION}-${CONFIGURE_TARGET}
@@ -147,11 +142,6 @@ CONFIGURE_TARGET= ${ARCH}-unknown-freebsd${"${ARCH:Maarch64}" != "":?:-gnueabihf
CONFIGURE_ARGS+= --host=${CONFIGURE_TARGET}
.endif
-post-patch:
- ${SED} -e 's|%%DYNAMIC%%|${HADRIAN_SETTING_DYNAMIC}|' \
- -e 's|%%PROFILE%%|${HADRIAN_SETTING_PROFILE}|' \
- ${PATCHDIR}/UserSettings.hs > ${WRKSRC}/hadrian/src/UserSettings.hs
-
pre-configure:
# Call the bootstrap script
cd ${WRKSRC} && ${BOOT_SCRIPT}
diff --git a/lang/ghc/files/UserSettings.hs b/lang/ghc/files/UserSettings.hs
deleted file mode 100644
index 01d8b0187f06..000000000000
--- a/lang/ghc/files/UserSettings.hs
+++ /dev/null
@@ -1,75 +0,0 @@
--- Ensure we don't expose any unfoldings to guarantee quick rebuilds
-{-# OPTIONS_GHC -O0 #-}
-
--- If you want to customise your build you should copy this file from
--- hadrian/src/UserSettings.hs to hadrian/UserSettings.hs and edit your copy.
--- If you don't copy the file your changes will be tracked by git and you can
--- accidentally commit them.
---
--- See doc/user-settings.md for instructions, and src/Flavour.hs for auxiliary
--- functions for manipulating flavours.
--- Please update doc/user-settings.md when committing changes to this file.
-module UserSettings (
- userFlavours, userPackages, userDefaultFlavour,
- verboseCommand, buildProgressColour, successColour, finalStage
- ) where
-
-import qualified Data.Set as Set
-import Flavour.Type
-import Expression
-import {-# SOURCE #-} Settings.Default
-
--- See doc/user-settings.md for instructions.
--- Please update doc/user-settings.md when committing changes to this file.
-
--- | Name of the default flavour, i.e the one used when no --flavour=<name>
--- argument is passed to Hadrian.
-userDefaultFlavour :: String
-userDefaultFlavour = "default"
-
--- | User-defined build flavours. See 'userFlavour' as an example.
-userFlavours :: [Flavour]
-userFlavours = [userFlavour] -- Add more build flavours if need be.
-
--- | This is an example user-defined build flavour. Feel free to modify it and
--- use by passing @--flavour=user@ from the command line.
-userFlavour :: Flavour
-userFlavour = defaultFlavour {
- name = "ports"
- , libraryWays = Set.difference <$> defaultLibraryWays <*> pure ws
- , dynamicGhcPrograms = pure %%DYNAMIC%%
--- , ghcProfiled = %%PROFILE%%
- }
- where
- ws = Set.fromList $ concat [
- if %%DYNAMIC%% then [] else [dynamic]
- , if %%PROFILE%% then [] else [profiling]]
-
--- | Add user-defined packages. Note, this only lets Hadrian know about the
--- existence of a new package; to actually build it you need to create a new
--- build flavour, modifying the list of packages that are built by default.
-userPackages :: [Package]
-userPackages = []
-
--- | Set to 'True' to print full command lines during the build process. Note:
--- this is a 'Predicate', hence you can enable verbose output only for certain
--- targets, e.g.: @verboseCommand = package ghcPrim@.
-verboseCommand :: Predicate
-verboseCommand = do
- verbosity <- expr getVerbosity
- return $ verbosity >= Verbose
-
--- | Set colour for build progress messages (e.g. executing a build command).
-buildProgressColour :: BuildProgressColour
-buildProgressColour = mkBuildProgressColour (Dull Magenta)
-
--- | Set colour for success messages (e.g. a package is built successfully).
-successColour :: SuccessColour
-successColour = mkSuccessColour (Dull Green)
-
--- | Stop after building the StageN compiler.
--- For example, setting the 'finalStage' to 'Stage1' will just build the
--- 'Stage1' compiler. Setting it to 'Stage3' will build the 'Stage3'
--- compiler. Setting it to 'Stage0' will mean nothing gets built at all.
-finalStage :: Stage
-finalStage = Stage2