nixpkgs/pkgs/development/tools/gnulib/default.nix
Adam Joseph 9eafe4319c gnulib: add gnulib-longdouble-redirect.patch
This patch adds gnulib-longdouble-redirect.patch, which is a subset of
gnulib commit 776af40e09b476a41073131a90022572f448c189.

This patch must be applied to the copy of gnulib which is vendored
within a few packages, when compiling for platforms that use
longdouble-redirection (a glibc-specific feature).  Without it,
compile failures mentioning "__LDBL_REDIR1_DECL" will occur.

Currently there are two packages which need this patch to their
vendored gnulib: gettext and gnused.  Both projects have merged a
fixed version of gnulib but have not yet made a release with the fix.
We can drop this patch as soon as both of those projects are
version-bumped.
2023-04-05 15:51:17 -07:00

48 lines
1.3 KiB
Nix

{ lib, stdenv, fetchgit, python3 }:
stdenv.mkDerivation {
pname = "gnulib";
version = "20210702";
src = fetchgit {
url = "https://git.savannah.gnu.org/r/gnulib.git";
rev = "901694b904cd861adc2529b2e05a3fb33f9b534f";
sha256 = "1f5znlv2wjziglw9vlygdgm4jfbsz34h2dz6w4h90bl4hm0ycb1w";
};
postPatch = ''
patchShebangs gnulib-tool.py
'';
buildInputs = [ python3 ];
installPhase = ''
mkdir -p $out/bin
cp -r * $out/
ln -s $out/lib $out/include
ln -s $out/gnulib-tool $out/bin/
'';
# do not change headers to not update all vendored build files
dontFixup = true;
passthru = {
# This patch is used by multiple other packages (currently:
# gnused, gettext) which contain vendored copies of gnulib.
# Without it, compilation will fail with error messages about
# "__LDBL_REDIR1_DECL" or similar on platforms with longdouble
# redirects (currently powerpc64). Once all of those other
# packages make a release with a newer gnulib we can drop this
# patch.
longdouble-redirect-patch = ./gnulib-longdouble-redirect.patch;
};
meta = with lib; {
description = "Central location for code to be shared among GNU packages";
homepage = "https://www.gnu.org/software/gnulib/";
license = licenses.gpl3Plus;
mainProgram = "gnulib-tool";
platforms = platforms.unix;
};
}