automake and stuff

This commit is contained in:
Some One 2025-08-14 16:45:04 +02:00
parent b2b92d6c5f
commit fe0035e40f
11 changed files with 148 additions and 26 deletions

20
automake/automake.nix Normal file
View File

@ -0,0 +1,20 @@
{stdenv, fetchurl, perl, autoconf269}: stdenv.mkDerivation rec {
pname = "automake";
version = "1.11.6";
src = fetchurl {
url = "mirror://gnu/automake/automake-${version}.tar.gz";
hash = "sha256-U9vxlFQBxD9M4ZwZcbrs2/i8MuDzf6P0n+e2mS0NIDA=";
};
patches = [ ./fix-perl-5.26.patch ];
builder = ./builder.sh;
setupHook = ./setup-hook.sh;
# Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
# "fixed" path in generated files!
dontPatchShebangs = true;
buildInputs = [ perl autoconf269 ];
}

48
automake/builder.sh Normal file
View File

@ -0,0 +1,48 @@
source $stdenv/setup
# Wrap the given `aclocal' program, appending extra `-I' flags
# corresponding to the directories listed in $ACLOCAL_PATH. (Note
# that `wrapProgram' can't be used for that purpose since it can only
# prepend flags, not append them.)
wrapAclocal() {
local program="$1"
local wrapped="$(dirname $program)/.$(basename $program)-wrapped"
mv "$program" "$wrapped"
cat > "$program"<<EOF
#! $SHELL -e
unset extraFlagsArray
declare -a extraFlagsArray
oldIFS=\$IFS
IFS=:
echo "Wrapping! \$ACLOCAL_PATH"
for dir in \$ACLOCAL_PATH; do
if test -n "\$dir" -a -d "\$dir"; then
extraFlagsArray=("\${extraFlagsArray[@]}" "-I" "\$dir")
fi
done
IFS=\$oldIFS
exec "$wrapped" "\$@" "\${extraFlagsArray[@]}"
EOF
chmod +x "$program"
}
postInstall() {
# Create a wrapper around `aclocal' that converts every element in
# `ACLOCAL_PATH' into a `-I dir' option. This way `aclocal'
# becomes modular; M4 macros do not need to be stored in a single
# global directory, while callers of `aclocal' do not need to pass
# `-I' options explicitly.
for prog in $out/bin/aclocal*; do
wrapAclocal "$prog"
done
ln -s aclocal-1.11 $out/share/aclocal
ln -s automake-1.11 $out/share/automake
}
genericBuild

View File

@ -0,0 +1,10 @@
--- automake-1.11.2/automake.in
+++ automake-1.11.2/automake.in
@@ -4156,7 +4156,7 @@ sub substitute_ac_subst_variables_worker($)
sub substitute_ac_subst_variables ($)
{
my ($text) = @_;
- $text =~ s/\${([^ \t=:+{}]+)}/&substitute_ac_subst_variables_worker ($1)/ge;
+ $text =~ s/\$\{([^ \t=:+{}]+)}/&substitute_ac_subst_variables_worker ($1)/ge;
return $text;
}

5
automake/setup-hook.sh Normal file
View File

@ -0,0 +1,5 @@
addAclocals () {
addToSearchPathWithCustomDelimiter : ACLOCAL_PATH $1/share/aclocal-1.11
}
addEnvHooks "$hostOffset" addAclocals

24
libxml2.nix Normal file
View File

@ -0,0 +1,24 @@
{stdenv, fetchFromGitLab, autoreconfHook, libtool}: stdenv.mkDerivation rec {
pname = "libxml2";
version = "2.7.6";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "GNOME";
repo = pname;
rev = "v" + version;
hash = "sha256-5+IWJMbqqcCPJKfDOHdRGv62XbUPOTjp9ZhsqbbHTeg=";
};
#buildInputs = [autoconf269 automake];
buildInputs = [autoreconfHook];
patchPhase = ''
export ACLOCAL_PATH=${libtool}/share/aclocal:$ACLOCAL_PATH
export CFLAGS="-Wno-incompatible-pointer-types"
'';
/*configurePhase = ''
autoreconf
./configure
'';*/
}

24
libxslt.nix Normal file
View File

@ -0,0 +1,24 @@
{stdenv, fetchFromGitLab, autoreconfHook, libtool, libxml2, breakpointHook}: stdenv.mkDerivation rec {
pname = "libxslt";
version = "1.1.26";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "GNOME";
repo = pname;
rev = "v" + version;
hash = "sha256-PaKgvQQotmCbpGiWhm9TtSAGGN8wJQNmRvEmtro/pqQ=";
};
#buildInputs = [autoconf269 automake];
buildInputs = [autoreconfHook libxml2 breakpointHook];
patchPhase = ''
export ACLOCAL_PATH=${libtool}/share/aclocal:$ACLOCAL_PATH
'';
#export CFLAGS="-Wno-incompatible-pointer-types"
/*configurePhase = ''
autoreconf
./configure
'';*/
}

View File

@ -1,16 +1,17 @@
{stdenv, fetchPypi, buildPythonPackage, setuptools, argparse }: buildPythonPackage rec { {stdenv, fetchPypi, buildPythonPackage, setuptools, libxml2 }: buildPythonPackage rec {
pname = "Jinja2"; pname = "lxml";
version = "2.5.2"; version = "2.2.6";
format = "setuptools"; format = "setuptools";
#pyproject = true; #pyproject = true;
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
extension = "tar.gz"; extension = "tar.gz";
hash = "sha256-GQQPAbOp2MY+TVeTb3hxCQgZm2k3CrRKD3QH3YkfAZs="; hash = "sha256-f9NuSlY2DNXXMZ41ewSpDixrg26iIMiPlFHDAK4zzF4=";
}; };
propagatedBuildInputs = [setuptools argparse]; propagatedBuildInputs = [setuptools];
buildInputs = [libxml2];
#dependencies = [importlib]; #dependencies = [importlib];
} }

View File

@ -1,24 +1,18 @@
nixpkgsPath: { pkgs, oldPkgs }: nixpkgsPath: { pkgs, oldPkgs }:
let let
bommels = pkgs.lib.makeScope pkgs.newScope (self: rec { bommels = pkgs.lib.makeScope pkgs.newScope (self: rec {
# python26 = pkgs.callPackage ./python26/default.nix { automake = pkgs.callPackage ./automake/automake.nix {};
# self = python26; autoreconfHook = pkgs.autoreconfHook269.override {
# xlibsWrapper = pkgs.xlibsWrapper; automake = automake;
# }; };
libxml2 = pkgs.callPackage ./libxml2.nix { inherit autoreconfHook; };
libxslt = pkgs.callPackage ./libxslt.nix { inherit autoreconfHook libxml2; };
#setuptools = self.callPackage ./setuptools.nix { inherit pythonPackages; }; pythonInterpreters = self.callPackage ./python-interpreters.nix { inherit nixpkgsPath; };
#wrapPython = pkgs.callPackage ./python26/wrap-python.nix { python = python26; };
#mkPythonDerivation = pkgs.callPackage ./python26/mk-python-derivation.nix { inherit setuptools wrapPython; python = python26; };
#bootstrapped-pip = pkgs.callPackage ./python26/bootstrapped-pip.nix { python = python26; };
#buildPythonPackage = pkgs.callPackage ./python26/build-python-package.nix { inherit bootstrapped-pip mkPythonDerivation; python = python26; };
#pip = pkgs.callPackage ./pip.nix { inherit python26 buildPythonPackage; };
pythonInterpreters = self.callPackage ./python-interpreters.nix { inherit nixpkgsPath;};
inherit (pythonInterpreters) python26; inherit (pythonInterpreters) python26;
python26Packages = python26.pkgs; python26Packages = python26.pkgs;
pythonPackages = python26Packages; pythonPackages = python26Packages;
#importlib = self.callPackage ./importlib.nix {};
some-package = pkgs.callPackage ./some-package.nix { inherit pythonPackages; }; some-package = pkgs.callPackage ./some-package.nix { inherit pythonPackages; };
}); });
in in

View File

@ -49,5 +49,6 @@ rec {
bommels = { bommels = {
jinja2 = callPackage ./jinja2.nix { }; jinja2 = callPackage ./jinja2.nix { };
lxml = callPackage ./lxml.nix { };
}; };
} }

2
result
View File

@ -1 +1 @@
/nix/store/sdpslgfqlmmbjaz93m7w9c5c01fs8wxn-python2.6-Jinja2-2.5.2 /nix/store/3mdywqnsfmphw8jg4x8jk4cp7zi2pg5n-libxslt-1.1.26

View File

@ -1,8 +1,3 @@
{stdenv, path }: stdenv.mkDerivation { {python26Packages }: python26Packages.buildPythonPackage {
pname = "abc"; pname = "something";
version = "0.1.0";
#src = ./some-package.nix;
builder = ''
'';
PATH_TEST=path;
} }