From a6635fbc19f3d4d13256d11aa8fb14952b92826d Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Sat, 14 Sep 2019 11:46:39 +0000 Subject: [PATCH 1/4] pinentry: fix cross-compilation --- .../tools/security/pinentry/autoconf-ar.patch | 35 +++++++++++++++++++ pkgs/tools/security/pinentry/default.nix | 8 +++-- 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 pkgs/tools/security/pinentry/autoconf-ar.patch diff --git a/pkgs/tools/security/pinentry/autoconf-ar.patch b/pkgs/tools/security/pinentry/autoconf-ar.patch new file mode 100644 index 000000000000..6f531cfce325 --- /dev/null +++ b/pkgs/tools/security/pinentry/autoconf-ar.patch @@ -0,0 +1,35 @@ +diff -ur a/configure.ac b/configure.ac +--- a/configure.ac 2019-09-14 11:30:11.584847746 +0000 ++++ b/configure.ac 2019-09-14 11:31:26.692355265 +0000 +@@ -81,6 +81,7 @@ + AC_PROG_CPP + AC_PROG_INSTALL + AC_PROG_RANLIB ++AC_CHECK_TOOL(AR, ar) + # We need to check for cplusplus here because we may not do the test + # for Qt and autoconf does does not allow that. + AC_PROG_CXX +diff -ur a/pinentry/Makefile.in b/pinentry/Makefile.in +--- a/pinentry/Makefile.in 2017-12-03 17:43:23.000000000 +0000 ++++ b/pinentry/Makefile.in 2019-09-14 11:32:02.532000236 +0000 +@@ -113,7 +113,7 @@ + CONFIG_CLEAN_FILES = + CONFIG_CLEAN_VPATH_FILES = + LIBRARIES = $(noinst_LIBRARIES) +-AR = ar ++AR = @AR@ + ARFLAGS = cru + AM_V_AR = $(am__v_AR_@AM_V@) + am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +diff -ur a/secmem/Makefile.in b/secmem/Makefile.in +--- a/secmem/Makefile.in 2017-12-03 17:43:23.000000000 +0000 ++++ b/secmem/Makefile.in 2019-09-14 11:31:58.764934552 +0000 +@@ -113,7 +113,7 @@ + CONFIG_CLEAN_FILES = + CONFIG_CLEAN_VPATH_FILES = + LIBRARIES = $(noinst_LIBRARIES) +-AR = ar ++AR = @AR@ + ARFLAGS = cru + AM_V_AR = $(am__v_AR_@AM_V@) + am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) diff --git a/pkgs/tools/security/pinentry/default.nix b/pkgs/tools/security/pinentry/default.nix index ac6a50960ad2..ec1425bbeb4a 100644 --- a/pkgs/tools/security/pinentry/default.nix +++ b/pkgs/tools/security/pinentry/default.nix @@ -1,4 +1,4 @@ -{ fetchurl, fetchpatch, stdenv, lib, pkgconfig +{ fetchurl, fetchpatch, stdenv, lib, pkgconfig, autoreconfHook , libgpgerror, libassuan , libcap ? null, libsecret ? null, ncurses ? null, gtk2 ? null, gcr ? null , qt4 ? null, qt5 ? null @@ -23,7 +23,7 @@ mkDerivation rec { sha256 = "0w35ypl960pczg5kp6km3dyr000m1hf0vpwwlh72jjkjza36c1v8"; }; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ pkgconfig autoreconfHook ]; buildInputs = [ libgpgerror libassuan libcap libsecret gtk2 gcr ncurses qt4 ] ++ stdenv.lib.optional (qt5 != null) qt5.qtbase; @@ -32,7 +32,9 @@ mkDerivation rec { substituteInPlace pinentry/pinentry-curses.c --replace ncursesw ncurses ''; - patches = lib.optionals (gtk2 != null) [ + patches = [ + ./autoconf-ar.patch + ] ++ lib.optionals (gtk2 != null) [ (fetchpatch { url = "https://salsa.debian.org/debian/pinentry/raw/debian/1.1.0-1/debian/patches/" + "0007-gtk2-When-X11-input-grabbing-fails-try-again-over-0..patch"; From e39d627a122de18e9b133e8f4c0ed3e006cbde5d Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Sat, 14 Sep 2019 11:46:49 +0000 Subject: [PATCH 2/4] gnupg: fix cross-compilation --- pkgs/tools/security/gnupg/22.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/security/gnupg/22.nix b/pkgs/tools/security/gnupg/22.nix index 90bd55f55a23..e2f460e7e308 100644 --- a/pkgs/tools/security/gnupg/22.nix +++ b/pkgs/tools/security/gnupg/22.nix @@ -24,9 +24,9 @@ stdenv.mkDerivation rec { }; depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ pkgconfig texinfo ]; buildInputs = [ - libgcrypt libassuan libksba libiconv npth gettext texinfo + libgcrypt libassuan libksba libiconv npth gettext readline libusb gnutls adns openldap zlib bzip2 sqlite ]; From 101947774c8aea770c650b7d3b78d50c63215742 Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Sat, 14 Sep 2019 12:53:04 +0000 Subject: [PATCH 3/4] udisks2: disable docs when cross-compiling --- pkgs/os-specific/linux/udisks/2-default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/udisks/2-default.nix b/pkgs/os-specific/linux/udisks/2-default.nix index e99e9e37d823..1d967b38eb96 100644 --- a/pkgs/os-specific/linux/udisks/2-default.nix +++ b/pkgs/os-specific/linux/udisks/2-default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { sha256 = "01wx2x8xyal595dhdih7rva2bz7gqzgwdp56gi0ikjdzayx17wcf"; }; - outputs = [ "out" "man" "dev" "devdoc" ]; + outputs = [ "out" "man" "dev" ] ++ stdenv.lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "devdoc"; patches = [ (substituteAll { @@ -57,7 +57,7 @@ stdenv.mkDerivation rec { preConfigure = "NOCONFIGURE=1 ./autogen.sh"; configureFlags = [ - "--enable-gtk-doc" + (stdenv.lib.enableFeature (stdenv.buildPlatform == stdenv.hostPlatform) "gtk-doc") "--localstatedir=/var" "--with-systemdsystemunitdir=$(out)/etc/systemd/system" "--with-udevdir=$(out)/lib/udev" From 35f39ac48ce6ed046b7dcce3ee6e8e9162ac12aa Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Wed, 11 Sep 2019 13:07:31 +0000 Subject: [PATCH 4/4] dtc: make python bindings optional dtc's build system does not support cross-compilation of its swig-generated python bindings. --- pkgs/development/compilers/dtc/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/dtc/default.nix b/pkgs/development/compilers/dtc/default.nix index ea305cc5c84c..dc628c0d7625 100644 --- a/pkgs/development/compilers/dtc/default.nix +++ b/pkgs/development/compilers/dtc/default.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchgit, flex, bison, pkgconfig, python2, swig, which }: +{ stdenv, lib, fetchgit, flex, bison, pkgconfig, which +, pythonSupport ? stdenv.buildPlatform == stdenv.hostPlatform, python2, swig +}: stdenv.mkDerivation rec { pname = "dtc"; @@ -10,16 +12,17 @@ stdenv.mkDerivation rec { sha256 = "075gj8bbahfdb8dlif3d2dpzjrkyf3bwbcmx96zpwhlgs0da8jxh"; }; - nativeBuildInputs = [ flex bison pkgconfig swig which ]; - buildInputs = [ python2 ]; + nativeBuildInputs = [ flex bison pkgconfig which ] ++ lib.optionals pythonSupport [ python2 swig ]; + buildInputs = lib.optionals pythonSupport [ python2 ]; postPatch = '' patchShebangs pylibfdt/ ''; + makeFlags = lib.optionals (!pythonSupport) [ "NO_PYTHON=1" ]; installFlags = [ "INSTALL=install" "PREFIX=$(out)" "SETUP_PREFIX=$(out)" ]; - meta = with stdenv.lib; { + meta = with lib; { description = "Device Tree Compiler"; homepage = https://git.kernel.org/cgit/utils/dtc/dtc.git; license = licenses.gpl2; # dtc itself is GPLv2, libfdt is dual GPL/BSD