diff --git a/pkgs/by-name/li/libqb/package.nix b/pkgs/by-name/li/libqb/package.nix index 0badad4cc9eb..51b18f0ef9c9 100644 --- a/pkgs/by-name/li/libqb/package.nix +++ b/pkgs/by-name/li/libqb/package.nix @@ -8,25 +8,28 @@ libxml2, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "libqb"; - version = "2.0.8"; + version = "2.0.9"; src = fetchFromGitHub { owner = "ClusterLabs"; repo = "libqb"; - rev = "v${version}"; - sha256 = "sha256-ZjxC7W4U8T68mZy/OvWj/e4W9pJIj2lVDoEjxXYr/G8="; + tag = "v${finalAttrs.version}"; + # Upstream uses .gitattributes to inject information about the revision + # hash and the refname into `configure.ac`, see: + # - https://git-scm.com/docs/gitattributes#_export_subst and + # - https://github.com/ClusterLabs/libqb/commit/d6875f29d6d1175f621e33d312fcace9a55f9094 + # Directly inject version and remove complicated logic + # https://github.com/ClusterLabs/libqb/blob/d6875f29d6d1175f621e33d312fcace9a55f9094/configure.ac#L9-L15 + postFetch = '' + substituteInPlace $out/configure.ac \ + --replace-fail "AC_INIT([libqb]," "AC_INIT([libqb], ${finalAttrs.version}," + sed -i '/m4_esyscmd(\[build-aux\/git-version-gen/ , /\]),/ d' $out/configure.ac + ''; + hash = "sha256-LhB7Q78heCmcgtcHqL+uEv0O2s4mXyfdTzmoCVqC0x0="; }; - patches = [ - # add a declaration of fdatasync, missing on darwin https://github.com/ClusterLabs/libqb/pull/496 - (fetchpatch { - url = "https://github.com/ClusterLabs/libqb/commit/255ccb70ee19cc0c82dd13e4fd5838ca5427795f.patch"; - hash = "sha256-6x4B3FM0XSRIeAly8JtMOGOdyunTcbaDzUeBZInXR4U="; - }) - ]; - nativeBuildInputs = [ autoreconfHook pkg-config @@ -34,8 +37,10 @@ stdenv.mkDerivation rec { buildInputs = [ libxml2 ]; + # Remove configure check for linker flag `--enable-new-dtags`, which fails + # on darwin. The flag is never used by the Makefile anyway. postPatch = '' - sed -i '/# --enable-new-dtags:/,/--enable-new-dtags is required/ d' configure.ac + sed -i '/# --enable-new-dtags:/,/esac/ d' configure.ac ''; meta = { @@ -44,4 +49,4 @@ stdenv.mkDerivation rec { license = lib.licenses.lgpl21Plus; platforms = lib.platforms.unix; }; -} +})