Skip to content

Commit f10a9c9

Browse files
committed
Merge branch 'haskell-sdl2-pkg-config-workarounds' into haskell-updates
This is a manual merge of the PR #265678 since it has a merge conflict
2 parents 2fe9080 + c31f006 commit f10a9c9

7 files changed

Lines changed: 48 additions & 24 deletions

File tree

pkgs/development/haskell-modules/configuration-common.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,6 @@ self: super: {
638638
saltine = dontCheck super.saltine; # https://github.com/tel/saltine/pull/56
639639
scp-streams = dontCheck super.scp-streams;
640640
sdl2 = dontCheck super.sdl2; # the test suite needs an x server
641-
sdl2-ttf = dontCheck super.sdl2-ttf; # as of version 0.2.1, the test suite requires user intervention
642641
separated = dontCheck super.separated;
643642
shadowsocks = dontCheck super.shadowsocks;
644643
shake-language-c = dontCheck super.shake-language-c;
@@ -2680,4 +2679,10 @@ self: super: {
26802679

26812680
# Tests rely on (missing) submodule
26822681
unleash-client-haskell-core = dontCheck super.unleash-client-haskell-core;
2682+
2683+
# Workaround for Cabal failing to find nonexistent SDL2 library?!
2684+
# https://github.com/NixOS/nixpkgs/issues/260863
2685+
sdl2-gfx = overrideCabal { __propagatePkgConfigDepends = false; } super.sdl2-gfx;
2686+
sdl2-ttf = overrideCabal { __onlyPropagateKnownPkgConfigModules = true; } super.sdl2-ttf;
2687+
26832688
} // import ./configuration-tensorflow.nix {inherit pkgs haskellLib;} self super

pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4800,10 +4800,8 @@ broken-packages:
48004800
- sdl2-cairo-image # failure in job https://hydra.nixos.org/build/233210135 at 2023-09-02
48014801
- sdl2-compositor # failure in job https://hydra.nixos.org/build/233198910 at 2023-09-02
48024802
- sdl2-fps # failure in job https://hydra.nixos.org/build/233195346 at 2023-09-02
4803-
- sdl2-gfx # failure in job https://hydra.nixos.org/build/233236795 at 2023-09-02
48044803
- sdl2-image # failure in job https://hydra.nixos.org/build/233216837 at 2023-09-02
48054804
- sdl2-mixer # failure in job https://hydra.nixos.org/build/233228951 at 2023-09-02
4806-
- sdl2-ttf # failure in job https://hydra.nixos.org/build/233238600 at 2023-09-02
48074805
- sdp # failure in job https://hydra.nixos.org/build/233246702 at 2023-09-02
48084806
- seacat # failure in job https://hydra.nixos.org/build/233229959 at 2023-09-02
48094807
- seakale # failure in job https://hydra.nixos.org/build/233236200 at 2023-09-02

pkgs/development/haskell-modules/hackage-packages.nix

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkgs/development/libraries/SDL2/default.nix

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,21 @@
4949
, audiofile
5050
, libiconv
5151
, withStatic ? false
52+
# passthru.tests
53+
, testers
5254
}:
5355

5456
# NOTE: When editing this expression see if the same change applies to
5557
# SDL expression too
5658

57-
stdenv.mkDerivation rec {
59+
stdenv.mkDerivation (finalAttrs: {
5860
pname = "SDL2";
5961
version = "2.28.3";
6062

6163
src = fetchFromGitHub {
6264
owner = "libsdl-org";
6365
repo = "SDL";
64-
rev = "release-${version}";
66+
rev = "release-${finalAttrs.version}";
6567
hash = "sha256-/kQ2IyvAfmZ+zIUt1WuEIeX0nYPGXDlAQk2qDsQnFFs=";
6668
};
6769
dontDisableStatic = if withStatic then 1 else 0;
@@ -96,7 +98,7 @@ stdenv.mkDerivation rec {
9698
++ lib.optionals x11Support [ libX11 ];
9799

98100
propagatedBuildInputs = lib.optionals x11Support [ xorgproto ]
99-
++ dlopenPropagatedBuildInputs;
101+
++ finalAttrs.dlopenPropagatedBuildInputs;
100102

101103
dlopenBuildInputs = lib.optionals alsaSupport [ alsa-lib audiofile ]
102104
++ lib.optional dbusSupport dbus
@@ -109,7 +111,7 @@ stdenv.mkDerivation rec {
109111
++ lib.optionals drmSupport [ libdrm mesa ];
110112

111113
buildInputs = [ libiconv ]
112-
++ dlopenBuildInputs
114+
++ finalAttrs.dlopenBuildInputs
113115
++ lib.optional ibusSupport ibus
114116
++ lib.optionals waylandSupport [ wayland-protocols ]
115117
++ lib.optionals stdenv.isDarwin [ AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL ];
@@ -156,7 +158,7 @@ stdenv.mkDerivation rec {
156158
# list the symbols used in this way.
157159
postFixup =
158160
let
159-
rpath = lib.makeLibraryPath (dlopenPropagatedBuildInputs ++ dlopenBuildInputs);
161+
rpath = lib.makeLibraryPath (finalAttrs.dlopenPropagatedBuildInputs ++ finalAttrs.dlopenBuildInputs);
160162
in
161163
lib.optionalString (stdenv.hostPlatform.extensions.sharedLibrary == ".so") ''
162164
for lib in $out/lib/*.so* ; do
@@ -171,6 +173,9 @@ stdenv.mkDerivation rec {
171173
passthru = {
172174
inherit openglSupport;
173175
updateScript = nix-update-script { extraArgs = ["--version-regex" "release-(.*)"]; };
176+
tests.pkg-config = testers.hasPkgConfigModules {
177+
package = finalAttrs.finalPackage;
178+
};
174179
};
175180

176181
meta = with lib; {
@@ -180,5 +185,6 @@ stdenv.mkDerivation rec {
180185
license = licenses.zlib;
181186
platforms = platforms.all;
182187
maintainers = with maintainers; [ cpages ];
188+
pkgConfigModules = [ "sdl2" ];
183189
};
184-
}
190+
})

pkgs/development/libraries/SDL2_gfx/default.nix

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
{ lib, stdenv, darwin, fetchurl, pkg-config, SDL2 }:
1+
{ lib, stdenv, darwin, fetchurl, pkg-config, SDL2, testers }:
22

3-
stdenv.mkDerivation rec {
3+
stdenv.mkDerivation (finalAttrs: {
44
pname = "SDL2_gfx";
55
version = "1.0.4";
66

77
src = fetchurl {
8-
url = "http://www.ferzkopp.net/Software/${pname}/${pname}-${version}.tar.gz";
8+
url = "http://www.ferzkopp.net/Software/${finalAttrs.pname}/${finalAttrs.pname}-${finalAttrs.version}.tar.gz";
99
sha256 = "0qk2ax7f7grlxb13ba0ll3zlm8780s7j8fmrhlpxzjgdvldf1q33";
1010
};
1111

@@ -17,6 +17,10 @@ stdenv.mkDerivation rec {
1717
configureFlags = [(if stdenv.hostPlatform.isx86 then "--enable-mmx" else "--disable-mmx")]
1818
++ lib.optional stdenv.isDarwin "--disable-sdltest";
1919

20+
passthru.tests.pkg-config = testers.hasPkgConfigModules {
21+
package = finalAttrs.finalPackage;
22+
};
23+
2024
meta = with lib; {
2125
description = "SDL graphics drawing primitives and support functions";
2226

@@ -42,5 +46,6 @@ stdenv.mkDerivation rec {
4246
license = licenses.zlib;
4347
maintainers = with maintainers; [ cpages ];
4448
platforms = platforms.unix;
49+
pkgConfigModules = [ "SDL2_gfx" ];
4550
};
46-
}
51+
})

pkgs/development/libraries/SDL2_ttf/default.nix

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
{ lib, stdenv, pkg-config, darwin, fetchurl, SDL2, freetype, harfbuzz, libGL }:
1+
{ lib, stdenv, pkg-config, darwin, fetchurl, SDL2, freetype, harfbuzz, libGL, testers }:
22

3-
stdenv.mkDerivation rec {
3+
stdenv.mkDerivation (finalAttrs: {
44
pname = "SDL2_ttf";
55
version = "2.20.2";
66

77
src = fetchurl {
8-
url = "https://www.libsdl.org/projects/SDL_ttf/release/${pname}-${version}.tar.gz";
8+
url = "https://www.libsdl.org/projects/SDL_ttf/release/${finalAttrs.pname}-${finalAttrs.version}.tar.gz";
99
sha256 = "sha256-ncce2TSHUhsQeixKnKa/Q/ti9r3dXCawVea5FBiiIFM=";
1010
};
1111

@@ -18,10 +18,15 @@ stdenv.mkDerivation rec {
1818
++ lib.optional (!stdenv.isDarwin) libGL
1919
++ lib.optional stdenv.isDarwin darwin.libobjc;
2020

21+
passthru.tests.pkg-config = testers.hasPkgConfigModules {
22+
package = finalAttrs.finalPackage;
23+
};
24+
2125
meta = with lib; {
2226
description = "Support for TrueType (.ttf) font files with Simple Directmedia Layer";
2327
platforms = platforms.unix;
2428
license = licenses.zlib;
2529
homepage = "https://github.com/libsdl-org/SDL_ttf";
30+
pkgConfigModules = [ "SDL2_ttf" ];
2631
};
27-
}
32+
})

pkgs/development/libraries/harfbuzz/default.nix

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@
3030
, gtk4
3131
, mapnik
3232
, qt5
33+
, testers
3334
}:
3435

35-
stdenv.mkDerivation rec {
36+
stdenv.mkDerivation (finalAttrs: {
3637
pname = "harfbuzz${lib.optionalString withIcu "-icu"}";
3738
version = "7.3.0";
3839

3940
src = fetchurl {
40-
url = "https://github.com/harfbuzz/harfbuzz/releases/download/${version}/harfbuzz-${version}.tar.xz";
41+
url = "https://github.com/harfbuzz/harfbuzz/releases/download/${finalAttrs.version}/harfbuzz-${finalAttrs.version}.tar.xz";
4142
hash = "sha256-IHcHiXSaybqEbfM5g9vaItuDbHDZ9dBQy5qlNHCUqPs=";
4243
};
4344

@@ -103,6 +104,9 @@ stdenv.mkDerivation rec {
103104
passthru.tests = {
104105
inherit gimp gtk3 gtk4 mapnik;
105106
inherit (qt5) qtbase;
107+
pkg-config = testers.hasPkgConfigModules {
108+
package = finalAttrs.finalPackage;
109+
};
106110
};
107111

108112
meta = with lib; {
@@ -112,5 +116,10 @@ stdenv.mkDerivation rec {
112116
maintainers = [ maintainers.eelco ];
113117
license = licenses.mit;
114118
platforms = platforms.unix;
119+
pkgConfigModules = [
120+
"harfbuzz"
121+
"harfbuzz-gobject"
122+
"harfbuzz-subset"
123+
];
115124
};
116-
}
125+
})

0 commit comments

Comments
 (0)