diff --git a/overlays/musl.nix b/overlays/musl.nix index f86e270118..f7b9c0ab04 100644 --- a/overlays/musl.nix +++ b/overlays/musl.nix @@ -41,6 +41,15 @@ final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl ({ openssl = prev.openssl.override { static = true; }; + # Cups and tracker pull in systemd + gtk4 = (prev.gtk4.override { + cupsSupport = false; + trackerSupport = false; + gst_all_1 = { gst-plugins-bad = null; gst-plugins-base = null; }; + }).overrideAttrs (oldAttrs: { + mesonFlags = oldAttrs.mesonFlags ++ [ "-Dmedia-gstreamer=disabled" ]; + }); + icu = (prev.icu.overrideAttrs (old: { configureFlags = old.configureFlags ++ [ "--enable-static" "--disable-shared" ]; })); # Fails on cross compile diff --git a/test/cabal.project.local b/test/cabal.project.local index ab9b45c0f4..02f2b97244 100644 --- a/test/cabal.project.local +++ b/test/cabal.project.local @@ -22,14 +22,14 @@ repository head.hackage.ghc.haskell.org f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d - --sha256: sha256-gDLkCAZPa4xALm37iKVjDVnmBj0CwNKT1qzY/xiiPOY= + --sha256: sha256-j+maRnTnoCe341pX+uWMPUVqRbGDOA6w1WlnqfaO9Qc= repository ghcjs-overlay - url: https://raw.githubusercontent.com/input-output-hk/hackage-overlay-ghcjs/8ef1977ba226b9dea0a5f43824c2e3507280d306 + url: https://raw.githubusercontent.com/input-output-hk/hackage-overlay-ghcjs/d37efd733666d090bf1c83bf7d5f9cb71b1dacc1 secure: True root-keys: key-threshold: 0 - --sha256: sha256-jcOUSw6rtBdLXx5/yx1EMKaYfvVWJgpTVe567jA81Ls= + --sha256: sha256-6I5mu1QFdvWFm6jWOUMKGm3VHvB7vSqiBjjHgAZJReo= if !impl(ghc>=9.11) && !os(ghcjs) active-repositories: hackage.haskell.org diff --git a/test/default.nix b/test/default.nix index e1784beb49..067f950112 100644 --- a/test/default.nix +++ b/test/default.nix @@ -233,6 +233,7 @@ let plugin = callTest ./plugin {}; supported-languages = callTest ./supported-langauges {}; js-template-haskell = callTest ./js-template-haskell {}; + gi-gtk = callTest ./gi-gtk { inherit util; }; unit = unitTests; }; diff --git a/test/gi-gtk/default.nix b/test/gi-gtk/default.nix new file mode 100644 index 0000000000..7567264cff --- /dev/null +++ b/test/gi-gtk/default.nix @@ -0,0 +1,38 @@ +# Test building TH code that needs DLLs when cross compiling for windows +{ stdenv, lib, util, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }: + +with lib; + +let + project = project' { + inherit compiler-nix-name evalPackages; + src = testSrc "gi-gtk"; + cabalProjectLocal = builtins.readFile ../cabal.project.local + '' + if impl(ghc >=9.11) + constraints: filepath source + ''; + }; + + packages = project.hsPkgs; + +in recurseIntoAttrs rec { + meta.disabled = stdenv.hostPlatform.isGhcjs + # Gtk cross compilation seems to be broken in nixpkgs + || stdenv.hostPlatform.isWindows + # We can't make static libraries for Gtk + || stdenv.hostPlatform.isMusl + # Older versions of GHC fail for aarch64 with + # error: incompatible pointer to integer conversion assigning to 'ffi_arg' (aka 'unsigned long') from 'HsPtr' (aka 'void *') [-Wint-conversion] + || builtins.elem compiler-nix-name ["ghc8107" "ghc902" "ghc928" "ghc948"] && stdenv.hostPlatform.isAarch64 + # Cross compilation to aarch64 is also broken + || stdenv.hostPlatform.isAarch64 && !stdenv.buildPlatform.isAarch64; + + ifdInputs = { + inherit (project) plan-nix; + }; + + build = packages.test-gi-gtk.components.exes.test-gi-gtk; + check = haskellLib.check build; + build-profiled = packages.test-gi-gtk.components.exes.test-gi-gtk.profiled; + check-profiled = haskellLib.check build-profiled; +} diff --git a/test/gi-gtk/src/Main.hs b/test/gi-gtk/src/Main.hs new file mode 100644 index 0000000000..938cf2bf59 --- /dev/null +++ b/test/gi-gtk/src/Main.hs @@ -0,0 +1,9 @@ +module Main where + +import qualified GI.Gtk as Gtk (initCheck) + +main :: IO () +main = do + Gtk.initCheck + return () + diff --git a/test/gi-gtk/test-gi-gtk.cabal b/test/gi-gtk/test-gi-gtk.cabal new file mode 100644 index 0000000000..13a65c2f75 --- /dev/null +++ b/test/gi-gtk/test-gi-gtk.cabal @@ -0,0 +1,14 @@ +cabal-version: >=1.10 +name: test-gi-gtk +version: 0.1.0.0 +license: PublicDomain +author: Hamish Mackenzie +maintainer: Hamish.K.Mackenzie@gmail.com +build-type: Simple + +executable test-gi-gtk + build-depends: base + , gi-gtk + main-is: Main.hs + hs-source-dirs: src + default-language: Haskell2010