Giter VIP home page Giter VIP logo

Comments (5)

waruqi avatar waruqi commented on August 27, 2024

you can open a pr to add on_fetch, it will find system binutils. https://github.com/xmake-io/xmake-repo/blob/dev/packages/b/binutils/xmake.lua

like this.

https://github.com/xmake-io/xmake-repo/blob/84f6cefdff3501dbe4953b732d04813e351ee809/packages/c/cuda-samples/xmake.lua#L14

from xmake.

enzalito avatar enzalito commented on August 27, 2024

Ok thanks, I will do that.
I have one question though. Sometimes binutils is not not packaged with all the static / dynamic libraries and header files (binutils on Ubuntu, binutils-dev has everything). So should I check if both the binaries and the lib / header files exist in on_fetch ?

from xmake.

waruqi avatar waruqi commented on August 27, 2024

use package:is_binary() and package:is_library()

from xmake.

enzalito avatar enzalito commented on August 27, 2024

@waruqi I'm not certain that I'm on the right path but I came up with that :

    on_fetch("@linux", "@macosx", "@msys", function (package, opt)
        if opt.system then
            if package:is_binary() then
                -- TODO
                return {}

            elseif package:is_library() then
                local libs = {"bfd", "ctf", "opcodes"}
                result = {links = {}}
                for _, lib in ipairs(libs) do
                    local libinfo = package:find_package("system::" .. lib)                    
                    if libinfo then
                        table.insert(result.links, libinfo.links)
                    end
                end
                return result
            end
        end
    end)

It works for me when I use package:add("deps", "binutils", {kind = "library", system = true}) at least.

For the binary part, I'm not sure about how I should proceed. I tried using package:find_package here too but none of binutils' binaries were found. package:find_tool("system::" .. name) only finds a fraction of the libraries : ld, objcopy and ranlib.
I'm also unsure about how I could merge the results of multiple package:find_tool calls.

from xmake.

waruqi avatar waruqi commented on August 27, 2024

see https://github.com/xmake-io/xmake-repo/blob/41fe34936a4d2a81355528dcfba3d809de3b1905/packages/l/llvm/fetch.lua#L22

only return non-nil value.

from xmake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.