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:12:04 +09:00
commit f10a9c9094
No known key found for this signature in database
GPG Key ID: 462E0C03D11422F4
7 changed files with 48 additions and 24 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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" ];
};
}
})

View File

@ -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" ];
};
}
})

View File

@ -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" ];
};
}
})

View File

@ -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"
];
};
}
})