about summary refs log tree commit diff
path: root/pkgs/by-name/lx
diff options
context:
space:
mode:
authorAdam Stephens <adam@valkor.net>2023-10-27 23:21:18 -0400
committerAdam Stephens <adam@valkor.net>2023-10-27 23:21:18 -0400
commitf99641d65408184128a8497de59e7553f4181a24 (patch)
tree526466353f79f32d6b5619ceeccbfa8199431b43 /pkgs/by-name/lx
parentf1e2ae3677509defbb383d907f1015123e2a83e0 (diff)
lxd-to-incus: 0.1 -> 0.2
Diffstat (limited to 'pkgs/by-name/lx')
-rw-r--r--pkgs/by-name/lx/lxd-to-incus/d7f7ae55a54437616174f80fb8faa80ae4ffcda4.patch25
-rw-r--r--pkgs/by-name/lx/lxd-to-incus/package.nix26
2 files changed, 40 insertions, 11 deletions
diff --git a/pkgs/by-name/lx/lxd-to-incus/d7f7ae55a54437616174f80fb8faa80ae4ffcda4.patch b/pkgs/by-name/lx/lxd-to-incus/d7f7ae55a54437616174f80fb8faa80ae4ffcda4.patch
new file mode 100644
index 0000000000000..ea3d240da879b
--- /dev/null
+++ b/pkgs/by-name/lx/lxd-to-incus/d7f7ae55a54437616174f80fb8faa80ae4ffcda4.patch
@@ -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
+ 	}
+ 
diff --git a/pkgs/by-name/lx/lxd-to-incus/package.nix b/pkgs/by-name/lx/lxd-to-incus/package.nix
index 0b9c34fb046d1..8e58ede27c009 100644
--- a/pkgs/by-name/lx/lxd-to-incus/package.nix
+++ b/pkgs/by-name/lx/lxd-to-incus/package.nix
@@ -1,32 +1,36 @@
 { lib
 , buildGoModule
 , fetchFromGitHub
-, gitUpdater
+, nix-update-script
 }:
 
 buildGoModule rec {
   pname = "lxd-to-incus";
-  version = "0.1";
+  version = "0.2";
 
   src = fetchFromGitHub {
     owner = "lxc";
     repo = "incus";
-    # use commit which fixes 0.1 versioning, use tags for > 0.1
-    rev = "253a06bd8506bf42628d32ccbca6409d051465ec";
-    hash = "sha256-LXCTrZEDnFTJpqVH+gnG9HaV1wcvTFsVv2tAWabWYmg=";
+    rev = "refs/tags/incus-${version}";
+    hash = "sha256-WhprzGzTeB8sEMMTYN5j1Zrwg0GiGLlXTqCkcPq0XVo=";
   };
 
+  patches = [
+    ./d7f7ae55a54437616174f80fb8faa80ae4ffcda4.patch
+  ];
+
   modRoot = "cmd/lxd-to-incus";
 
-  vendorHash = "sha256-Kk5sx8UYuip/qik5ez/pxi+DmzjkPIHNYUHVvBm9f9g=";
+  vendorHash = "sha256-J95b4fm+VwndoxS8RQF8V8ufI3RjclqzAskEd3ut4bU=";
 
-  # required for go-cowsql.
-  CGO_LDFLAGS_ALLOW="(-Wl,-wrap,pthread_create)|(-Wl,-z,now)";
+  CGO_ENABLED = 0;
 
   passthru = {
-    updateScript = gitUpdater {
-      rev-prefix = "incus-";
-    };
+    updateScript = nix-update-script {
+       extraArgs = [
+        "-vr" "incus-\(.*\)"
+       ];
+     };
   };
 
   meta = {