xmake-repo icon indicating copy to clipboard operation
xmake-repo copied to clipboard

Collect frequently used C/C++ packages

Open waruqi opened this issue 5 years ago • 140 comments

Please tell us the third-party c/c++ packages you need. We will try to add it to the official repository first.

Of course, we also hope that everyone can help to contribute some packages to the repository. 🙏

Thanks!

We can see all collected packages in official repository. https://github.com/xmake-io/xmake-repo/tree/dev/packages

Or we can run the following command to show the currect package list.

cd xmake-repo
xmake l scripts/list.lua

waruqi avatar Mar 29 '19 09:03 waruqi

#1 ffmpeg

waruqi avatar Mar 29 '19 09:03 waruqi

https://github.com/nlohmann/json

https://github.com/onqtam/doctest

wutiantong avatar Apr 02 '19 02:04 wutiantong

https://github.com/nlohmann/json

This package has been collected, you can see: https://github.com/xmake-io/xmake-repo/tree/master/packages/n/nlohmann_json

waruqi avatar Apr 02 '19 03:04 waruqi

https://www.cairographics.org/ https://www.pango.org/

lineCode avatar Apr 03 '19 00:04 lineCode

https://github.com/onqtam/doctest

@wutiantong done

https://github.com/xmake-io/xmake-repo/tree/master/packages/d/doctest

waruqi avatar Apr 03 '19 01:04 waruqi

I hope this is helpful:

Here is a list of Buckaroo's officially supported libraries and then there is more on our wishlist.

nikhedonia avatar Apr 09 '19 07:04 nikhedonia

I hope this is helpful:

Here is a list of Buckaroo's officially supported libraries and then there is more on our wishlist.

Ok, I will look at it.

Thanks!

waruqi avatar Apr 09 '19 07:04 waruqi

Here are the libraries supported by vcpkg, maybe it's helpful.

Berrysoft avatar Apr 09 '19 16:04 Berrysoft

Nana Library

kassane avatar Apr 10 '19 12:04 kassane

Nana Library

Ok, I will add it.

waruqi avatar Apr 10 '19 13:04 waruqi

https://www.cairographics.org/

@lineCode done

add_requires("cairo", "pixman")

Support linux, macOS and windows.

waruqi avatar Apr 12 '19 03:04 waruqi

Add boost library. for example:

add_requires("boost")
target("test")
    set_kind("binary")
    set_languages("c++14")
    add_files("src/*.cpp")
    add_packages("boost")

Only add the given boost library.

add_requires("boost", {alias = "boost-context", configs = {context = true}})
target("test")
    set_kind("binary")
    set_languages("c++14")
    add_files("src/*.cpp")
    add_packages("boost-context")

Show all boost libraries configuration

xmake require --info boost

      -> configs:
         -> multi: Enable multi-thread support. (default: true)
         -> filesystem: Enable filesystem library. (default: true)
         -> fiber: Enable fiber library. (default: false)
         -> coroutine: Enable coroutine library. (default: false)
         -> context: Enable context library. (default: false)
         -> thread: Enable thread library. (default: false)
         -> regex: Enable regex library. (default: false)
         -> system: Enable system library. (default: false)
         -> container: Enable container library. (default: false)
         -> exception: Enable exception library. (default: false)
         -> timer: Enable timer library. (default: false)
         -> atomic: Enable atomic library. (default: false)
         -> graph: Enable graph library. (default: false)
         -> serialization: Enable serialization library. (default: false)
         -> random: Enable random library. (default: false)
         -> wave: Enable wave library. (default: false)
         -> date_time: Enable date_time library. (default: false)
         -> locale: Enable locale library. (default: false)
         -> iostreams: Enable iostreams library. (default: false)

waruqi avatar Jul 23 '19 02:07 waruqi

The big one that's currently missing for me is Poco. Another one that I would like to see is but is less important is bs::framework.

romatthe avatar Jul 23 '19 23:07 romatthe

Suggestion: Inja


Nana Library is outdated: v1.6.1 -> 1.7.2 add_versions("1.7.2", "e2efb3b7619e4ef3b6de93f8afc70ff477ec6cabf4f9740f0d786904c790613f") I locally modified the repo script for this library and just had a problem with the test:

checking for the unzip ... /usr/bin/unzip
checking for the git ... /usr/bin/git
checking for the gzip ... /usr/bin/gzip
checking for the tar ... /usr/bin/tar
checking for the ping ... /usr/bin/ping
pinging for the host(github.com) ... 102 ms
pinging for the host(gitlab.com) ... 143 ms
pinging for the host(gitee.com) ... 362 ms
updating repositories .. 
cloning repository(xmake-repo): https://github.com/xmake-io/xmake-repo.git to /home/kassane/.xmake/repositories/xmake-repo ..
/usr/bin/git clone https://github.com/xmake-io/xmake-repo.git -b master /home/kassane/.xmake/repositories/xmake-repo
Cloning into '/home/kassane/.xmake/repositories/xmake-repo'...
remote: Enumerating objects: 83, done.
remote: Counting objects: 100% (83/83), done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 2798 (delta 34), reused 46 (delta 12), pack-reused 2715
Receiving objects: 100% (2798/2798), 462.04 KiB | 650.00 KiB/s, done.
Resolving deltas: 100% (1403/1403), done.
ok
checking for the xmake::nana ... no
checking for the brew ... no
checking for the vcpkg directory ... no
checking for the pkg-config ... /usr/bin/pkg-config
checking for the nana ... no
note: try installing these packages (pass -y to skip confirm)?
in my-repo:
  -> nana 1.7.2 
please input: y (y/n)

checking for the curl ... /usr/bin/curl
/usr/bin/curl -SL -A Xmake/2.2.8 (Linux;x86_64 5.3.1-arch1-1-ARCH) curl/7.66.0 https://github.com/cnjinhao/nana/archive/v1.7.2.tar.gz -o v1.7.2.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   121    0   121    0     0    227      0 --:--:-- --:--:-- --:--:--   227
100  557k    0  557k    0     0   327k      0 --:--:--  0:00:01 --:--:-- 1375k
/usr/bin/tar -xvf v1.7.2.tar.gz -C source.tmp
nana-1.7.2/
...
  => download https://github.com/cnjinhao/nana/archive/v1.7.2.tar.gz .. ok                                                         
cmake -DCMAKE_INSTALL_PREFIX=/home/kassane/.xmake/cache/packages/1910/n/nana/1.7.2/source/nana-1.7.2/build_619CEAD9/install ..
-- The CXX compiler identification is GNU 9.1.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
The compiled Nana library will be installed in /home/kassane/.xmake/cache/packages/1910/n/nana/1.7.2/source/nana-1.7.2/build_619CEAD9/install/lib
The Nana include files will be installed in /home/kassane/.xmake/cache/packages/1910/n/nana/1.7.2/source/nana-1.7.2/build_619CEAD9/install/include
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found Freetype: /usr/lib/libfreetype.so (found version "2.10.1") 
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.6.3") 
-- Checking for module 'fontconfig'
--   Found fontconfig, version 2.13.91
-- Found Fontconfig: /usr/lib/libfontconfig.so  
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/kassane/.xmake/cache/packages/1910/n/nana/1.7.2/source/nana-1.7.2/build_619CEAD9
make -j4
Scanning dependencies of target nana
[  1%] Building CXX object CMakeFiles/nana.dir/source/basic_types.cpp.o
[  2%] Building CXX object CMakeFiles/nana.dir/source/charset.cpp.o
...
[ 98%] Building CXX object CMakeFiles/nana.dir/source/threads/pool.cpp.o
[100%] Linking CXX static library libnana.a
[100%] Built target nana
make install
[100%] Built target nana
Install the project...
-- Install configuration: ""
-- Installing: /home/kassane/.xmake/cache/packages/1910/n/nana/1.7.2/source/nana-1.7.2/build_619CEAD9/install/lib/libnana.a
-- Installing: /home/kassane/.xmake/cache/packages/1910/n/nana/1.7.2/source/nana-1.7.2/build_619CEAD9/install/include/nana
-- Installing: /home/kassane/.xmake/cache/packages/1910/n/nana/1.7.2/source/nana-1.7.2/build_619CEAD9/install/include/nana/config.hpp
...
-- Installing: /home/kassane/.xmake/cache/packages/1910/n/nana/1.7.2/source/nana-1.7.2/build_619CEAD9/install/include/nana/system/platform.hpp
-- Installing: /home/kassane/.xmake/cache/packages/1910/n/nana/1.7.2/source/nana-1.7.2/build_619CEAD9/install/include/nana/push_ignore_diagnostic
checking for the xmake::nana ... 1.7.2
{ 
  links = { 
    "nana" 
  },
  linkdirs = { 
    "/home/kassane/.xmake/packages/n/nana/1.7.2/c5156c97e2e9dec5edeaa17987d59d44/lib" 
  },
  version = "1.7.2",
  includedirs = { 
    "/home/kassane/.xmake/packages/n/nana/1.7.2/c5156c97e2e9dec5edeaa17987d59d44/include" 
  } 
}

patching /home/kassane/.xmake/packages/n/nana/1.7.2/c5156c97e2e9dec5edeaa17987d59d44/lib/pkgconfig/nana.pc ..
checking for the gcc ... /usr/bin/gcc
checking for the c++ compiler (cxx) ... gcc
checking for the ccache ... no
checking for the g++ ... /usr/bin/g++
checking for the linker (ld) ... g++
> checking for the c++ links(nana)
> checking for the c++ snippet(test)
error: assertion failed!
  => install nana 1.7.2 .. failed                                                                                                  
error: install failed!

kassane avatar Oct 02 '19 19:10 kassane

Suggestion: Inja

done

Nana Library is outdated: v1.6.1 -> 1.7.2 add_versions("1.7.2", "e2efb3b7619e4ef3b6de93f8afc70ff477ec6cabf4f9740f0d786904c790613f") I locally modified the repo script for this library and just had a problem with the test:

I attempt to fix it, you can try it again.

waruqi avatar Oct 03 '19 15:10 waruqi

Currently in my local repository, I removed this function. After removal the error does not occur. https://github.com/xmake-io/xmake-repo/blob/7d788ef6b96b9570447712fe0bde711083f22242/packages/n/nana/xmake.lua#L19

kassane avatar Oct 03 '19 16:10 kassane

Adding Raylib would be appreciated.

elitepleb avatar Oct 04 '19 13:10 elitepleb

Currently in my local repository, I removed this function. After removal the error does not occur. https://github.com/xmake-io/xmake-repo/blob/7d788ef6b96b9570447712fe0bde711083f22242/packages/n/nana/xmake.lua#L19

on_test is required, you can modify the test code to pass it.

waruqi avatar Oct 04 '19 13:10 waruqi

Adding Raylib would be appreciated.

I've only added raylib on macOS now. https://github.com/xmake-io/xmake-repo/blob/master/packages/r/raylib/xmake.lua

waruqi avatar Oct 05 '19 05:10 waruqi

Currently in my local repository, I removed this function. After removal the error does not occur. https://github.com/xmake-io/xmake-repo/blob/7d788ef6b96b9570447712fe0bde711083f22242/packages/n/nana/xmake.lua#L19

on_test is required, you can modify the test code to pass it.

I downloaded your new script and the error was still in the assert. However in the local repo I added the line below and it did not occur but the error.

add_links("pthread", "jpeg", "png")

Output:

patching /home/kassane/.xmake/packages/n/nana/1.7.2/c5156c97e2e9dec5edeaa17987d59d44/lib/pkgconfig/nana.pc ..
checking for the gcc ... /usr/bin/gcc
checking for the c++ compiler (cxx) ... gcc
checking for the ccache ... no
> checking for the c++ snippet(test)
  => install nana 1.7.2 .. ok                                                                                                      
configure
{
    arch = x86_64
    ccache = true
    mode = release
    ndk_stdcxx = true
    host = linux
    kind = static
    buildir = build
    cxx = /usr/bin/gcc
    plat = linux
}
checking for the g++ ... /usr/bin/g++
checking for the linker (ld) ... g++
checking for the /usr/bin/gcc ... ok
checking for the flags (-O3) ... ok
[  0%]: compiling.release src/main.cpp
/usr/bin/gcc -c -fvisibility=hidden -O3 -I/home/kassane/.xmake/packages/n/nana/1.7.2/c5156c97e2e9dec5edeaa17987d59d44/include -m64 -I/usr/local/include -I/usr/include -o build/.objs/Nana_test/linux/x86_64/release/src/main.cpp.o src/main.cpp
checking for the flags (-MMD -MF) ... ok
[100%]: linking.release Nana_test
/usr/bin/g++ -o build/linux/x86_64/release/Nana_test build/.objs/Nana_test/linux/x86_64/release/src/main.cpp.o -s -fvisibility=hidden -m64 -L/usr/local/lib -L/usr/lib
build ok!👌

kassane avatar Oct 05 '19 19:10 kassane

Thank you for your effort. Maybe this can help finish the cmake part of raylib. https://github.com/raysan5/raylib/blob/master/projects/CMake/CMakeLists.txt

elitepleb avatar Oct 05 '19 20:10 elitepleb

I downloaded your new script and the error was still in the assert. However in the local repo I added the line below and it did not occur but the error.

add_links("pthread", "jpeg", "png")

@kassane Can you show me the error output?

It's a bit strange, NANA_CMAKE_ENABLE_JPEG is OFF by default. Why is the jpeg library still used?

https://github.com/cnjinhao/nana/blob/master/build/cmake/enable_jpeg.cmake

option(NANA_CMAKE_ENABLE_JPEG "Enable the use of JPEG" OFF)
option(NANA_CMAKE_LIBJPEG_FROM_OS "Use libjpeg from operating system." ON)
option(JPEG_HAVE_BOOLEAN "Defining HAVE_BOOLEAN before including jpeglib.h" OFF)

# todo: decide - PUBLIC vs PRIVATE

if(NANA_CMAKE_ENABLE_JPEG)

waruqi avatar Oct 06 '19 06:10 waruqi

Thank you for your effort. Maybe this can help finish the cmake part of raylib. https://github.com/raysan5/raylib/blob/master/projects/CMake/CMakeLists.txt

I don't have a x11 linux environment here, I can't test it further.

You can try to modify and improve the following code to support raylib on linux.

https://github.com/xmake-io/xmake-repo/blob/611325404dfd140a532827a0288860877b85ff7b/packages/r/raylib/xmake.lua#L28-L31

waruqi avatar Oct 06 '19 07:10 waruqi

I downloaded your new script and the error was still in the assert. However in the local repo I added the line below and it did not occur but the error.

add_links("pthread", "jpeg", "png")

@kassane Can you show me the error output?

It's a bit strange, NANA_CMAKE_ENABLE_JPEG is OFF by default. Why is the jpeg library still used?

https://github.com/cnjinhao/nana/blob/master/build/cmake/enable_jpeg.cmake

option(NANA_CMAKE_ENABLE_JPEG "Enable the use of JPEG" OFF)
option(NANA_CMAKE_LIBJPEG_FROM_OS "Use libjpeg from operating system." ON)
option(JPEG_HAVE_BOOLEAN "Defining HAVE_BOOLEAN before including jpeglib.h" OFF)

# todo: decide - PUBLIC vs PRIVATE

if(NANA_CMAKE_ENABLE_JPEG)

I did another test but without the jpeg and png libs. Nana only requires pthread. without pthread:

patching /home/kassane/.xmake/packages/n/nana/1.7.2/c5156c97e2e9dec5edeaa17987d59d44/lib/pkgconfig/nana.pc ..
checking for the gcc ... /usr/bin/gcc
checking for the c++ compiler (cxx) ... gcc
checking for the ccache ... no
checking for the g++ ... /usr/bin/g++
checking for the linker (ld) ... g++
> checking for the c++ links(nana)
> checking for the c++ snippet(test)
error: assertion failed!
  => install nana 1.7.2 .. failed                                                                                                  
error: install failed!

kassane avatar Oct 06 '19 15:10 kassane

I did another test but without the jpeg and png libs. Nana only requires pthread.

What test?

waruqi avatar Oct 07 '19 01:10 waruqi

What test?

asciicast

kassane avatar Oct 07 '19 11:10 kassane

@kassane Can you give me more test error info? please add -D argument to get diagnosis info.

xmake f -c -v -D

waruqi avatar Oct 07 '19 12:10 waruqi

@waruqi asciicast

error: ./my-repo/packages/n/nana/xmake.lua:25: assertion failed!
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:762]: in function 'raiselevel'
    [@programdir/core/sandbox/modules/utils.lua:178]: in function 'assert'
    [./my-repo/packages/n/nana/xmake.lua:25]: in function 'script'
    [@programdir/actions/require/impl/utils/filter.lua:119]: in function 'call'
    [@programdir/actions/require/impl/action/test.lua:50]: in function 'test'
    [@programdir/actions/require/impl/action/install.lua:212]:
    [C]: in function 'trycall'
    [@programdir/core/sandbox/modules/try.lua:121]: in function 'try'
    [@programdir/actions/require/impl/action/install.lua:142]: in function 'install'
    [@programdir/actions/require/impl/package.lua:594]:

  => install nana 1.7.2 .. failed                                                                                                  
error: @programdir/core/sandbox/modules/process.lua:148: @programdir/actions/require/impl/action/install.lua:262: install failed!
stack traceback:
        [C]: in function 'error'
        @programdir/core/base/os.lua:762: in function 'raise'
        @programdir/actions/require/impl/action/install.lua:262: in function 'catch'
        @programdir/core/sandbox/modules/try.lua:127: in function 'try'
        @programdir/actions/require/impl/action/install.lua:142: in function 'install'
        @programdir/actions/require/impl/package.lua:594: in function <@programdir/actions/require/impl/package.lua:519>

kassane avatar Oct 07 '19 14:10 kassane

@kassane Can you let me see the content of ./my-repo/packages/n/nana/xmake.lua?

waruqi avatar Oct 07 '19 15:10 waruqi

package("nana")

    set_homepage("http://nanapro.org")
    set_description("A modern C++ GUI library.")

    add_urls("https://github.com/cnjinhao/nana/archive/v$(version).tar.gz",
             "https://github.com/cnjinhao/nana.git")
    add_versions("1.6.2", "5f5cb791dff292e27bfa29d850b93f809a0d91d6044ea7e22ce7ae76a5d8b24e")
    add_versions("1.7.2", "e2efb3b7619e4ef3b6de93f8afc70ff477ec6cabf4f9740f0d786904c790613f")

    if is_plat("linux", "windows") then
        add_deps("cmake >=3.12")
        add_links("pthread") <-- my change
    end

    if is_plat("windows") then
        add_syslinks("ole32", "shell32", "user32", "kernel32", "user32", "gdi32", "winspool", "comdlg32", "advapi32")
    end

    on_install("linux", "windows", function (package)
        import("package.tools.cmake").install(package)
    end)

    on_test(function (package)
        assert(package:check_cxxsnippets({test = [[
            #include <nana/gui.hpp>
            #include <nana/gui/widgets/form.hpp>
            #include <nana/gui/widgets/label.hpp>
            using namespace nana;
            void test() {
                form    fm;
                label   lb(fm, rectangle(fm.size()));
                lb.caption("Hello, World");
                fm.show();
                exec();
            }
        ]]}, {configs = {languages = "c++11"}}))
    end)

kassane avatar Oct 07 '19 15:10 kassane