Unverified Commit 94db8d8c authored by github-actions[bot]'s avatar github-actions[bot] Committed by GitHub
Browse files

Merge master into staging-next

parents 55f67b32 e718d584
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ let
      { name = "gvariant"; description = "GVariant formatted string serialization functions"; }
      { name = "customisation"; description = "Functions to customise (derivation-related) functions, derivatons, or attribute sets"; }
      { name = "meta"; description = "functions for derivation metadata"; }
      { name = "derivations"; description = "miscellaneous derivation-specific functions"; }
    ];
  };

+1 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ let
    inherit (self.customisation) overrideDerivation makeOverridable
      callPackageWith callPackagesWith extendDerivation hydraJob
      makeScope makeScopeWithSplicing makeScopeWithSplicing';
    inherit (self.derivations) lazyDerivation;
    inherit (self.derivations) lazyDerivation optionalDrvAttr;
    inherit (self.meta) addMetaAttrs dontDistribute setName updateName
      appendToName mapDerivationAttrset setPrio lowPrio lowPrioSet hiPrio
      hiPrioSet getLicenseFromSpdxId getExe getExe';
+26 −0
Original line number Diff line number Diff line
@@ -98,4 +98,30 @@ in
      # `lazyDerivation` caller knew a shortcut, be taken from there.
      meta = args.meta or checked.meta;
    } // passthru;

  /* Conditionally set a derivation attribute.

     Because `mkDerivation` sets `__ignoreNulls = true`, a derivation
     attribute set to `null` will not impact the derivation output hash.
     Thus, this function passes through its `value` argument if the `cond`
     is `true`, but returns `null` if not.

     Type: optionalDrvAttr :: Bool -> a -> a | Null

     Example:
       (stdenv.mkDerivation {
         name = "foo";
         x = optionalDrvAttr true 1;
         y = optionalDrvAttr false 1;
       }).drvPath == (stdenv.mkDerivation {
         name = "foo";
         x = 1;
       }).drvPath
       => true
  */
  optionalDrvAttr =
    # Condition
    cond:
    # Attribute value
    value: if cond then value else null;
}
+19 −1
Original line number Diff line number Diff line
@@ -1902,7 +1902,7 @@ runTests {
    expected = true;
  };

  # lazyDerivation
  # DERIVATIONS

  testLazyDerivationIsLazyInDerivationForAttrNames = {
    expr = attrNames (lazyDerivation {
@@ -1955,6 +1955,24 @@ runTests {
    expected = derivation;
  };

  testOptionalDrvAttr = let
    mkDerivation = args: derivation (args // {
      builder = "builder";
      system = "system";
      __ignoreNulls = true;
    });
  in {
    expr = (mkDerivation {
      name = "foo";
      x = optionalDrvAttr true 1;
      y = optionalDrvAttr false 1;
    }).drvPath;
    expected = (mkDerivation {
      name = "foo";
      x = 1;
    }).drvPath;
  };

  testTypeDescriptionInt = {
    expr = (with types; int).description;
    expected = "signed integer";
+11 −5
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
, fftw
, gnutls
, libcdio
, libebur128
, libmtp
, libpthreadstubs
, libtasn1
@@ -34,21 +35,23 @@
, gst_all_1
, withVlc ? true
, libvlc
, nix-update-script
}:

let
  inherit (lib) optionals;
  inherit (lib) optionals optionalString;

in
stdenv.mkDerivation rec {
  pname = "strawberry";
  version = "1.0.21";
  version = "1.0.23";

  src = fetchFromGitHub {
    owner = "jonaski";
    repo = pname;
    rev = version;
    hash = "sha256-McwnYHaw0LYDeHLDQzfqRIYMV2FoiMdHyOL/EE8/esU=";
    hash = "sha256-hzZx530HD7R3JOG6cCsoaW9puYkmu7m5lr+EfobKX7o=";
    fetchSubmodules = true;
  };

  # the big strawberry shown in the context menu is *very* much in your face, so use the grey version instead
@@ -64,6 +67,7 @@ stdenv.mkDerivation rec {
    fftw
    gnutls
    libcdio
    libebur128
    libidn2
    libmtp
    libpthreadstubs
@@ -89,7 +93,7 @@ stdenv.mkDerivation rec {
    gst-plugins-good
    gst-plugins-bad
    gst-plugins-ugly
  ]) ++ lib.optional withVlc libvlc;
  ]) ++ optionals withVlc [ libvlc ];

  nativeBuildInputs = [
    cmake
@@ -101,13 +105,15 @@ stdenv.mkDerivation rec {
    util-linux
  ];

  postInstall = lib.optionalString withGstreamer ''
  postInstall = optionalString withGstreamer ''
    qtWrapperArgs+=(
      --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
      --prefix GIO_EXTRA_MODULES : "${glib-networking.out}/lib/gio/modules"
    )
  '';

  passthru.updateScript = nix-update-script { };

  meta = with lib; {
    description = "Music player and music collection organizer";
    homepage = "https://www.strawberrymusicplayer.org/";
Loading