diff options
author | Alyssa Ross <hi@alyssa.is> | 2022-03-19 09:13:54 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2022-03-19 09:13:54 +0000 |
commit | 220273ccc689041667ab5ff55fe5b1e93689227a (patch) | |
tree | d1c95664832920b476ab48ab5dd9ad09ec67d82d /nixpkgs/pkgs/development/libraries/libxml2 | |
parent | 68bab940e926ec7ae7380947a78c581e6aadcd18 (diff) | |
parent | 6e3ee8957637a60f5072e33d78e05c0f65c54366 (diff) | |
download | nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar.gz nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar.bz2 nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar.lz nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar.xz nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar.zst nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.zip |
Merge commit '6e3ee8957637a60f5072e33d78e05c0f65c54366'
Conflicts: nixpkgs/pkgs/applications/networking/browsers/firefox/packages.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libxml2')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/libxml2/default.nix | 122 |
1 files changed, 75 insertions, 47 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libxml2/default.nix b/nixpkgs/pkgs/development/libraries/libxml2/default.nix index bc11c9cfea1f..3b7cae36a0ee 100644 --- a/nixpkgs/pkgs/development/libraries/libxml2/default.nix +++ b/nixpkgs/pkgs/development/libraries/libxml2/default.nix @@ -1,20 +1,37 @@ -{ stdenv, lib, fetchurl, fetchpatch -, zlib, xz, libintl, python, gettext, ncurses, findXMLCatalogs +{ stdenv +, lib +, fetchurl +, zlib +, pkg-config +, autoreconfHook +, xz +, libintl +, python +, gettext +, ncurses +, findXMLCatalogs , libiconv , pythonSupport ? enableShared && stdenv.buildPlatform == stdenv.hostPlatform -, icuSupport ? false, icu ? null +, icuSupport ? false +, icu , enableShared ? stdenv.hostPlatform.libc != "msvcrt" && !stdenv.hostPlatform.isStatic , enableStatic ? !enableShared +, gnome }: stdenv.mkDerivation rec { pname = "libxml2"; - version = "2.9.12"; + version = "2.9.13"; + + outputs = [ "bin" "dev" "out" "man" "doc" ] + ++ lib.optional pythonSupport "py" + ++ lib.optional (enableStatic && enableShared) "static"; src = fetchurl { - url = "http://xmlsoft.org/sources/${pname}-${version}.tar.gz"; - sha256 = "14hxwzmf5xqppx77z7i0ni9lpzg1a84dqpf8j8l1fvy570g6imn8"; + url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "J2EwYC0S/khOzANEfuXnWdBGVVj7yda9FE43RTBuvw4="; }; + patches = [ # Upstream bugs: # https://bugzilla.gnome.org/show_bug.cgi?id=789714 @@ -28,62 +45,65 @@ stdenv.mkDerivation rec { # https://github.com/NixOS/nixpkgs/pull/63174 # https://github.com/NixOS/nixpkgs/pull/72342 ./utf8-xmlErrorFuncHandler.patch - - # Work around lxml API misuse. - # https://gitlab.gnome.org/GNOME/libxml2/issues/255 - (fetchpatch { - url = "https://gitlab.gnome.org/GNOME/libxml2/commit/85b1792e37b131e7a51af98a37f92472e8de5f3f.patch"; - sha256 = "epqlNs2S0Zczox3KyCB6R2aJKh87lXydlZ0x6tLHweE="; - }) ]; - outputs = [ "bin" "dev" "out" "man" "doc" ] - ++ lib.optional pythonSupport "py" - ++ lib.optional (enableStatic && enableShared) "static"; - strictDeps = true; - buildInputs = lib.optional pythonSupport python - ++ lib.optional (pythonSupport && python?isPy2 && python.isPy2) gettext - ++ lib.optional (pythonSupport && python?isPy3 && python.isPy3) ncurses - ++ lib.optional (stdenv.isDarwin && - pythonSupport && python?isPy2 && python.isPy2) libintl + nativeBuildInputs = [ + pkg-config + autoreconfHook + ]; + + buildInputs = lib.optionals pythonSupport [ + python + ] ++ lib.optionals (pythonSupport && python?isPy2 && python.isPy2) [ + gettext + ] ++ lib.optionals (pythonSupport && python?isPy3 && python.isPy3) [ + ncurses + ] ++ lib.optionals (stdenv.isDarwin && pythonSupport && python?isPy2 && python.isPy2) [ + libintl + ] ++ lib.optionals stdenv.isFreeBSD [ # Libxml2 has an optional dependency on liblzma. However, on impure # platforms, it may end up using that from /usr/lib, and thus lack a # RUNPATH for that, leading to undefined references for its users. - ++ lib.optional stdenv.isFreeBSD xz; + xz + ]; - propagatedBuildInputs = [ zlib findXMLCatalogs ] - ++ lib.optional stdenv.isDarwin libiconv - ++ lib.optional icuSupport icu; + propagatedBuildInputs = [ + zlib + findXMLCatalogs + ] ++ lib.optionals stdenv.isDarwin [ + libiconv + ] ++ lib.optionals icuSupport [ + icu + ]; configureFlags = [ - "--exec_prefix=$dev" + "--exec-prefix=${placeholder "dev"}" (lib.enableFeature enableStatic "static") (lib.enableFeature enableShared "shared") (lib.withFeature icuSupport "icu") (lib.withFeatureAs pythonSupport "python" python) ]; - preConfigure = lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") '' - MACOSX_DEPLOYMENT_TARGET=10.16 - ''; + installFlags = lib.optionals pythonSupport [ + "pythondir=\"${placeholder "py"}/${python.sitePackages}\"" + ]; enableParallelBuilding = true; - # disable test that's problematic with newer pythons: see - # https://mail.gnome.org/archives/xml/2017-August/msg00014.html - preCheck = lib.optionalString (pythonSupport && !(python?pythonOlder && python.pythonOlder "3.5")) '' - echo "" > python/tests/tstLastError.py - ''; - - doCheck = (stdenv.hostPlatform == stdenv.buildPlatform) && !stdenv.isDarwin && + doCheck = + (stdenv.hostPlatform == stdenv.buildPlatform) && + !stdenv.isDarwin && stdenv.hostPlatform.libc != "musl"; - preInstall = lib.optionalString pythonSupport - ''substituteInPlace python/libxml2mod.la --replace "${python}" "$py"''; - installFlags = lib.optional pythonSupport - "pythondir=\"${placeholder "py"}/lib/${python.libPrefix}/site-packages\""; + preConfigure = lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") '' + MACOSX_DEPLOYMENT_TARGET=10.16 + ''; + + preInstall = lib.optionalString pythonSupport '' + substituteInPlace python/libxml2mod.la --replace "$dev/${python.sitePackages}" "$py/${python.sitePackages}" + ''; postFixup = '' moveToOutput bin/xml2-config "$dev" @@ -93,13 +113,21 @@ stdenv.mkDerivation rec { moveToOutput lib/libxml2.a "$static" ''; - passthru = { inherit version; pythonSupport = pythonSupport; }; + passthru = { + inherit version; + pythonSupport = pythonSupport; + + updateScript = gnome.updateScript { + packageName = pname; + versionPolicy = "none"; + }; + }; - meta = { + meta = with lib; { homepage = "http://xmlsoft.org/"; - description = "An XML parsing library for C"; - license = lib.licenses.mit; - platforms = lib.platforms.all; - maintainers = [ lib.maintainers.eelco ]; + description = "XML parsing library for C"; + license = licenses.mit; + platforms = platforms.all; + maintainers = with maintainers; [ eelco jtojnar ]; }; } |