head 1.1; access; symbols pkgsrc-2026Q1:1.1.0.10 pkgsrc-2026Q1-base:1.1 pkgsrc-2025Q4:1.1.0.8 pkgsrc-2025Q4-base:1.1 pkgsrc-2025Q3:1.1.0.6 pkgsrc-2025Q3-base:1.1 pkgsrc-2025Q2:1.1.0.4 pkgsrc-2025Q2-base:1.1 pkgsrc-2025Q1:1.1.0.2 pkgsrc-2025Q1-base:1.1; locks; strict; comment @# @; 1.1 date 2025.01.29.13.21.53; author pho; state Exp; branches; next ; commitid BioNou7xEmeVNnHF; desc @@ 1.1 log @lang/ghc910: import ghc-9.10.1 GHC: The Glasgow Haskell Compiler. The Glasgow Haskell Compiler is a robust, fully-featured, optimising compiler for the functional programming language Haskell 98 (http://www.haskell.org). GHC compiles Haskell to either native code or C. It implements numerous experimental language extensions to Haskell, including concurrency, a foreign language interface, several type-system extensions, exceptions, and so on. GHC comes with a generational garbage collector, a space and time profiler, and a comprehensive set of libraries. This package provides the 9.10.x release series. @ text @$NetBSD$ Building "clock" needs patching on NetBSD due to its ccall to clock_gettime(2) and clock_getres(2). This hack can be removed if we upstream this patch and GHC adopts it in hadrian/bootstrap/*.json. This incurs a small runtime cost but it's what GHC devs recommend: https://www.haskell.org/ghc/blog/20210709-capi-usage.html --- clock-0.8.4/System/Clock.hsc.orig 2001-09-09 01:46:40.000000000 +0000 +++ clock-0.8.4/System/Clock.hsc @@@@ -1,3 +1,4 @@@@ +{-# LANGUAGE CApiFFI #-} -- | High-resolution, realtime clock and timer functions for Posix -- systems. This module is being developed according to IEEE Std -- 1003.1-2008: , @@@@ -149,8 +150,8 @@@@ type ClockId = CClockId type ClockId = #{type clockid_t} #endif -foreign import ccall unsafe clock_gettime :: ClockId -> Ptr TimeSpec -> IO CInt -foreign import ccall unsafe clock_getres :: ClockId -> Ptr TimeSpec -> IO CInt +foreign import capi unsafe "time.h clock_gettime" clock_gettime :: ClockId -> Ptr TimeSpec -> IO CInt +foreign import capi unsafe "time.h clock_getres" clock_getres :: ClockId -> Ptr TimeSpec -> IO CInt foreign import capi unsafe "time.h value CLOCK_MONOTONIC" clock_MONOTONIC :: ClockId foreign import capi unsafe "time.h value CLOCK_REALTIME" clock_REALTIME :: ClockId @