btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / li / libomxil-bellagio / package.nix
blob78f37bbbb67dd40264e032310757a39047e0e18f
1 { lib
2 , stdenv
3 , fetchurl
4 }:
6 stdenv.mkDerivation rec {
7   pname = "libomxil-bellagio";
8   version = "0.9.3";
10   src = fetchurl {
11     url = "mirror://sourceforge/omxil/omxil/Bellagio%20${version}/${pname}-${version}.tar.gz";
12     sha256 = "0k6p6h4npn8p1qlgq6z3jbfld6n1bqswzvxzndki937gr0lhfg2r";
13   };
15   configureFlags =
16     lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" ];
18   patches = [
19     ./fedora-fixes.patch
20     ./fno-common.patch
21     # Fix stack overread: https://sourceforge.net/p/omxil/patches/8/
22     (fetchurl {
23       name = "no-overread.patch";
24       url = "https://sourceforge.net/p/omxil/patches/8/attachment/0001-src-base-omx_base_component.c-fix-stack-overread.patch";
25       hash = "sha256-ElpiDxU0Ii4Ou8ebVx4Ne9UnB6mesC8cRj77N7LdovA=";
26     })
27   ];
29   # Disable parallel build as it fails as:
30   #    ld: cannot find -lomxil-bellagio
31   enableParallelBuilding = false;
33   doCheck = false; # fails
35   env.NIX_CFLAGS_COMPILE =
36     # stringop-truncation: see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1028978
37     if stdenv.cc.isGNU then "-Wno-error=array-bounds -Wno-error=stringop-overflow=8 -Wno-error=stringop-truncation"
38     else let
39       isLLVM17 = stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17";
40     in "-Wno-error=absolute-value -Wno-error=enum-conversion -Wno-error=logical-not-parentheses -Wno-error=non-literal-null-conversion${lib.optionalString (isLLVM17) " -Wno-error=unused-but-set-variable"}";
42   meta = with lib; {
43     homepage = "https://omxil.sourceforge.net/";
44     description = "Opensource implementation of the Khronos OpenMAX Integration Layer API to access multimedia components";
45     mainProgram = "omxregister-bellagio";
46     license = licenses.lgpl21Plus;
47     platforms = platforms.linux;
48   };