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-11-21 17:40:18 +00:00
|
|
|
version = "2.5.0";
|
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-11-21 17:40:18 +00:00
|
|
|
sha256 = "1gnwihpfz4x18rwd6cbrdggmfqjzwsdfh1gpmc0ph21c4gq2097g";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
outputs = [ "out" "dev" ]; # TODO: fix referrers
|
|
|
|
outputBin = "dev";
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
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
|
|
|
|
};
|
|
|
|
}
|