<commit_before>{ stdenv, fetchurl, devicemapper }:

stdenv.mkDerivation rec {
  name = "dmraid-1.0.0.rc16";

  src = fetchurl {
    url = "http://people.redhat.com/~heinzm/sw/dmraid/src/old/${name}.tar.bz2";
    sha256 = "0m92971gyqp61darxbiri6a48jz3wq3gkp8r2k39320z0i6w8jgq";
  };

  patches = [ ./hardening-format.patch ];

  postPatch = ''
    sed -i 's/\[\[[^]]*\]\]/[ "''$''${n##*.}" = "so" ]/' */lib/Makefile.in
  '';

  preConfigure = "cd */";<commit_msg>dmraid: fix w/musl (missing includes, -D_GNU_SOURCE)<commit_after>{ stdenv, fetchurl, fetchpatch, devicemapper }:

stdenv.mkDerivation rec {
  name = "dmraid-1.0.0.rc16";

  src = fetchurl {
    url = "http://people.redhat.com/~heinzm/sw/dmraid/src/old/${name}.tar.bz2";
    sha256 = "0m92971gyqp61darxbiri6a48jz3wq3gkp8r2k39320z0i6w8jgq";
  };

  patches = [ ./hardening-format.patch ]
    ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
      (fetchpatch {
        url = "https://raw.githubusercontent.com/void-linux/void-packages/fceed4b8e96b3c1da07babf6f67b6ed1588a28b2/srcpkgs/dmraid/patches/006-musl-libc.patch";
        sha256 = "1j8xda0fpz8lxjxnqdidy7qb866qrzwpbca56yjdg6vf4x21hx6w";
        stripLen = 2;
        extraPrefix = "1.0.0.rc16/";
      })
    ];

  postPatch = ''
    sed -i 's/\[\[[^]]*\]\]/[ "''$''${n##*.}" = "so" ]/' */lib/Makefile.in
  '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
    NIX_CFLAGS_COMPILE+=" -D_GNU_SOURCE"
  '';

  preConfigure = "cd */";
{'fraction_non_alphanumeric': 0.19548872180451127, 'fraction_numerical': 0.07518796992481203, 'mean_word_length': 3.344213649851632, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1776171', 'n_tokens_mistral': 707, 'n_tokens_neox': 653, 'n_words': 71}