nixpkgs/pkgs/by-name/lx/lxd-unwrapped-lts/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

115 lines
2.3 KiB
Nix
Raw Normal View History

{
lib,
hwdata,
pkg-config,
lxc,
2024-07-10 01:01:02 +00:00
buildGoModule,
fetchFromGitHub,
acl,
libcap,
dqlite,
raft-canonical,
sqlite,
udev,
installShellFiles,
nixosTests,
nix-update-script,
2018-03-16 09:58:54 +00:00
}:
2016-06-03 13:55:03 +00:00
2024-07-10 01:01:02 +00:00
buildGoModule rec {
2024-04-02 03:59:10 +00:00
pname = "lxd-unwrapped-lts";
# major/minor are used in updateScript to pin to LTS
2024-07-02 12:10:11 +00:00
version = "5.21.1";
2016-06-03 13:55:03 +00:00
src = fetchFromGitHub {
owner = "canonical";
repo = "lxd";
rev = "refs/tags/lxd-${version}";
2024-07-02 12:10:11 +00:00
hash = "sha256-6php6dThpyADOY+2PZ38WxK2jPKd61D0OCwTKjAhAUg=";
2016-06-03 13:55:03 +00:00
};
2024-07-02 12:10:11 +00:00
vendorHash = "sha256-iGW2FQjuqANadFuMHa+2VXiUgoU0VFBJYUyh0pMIdWY=";
2022-09-30 02:14:19 +00:00
postPatch = ''
substituteInPlace shared/usbid/load.go \
--replace "/usr/share/misc/usb.ids" "${hwdata}/share/hwdata/usb.ids"
'';
excludedPackages = [
"test"
"lxd/db/generate"
"lxd-agent"
"lxd-migrate"
];
nativeBuildInputs = [
installShellFiles
pkg-config
];
2022-09-30 02:14:19 +00:00
buildInputs = [
lxc
acl
libcap
dqlite.dev
raft-canonical.dev
sqlite
2022-09-30 02:14:19 +00:00
udev.dev
];
ldflags = [
"-s"
"-w"
];
2022-09-30 02:14:19 +00:00
tags = [ "libsqlite3" ];
2018-03-16 09:58:54 +00:00
preBuild = ''
2023-07-19 13:16:20 +00:00
# required for go-dqlite. See: https://github.com/canonical/lxd/pull/8939
2021-07-14 04:20:00 +00:00
export CGO_LDFLAGS_ALLOW="(-Wl,-wrap,pthread_create)|(-Wl,-z,now)"
'';
2018-10-13 09:44:54 +00:00
# build static binaries: https://github.com/canonical/lxd/blob/6fd175c45e65cd475d198db69d6528e489733e19/Makefile#L43-L51
postBuild = ''
make lxd-agent lxd-migrate
'';
checkFlags =
let
skippedTests = [
"TestValidateConfig"
"TestConvertNetworkConfig"
"TestConvertStorageConfig"
"TestSnapshotCommon"
"TestContainerTestSuite"
];
in
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
2022-09-30 02:14:19 +00:00
2018-03-16 09:58:54 +00:00
postInstall = ''
2022-09-30 02:14:19 +00:00
installShellCompletion --bash --name lxd ./scripts/bash/lxd-client
2018-03-16 09:58:54 +00:00
'';
passthru = {
tests.lxd = nixosTests.lxd;
tests.lxd-to-incus = nixosTests.incus.lxd-to-incus;
updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"lxd-(5.21.*)"
];
};
2023-05-27 18:57:27 +00:00
};
2020-12-06 08:59:59 +00:00
meta = with lib; {
2016-06-03 13:55:03 +00:00
description = "Daemon based on liblxc offering a REST API to manage containers";
2023-07-19 13:16:20 +00:00
homepage = "https://ubuntu.com/lxd";
changelog = "https://github.com/canonical/lxd/releases/tag/lxd-${version}";
license = with licenses; [
asl20
agpl3Plus
];
maintainers = teams.lxc.members;
2016-06-03 13:55:03 +00:00
platforms = platforms.linux;
};
}