2020-06-07 08:38:37 +01:00
|
|
|
{ stdenv, buildPackages, fetchurl, autoreconfHook, which, pkgconfig, perl, guile, libxml2 }:
|
2015-08-13 01:01:29 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "autogen";
|
2020-06-07 08:38:37 +01:00
|
|
|
version = "5.18.16";
|
2015-08-13 01:01:29 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-03-19 19:41:19 +00:00
|
|
|
url = "mirror://gnu/autogen/rel${version}/autogen-${version}.tar.xz";
|
2020-06-07 08:38:37 +01:00
|
|
|
sha256 = "16mlbdys8q4ckxlvxyhwkdnh1ay9f6g0cyp1kylkpalgnik398gq";
|
2015-08-13 01:01:29 +01:00
|
|
|
};
|
|
|
|
|
2020-06-07 08:38:37 +01:00
|
|
|
patches = let
|
|
|
|
dp = { ver ? "1%255.18.16-4", pname, name ? (pname + ".diff"), sha256 }: fetchurl {
|
|
|
|
url = "https://salsa.debian.org/debian/autogen/-/raw/debian/${ver}"
|
|
|
|
+ "/debian/patches/${pname}.diff?inline=false";
|
|
|
|
inherit name sha256;
|
|
|
|
};
|
|
|
|
in [
|
|
|
|
(dp {
|
|
|
|
pname = "20_no_Werror";
|
|
|
|
sha256 = "08z4s2ifiqyaacjpd9pzr59w8m4j3548kkaq1bwvp2gjn29m680x";
|
|
|
|
})
|
|
|
|
(dp {
|
|
|
|
pname = "30_ag_macros.m4_syntax_error";
|
|
|
|
sha256 = "1z8vmbwbkz3505wd33i2xx91mlf8rwsa7klndq37nw821skxwyh3";
|
|
|
|
})
|
|
|
|
(dp {
|
|
|
|
pname = "31_allow_overriding_AGexe_for_crossbuild";
|
|
|
|
sha256 = "0h9wkc9bqb509knh8mymi43hg6n6sxg2lixvjlchcx7z0j7p8xkf";
|
|
|
|
})
|
2020-06-07 16:36:28 +01:00
|
|
|
];
|
|
|
|
|
2020-06-07 08:38:37 +01:00
|
|
|
outputs = [ "bin" "dev" "lib" "out" "man" "info" ];
|
|
|
|
|
2020-06-06 22:53:52 +01:00
|
|
|
nativeBuildInputs = [
|
2020-06-14 08:11:14 +01:00
|
|
|
which pkgconfig perl autoreconfHook/*patches applied*/
|
2020-06-06 22:53:52 +01:00
|
|
|
] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
2017-10-25 20:44:19 +01:00
|
|
|
# autogen needs a build autogen when cross-compiling
|
2020-06-06 22:53:52 +01:00
|
|
|
buildPackages.buildPackages.autogen buildPackages.texinfo
|
|
|
|
];
|
2017-10-25 20:44:19 +01:00
|
|
|
buildInputs = [
|
|
|
|
guile libxml2
|
|
|
|
];
|
|
|
|
|
|
|
|
configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
|
|
|
"--with-libxml2=${libxml2.dev}"
|
|
|
|
"--with-libxml2-cflags=-I${libxml2.dev}/include/libxml2"
|
|
|
|
# the configure check for regcomp wants to run a host program
|
|
|
|
"libopts_cv_with_libregex=yes"
|
|
|
|
#"MAKEINFO=${buildPackages.texinfo}/bin/makeinfo"
|
|
|
|
];
|
2015-08-13 01:01:29 +01:00
|
|
|
|
2020-06-07 08:38:37 +01:00
|
|
|
#doCheck = true; # not reliable
|
2015-08-13 01:01:29 +01:00
|
|
|
|
2015-08-23 23:29:08 +01:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $dev/bin
|
|
|
|
mv $bin/bin/autoopts-config $dev/bin
|
|
|
|
|
|
|
|
for f in $lib/lib/autogen/tpl-config.tlib $out/share/autogen/tpl-config.tlib; do
|
|
|
|
sed -e "s|$dev/include|/no-such-autogen-include-path|" -i $f
|
|
|
|
sed -e "s|$bin/bin|/no-such-autogen-bin-path|" -i $f
|
|
|
|
sed -e "s|$lib/lib|/no-such-autogen-lib-path|" -i $f
|
|
|
|
done
|
|
|
|
|
2020-06-14 08:11:14 +01:00
|
|
|
'' + stdenv.lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
|
2020-06-07 08:38:37 +01:00
|
|
|
# remove /build/** from RPATHs
|
|
|
|
for f in "$bin"/bin/*; do
|
|
|
|
local nrp="$(patchelf --print-rpath "$f" | sed -E 's@(:|^)/build/[^:]*:@\1@g')"
|
|
|
|
patchelf --set-rpath "$nrp" "$f"
|
|
|
|
done
|
|
|
|
'';
|
2015-08-13 01:01:29 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Automated text and program generation tool";
|
|
|
|
license = with licenses; [ gpl3Plus lgpl3Plus ];
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.gnu.org/software/autogen/";
|
2015-08-13 01:01:29 +01:00
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = [ ];
|
|
|
|
};
|
|
|
|
}
|