77, useFastWeak ? true
88, useReflexOptimizer ? false
99, useTextJSString ? true # Use an implementation of "Data.Text" that uses the more performant "Data.JSString" from ghcjs-base under the hood.
10+ , useWebkit2Gtk ? false # Enable webkit2gtk to build reflex-dom desktop apps
1011, __useTemplateHaskell ? true # Deprecated, just here until we remove feature from reflex and stop CIing it
1112, __useNewerCompiler ? true
1213, iosSdkVersion ? "16.1"
1920
2021let iosSupport = system == "x86_64-darwin" ;
2122 androidSupport = lib . elem system [ "x86_64-linux" ] ;
23+ ghc86Support = lib . elem system [ "x86_64-linux" "x86_64-darwin" ] ;
2224
2325 xcodeVer = {
2426 "16.1" = "14.1" ;
@@ -49,13 +51,19 @@ let iosSupport = system == "x86_64-darwin";
4951 bootPkgs = super . haskell . packages . ghc865Binary // {
5052 happy = super . haskell . packages . ghc865Binary . happy_1_19_12 ;
5153 } ;
54+ useLdGold = ! ( self . stdenv . targetPlatform . isAarch32 ) && self . stdenv . hostPlatform . useAndroidPrebuilt ;
55+ enableDocs = false ;
56+ enableHaddockProgram = false ;
5257 } ;
5358 ghcSplices-8_10 = ( super . haskell . compiler . ghc8107 . override {
5459 # New option for GHC 8.10. Explicitly enable profiling builds
5560 enableProfiledLibs = true ;
56- bootPkgs = super . haskell . packages . ghc865Binary // {
57- happy = super . haskell . packages . ghc865Binary . happy_1_19_12 ;
58- } ;
61+ #enableShared = self.stdenv.hostPlatform == self.stdenv.targetPlatform;
62+ #enableShared = false;
63+ bootPkgs = if ( super . stdenv . hostPlatform . isAarch64 ) then ( super . haskell . packages . ghc8107Binary // {
64+ happy = super . haskell . packages . ghc8107Binary . happy_1_19_12 ;
65+ } ) else
66+ ( super . haskell . packages . ghc865Binary // { happy = super . haskell . packages . ghc865Binary . happy_1_19_12 ; } ) ;
5967 } ) . overrideAttrs ( drv : {
6068 src = nixpkgs . hackGet ./haskell-overlays/splices-load-save/dep/ghc-8.10 ;
6169 # When building from the ghc git repo, ./boot must be run before configuring, whereas
@@ -94,7 +102,8 @@ let iosSupport = system == "x86_64-darwin";
94102 useFastWeak useReflexOptimizer enableLibraryProfiling enableTraceReflexEvents
95103 useTextJSString enableExposeAllUnfoldings __useTemplateHaskell
96104 haskellOverlaysPre
97- haskellOverlaysPost ;
105+ haskellOverlaysPost
106+ useWebkit2Gtk ;
98107 inherit ghcSavedSplices-8_6 ghcSavedSplices-8_10 ;
99108 } ;
100109 } ;
@@ -105,13 +114,13 @@ let iosSupport = system == "x86_64-darwin";
105114 libiconv = super . darwin . libiconv . overrideAttrs ( _ :
106115 lib . optionalAttrs ( self . stdenv . hostPlatform != self . stdenv . buildPlatform ) {
107116 postInstall = "rm $out/include/libcharset.h $out/include/localcharset.h" ;
108- configureFlags = [ "--disable -shared" "--enable-static" ] ;
117+ configureFlags = [ "--enable -shared" "--enable-static" ] ;
109118 } ) ;
110- } ;
119+ } ;
111120 zlib = super . zlib . override ( lib . optionalAttrs
112121 ( self . stdenv . hostPlatform != self . stdenv . buildPlatform )
113- { static = true ; shared = false ; } ) ;
114- } ;
122+ { static = true ; shared = true ; } ) ;
123+ } ;
115124
116125 mobileGhcOverlay = import ./nixpkgs-overlays/mobile-ghc { inherit lib ; } ;
117126
@@ -120,33 +129,53 @@ let iosSupport = system == "x86_64-darwin";
120129 nixpkgsArgs = {
121130 inherit system ;
122131 overlays = [
132+ ( import ./nixpkgs-overlays/ghc.nix { inherit lib ; } )
123133 hackGetOverlay
124134 bindHaskellOverlays
125135 forceStaticLibs
126136 splicesEval
127137 mobileGhcOverlay
128138 allCabalHashesOverlay
129139 ( self : super : {
130- binutils-unwrapped = super . binutils-unwrapped . override {
131- autoreconfHook = lib . optional self . stdenv . buildPlatform . isDarwin super . autoreconfHook269 ;
140+
141+ runtimeShellPackage = if ( self . stdenv . hostPlatform . isGhcjs || self . stdenv . targetPlatform . isiOS )
142+ then super . buildPackages . runtimeShellPackage
143+ else super . runtimeShellPackage ;
144+
145+ polkit = super . polkit . override {
146+ gobject-introspection = super . gobject-introspection-unwrapped ;
132147 } ;
133148
134- # Bump ios-deploy
135- # - for faster deployments
136- # - fixes debug deploy with iOS 16/macos 12.3/ xcode 13.4.1
137- darwin = super . darwin // {
138- ios-deploy = super . darwin . ios-deploy . overrideAttrs ( _ : {
139- version = "HEAD" ;
149+ darwin = super . darwin . overrideScope ( dself : dsuper : {
150+ ios-deploy = dsuper . ios-deploy . overrideAttrs ( _ : {
151+ version = "1.12.2" ;
140152 src = self . fetchFromGitHub {
141153 owner = "ios-control" ;
142154 repo = "ios-deploy" ;
143- rev = "b3254438719b6bc82ceab1f630e7d642a9acfac5" ; # unreleased
144- sha256 = "W45Qjr3xqvDWieLBgt4//nthxxcc3hgrJNrpSk7vWj8= " ;
155+ rev = "ed7de7792d28a5110242748649047a95c95ea917" ;
156+ sha256 = "082w7j490khfpbv1diwrjixjbg9g93wdr2khyzdhv8xmzzwq4lad " ;
145157 } ;
146158 } ) ;
159+ } ) ;
160+ openjdk16-bootstrap = super . openjdk16-bootstrap . override {
161+ gtkSupport = false ;
162+ } ;
163+ adoptopenjdk-hotspot-bin-16 = super . adoptopenjdk-hotspot-bin-16 . override {
164+ gtkSupport = false ;
147165 } ;
166+
167+ sqlite = super . sqlite . overrideAttrs ( old : lib . optionalAttrs ( self . stdenv . hostPlatform . useAndroidPrebuilt or false ) {
168+ postBuild = ''
169+ mkdir -p $debug
170+ '' ;
171+ } ) ;
172+
173+ libiconv = super . libiconv . overrideAttrs ( old : lib . optionalAttrs ( self . stdenv . hostPlatform . useAndroidPrebuilt or false ) {
174+ configureFlags = [ "--disable-shared" "--enable-static" ] ;
175+ } ) ;
176+
177+ libffi = if ( self . stdenv . hostPlatform . useAndroidPrebuilt or false ) then super . libffi_3_3 else super . libffi ;
148178 } )
149- ( import ./nixpkgs-overlays/ghc.nix { inherit lib ; } )
150179 ] ++ nixpkgsOverlays ;
151180 config = config // {
152181 permittedInsecurePackages = ( config . permittedInsecurePackages or [ ] ) ++ [
@@ -166,24 +195,41 @@ let iosSupport = system == "x86_64-darwin";
166195 wasmCross = nixpkgs . hackGet ./wasm-cross ;
167196 webGhcSrc = ( import ( wasmCross + /webghc.nix ) { inherit fetchgit ; } ) . ghc8107SplicesSrc ;
168197 nixpkgsCross = {
198+ # NOTE(Dylan Green):
199+ # sdkVer 30 is the minimum for android, else we have to use libffi 3.3
200+ # bionic doesn't support/expose memfd_create before sdk30
201+ # https://android.googlesource.com/platform/bionic/+/refs/heads/master/docs/status.md
202+ # Look for "new libc functions in R (API Level 30):", memfd_create will be one of the functions /
203+ # symbols we need to build newer libffi
204+ # This means we'll drop all SDKs pre-30
205+
206+ # NOTE(Dylan Green):
207+ # We don't want to use "isStatic" here as we still rely on shared-objects
208+ # adding "isStatic" completely disables generating most SOs, and we still need them
209+ # for libffi (at the very least). Currently the big issues are caused by the linker attempting (and failing)
210+ # to link against a dynamic crtbegin.o (crtbegin.c) bionic does provide a static crtbegin, although the linker
211+ # defaults to a dynamic version
212+
213+ # TODO(Dylan Green):
214+ # Look into making this a proper static build up into "reflex-todomvc"
169215 android = lib . mapAttrs ( _ : args : nixpkgsFunc ( nixpkgsArgs // args ) ) rec {
170216 aarch64 = {
171- crossSystem = lib . systems . examples . aarch64-android-prebuilt //
172- { isStatic = true ; } ;
173- sdkVer = "30" ;
217+ crossSystem = lib . systems . examples . aarch64-android-prebuilt // {
218+ #isStatic = true;
219+ sdkVer = "30" ;
220+ } ;
174221 } ;
175222 aarch32 = {
176223 crossSystem = lib . systems . examples . armv7a-android-prebuilt // {
177- isStatic = true ;
178- # Choose an old version so it's easier to find phones to test on
179- sdkVer = "23" ;
224+ #isStatic = true;
225+ sdkVer = "30" ;
180226 } ;
181227 } ;
182228 } ;
183229 ios = lib . mapAttrs ( _ : args : nixpkgsFunc ( nixpkgsArgs // args ) ) rec {
184230 simulator64 = {
185231 crossSystem = lib . systems . examples . iphone64-simulator // {
186- # isStatic = true;
232+ isStatic = true ;
187233 sdkVer = iosSdkVersion ;
188234 inherit xcodeVer ;
189235 } ;
@@ -229,12 +275,6 @@ let iosSupport = system == "x86_64-darwin";
229275 override = new : makeRecursivelyOverridable ( x . override ( old : ( combineOverrides old new ) ) ) ;
230276 } ;
231277
232- cabal2nixResult = src : builtins . trace "cabal2nixResult is deprecated; use ghc.haskellSrc2nix or ghc.callCabal2nix instead" ( ghc . haskellSrc2nix {
233- name = "for-unknown-package" ;
234- src = "file://${ src } " ;
235- sha256 = null ;
236- } ) ;
237-
238278 ghcSavedSplices = if __useNewerCompiler then ghcSavedSplices-8_10 else ghcSavedSplices-8_6 ;
239279 ghcSavedSplices-8_6 = ( makeRecursivelyOverridable nixpkgs . haskell . packages . integer-simple . ghcSplices-8_6 ) . override {
240280 overrides = lib . foldr lib . composeExtensions ( _ : _ : { } ) ( let
@@ -269,8 +309,7 @@ let iosSupport = system == "x86_64-darwin";
269309 ghcjs = if __useNewerCompiler then ghcjs8_10 else ghcjs8_6 ;
270310 ghcjs8_6 = ( makeRecursivelyOverridable ( nixpkgsCross . ghcjs . haskell . packages . ghcjs86 . override ( old : {
271311 ghc = old . ghc . override {
272- bootPkgs = with nixpkgsCross . ghcjs . buildPackages . haskell . packages ;
273- ghc865 // { happy = ghc865 . callHackage "happy" "1.19.9" { } ; } ;
312+ bootPkgs = old . ghc . bootPkgs // { happy = old . ghc . bootPkgs . happy_1_19_12 ; } ;
274313 cabal-install = import ./haskell-overlays/ghcjs-8.6/cabal-install.nix { inherit nixpkgs ; } ;
275314 ghcjsSrc = import ./haskell-overlays/ghcjs-8.6/src.nix {
276315 inherit ( nixpkgs . stdenvNoCC ) mkDerivation ;
@@ -514,7 +553,6 @@ in let this = rec {
514553 cabal-install
515554 ghcid
516555 hasktags
517- hlint
518556 stylish-haskell # Recent stylish-haskell only builds with AMP in place
519557 reflex-ghci
520558 ;
@@ -589,7 +627,7 @@ in let this = rec {
589627 iosReflexTodomvc iosSimulatorReflexTodomvc
590628 ] ;
591629
592- inherit cabal2nixResult system androidSupport iosSupport ;
630+ inherit system androidSupport iosSupport ghc86Support ;
593631 project = args : import ./project this ( args ( { pkgs = nixpkgs ; } // this ) ) ;
594632 tryReflexShell = pinBuildInputs ( "shell-" + system ) tryReflexPackages ;
595633 ghcjsExternsJs = ./ghcjs.externs.js ;
0 commit comments