Sfoglia il codice sorgente

eudev: add v3.2.14 (#6936)

* eudev: add v3.2.14

* remove v3.2.14

* remove doc

* fix m4 for gcc15

* m4: fix gcc15

* m4: use gnu11

* pkg-config: fix gcc15
star9029 3 mesi fa
parent
commit
f45afb1a76
3 ha cambiato i file con 53 aggiunte e 21 eliminazioni
  1. 29 16
      packages/e/eudev/xmake.lua
  2. 8 2
      packages/m/m4/xmake.lua
  3. 16 3
      packages/p/pkg-config/xmake.lua

+ 29 - 16
packages/e/eudev/xmake.lua

@@ -1,29 +1,42 @@
 package("eudev")
-
-    set_homepage("https://dev.gentoo.org/~blueness/eudev/")
+    set_homepage("https://github.com/eudev-project/eudev")
     set_description("A fork of systemd with the aim of isolating udev from any particular flavor of system initialization.")
+    set_license("GPL-2.0")
+
+    add_urls("https://github.com/eudev-project/eudev/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/eudev-project/eudev.git")
 
-    add_urls("https://dev.gentoo.org/~blueness/eudev/eudev-$(version).tar.gz")
-    add_versions("3.2.9", "89618619084a19e1451d373c43f141b469c9fd09767973d73dd268b92074d4fc")
+    add_versions("v3.2.14", "c340e6c51dfc5531ac0c0fa84a34b72162acf525f9023eb9cf4931b782c8f177")
+    add_versions("v3.2.9", "7d281276b480da3935d1acb239748c2c9db01a8043aad7e918ce57a223d8cd24")
 
-    if is_plat("linux") then
-        add_deps("autoconf", "automake", "libtool", "pkg-config", "gperf")
-    end
+    add_configs("kmod", {description = "Enable loadable modules support", default = false, type = "boolean"})
+    add_configs("selinux", {description = "Enable optional SELINUX support", default = false, type = "boolean", readonly = true})
+    add_configs("tools", {description = "Build tools", default = false, type = "boolean"})
 
-    on_install("linux", function (package)
-        local configs = {}
-        if package:config("shared") then
-            table.insert(configs, "--enable-shared=yes")
-        else
-            table.insert(configs, "--enable-shared=no")
+    add_deps("autotools", "pkg-config", "gperf")
+
+    on_load(function (package)
+        if package:config("kmod") then
+            package:add("deps", "libkmod")
         end
-        if package:config("pic") ~= false then
-            table.insert(configs, "--with-pic")
+    end)
+
+    on_install("linux", "cross", function (package)
+        io.replace("autogen.sh", "./make.sh", "", {plain = true}) --remove doc build
+        if package:config("kmod") then
+            io.replace("configure.ac", "libkmod >= 15", "libkmod >= v15", {plain = true})
+            io.replace("src/udev/udev-builtin-kmod.c", "#include <libkmod.h>", "#include <libkmod/libkmod.h>", {plain = true})
         end
+
+        local configs = {"--disable-manpages"}
+        table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
+        table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
+        table.insert(configs, "--enable-kmod=" .. (package:config("kmod") and "yes" or "no"))
+        table.insert(configs, "--enable-selinux=" .. (package:config("selinux") and "yes" or "no"))
+        table.insert(configs, "--enable-programs=" .. (package:config("tools") and "yes" or "no"))
         import("package.tools.autoconf").install(package, configs)
     end)
 
-
     on_test(function (package)
         assert(package:has_cfuncs("udev_new", {includes = "libudev.h"}))
     end)

+ 8 - 2
packages/m/m4/xmake.lua

@@ -1,5 +1,4 @@
 package("m4")
-
     set_kind("binary")
     set_homepage("https://www.gnu.org/software/m4")
     set_description("Macro processing language")
@@ -7,6 +6,7 @@ package("m4")
     add_urls("https://ftpmirror.gnu.org/m4/m4-$(version).tar.xz",
              "https://ftp.gnu.org/gnu/m4/m4-$(version).tar.xz",
              "https://mirrors.ustc.edu.cn/gnu/m4/m4-$(version).tar.xz")
+
     add_versions("1.4.18", "f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07")
     add_versions("1.4.19", "63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96")
 
@@ -38,7 +38,13 @@ package("m4")
 #endif]])
             file:close()
         end
-        import("package.tools.autoconf").install(package, {"--disable-dependency-tracking"})
+
+        local configs = {"--disable-dependency-tracking"}
+
+        local opt = {}
+        -- https://mail.gnu.org/archive/html/bug-m4/2024-11/msg00000.html
+        opt.cflags = "-std=gnu99"
+        import("package.tools.autoconf").install(package, configs, opt)
     end)
 
     on_test(function (package)

+ 16 - 3
packages/p/pkg-config/xmake.lua

@@ -25,9 +25,22 @@ package("pkg-config")
         if is_host("macosx") then
             table.insert(pcpath, "/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/" .. macos.version():major() .. '.' .. macos.version():minor())
         end
-        -- see https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/81
-        local opt = {cflags = "-Wno-int-conversion"}
-        import("package.tools.autoconf").install(package, {"--disable-werror", "--disable-compile-warnings", "--disable-debug", "--disable-host-tool", "--with-internal-glib", ["with-pc-path"] = table.concat(pcpath, ':')}, opt)
+
+        local configs = {
+            "--disable-werror",
+            "--disable-compile-warnings",
+            "--disable-debug",
+            "--disable-host-tool",
+            "--with-internal-glib", 
+            ["with-pc-path"] = table.concat(pcpath, ':'),
+        }
+        local opt = {
+            cflags = {
+                "-Wno-int-conversion", -- https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/81
+                "-std=gnu99", -- gcc15 default c23
+            }
+        }
+        import("package.tools.autoconf").install(package, configs, opt)
     end)
 
     on_test(function (package)