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
This commit is contained in:
Dennis Gosnell
2023-11-10 09:16:34 +09:00
7 changed files with 48 additions and 24 deletions
@@ -638,7 +638,6 @@ self: super: {
saltine = dontCheck super.saltine; # https://github.com/tel/saltine/pull/56 saltine = dontCheck super.saltine; # https://github.com/tel/saltine/pull/56
scp-streams = dontCheck super.scp-streams; scp-streams = dontCheck super.scp-streams;
sdl2 = dontCheck super.sdl2; # the test suite needs an x server 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; separated = dontCheck super.separated;
shadowsocks = dontCheck super.shadowsocks; shadowsocks = dontCheck super.shadowsocks;
shake-language-c = dontCheck super.shake-language-c; shake-language-c = dontCheck super.shake-language-c;
@@ -2680,4 +2679,10 @@ self: super: {
# Tests rely on (missing) submodule # Tests rely on (missing) submodule
unleash-client-haskell-core = dontCheck super.unleash-client-haskell-core; 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 } // import ./configuration-tensorflow.nix {inherit pkgs haskellLib;} self super
@@ -4800,10 +4800,8 @@ broken-packages:
- sdl2-cairo-image # failure in job https://hydra.nixos.org/build/233210135 at 2023-09-02 - 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-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-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-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-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 - 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 - 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 - seakale # failure in job https://hydra.nixos.org/build/233236200 at 2023-09-02
-4
View File
@@ -263570,9 +263570,7 @@ self: {
executablePkgconfigDepends = [ SDL2 SDL2_gfx ]; executablePkgconfigDepends = [ SDL2 SDL2_gfx ];
description = "Haskell bindings to SDL2_gfx"; description = "Haskell bindings to SDL2_gfx";
license = lib.licenses.mit; license = lib.licenses.mit;
hydraPlatforms = lib.platforms.none;
mainProgram = "sdl2-gfx-example"; mainProgram = "sdl2-gfx-example";
broken = true;
}) {inherit (pkgs) SDL2; inherit (pkgs) SDL2_gfx;}; }) {inherit (pkgs) SDL2; inherit (pkgs) SDL2_gfx;};
"sdl2-image" = callPackage "sdl2-image" = callPackage
@@ -263666,8 +263664,6 @@ self: {
description = "Bindings to SDL2_ttf"; description = "Bindings to SDL2_ttf";
license = lib.licenses.bsd3; license = lib.licenses.bsd3;
badPlatforms = lib.platforms.darwin; badPlatforms = lib.platforms.darwin;
hydraPlatforms = lib.platforms.none;
broken = true;
}) {inherit (pkgs) SDL2; inherit (pkgs) SDL2_ttf;}; }) {inherit (pkgs) SDL2; inherit (pkgs) SDL2_ttf;};
"sdnv" = callPackage "sdnv" = callPackage
+12 -6
View File
@@ -49,19 +49,21 @@
, audiofile , audiofile
, libiconv , libiconv
, withStatic ? false , withStatic ? false
# passthru.tests
, testers
}: }:
# NOTE: When editing this expression see if the same change applies to # NOTE: When editing this expression see if the same change applies to
# SDL expression too # SDL expression too
stdenv.mkDerivation rec { stdenv.mkDerivation (finalAttrs: {
pname = "SDL2"; pname = "SDL2";
version = "2.28.3"; version = "2.28.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "libsdl-org"; owner = "libsdl-org";
repo = "SDL"; repo = "SDL";
rev = "release-${version}"; rev = "release-${finalAttrs.version}";
hash = "sha256-/kQ2IyvAfmZ+zIUt1WuEIeX0nYPGXDlAQk2qDsQnFFs="; hash = "sha256-/kQ2IyvAfmZ+zIUt1WuEIeX0nYPGXDlAQk2qDsQnFFs=";
}; };
dontDisableStatic = if withStatic then 1 else 0; dontDisableStatic = if withStatic then 1 else 0;
@@ -96,7 +98,7 @@ stdenv.mkDerivation rec {
++ lib.optionals x11Support [ libX11 ]; ++ lib.optionals x11Support [ libX11 ];
propagatedBuildInputs = lib.optionals x11Support [ xorgproto ] propagatedBuildInputs = lib.optionals x11Support [ xorgproto ]
++ dlopenPropagatedBuildInputs; ++ finalAttrs.dlopenPropagatedBuildInputs;
dlopenBuildInputs = lib.optionals alsaSupport [ alsa-lib audiofile ] dlopenBuildInputs = lib.optionals alsaSupport [ alsa-lib audiofile ]
++ lib.optional dbusSupport dbus ++ lib.optional dbusSupport dbus
@@ -109,7 +111,7 @@ stdenv.mkDerivation rec {
++ lib.optionals drmSupport [ libdrm mesa ]; ++ lib.optionals drmSupport [ libdrm mesa ];
buildInputs = [ libiconv ] buildInputs = [ libiconv ]
++ dlopenBuildInputs ++ finalAttrs.dlopenBuildInputs
++ lib.optional ibusSupport ibus ++ lib.optional ibusSupport ibus
++ lib.optionals waylandSupport [ wayland-protocols ] ++ lib.optionals waylandSupport [ wayland-protocols ]
++ lib.optionals stdenv.isDarwin [ AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL ]; ++ lib.optionals stdenv.isDarwin [ AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL ];
@@ -156,7 +158,7 @@ stdenv.mkDerivation rec {
# list the symbols used in this way. # list the symbols used in this way.
postFixup = postFixup =
let let
rpath = lib.makeLibraryPath (dlopenPropagatedBuildInputs ++ dlopenBuildInputs); rpath = lib.makeLibraryPath (finalAttrs.dlopenPropagatedBuildInputs ++ finalAttrs.dlopenBuildInputs);
in in
lib.optionalString (stdenv.hostPlatform.extensions.sharedLibrary == ".so") '' lib.optionalString (stdenv.hostPlatform.extensions.sharedLibrary == ".so") ''
for lib in $out/lib/*.so* ; do for lib in $out/lib/*.so* ; do
@@ -171,6 +173,9 @@ stdenv.mkDerivation rec {
passthru = { passthru = {
inherit openglSupport; inherit openglSupport;
updateScript = nix-update-script { extraArgs = ["--version-regex" "release-(.*)"]; }; updateScript = nix-update-script { extraArgs = ["--version-regex" "release-(.*)"]; };
tests.pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
};
}; };
meta = with lib; { meta = with lib; {
@@ -180,5 +185,6 @@ stdenv.mkDerivation rec {
license = licenses.zlib; license = licenses.zlib;
platforms = platforms.all; platforms = platforms.all;
maintainers = with maintainers; [ cpages ]; maintainers = with maintainers; [ cpages ];
pkgConfigModules = [ "sdl2" ];
}; };
} })
@@ -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"; pname = "SDL2_gfx";
version = "1.0.4"; version = "1.0.4";
src = fetchurl { 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"; sha256 = "0qk2ax7f7grlxb13ba0ll3zlm8780s7j8fmrhlpxzjgdvldf1q33";
}; };
@@ -17,6 +17,10 @@ stdenv.mkDerivation rec {
configureFlags = [(if stdenv.hostPlatform.isx86 then "--enable-mmx" else "--disable-mmx")] configureFlags = [(if stdenv.hostPlatform.isx86 then "--enable-mmx" else "--disable-mmx")]
++ lib.optional stdenv.isDarwin "--disable-sdltest"; ++ lib.optional stdenv.isDarwin "--disable-sdltest";
passthru.tests.pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
};
meta = with lib; { meta = with lib; {
description = "SDL graphics drawing primitives and support functions"; description = "SDL graphics drawing primitives and support functions";
@@ -42,5 +46,6 @@ stdenv.mkDerivation rec {
license = licenses.zlib; license = licenses.zlib;
maintainers = with maintainers; [ cpages ]; maintainers = with maintainers; [ cpages ];
platforms = platforms.unix; platforms = platforms.unix;
pkgConfigModules = [ "SDL2_gfx" ];
}; };
} })
@@ -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"; pname = "SDL2_ttf";
version = "2.20.2"; version = "2.20.2";
src = fetchurl { 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="; sha256 = "sha256-ncce2TSHUhsQeixKnKa/Q/ti9r3dXCawVea5FBiiIFM=";
}; };
@@ -18,10 +18,15 @@ stdenv.mkDerivation rec {
++ lib.optional (!stdenv.isDarwin) libGL ++ lib.optional (!stdenv.isDarwin) libGL
++ lib.optional stdenv.isDarwin darwin.libobjc; ++ lib.optional stdenv.isDarwin darwin.libobjc;
passthru.tests.pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
};
meta = with lib; { meta = with lib; {
description = "Support for TrueType (.ttf) font files with Simple Directmedia Layer"; description = "Support for TrueType (.ttf) font files with Simple Directmedia Layer";
platforms = platforms.unix; platforms = platforms.unix;
license = licenses.zlib; license = licenses.zlib;
homepage = "https://github.com/libsdl-org/SDL_ttf"; homepage = "https://github.com/libsdl-org/SDL_ttf";
pkgConfigModules = [ "SDL2_ttf" ];
}; };
} })
@@ -30,14 +30,15 @@
, gtk4 , gtk4
, mapnik , mapnik
, qt5 , qt5
, testers
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation (finalAttrs: {
pname = "harfbuzz${lib.optionalString withIcu "-icu"}"; pname = "harfbuzz${lib.optionalString withIcu "-icu"}";
version = "7.3.0"; version = "7.3.0";
src = fetchurl { 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="; hash = "sha256-IHcHiXSaybqEbfM5g9vaItuDbHDZ9dBQy5qlNHCUqPs=";
}; };
@@ -103,6 +104,9 @@ stdenv.mkDerivation rec {
passthru.tests = { passthru.tests = {
inherit gimp gtk3 gtk4 mapnik; inherit gimp gtk3 gtk4 mapnik;
inherit (qt5) qtbase; inherit (qt5) qtbase;
pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
};
}; };
meta = with lib; { meta = with lib; {
@@ -112,5 +116,10 @@ stdenv.mkDerivation rec {
maintainers = [ maintainers.eelco ]; maintainers = [ maintainers.eelco ];
license = licenses.mit; license = licenses.mit;
platforms = platforms.unix; platforms = platforms.unix;
pkgConfigModules = [
"harfbuzz"
"harfbuzz-gobject"
"harfbuzz-subset"
];
}; };
} })