Unverified Commit 30d35d0f authored by Doron Behar's avatar Doron Behar Committed by GitHub
Browse files

opus-tools: switch to fetchFromGitLab (#496318)

parents e33c3766 3ee93f5d
Loading
Loading
Loading
Loading
+22 −5
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchurl,
  fetchFromGitLab,
  libogg,
  libao,
  autoreconfHook,
  pkg-config,
  flac,
  opusfile,
  libopusenc,
  versionCheckHook,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "opus-tools";
  version = "0.2";

  src = fetchurl {
    url = "https://downloads.xiph.org/releases/opus/opus-tools-${finalAttrs.version}.tar.gz";
    sha256 = "11pzl27s4vcz4m18ch72nivbhww2zmzn56wspb7rll1y1nq6rrdl";
  src = fetchFromGitLab {
    domain = "gitlab.xiph.org";
    owner = "xiph";
    repo = "opus-tools";
    tag = "v${finalAttrs.version}";
    hash = "sha256-Tr+xvZKu1nuachgN7GXwqFyJYPQ/sWqaVJQHWhLAt+k=";
  };
  postPatch = ''
    echo 'PACKAGE_VERSION="${finalAttrs.version}"' > package_version
  '';

  nativeBuildInputs = [ pkg-config ];
  nativeBuildInputs = [
    autoreconfHook
    pkg-config
  ];
  buildInputs = [
    libogg
    libao
@@ -28,6 +39,12 @@ stdenv.mkDerivation (finalAttrs: {
    libopusenc
  ];

  doInstallCheck = true;
  nativeInstallCheckInputs = [
    versionCheckHook
  ];
  versionCheckProgram = "${placeholder "out"}/bin/opusenc";

  meta = {
    description = "Tools to work with opus encoded audio streams";
    homepage = "https://www.opus-codec.org/";