From 0de95f9e9f76dec68e311f21b0d69e1374ae2088 Mon Sep 17 00:00:00 2001 From: Alexander Sosedkin Date: Sun, 3 Jul 2022 18:39:27 +0200 Subject: [PATCH] pkgs/cross-compiling/talloc-static: update, build differently --- modules/environment/login/default.nix | 2 +- pkgs/cross-compiling/talloc-static.nix | 48 +++++++++++++++++--------- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/modules/environment/login/default.nix b/modules/environment/login/default.nix index d668161..aefab1a 100644 --- a/modules/environment/login/default.nix +++ b/modules/environment/login/default.nix @@ -82,7 +82,7 @@ in environment.files = { inherit login loginInner; - prootStatic = "/nix/store/r8jasn8fdiwvp26b1bxia0r6nhp4cqfx-proot-termux-aarch64-unknown-linux-android-unstable-2022-05-03"; + prootStatic = "/nix/store/scj2cqyvcra7dcan4y73n0459ac7fms7-proot-termux-aarch64-unknown-linux-android-unstable-2022-05-03"; }; }; diff --git a/pkgs/cross-compiling/talloc-static.nix b/pkgs/cross-compiling/talloc-static.nix index 733d5f5..c85de7d 100644 --- a/pkgs/cross-compiling/talloc-static.nix +++ b/pkgs/cross-compiling/talloc-static.nix @@ -1,33 +1,38 @@ -# Copyright (c) 2019-2021, see AUTHORS. Licensed under MIT License, see LICENSE. +# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE. -{ callPackage, python3, wafHook }: +{ callPackage +, fetchurl +, python3 +, pkg-config +, wafHook +}: let pkgsCross = callPackage ./cross-pkgs.nix { }; in -pkgsCross.talloc.overrideAttrs (_: rec { - pname = "talloc-static"; - version = "2.3.2"; - name = "${pname}-${version}"; +pkgsCross.stdenv.mkDerivation rec { + pname = "talloc"; + version = "2.3.4"; - nativeBuildInputs = [ python3 wafHook ]; + src = fetchurl { + url = "mirror://samba/talloc/${pname}-${version}.tar.gz"; + sha256 = "sha256-F5+eviZeZ+SrLCbK0rfeS2p3xsIS+WaQM4KGnwa+ZQU="; + }; + + nativeBuildInputs = [ pkg-config python3 wafHook ]; buildInputs = []; wafPath = "./buildtools/bin/waf"; wafConfigureFlags = [ - "--disable-rpath" - "--disable-python" - "--cross-compile" - "--cross-answers=cross-answers.txt" + "--disable-rpath" + "--disable-python" + "--cross-compile" + "--cross-answers=cross-answers.txt" ]; - postInstall = '' - ${pkgsCross.stdenv.cc.targetPrefix}ar q $out/lib/libtalloc.a bin/default/talloc.c.[0-9]*.o - rm -f $out/lib/libtalloc.so* - ''; - preConfigure = '' + export PYTHONHASHSEED=1 cat < cross-answers.txt Checking uname sysname type: "Linux" Checking uname machine type: "dontcare" @@ -56,4 +61,13 @@ pkgsCross.talloc.overrideAttrs (_: rec { Checking getconf large file support flags work: OK EOF ''; -}) + + # can't link unneeded .so, we'll link a static one by hand + buildPhase = "python ./buildtools/bin/waf build || true"; + installPhase = '' + mkdir -p $out/lib $out/include + ${pkgsCross.stdenv.cc.targetPrefix}ar q $out/lib/libtalloc.a \ + bin/default/talloc.c.[0-9]*.o + cp talloc.h $out/include/ + ''; +}