nixpkgs/pkgs/by-name/ex/expat/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

79 lines
2.1 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchurl
, updateAutotoolsGnuConfigScriptsHook
# for passthru.tests
, python3
, perlPackages
, haskellPackages
, luaPackages
, ocamlPackages
2024-02-09 13:11:12 +00:00
, testers
}:
# 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.
2024-02-23 05:29:02 +00:00
let
version = "2.6.4";
2024-02-23 05:29:02 +00:00
tag = "R_${lib.replaceStrings ["."] ["_"] version}";
in
2024-02-09 13:11:12 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "expat";
2024-02-23 05:29:02 +00:00
inherit version;
2012-09-26 19:04:27 +00:00
src = fetchurl {
2024-02-23 05:29:02 +00:00
url = with finalAttrs; "https://github.com/libexpat/libexpat/releases/download/${tag}/${pname}-${version}.tar.xz";
hash = "sha256-ppVina4EcFWzfVCg/0d20dRdCkyELPTM7hWEQfVf9+4=";
};
strictDeps = true;
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
outputs = [ "out" "dev" ]; # TODO: fix referrers
2015-10-15 11:57:38 +00:00
outputBin = "dev";
enableParallelBuilding = true;
configureFlags = lib.optional stdenv.hostPlatform.isFreeBSD "--with-pic";
2015-10-15 11:57:38 +00:00
outputMan = "dev"; # tiny page for a dev tool
doCheck = true; # not cross;
2017-08-21 08:10:42 +00:00
preCheck = ''
patchShebangs ./run.sh ./test-driver-wrapper.sh
2017-08-21 08:10:42 +00:00
'';
# CMake files incorrectly calculate library path from dev prefix
# https://github.com/libexpat/libexpat/issues/501
postFixup = ''
2024-02-09 13:11:12 +00:00
substituteInPlace $dev/lib/cmake/expat-${finalAttrs.version}/expat-noconfig.cmake \
--replace "$"'{_IMPORT_PREFIX}' $out
'';
passthru.tests = {
inherit python3;
inherit (python3.pkgs) xmltodict;
inherit (haskellPackages) hexpat;
inherit (perlPackages) XMLSAXExpat XMLParser;
inherit (luaPackages) luaexpat;
inherit (ocamlPackages) ocaml_expat;
2024-02-09 13:11:12 +00:00
pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
};
};
meta = with lib; {
changelog = "https://github.com/libexpat/libexpat/blob/${tag}/expat/Changes";
homepage = "https://libexpat.github.io/";
description = "Stream-oriented XML parser library written in C";
mainProgram = "xmlwf";
platforms = platforms.all;
license = licenses.mit; # expat version
2024-02-09 13:11:12 +00:00
pkgConfigModules = [ "expat" ];
};
2024-02-09 13:11:12 +00:00
})