Hello, I’m trying to package Urbackup Server to Nix package manager and I’m having some trouble building it.
The error is the following:
$ ./configure --enable-embedded-cryptopp
[...]
$ make
[...]
make[2]: Entering directory '/build/urbackup_backend/cryptoplugin/src'
make all-am
make[3]: Entering directory '/build/urbackup_backend/cryptoplugin/src'
cp adhoc.cpp.proto adhoc.cpp
make[3]: *** No rule to make target 'cryptlib.cpp', needed by 'libcryptlib_la-cryptlib.lo'. Stop.
make[3]: *** Waiting for unfinished jobs....
cp: cannot stat 'adhoc.cpp.proto': No such file or directory
make[3]: *** [Makefile:2964: adhoc.cpp] Error 1
make[3]: Leaving directory '/build/urbackup_backend/cryptoplugin/src'
make[2]: *** [Makefile:954: all] Error 2
make[2]: Leaving directory '/build/urbackup_backend/cryptoplugin/src'
make[1]: *** [Makefile:6241: all-recursive] Error 1
make[1]: Leaving directory '/build/urbackup_backend'
make: *** [Makefile:1501: all] Error 2
I replicated the same error both in Nix inside Debian Trixie and in Debian Trixie itself.
When building without --enable-embedded-cryptopp in Debian Trixie it builds sucessfully.
Thanks, it now works in Debian Trixie, but in nix it gives a wget error:
> Resolving buildserver.urbackup.org (buildserver.urbackup.org)... failed: Temporary failure in name resolution.
> wget: unable to resolve host address 'buildserver.urbackup.org'
There is a cryptopp package in Nix, which seems to be version 8.9.0 but, for some unknown reason, urbackup builder can’t find it (with cryptopp in build inputs and configure without --enable-embedded-cryptopp):
[...]
> checking for curl_free... yes
> checking for crypto++ version >= 5.1... no
> Crypto++ not found. Please install (cryptopp-devel/libcrypto++-dev) or run configure with --enable-embedded-cryptopp
I found that the cryptopp package doesn’t come with headers, only with .so files. Maybe thats why it cant find the package.
And I believe embedded cryptopp is not an option as Nix, by design, doesnt allow internet access. As the package must be available through nixpkgs if understand it correctly.1
edit:
The headers are packaged together in the same package. They can be accessed by finding the crypto++.dev derivation in the nix store. And should be accessible by the package derivation.
I found how to make cryptopp acessible. Just ./configure --with-crypto-prefix=<cryptopp-dev_nix-store_path>
Anyway, here is the full nix expression that configure and builds sucessfully. I’m still having issues with installing it but that is more Nix specific.
with import <nixpkgs> {};
stdenv.mkDerivation rec {
pname = "urbackup-server";
version = "2.5.20";
src = fetchFromGitHub {
owner = "uroni";
repo = "urbackup_backend";
rev = "refs/tags/${version}";
hash = "sha256-brP7nYikbIvQP/K+qSKyd8eHWUIK9Ai/4qP09ptr+lE=";
};
buildInputs = [
cryptopp
curlWithGnuTls
autoconf
automake
libtool
pkg-config
# gnum4
# zlib
# zstd
];
configurePhase = ''
runHook preConfigure
bash switch_build.sh server
autoreconf --install
sh configure --prefix=$out \
--with-crypto-prefix=${ builtins.storePath cryptopp.dev }
runHook postConfigure
'';
# --localstatedir="/var/lib"
doCheck = true;
enableParallelBuilding = true;
meta = with lib; {
description = "Easy to setup Open Source client/server backup system";
longDescription = "An easy to setup Open Source client/server backup system, that through a combination of image and file backups accomplishes both data safety and a fast restoration time";
homepage = "https://www.urbackup.org/index.html";
license = licenses.agpl3Plus;
platforms = platforms.linux;
};
}