Merge pull request #263895 from adamcstephens/incus/0.2

incus: 0.1 -> 0.2
This commit is contained in:
Mario Rodas 2023-10-28 08:44:25 -05:00 committed by GitHub
commit 22f013360d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 51 additions and 22 deletions

@ -10,21 +10,21 @@
, sqlite , sqlite
, udev , udev
, installShellFiles , installShellFiles
, gitUpdater , nix-update-script
}: }:
buildGoModule rec { buildGoModule rec {
pname = "incus-unwrapped"; pname = "incus-unwrapped";
version = "0.1"; version = "0.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "lxc"; owner = "lxc";
repo = "incus"; repo = "incus";
rev = "refs/tags/incus-${version}"; rev = "refs/tags/incus-${version}";
hash = "sha256-DCNMhfSzIpu5Pdg2TiFQ7GgLEScqt/Xqm2X+VSdeaME="; hash = "sha256-WhprzGzTeB8sEMMTYN5j1Zrwg0GiGLlXTqCkcPq0XVo=";
}; };
vendorHash = "sha256-Pk0/SfGCqXdXvNHbokSV8ajFHeOv0+Et0JytRCoBLU4="; vendorHash = "sha256-4fxQHtvRULTyKJTGdo42qwWQUSIWqbqOO1Wf8daBP/s=";
postPatch = '' postPatch = ''
substituteInPlace internal/usbid/load.go \ substituteInPlace internal/usbid/load.go \
@ -54,10 +54,8 @@ buildGoModule rec {
ldflags = [ "-s" "-w" ]; ldflags = [ "-s" "-w" ];
tags = [ "libsqlite3" ]; tags = [ "libsqlite3" ];
preBuild = '' # required for go-cowsql.
# required for go-cowsql. CGO_LDFLAGS_ALLOW = "(-Wl,-wrap,pthread_create)|(-Wl,-z,now)";
export CGO_LDFLAGS_ALLOW="(-Wl,-wrap,pthread_create)|(-Wl,-z,now)"
'';
postBuild = '' postBuild = ''
make incus-agent incus-migrate make incus-agent incus-migrate
@ -81,9 +79,11 @@ buildGoModule rec {
''; '';
passthru = { passthru = {
updateScript = gitUpdater { updateScript = nix-update-script {
rev-prefix = "incus-"; extraArgs = [
}; "-vr" "incus-\(.*\)"
];
};
}; };
meta = { meta = {

@ -0,0 +1,25 @@
From d7f7ae55a54437616174f80fb8faa80ae4ffcda4 Mon Sep 17 00:00:00 2001
From: Adam Stephens <adam@valkor.net>
Date: Fri, 27 Oct 2023 13:26:11 -0400
Subject: [PATCH] lxd-to-incus: query systemd instead of assuming service file
path
Signed-off-by: Adam Stephens <adam@valkor.net>
---
cmd/lxd-to-incus/targets.go | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cmd/lxd-to-incus/targets.go b/cmd/lxd-to-incus/targets.go
index f2b405e0e4..ed84d3ebce 100644
--- a/cmd/lxd-to-incus/targets.go
+++ b/cmd/lxd-to-incus/targets.go
@@ -25,7 +25,8 @@ func (s *targetSystemd) Present() bool {
return false
}
- if !util.PathExists("/lib/systemd/system/incus.service") {
+ _, err := subprocess.RunCommand("systemctl", "list-unit-files", "incus.service")
+ if err != nil {
return false
}

@ -1,32 +1,36 @@
{ lib { lib
, buildGoModule , buildGoModule
, fetchFromGitHub , fetchFromGitHub
, gitUpdater , nix-update-script
}: }:
buildGoModule rec { buildGoModule rec {
pname = "lxd-to-incus"; pname = "lxd-to-incus";
version = "0.1"; version = "0.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "lxc"; owner = "lxc";
repo = "incus"; repo = "incus";
# use commit which fixes 0.1 versioning, use tags for > 0.1 rev = "refs/tags/incus-${version}";
rev = "253a06bd8506bf42628d32ccbca6409d051465ec"; hash = "sha256-WhprzGzTeB8sEMMTYN5j1Zrwg0GiGLlXTqCkcPq0XVo=";
hash = "sha256-LXCTrZEDnFTJpqVH+gnG9HaV1wcvTFsVv2tAWabWYmg=";
}; };
patches = [
./d7f7ae55a54437616174f80fb8faa80ae4ffcda4.patch
];
modRoot = "cmd/lxd-to-incus"; modRoot = "cmd/lxd-to-incus";
vendorHash = "sha256-Kk5sx8UYuip/qik5ez/pxi+DmzjkPIHNYUHVvBm9f9g="; vendorHash = "sha256-J95b4fm+VwndoxS8RQF8V8ufI3RjclqzAskEd3ut4bU=";
# required for go-cowsql. CGO_ENABLED = 0;
CGO_LDFLAGS_ALLOW="(-Wl,-wrap,pthread_create)|(-Wl,-z,now)";
passthru = { passthru = {
updateScript = gitUpdater { updateScript = nix-update-script {
rev-prefix = "incus-"; extraArgs = [
}; "-vr" "incus-\(.*\)"
];
};
}; };
meta = { meta = {