2022-03-05 16:20:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
# for passthru.tests
|
|
|
|
, python3
|
|
|
|
, perlPackages
|
|
|
|
, haskellPackages
|
|
|
|
, luaPackages
|
|
|
|
, ocamlPackages
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
# Note: this package is used for bootstrapping fetchurl, and thus
|
|
|
|
# cannot use fetchpatch! All mutable patches (generated by GitHub or
|
|
|
|
# cgit) that are needed here should be included directly in Nixpkgs as
|
|
|
|
# files.
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "expat";
|
2022-05-18 14:49:53 +00:00
|
|
|
version = "2.4.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-06-28 23:13:55 +00:00
|
|
|
url = "https://github.com/libexpat/libexpat/releases/download/R_${lib.replaceStrings ["."] ["_"] version}/${pname}-${version}.tar.xz";
|
2022-05-18 14:49:53 +00:00
|
|
|
sha256 = "sha256-95uPkEt0nj4NIK/q3s+CScVbLjLU67CJrjeN9HncryU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ]; # TODO: fix referrers
|
|
|
|
outputBin = "dev";
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
configureFlags = lib.optional stdenv.isFreeBSD "--with-pic";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputMan = "dev"; # tiny page for a dev tool
|
|
|
|
|
|
|
|
doCheck = true; # not cross;
|
|
|
|
|
|
|
|
preCheck = ''
|
2021-06-28 23:13:55 +00:00
|
|
|
patchShebangs ./configure ./run.sh ./test-driver-wrapper.sh
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
# CMake files incorrectly calculate library path from dev prefix
|
|
|
|
# https://github.com/libexpat/libexpat/issues/501
|
|
|
|
postFixup = ''
|
|
|
|
substituteInPlace $dev/lib/cmake/expat-${version}/expat-noconfig.cmake \
|
|
|
|
--replace "$"'{_IMPORT_PREFIX}' $out
|
|
|
|
'';
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit python3;
|
2022-04-15 01:41:22 +00:00
|
|
|
inherit (python3.pkgs) xmltodict;
|
2022-03-05 16:20:37 +00:00
|
|
|
inherit (haskellPackages) hexpat;
|
|
|
|
inherit (perlPackages) XMLSAXExpat XMLParser;
|
|
|
|
inherit (luaPackages) luaexpat;
|
|
|
|
inherit (ocamlPackages) ocaml_expat;
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2021-06-28 23:13:55 +00:00
|
|
|
homepage = "https://libexpat.github.io/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A stream-oriented XML parser library written in C";
|
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.mit; # expat version
|
|
|
|
};
|
|
|
|
}
|