summary refs log tree commit diff
diff options
context:
space:
mode:
authorDennis Gosnell <cdep.illabout@gmail.com>2023-11-10 09:12:04 +0900
committerDennis Gosnell <cdep.illabout@gmail.com>2023-11-10 09:16:34 +0900
commitf10a9c90947faa4a399e6c98c9fa0ee5c4ae51c5 (patch)
tree7d34b518db31864ae2edaaea65504abfac148d68
parent2fe90802da10b14bd6e14c582a5585ac5c56874d (diff)
parentc31f00657042dcb85e45777be4f3701032a4f2f5 (diff)
downloadnixpkgs-f10a9c90947faa4a399e6c98c9fa0ee5c4ae51c5.tar
nixpkgs-f10a9c90947faa4a399e6c98c9fa0ee5c4ae51c5.tar.gz
nixpkgs-f10a9c90947faa4a399e6c98c9fa0ee5c4ae51c5.tar.bz2
nixpkgs-f10a9c90947faa4a399e6c98c9fa0ee5c4ae51c5.tar.lz
nixpkgs-f10a9c90947faa4a399e6c98c9fa0ee5c4ae51c5.tar.xz
nixpkgs-f10a9c90947faa4a399e6c98c9fa0ee5c4ae51c5.tar.zst
nixpkgs-f10a9c90947faa4a399e6c98c9fa0ee5c4ae51c5.zip
Merge branch 'haskell-sdl2-pkg-config-workarounds' into haskell-updates
This is a manual merge of the PR
https://github.com/NixOS/nixpkgs/pull/265678 since it has a merge
conflict
-rw-r--r--pkgs/development/haskell-modules/configuration-common.nix7
-rw-r--r--pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml2
-rw-r--r--pkgs/development/haskell-modules/hackage-packages.nix4
-rw-r--r--pkgs/development/libraries/SDL2/default.nix18
-rw-r--r--pkgs/development/libraries/SDL2_gfx/default.nix13
-rw-r--r--pkgs/development/libraries/SDL2_ttf/default.nix13
-rw-r--r--pkgs/development/libraries/harfbuzz/default.nix15
7 files changed, 48 insertions, 24 deletions
diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index 72336ba31b8..723b8e5efba 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -638,7 +638,6 @@ self: super: {
   saltine = dontCheck super.saltine; # https://github.com/tel/saltine/pull/56
   scp-streams = dontCheck super.scp-streams;
   sdl2 = dontCheck super.sdl2; # the test suite needs an x server
-  sdl2-ttf = dontCheck super.sdl2-ttf; # as of version 0.2.1, the test suite requires user intervention
   separated = dontCheck super.separated;
   shadowsocks = dontCheck super.shadowsocks;
   shake-language-c = dontCheck super.shake-language-c;
@@ -2680,4 +2679,10 @@ self: super: {
 
   # Tests rely on (missing) submodule
   unleash-client-haskell-core = dontCheck super.unleash-client-haskell-core;
+
+  # Workaround for Cabal failing to find nonexistent SDL2 library?!
+  # https://github.com/NixOS/nixpkgs/issues/260863
+  sdl2-gfx = overrideCabal { __propagatePkgConfigDepends = false; } super.sdl2-gfx;
+  sdl2-ttf = overrideCabal { __onlyPropagateKnownPkgConfigModules = true; } super.sdl2-ttf;
+
 } // import ./configuration-tensorflow.nix {inherit pkgs haskellLib;} self super
diff --git a/pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml b/pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml
index ff0a507ef3b..0805f78768d 100644
--- a/pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml
+++ b/pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml
@@ -4800,10 +4800,8 @@ broken-packages:
   - sdl2-cairo-image # failure in job https://hydra.nixos.org/build/233210135 at 2023-09-02
   - sdl2-compositor # failure in job https://hydra.nixos.org/build/233198910 at 2023-09-02
   - sdl2-fps # failure in job https://hydra.nixos.org/build/233195346 at 2023-09-02
-  - sdl2-gfx # failure in job https://hydra.nixos.org/build/233236795 at 2023-09-02
   - sdl2-image # failure in job https://hydra.nixos.org/build/233216837 at 2023-09-02
   - sdl2-mixer # failure in job https://hydra.nixos.org/build/233228951 at 2023-09-02
-  - sdl2-ttf # failure in job https://hydra.nixos.org/build/233238600 at 2023-09-02
   - sdp # failure in job https://hydra.nixos.org/build/233246702 at 2023-09-02
   - seacat # failure in job https://hydra.nixos.org/build/233229959 at 2023-09-02
   - seakale # failure in job https://hydra.nixos.org/build/233236200 at 2023-09-02
diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix
index 8da701f3316..d40af7db481 100644
--- a/pkgs/development/haskell-modules/hackage-packages.nix
+++ b/pkgs/development/haskell-modules/hackage-packages.nix
@@ -263570,9 +263570,7 @@ self: {
        executablePkgconfigDepends = [ SDL2 SDL2_gfx ];
        description = "Haskell bindings to SDL2_gfx";
        license = lib.licenses.mit;
-       hydraPlatforms = lib.platforms.none;
        mainProgram = "sdl2-gfx-example";
-       broken = true;
      }) {inherit (pkgs) SDL2; inherit (pkgs) SDL2_gfx;};
 
   "sdl2-image" = callPackage
@@ -263666,8 +263664,6 @@ self: {
        description = "Bindings to SDL2_ttf";
        license = lib.licenses.bsd3;
        badPlatforms = lib.platforms.darwin;
-       hydraPlatforms = lib.platforms.none;
-       broken = true;
      }) {inherit (pkgs) SDL2; inherit (pkgs) SDL2_ttf;};
 
   "sdnv" = callPackage
diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix
index 7b741b803de..d74ab371bb1 100644
--- a/pkgs/development/libraries/SDL2/default.nix
+++ b/pkgs/development/libraries/SDL2/default.nix
@@ -49,19 +49,21 @@
 , audiofile
 , libiconv
 , withStatic ? false
+# passthru.tests
+, testers
 }:
 
 # NOTE: When editing this expression see if the same change applies to
 # SDL expression too
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "SDL2";
   version = "2.28.3";
 
   src = fetchFromGitHub {
     owner = "libsdl-org";
     repo = "SDL";
-    rev = "release-${version}";
+    rev = "release-${finalAttrs.version}";
     hash = "sha256-/kQ2IyvAfmZ+zIUt1WuEIeX0nYPGXDlAQk2qDsQnFFs=";
   };
   dontDisableStatic = if withStatic then 1 else 0;
@@ -96,7 +98,7 @@ stdenv.mkDerivation rec {
     ++ lib.optionals x11Support [ libX11 ];
 
   propagatedBuildInputs = lib.optionals x11Support [ xorgproto ]
-    ++ dlopenPropagatedBuildInputs;
+    ++ finalAttrs.dlopenPropagatedBuildInputs;
 
   dlopenBuildInputs = lib.optionals alsaSupport [ alsa-lib audiofile ]
     ++ lib.optional dbusSupport dbus
@@ -109,7 +111,7 @@ stdenv.mkDerivation rec {
     ++ lib.optionals drmSupport [ libdrm mesa ];
 
   buildInputs = [ libiconv ]
-    ++ dlopenBuildInputs
+    ++ finalAttrs.dlopenBuildInputs
     ++ lib.optional ibusSupport ibus
     ++ lib.optionals waylandSupport [ wayland-protocols ]
     ++ lib.optionals stdenv.isDarwin [ AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL ];
@@ -156,7 +158,7 @@ stdenv.mkDerivation rec {
   # list the symbols used in this way.
   postFixup =
     let
-      rpath = lib.makeLibraryPath (dlopenPropagatedBuildInputs ++ dlopenBuildInputs);
+      rpath = lib.makeLibraryPath (finalAttrs.dlopenPropagatedBuildInputs ++ finalAttrs.dlopenBuildInputs);
     in
     lib.optionalString (stdenv.hostPlatform.extensions.sharedLibrary == ".so") ''
       for lib in $out/lib/*.so* ; do
@@ -171,6 +173,9 @@ stdenv.mkDerivation rec {
   passthru = {
     inherit openglSupport;
     updateScript = nix-update-script { extraArgs = ["--version-regex" "release-(.*)"]; };
+    tests.pkg-config = testers.hasPkgConfigModules {
+      package = finalAttrs.finalPackage;
+    };
   };
 
   meta = with lib; {
@@ -180,5 +185,6 @@ stdenv.mkDerivation rec {
     license = licenses.zlib;
     platforms = platforms.all;
     maintainers = with maintainers; [ cpages ];
+    pkgConfigModules = [ "sdl2" ];
   };
-}
+})
diff --git a/pkgs/development/libraries/SDL2_gfx/default.nix b/pkgs/development/libraries/SDL2_gfx/default.nix
index 3d599c39c05..83b57b42c7c 100644
--- a/pkgs/development/libraries/SDL2_gfx/default.nix
+++ b/pkgs/development/libraries/SDL2_gfx/default.nix
@@ -1,11 +1,11 @@
-{ lib, stdenv, darwin, fetchurl, pkg-config, SDL2 }:
+{ lib, stdenv, darwin, fetchurl, pkg-config, SDL2, testers }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "SDL2_gfx";
   version = "1.0.4";
 
   src = fetchurl {
-    url = "http://www.ferzkopp.net/Software/${pname}/${pname}-${version}.tar.gz";
+    url = "http://www.ferzkopp.net/Software/${finalAttrs.pname}/${finalAttrs.pname}-${finalAttrs.version}.tar.gz";
     sha256 = "0qk2ax7f7grlxb13ba0ll3zlm8780s7j8fmrhlpxzjgdvldf1q33";
   };
 
@@ -17,6 +17,10 @@ stdenv.mkDerivation rec {
   configureFlags = [(if stdenv.hostPlatform.isx86 then "--enable-mmx" else "--disable-mmx")]
      ++ lib.optional stdenv.isDarwin "--disable-sdltest";
 
+  passthru.tests.pkg-config = testers.hasPkgConfigModules {
+    package = finalAttrs.finalPackage;
+  };
+
   meta = with lib; {
     description = "SDL graphics drawing primitives and support functions";
 
@@ -42,5 +46,6 @@ stdenv.mkDerivation rec {
     license = licenses.zlib;
     maintainers = with maintainers; [ cpages ];
     platforms = platforms.unix;
+    pkgConfigModules = [ "SDL2_gfx" ];
   };
-}
+})
diff --git a/pkgs/development/libraries/SDL2_ttf/default.nix b/pkgs/development/libraries/SDL2_ttf/default.nix
index d2dd8d53929..e46b9d9c537 100644
--- a/pkgs/development/libraries/SDL2_ttf/default.nix
+++ b/pkgs/development/libraries/SDL2_ttf/default.nix
@@ -1,11 +1,11 @@
-{ lib, stdenv, pkg-config, darwin, fetchurl, SDL2, freetype, harfbuzz, libGL }:
+{ lib, stdenv, pkg-config, darwin, fetchurl, SDL2, freetype, harfbuzz, libGL, testers }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "SDL2_ttf";
   version = "2.20.2";
 
   src = fetchurl {
-    url = "https://www.libsdl.org/projects/SDL_ttf/release/${pname}-${version}.tar.gz";
+    url = "https://www.libsdl.org/projects/SDL_ttf/release/${finalAttrs.pname}-${finalAttrs.version}.tar.gz";
     sha256 = "sha256-ncce2TSHUhsQeixKnKa/Q/ti9r3dXCawVea5FBiiIFM=";
   };
 
@@ -18,10 +18,15 @@ stdenv.mkDerivation rec {
     ++ lib.optional (!stdenv.isDarwin) libGL
     ++ lib.optional stdenv.isDarwin darwin.libobjc;
 
+  passthru.tests.pkg-config = testers.hasPkgConfigModules {
+    package = finalAttrs.finalPackage;
+  };
+
   meta = with lib; {
     description = "Support for TrueType (.ttf) font files with Simple Directmedia Layer";
     platforms = platforms.unix;
     license = licenses.zlib;
     homepage = "https://github.com/libsdl-org/SDL_ttf";
+    pkgConfigModules = [ "SDL2_ttf" ];
   };
-}
+})
diff --git a/pkgs/development/libraries/harfbuzz/default.nix b/pkgs/development/libraries/harfbuzz/default.nix
index b1e09f7b82e..88f373dd4af 100644
--- a/pkgs/development/libraries/harfbuzz/default.nix
+++ b/pkgs/development/libraries/harfbuzz/default.nix
@@ -30,14 +30,15 @@
 , gtk4
 , mapnik
 , qt5
+, testers
 }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "harfbuzz${lib.optionalString withIcu "-icu"}";
   version = "7.3.0";
 
   src = fetchurl {
-    url = "https://github.com/harfbuzz/harfbuzz/releases/download/${version}/harfbuzz-${version}.tar.xz";
+    url = "https://github.com/harfbuzz/harfbuzz/releases/download/${finalAttrs.version}/harfbuzz-${finalAttrs.version}.tar.xz";
     hash = "sha256-IHcHiXSaybqEbfM5g9vaItuDbHDZ9dBQy5qlNHCUqPs=";
   };
 
@@ -103,6 +104,9 @@ stdenv.mkDerivation rec {
   passthru.tests = {
     inherit gimp gtk3 gtk4 mapnik;
     inherit (qt5) qtbase;
+    pkg-config = testers.hasPkgConfigModules {
+      package = finalAttrs.finalPackage;
+    };
   };
 
   meta = with lib; {
@@ -112,5 +116,10 @@ stdenv.mkDerivation rec {
     maintainers = [ maintainers.eelco ];
     license = licenses.mit;
     platforms = platforms.unix;
+    pkgConfigModules = [
+      "harfbuzz"
+      "harfbuzz-gobject"
+      "harfbuzz-subset"
+    ];
   };
-}
+})