Unverified Commit 1f49ce9c authored by superherointj's avatar superherointj Committed by GitHub
Browse files

Merge pull request #308360 from atorres1985-contrib/sdl2_net

SDL2_net: adopt and refactor
parents 8daae6f9 a1315850
Loading
Loading
Loading
Loading
+50 −0
Original line number Diff line number Diff line
{
  lib,
  SDL2,
  darwin,
  fetchFromGitHub,
  pkg-config,
  stdenv,
  # Boolean flags
  enableSdltest ? (!stdenv.isDarwin),
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "SDL2_net";
  version = "2.2.0";

  src = fetchFromGitHub {
    owner = "libsdl-org";
    repo = "SDL_net";
    rev = "release-${finalAttrs.version}";
    hash = "sha256-sEcKn/apA6FcR7ijb7sfuvP03ZdVfjkNZTXsasK8fAI=";
  };

  outputs = [ "out" "dev" ];

  nativeBuildInputs = [
    SDL2
    pkg-config
  ];

  buildInputs = lib.optionals stdenv.isDarwin [
    darwin.libobjc
  ];

  propagatedBuildInputs = [ SDL2 ];

  configureFlags = [
    (lib.enableFeature false "examples") # can't find libSDL2_test.a
    (lib.enableFeature enableSdltest "sdltest")
  ];

  strictDeps = true;

  meta = {
    homepage = "https://github.com/libsdl-org/SDL_net";
    description = "SDL multiplatform networking library";
    license = lib.licenses.zlib;
    maintainers = with lib.maintainers; [ AndersonTorres ];
    inherit (SDL2.meta) platforms;
  };
})
+0 −30
Original line number Diff line number Diff line
{ lib, stdenv, pkg-config, darwin, fetchurl, SDL2 }:

stdenv.mkDerivation rec {
  pname = "SDL2_net";
  version = "2.2.0";

  src = fetchurl {
    url = "https://www.libsdl.org/projects/SDL_net/release/${pname}-${version}.tar.gz";
    sha256 = "sha256-TkqJGYgxYnGXT/TpWF7R73KaEj0iwIvUcxKRedyFf+s=";
  };

  outputs = [ "out" "dev" ];

  nativeBuildInputs = [ pkg-config ];

  buildInputs = lib.optional stdenv.isDarwin darwin.libobjc;

  configureFlags = [ "--disable-examples" ]
  ++ lib.optional stdenv.isDarwin "--disable-sdltest";

  propagatedBuildInputs = [ SDL2 ];

  meta = with lib; {
    description = "SDL multiplatform networking library";
    homepage = "https://www.libsdl.org/projects/SDL_net";
    license = licenses.zlib;
    maintainers = with maintainers; [ ];
    platforms = platforms.unix;
  };
}
+0 −2
Original line number Diff line number Diff line
@@ -24344,8 +24344,6 @@ with pkgs;
  # SDL2_mixer_2_0 pinned for lzwolf
  SDL2_mixer_2_0 = callPackage ../development/libraries/SDL2_mixer/2_0.nix { };
  SDL2_net = callPackage ../development/libraries/SDL2_net { };
  SDL2_gfx = callPackage ../development/libraries/SDL2_gfx { };
  SDL2_sound = callPackage ../development/libraries/SDL2_sound {