Browse Source

openjdk: enable linux (#2894)

* openjdk: enable linux

* add dpes alsa-lib

* fix deps

* fix deps

* make deps shared

* fix deps

* try system lib

* revert

* force system lib

* try pkgconfig

* alsa-lib: add config

* alsa-lib: fix test

* openjdk: make alsa-lib shared

* alsa-lib: delete autotool flag

* alsa-lib: add config

* jnipp: enable linux

* alsa-lib: improve config name

* openjdk: fix deps configs
star9029 1 year ago
parent
commit
e08905b6b4
3 changed files with 19 additions and 11 deletions
  1. 15 9
      packages/a/alsa-lib/xmake.lua
  2. 1 1
      packages/j/jnipp/xmake.lua
  3. 3 1
      packages/o/openjdk/xmake.lua

+ 15 - 9
packages/a/alsa-lib/xmake.lua

@@ -1,26 +1,32 @@
 package("alsa-lib")
 package("alsa-lib")
     set_homepage("https://alsa-project.org/wiki/Main_Page")
     set_homepage("https://alsa-project.org/wiki/Main_Page")
     set_description("The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI functionality to the Linux operating system.")
     set_description("The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI functionality to the Linux operating system.")
+    set_license("LGPL-2.1")
 
 
-    set_urls("http://www.alsa-project.org/files/pub/lib/alsa-lib-$(version).tar.bz2")
+    add_urls("http://www.alsa-project.org/files/pub/lib/alsa-lib-$(version).tar.bz2", {alias = "home"})
+    add_urls("https://github.com/alsa-project/alsa-lib/archive/refs/tags/v$(version).tar.gz", {alias = "github"})
+    add_versions("home:1.2.10", "c86a45a846331b1b0aa6e6be100be2a7aef92efd405cf6bac7eef8174baa920e")
+    add_versions("github:1.2.10", "f55749847fd98274501f4691a2d847e89280c07d40a43cdac43d6443f69fc939")
 
 
-    add_versions("1.2.10", "c86a45a846331b1b0aa6e6be100be2a7aef92efd405cf6bac7eef8174baa920e")
+    add_configs("versioned", {description = "pass flag --without-versioned", default = true, type = "boolean"})
+
+    if is_plat("linux") then
+        add_extsources("pacman::alsa-lib", "apt::libasound2-dev")
+    end
 
 
     on_install("linux", function (package)
     on_install("linux", function (package)
-        local configs = {"--without-versioned"}
+        local configs = {}
         table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
         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-static=" .. (package:config("shared") and "no" or "yes"))
         if package:is_debug() then
         if package:is_debug() then
             table.insert(configs, "--enable-debug")
             table.insert(configs, "--enable-debug")
         end
         end
+        if package:config("versioned")then
+            table.insert(configs, "--without-versioned")
+        end
         import("package.tools.autoconf").install(package, configs)
         import("package.tools.autoconf").install(package, configs)
     end)
     end)
 
 
     on_test(function (package)
     on_test(function (package)
-        assert(package:check_csnippets({test = [[
-            void test() {
-                snd_ctl_card_info_t *info;
-                snd_ctl_card_info_alloca(&info);
-            }
-        ]]}, {includes = {"alsa/asoundlib.h"}}))
+        assert(package:has_cfuncs("snd_pcm_open", {includes = "alsa/asoundlib.h"}))
     end)
     end)

+ 1 - 1
packages/j/jnipp/xmake.lua

@@ -14,7 +14,7 @@ package("jnipp")
 
 
     add_deps("openjdk")
     add_deps("openjdk")
 
 
-    on_install("windows|x64", "macosx|x86_64", "macosx|arm64", "mingw|x86_64", function (package)
+    on_install("windows|x64", "linux|x86_64", "macosx|x86_64", "macosx|arm64", "mingw|x86_64", function (package)
         io.writefile("xmake.lua", [[
         io.writefile("xmake.lua", [[
             add_rules("mode.debug", "mode.release")
             add_rules("mode.debug", "mode.release")
             add_requires("openjdk")
             add_requires("openjdk")

+ 3 - 1
packages/o/openjdk/xmake.lua

@@ -27,6 +27,8 @@ package("openjdk")
     add_configs("shared", {description = "Download shared binaries.", default = true, type = "boolean", readonly = true})
     add_configs("shared", {description = "Download shared binaries.", default = true, type = "boolean", readonly = true})
 
 
     if is_plat("linux") then
     if is_plat("linux") then
+        add_deps("alsa-lib", {configs = {shared = true, versioned = false}})
+        add_deps("freetype", "libxtst", "libxi", "libxrender")
         add_extsources("pacman::jdk-openjdk", "apt::default-jdk")
         add_extsources("pacman::jdk-openjdk", "apt::default-jdk")
     elseif is_plat("macosx") then
     elseif is_plat("macosx") then
         add_extsources("brew::openjdk")
         add_extsources("brew::openjdk")
@@ -46,7 +48,7 @@ package("openjdk")
         end
         end
     end)
     end)
 
 
-    on_install("windows|x64", "macosx|x86_64", "macosx|arm64", "mingw|x86_64", function (package)
+    on_install("windows|x64", "linux|x86_64", "macosx|x86_64", "macosx|arm64", "mingw|x86_64", function (package)
         local plat
         local plat
         if package:is_plat("windows", "mingw") then
         if package:is_plat("windows", "mingw") then
             plat = "win32"
             plat = "win32"