Unverified Commit f10a9c90 authored by Dennis Gosnell's avatar Dennis Gosnell
Browse files

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
parents 2fe90802 c31f0065
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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
+0 −2
Original line number Diff line number Diff line
@@ -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
+0 −4
Original line number Diff line number Diff line
@@ -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
+12 −6
Original line number Diff line number Diff line
@@ -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" ];
  };
}
})
+9 −4
Original line number Diff line number Diff line
{ 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" ];
  };
}
})
Loading