Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add libcanberra repo #5586

Merged
merged 17 commits into from
Oct 28, 2024
Merged

add libcanberra repo #5586

merged 17 commits into from
Oct 28, 2024

Conversation

hahahahbenny
Copy link
Contributor

添加libcanberra的repo

@hahahahbenny
Copy link
Contributor Author

对了,ruki哥,如果自己手动加链接地址或者include地址的话,除了用add_includedir还有什么方法吗?因为如果用add_included加其他包的include地址,得转成相对地址才能加

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


By the way, brother ruki, if you manually add the link address or include address, is there any other way besides using add_includedir? Because if you use add_included to add the include address of other packages, you have to convert it to a relative address before adding it.

@waruqi
Copy link
Member

waruqi commented Oct 28, 2024

对了,ruki哥,如果自己手动加链接地址或者include地址的话,除了用add_includedir还有什么方法吗?因为如果用add_included加其他包的include地址,得转成相对地址才能加

只能用于添加当前包的 includedir 和 linkdirs ,为啥要加其他包的。。如果要加,也应该在对应那个包里 通过add_includedir 去导出。。不要在当前包中加其他包的 includedir

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


By the way, brother ruki, if you manually add the link address or include address, is there any other way besides using add_includedir? Because if you use add_included to add the include address of other packages, you have to convert it to a relative address before adding it.

It can only be used to add includedir and linkdirs of the current package. Why add other packages? . If you want to add it, you should export it through add_includedir in the corresponding package. . Do not add includedir from other packages to the current package.

end
local linkdirs = fetchinfo.linkdirs
if linkdirs and #linkdirs > 0 then
table.insert(configs, "LDFLAGS=-L" .. linkdirs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个时候返回的可能是 table 。不一定是 string

得先 wrap 下,然后 concat 下

            local includedirs = table.wrap(fetchinfo.includedirs or fetchinfo.sysincludedirs)

另外,autoconf.install 不是可以直接传递 cflags ,以及 packagedeps 么,为啥这个要单独设置

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确实,因为之前只有binary,在packagedeps加不进去,所以就手动加。现在修改

packages/l/libcanberra/xmake.lua Show resolved Hide resolved
if is_host("linux") then
add_extsources("apt::libtool", "pacman::libtool")
add_syslinks("dl")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里要单独放在 is_plat("linux"),否则会影响交叉编译

add_includedirs("include")

on_install("linux", function (package)
local fetchinfo = package:dep("libtool"):fetch()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

漏删了

add_deps("libtool", {kind = "library"})
add_deps("autoconf", "automake", "m4")
add_deps("libogg", "alsa-lib")
add_deps("libvorbis", {configs = {shared = true}})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

漏删了

add_syslinks("dl")
end

add_links("canberra", "canberra-null", "canberra-alsa", "canberra-oss", "canberra-pulse", "canberra-multi", "ltdl")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ltdl 也是这个包的库么?系统库得用 add_syslinks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ltdl 来自 libtool,加了 add_deps 就会自动放在最右面保证 link order,所以这里可以也删了

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个好像是 libtool 的库,不应该在 libtool 里面自动导出了么

@hahahahbenny
Copy link
Contributor Author

hahahahbenny commented Oct 28, 2024 via email

if package:is_plat("macosx") then
local bindir = package:installdir("bin")
os.ln(path.join(bindir, "libtoolize"), path.join(bindir, "glibtoolize"))
end
end)

on_test(function (package)
os.vrun("libtool --version")
if package:kind() ~= "binary" then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package:is_binary

@waruqi
Copy link
Member

waruqi commented Oct 28, 2024

ltdl是libtool的库

---Original--- From: @.> Date: Mon, Oct 28, 2024 15:40 PM To: @.>; Cc: @.@.>; Subject: Re: [xmake-io/xmake-repo] add libcanberra repo (PR #5586) @waruqi commented on this pull request. In packages/l/libcanberra/xmake.lua: > + set_homepage("https://0pointer.de/lennart/projects/libcanberra/") + set_description("libcanberra is an implementation of the XDG Sound Theme and Name Specifications") + set_license("LGPL-2.1") + + add_urls("http://0pointer.de/lennart/projects/libcanberra/libcanberra-$(version).tar.xz") + add_versions("0.30", "c2b671e67e0c288a69fc33dc1b6f1b534d07882c2aceed37004bf48c601afa72") + + add_deps("libtool", {kind = "library"}) + add_deps("autoconf", "automake", "m4") + add_deps("libogg", "alsa-lib") + + if is_plat("linux") then + add_syslinks("dl") + end + + add_links("canberra", "canberra-null", "canberra-alsa", "canberra-oss", "canberra-pulse", "canberra-multi", "ltdl") ltdl 也是这个包的库么?系统库得用 add_syslinks — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

那应该 libtool 里面设置 links 而不是这里

@star-hengxing
Copy link
Contributor

那改成这样,能拿到二进制也能拿到 lib/include 信息。

-- libtool/xmake.lua
on_load(function (package)
    if package:is_library() then
        package:addenv("PATH", "bin")
    end
end)

@star-hengxing star-hengxing merged commit 51dc33b into xmake-io:dev Oct 28, 2024
67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants