@@ -0,0 +1,50 @@
1+{ pkgs
2+, haskell
3+, stdenv
4+}:
5+
6+with stdenv.lib;
7+
8+let
9+ pkgSet = haskell.mkNewPkgSet {
10+ inherit pkgs;
11+ pkg-def = import ./plan.nix;
12+ pkg-def-overlays = [
13+ { project = ./project.nix; }
14+ ];
15+ modules = [ ];
16+ };
17+
18+ packages = pkgSet.config.hsPkgs;
19+
20+in
21+ stdenv.mkDerivation {
22+ name = "cabal-22-test";
23+
24+ buildCommand = ''
25+ exe="${packages.project.components.exes.project}/bin/project"
26+
27+ size=$(command stat --format '%s' "$exe")
28+ printf "size of executable $exe is $size. \n" >& 2
29+
30+ # fixme: run on target platform when cross-compiled
31+ printf "checking whether executable runs... " >& 2
32+ "$exe"
33+
34+ # fixme: linux-specific
35+ printf "checking that executable is dynamically linked to system libraries... " >& 2
36+ ldd "$exe" | grep libpthread
37+
38+ # fixme: posix-specific
39+ printf "checking that dynamic library is produced... " >& 2
40+ sofile=$(find "${packages.project.components.library}" | grep -e '\.so$')
41+ echo "$sofile"
42+
43+ printf "checking that dynamic library is dynamically linked to base... " >& 2
44+ ldd "$sofile" | grep libHSbase
45+
46+ touch $out
47+ '';
48+
49+ meta.platforms = platforms.all;
50+} // { inherit (packages) project; }