Procházet zdrojové kódy

add pkgconf package (#431)

* add initial package for pkgconf

* set the package kind, add test function

* initial work on adding windows support

* oops, add the cmake dep wrong

* bump pkgconf version

* switch cmake to meson

* disable tests
Ashley před 4 roky
rodič
revize
e84d49ffc6
1 změnil soubory, kde provedl 30 přidání a 0 odebrání
  1. 30 0
      packages/p/pkgconf/xmake.lua

+ 30 - 0
packages/p/pkgconf/xmake.lua

@@ -0,0 +1,30 @@
+package("pkgconf")
+    set_kind("binary")
+    set_homepage("http://pkgconf.org")
+    set_description("A program which helps to configure compiler and linker flags for development frameworks.")
+    add_urls("https://distfiles.dereferenced.org/pkgconf/pkgconf-$(version).tar.xz")
+    add_versions("1.7.4", "d73f32c248a4591139a6b17777c80d4deab6b414ec2b3d21d0a24be348c476ab")
+
+    on_load("windows", function(package)
+        package:add("deps", "meson")
+        package:add("deps", "ninja")
+    end)
+
+    on_install("linux", "bsd", function(package)
+        local configs = {}
+        table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) 
+        table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) 
+        if package:config("pic") ~= false then
+            table.insert(configs, "--with-pic")
+        end
+
+        import("package.tools.autoconf").install(package, configs)
+    end)
+
+    on_install("windows", function(package)
+        import("package.tools.meson").install(package, {"-Dtests=false"})
+    end)
+
+    on_test(function (package)
+        os.vrun("pkgconf --version")
+    end)