nixpkgs/pkgs/by-name/in/incus-unwrapped/package.nix

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

102 lines
2 KiB
Nix
Raw Normal View History

2023-08-29 16:51:14 +02:00
{ lib
, buildGoModule
, fetchFromGitHub
, acl
, cowsql
, hwdata
, libcap
, lxc
, pkg-config
, sqlite
, udev
, installShellFiles
2023-10-28 05:20:40 +02:00
, nix-update-script
2023-10-20 06:10:59 +02:00
, nixosTests
2023-08-29 16:51:14 +02:00
}:
buildGoModule rec {
pname = "incus-unwrapped";
version = "0.4.0";
2023-08-29 16:51:14 +02:00
src = fetchFromGitHub {
owner = "lxc";
repo = "incus";
2023-11-27 14:26:13 +01:00
rev = "refs/tags/v${version}";
hash = "sha256-crWepf5j3Gd1lhya2DGIh/to7l+AnjKJPR+qUd9WOzw=";
2023-08-29 16:51:14 +02:00
};
vendorHash = "sha256-YfUvkN1qUS3FFKb1wysg40WcJA8fT9SGDChSdT+xnkc=";
2023-08-29 16:51:14 +02:00
postPatch = ''
substituteInPlace internal/usbid/load.go \
--replace "/usr/share/misc/usb.ids" "${hwdata}/share/hwdata/usb.ids"
'';
excludedPackages = [
"cmd/incus-agent"
"cmd/incus-migrate"
"cmd/lxd-to-incus"
2023-11-27 14:26:13 +01:00
"test/mini-oidc"
2023-08-29 16:51:14 +02:00
];
nativeBuildInputs = [
installShellFiles
pkg-config
];
buildInputs = [
lxc
acl
libcap
cowsql.dev
sqlite
udev.dev
];
ldflags = [ "-s" "-w" ];
tags = [ "libsqlite3" ];
2023-10-28 05:20:40 +02:00
# required for go-cowsql.
CGO_LDFLAGS_ALLOW = "(-Wl,-wrap,pthread_create)|(-Wl,-z,now)";
2023-08-29 16:51:14 +02:00
postBuild = ''
make incus-agent incus-migrate
'';
preCheck =
let skippedTests = [
"TestValidateConfig"
"TestConvertNetworkConfig"
"TestConvertStorageConfig"
"TestSnapshotCommon"
"TestContainerTestSuite"
]; in
''
# Disable tests requiring local operations
buildFlagsArray+=("-run" "[^(${builtins.concatStringsSep "|" skippedTests})]")
'';
postInstall = ''
installShellCompletion --bash --name incus ./scripts/bash/incus
'';
passthru = {
2023-10-20 06:10:59 +02:00
tests.incus = nixosTests.incus;
2023-10-28 05:20:40 +02:00
updateScript = nix-update-script {
extraArgs = [
2023-11-27 14:26:13 +01:00
"-vr" "v\(.*\)"
2023-10-28 05:20:40 +02:00
];
};
2023-08-29 16:51:14 +02:00
};
meta = {
description = "Powerful system container and virtual machine manager";
homepage = "https://linuxcontainers.org/incus";
changelog = "https://github.com/lxc/incus/releases/tag/incus-${version}";
license = lib.licenses.asl20;
maintainers = lib.teams.lxc.members;
2023-08-29 16:51:14 +02:00
platforms = lib.platforms.linux;
};
}