networkmanager-vpnc: fix cross compilation (#376860)

This commit is contained in:
misuzu
2025-01-28 16:54:01 +02:00
committed by GitHub
2 changed files with 23 additions and 5 deletions
@@ -35,12 +35,12 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [
pkg-config
file
glib
];
buildInputs = [
vpnc
networkmanager
glib
] ++ lib.optionals withGnome [
gtk3
gtk4
@@ -55,6 +55,8 @@ stdenv.mkDerivation rec {
"--enable-absolute-paths"
];
strictDeps = true;
passthru = {
updateScript = gnome.updateScript {
packageName = pname;
+20 -4
View File
@@ -1,6 +1,8 @@
{
lib,
stdenv,
bash,
buildPackages,
fetchFromGitHub,
makeWrapper,
pkg-config,
@@ -24,7 +26,11 @@ stdenv.mkDerivation {
fetchSubmodules = true;
};
nativeBuildInputs = [ makeWrapper ] ++ lib.optional (!opensslSupport) pkg-config;
nativeBuildInputs = [
makeWrapper
perl
] ++ lib.optional (!opensslSupport) pkg-config;
buildInputs = [
libgcrypt
perl
@@ -40,15 +46,25 @@ stdenv.mkDerivation {
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
};
postPatch = ''
patchShebangs src/makeman.pl
'';
postPatch =
''
substituteInPlace src/vpnc-disconnect \
--replace-fail /bin/sh ${lib.getExe' bash "sh"}
patchShebangs src/makeman.pl
''
+ lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
# manpage generation invokes the build vpnc, which must be emulating when cross compiling
substituteInPlace src/makeman.pl --replace-fail \
'$vpnc --long-help' \
'${stdenv.hostPlatform.emulator buildPackages} $vpnc --long-help'
'';
enableParallelBuilding = true;
# Missing install depends:
# install: target '...-vpnc-unstable-2021-11-04/share/doc/vpnc': No such file or directory
# make: *** [Makefile:149: install-doc] Error 1
enableParallelInstalling = false;
strictDeps = true;
meta = with lib; {
homepage = "https://davidepucci.it/doc/vpnc/";