Files
nixpkgs/pkgs/by-name/li/libvncserver/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

89 lines
2.0 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
libjpeg,
openssl,
zlib,
libgcrypt,
libpng,
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
systemd,
enableShared ? !stdenv.hostPlatform.isStatic,
buildExamples ? false,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libvncserver";
version = "0.9.15";
outputs = [
"out"
"dev"
];
src = fetchFromGitHub {
owner = "LibVNC";
repo = "libvncserver";
tag = "LibVNCServer-${finalAttrs.version}";
hash = "sha256-a3acEjJM+ZA9jaB6qZ/czjIfx/L3j71VjJ6mtlqYcSw=";
};
patches = [
# fix generated pkg-config files
./pkgconfig.patch
(fetchpatch {
name = "libvncserver-fix-cmake-4.patch";
url = "https://github.com/LibVNC/libvncserver/commit/e64fa928170f22a2e21b5bbd6d46c8f8e7dd7a96.patch";
hash = "sha256-AAZ3H34+nLqQggb/sNSx2gIGK96m4zatHX3wpyjNLOA=";
})
];
nativeBuildInputs = [
cmake
];
cmakeFlags = [
(lib.cmakeBool "WITH_SYSTEMD" withSystemd)
(lib.cmakeBool "BUILD_SHARED_LIBS" enableShared)
(lib.cmakeBool "WITH_EXAMPLES" buildExamples)
(lib.cmakeBool "WITH_TESTS" finalAttrs.doCheck)
];
# This test checks if using the **installed** headers works.
# As it doesn't set the include paths correctly, and we have nixpkgs-review to check if
# packages continue to build, patching it would serve no purpose, so we can just remove the test entirely.
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-fail 'add_test(NAME includetest COMMAND' '# add_test(NAME includetest COMMAND'
'';
buildInputs = [
libjpeg
openssl
libgcrypt
libpng
]
++ lib.optionals withSystemd [
systemd
];
propagatedBuildInputs = [
zlib
];
doCheck = enableShared;
meta = with lib; {
description = "VNC server library";
homepage = "https://libvnc.github.io/";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ raskin ];
platforms = platforms.unix;
};
})