From e148619e37ecb3648bebb8912a1d61b08c0d86c5 Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Wed, 18 Aug 2021 21:12:26 +0200 Subject: [PATCH] hamlib: support cross-compilation, cleanup unfortunately, this disables perl bindings, but at least it compiles now - remove ExtUtilsMakeMaker, doesn't make a difference in the output - enable strictDeps --- pkgs/development/libraries/hamlib/default.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/hamlib/default.nix b/pkgs/development/libraries/hamlib/default.nix index cd56b04c0346..31b620ae5d2e 100644 --- a/pkgs/development/libraries/hamlib/default.nix +++ b/pkgs/development/libraries/hamlib/default.nix @@ -15,7 +15,8 @@ , perlPackages , pythonBindings ? true , tclBindings ? true -, perlBindings ? true +, perlBindings ? stdenv.buildPlatform == stdenv.hostPlatform +, buildPackages }: stdenv.mkDerivation rec { @@ -27,11 +28,15 @@ stdenv.mkDerivation rec { sha256 = "10788mgrhbc57zpzakcxv5aqnr2819pcshml6fbh8zvnkja562y9"; }; + strictDeps = true; + depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ swig pkg-config libtool - ]; + ] ++ lib.optionals pythonBindings [ python3 ] + ++ lib.optionals tclBindings [ tcl ] + ++ lib.optionals perlBindings [ perl ]; buildInputs = [ gd @@ -39,10 +44,12 @@ stdenv.mkDerivation rec { libusb-compat-0_1 boost ] ++ lib.optionals pythonBindings [ python3 ncurses ] - ++ lib.optionals tclBindings [ tcl ] - ++ lib.optionals perlBindings [ perl perlPackages.ExtUtilsMakeMaker ]; + ++ lib.optionals tclBindings [ tcl ]; - configureFlags = lib.optionals perlBindings [ "--with-perl-binding" ] + + configureFlags = [ + "CC_FOR_BUILD=${stdenv.cc.targetPrefix}cc" + ] ++ lib.optionals perlBindings [ "--with-perl-binding" ] ++ lib.optionals tclBindings [ "--with-tcl-binding" "--with-tcl=${tcl}/lib/" ] ++ lib.optionals pythonBindings [ "--with-python-binding" ];