Unverified Commit bf1a329f authored by Marcin Serwin's avatar Marcin Serwin
Browse files

SDL_compat: add basic checkPhase

parent fb4b83f9
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -59,12 +59,26 @@ stdenv.mkDerivation (finalAttrs: {

  dontPatchELF = true; # don't strip rpath

  cmakeFlags = [
    (lib.cmakeFeature "CMAKE_INSTALL_RPATH" (lib.makeLibraryPath [ sdl2-compat ]))
  cmakeFlags =
    let
      rpath = lib.makeLibraryPath [ sdl2-compat ];
    in
    [
      (lib.cmakeFeature "CMAKE_INSTALL_RPATH" rpath)
      (lib.cmakeFeature "CMAKE_BUILD_RPATH" rpath)
      (lib.cmakeBool "SDL12TESTS" finalAttrs.finalPackage.doCheck)
    ];

  enableParallelBuilding = true;

  # Darwin fails with "Critical error: required built-in appearance SystemAppearance not found"
  doCheck = !stdenv.hostPlatform.isDarwin;
  checkPhase = ''
    runHook preCheck
    ./testver
    runHook postCheck
  '';

  postInstall = ''
    # allow as a drop in replacement for SDL
    # Can be removed after treewide switch from pkg-config to pkgconf