nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchFromSavannah, python3, perl }:
2
3stdenv.mkDerivation rec {
4 pname = "gnulib";
5 version = "20231109";
6
7 src = fetchFromSavannah {
8 repo = "gnulib";
9 rev = "2dd1a7984c6b3e6056cef7e3f9933e0039c21634";
10 hash = "sha256-QtWf3mljEnr0TTogkoKN63Y5HTm14A2e/sIXX3xe2SE=";
11 };
12
13 postPatch = ''
14 patchShebangs gnulib-tool.py
15 substituteInPlace build-aux/{prefix-gnulib-mk,useless-if-before-free,update-copyright,gitlog-to-changelog,announce-gen} \
16 --replace-fail 'exec perl' 'exec ${lib.getExe perl}'
17 '';
18
19 buildInputs = [ python3 ];
20
21 installPhase = ''
22 mkdir -p $out/bin
23 cp -r * $out/
24 ln -s $out/lib $out/include
25 ln -s $out/gnulib-tool $out/bin/
26 '';
27
28 # do not change headers to not update all vendored build files
29 dontFixup = true;
30
31 passthru = {
32 # This patch is used by multiple other packages (currently:
33 # gnused, gettext) which contain vendored copies of gnulib.
34 # Without it, compilation will fail with error messages about
35 # "__LDBL_REDIR1_DECL" or similar on platforms with longdouble
36 # redirects (currently powerpc64). Once all of those other
37 # packages make a release with a newer gnulib we can drop this
38 # patch.
39 longdouble-redirect-patch = ./gnulib-longdouble-redirect.patch;
40 };
41
42 meta = with lib; {
43 description = "Central location for code to be shared among GNU packages";
44 homepage = "https://www.gnu.org/software/gnulib/";
45 changelog = "https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=ChangeLog";
46 license = licenses.gpl3Plus;
47 mainProgram = "gnulib-tool";
48 platforms = platforms.unix;
49 };
50}