Skip to content

Commit 22e85ba

Browse files
committed
Add test for cross compilation of gi-gtk
It looks like this will need #2232
1 parent 7bcd019 commit 22e85ba

File tree

5 files changed

+59
-0
lines changed

5 files changed

+59
-0
lines changed

overlays/musl.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl ({
4141

4242
openssl = prev.openssl.override { static = true; };
4343

44+
# Cups and tracker pull in systemd
45+
gtk4 = (prev.gtk4.override {
46+
cupsSupport = false;
47+
trackerSupport = false;
48+
gst_all_1 = { gst-plugins-bad = null; gst-plugins-base = null; };
49+
}).overrideAttrs (oldAttrs: {
50+
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dmedia-gstreamer=disabled" ];
51+
});
52+
4453
icu = (prev.icu.overrideAttrs (old: { configureFlags = old.configureFlags ++ [ "--enable-static" "--disable-shared" ]; }));
4554

4655
# Fails on cross compile

test/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ let
233233
plugin = callTest ./plugin {};
234234
supported-languages = callTest ./supported-langauges {};
235235
js-template-haskell = callTest ./js-template-haskell {};
236+
gi-gtk = callTest ./gi-gtk { inherit util; };
236237
unit = unitTests;
237238
};
238239

test/gi-gtk/default.nix

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Test building TH code that needs DLLs when cross compiling for windows
2+
{ stdenv, lib, util, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }:
3+
4+
with lib;
5+
6+
let
7+
project = project' {
8+
inherit compiler-nix-name evalPackages;
9+
src = testSrc "gi-gtk";
10+
cabalProjectLocal = builtins.readFile ../cabal.project.local;
11+
};
12+
13+
packages = project.hsPkgs;
14+
15+
in recurseIntoAttrs rec {
16+
meta.disabled = stdenv.hostPlatform.isGhcjs;
17+
18+
ifdInputs = {
19+
inherit (project) plan-nix;
20+
};
21+
22+
build = packages.test-gi-gtk.components.exes.test-gi-gtk;
23+
check = haskellLib.check build;
24+
build-profiled = packages.test-gi-gtk.components.exes.test-gi-gtk.profiled;
25+
check-profiled = haskellLib.check build-profiled;
26+
}

test/gi-gtk/src/Main.hs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module Main where
2+
3+
import qualified GI.Gtk as Gtk (initCheck)
4+
5+
main :: IO ()
6+
main = do
7+
Gtk.initCheck
8+
return ()
9+

test/gi-gtk/test-gi-gtk.cabal

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
cabal-version: >=1.10
2+
name: test-gi-gtk
3+
version: 0.1.0.0
4+
license: PublicDomain
5+
author: Hamish Mackenzie
6+
maintainer: [email protected]
7+
build-type: Simple
8+
9+
executable test-gi-gtk
10+
build-depends: base
11+
, gi-gtk
12+
main-is: Main.hs
13+
hs-source-dirs: src
14+
default-language: Haskell2010

0 commit comments

Comments
 (0)