Unverified Commit 2a75232c authored by Yureka's avatar Yureka Committed by GitHub
Browse files

pkgsMusl.directfb: unbreak (#228345)

parent e494bbff
Loading
Loading
Loading
Loading
+20 −4
Original line number Diff line number Diff line
@@ -23,6 +23,16 @@ stdenv.mkDerivation rec {
      url = "https://github.com/deniskropp/DirectFB/commit/3a236241bbec3f15b012b6f0dbe94353d8094557.patch";
      sha256 = "0rj3gv0zlb225sqjz04p4yagy4xacf3210aa8vra8i1f0fv0w4kw";
    })

    # Fixes for build of `pkgsMusl.directfb`; applied everywhere to prevent patchrot
    (fetchpatch {
      url = "https://git.alpinelinux.org/aports/plain/community/directfb/0001-directfb-fix-musl-compile.patch?id=f8158258493fc0c3eb5de2302e40f4bc44ecfb09";
      sha256 = "sha256-hmwzbaXu30ZkAqUn1NmvtlJkM6ctddKcO4hxh+1LSS4=";
    })
    (fetchpatch {
      url = "https://git.alpinelinux.org/aports/plain/community/directfb/0002-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch?id=f8158258493fc0c3eb5de2302e40f4bc44ecfb09";
      sha256 = "sha256-j3+mcP6hV9LKuba1GOdcM1cZfmXuJtRgx4vE484jIns=";
    })
  ];

  postPatch = ''
@@ -31,6 +41,12 @@ stdenv.mkDerivation rec {
    # if switching to cmake then a similar substitution has to be done
    substituteInPlace src/core/Makefile.am \
      --replace '`date -u "+%Y-%m-%d %H:%M"`' "`date -u \"+%Y-%m-%d %H:%M\" --date="@''${SOURCE_DATE_EPOCH}"`"
  '' + lib.optionalString stdenv.hostPlatform.isMusl ''
    # Specifically patch out two drivers that have build errors with musl libc,
    # while leaving the rest of the default selection enabled
    substituteInPlace configure.in \
      --replace checkfor_lirc={yes,no} \
      --replace checkfor_matrox={yes,no}
  '';

  nativeBuildInputs = [ autoreconfHook perl pkg-config flux ];
@@ -53,8 +69,10 @@ stdenv.mkDerivation rec {
    "--enable-mmx"
    "--enable-sse"
    "--with-software"
    "--with-smooth-scaling"
  ] ++ lib.optional enableX11 "--enable-x11";
  ]
    ++ lib.optional (!stdenv.hostPlatform.isMusl) "--with-smooth-scaling"
    ++ lib.optional enableX11 "--enable-x11"
  ;

  # Disable parallel building as parallel builds fail due to incomplete
  # depends between autogenerated CoreSlave.h and it's include sites:
@@ -83,7 +101,5 @@ stdenv.mkDerivation rec {
    license = licenses.lgpl21;
    platforms = platforms.linux;
    maintainers = [ maintainers.bjornfor ];
    broken = stdenv.hostPlatform.isMusl; # Broken at 2022-02-25
                                         # See https://github.com/NixOS/nixpkgs/issues/218274
  };
}