Giter Site home page Giter Site logo

pfultz2 / cget Goto Github PK

View Code? Open in Web Editor NEW
443.0 443.0 27.0 417 KB

C++ package retrieval

Home Page: http://cget.readthedocs.io

License: Other

Python 56.68% CMake 42.02% C++ 0.69% C 0.61%
c cget cmake cmake-packages cplusplus cpp crossplatform dependency-manager linux osx package-manager pkgconfig windows

cget's People

Contributors

ericbackus avatar horta avatar jayvdb avatar jehandadkhan avatar maddanio avatar msaf1980 avatar pfultz2 avatar welchr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cget's Issues

Using cget with catch

Hello,

Thanks for the great tool! I've got a quick question.

I see that you have a recipe for catch already. But, it looks like this goes through the process of building a single header file. Instead, I want to download the already made header file from the release tab here. However, when I try

cget install https://github.com/philsquared/Catch/releases/download/v2.0.0-develop.4/catch.hpp --cmake header

I get and error, something like...

Downloading ......
Extracting archive ....
Unexpected error: <class 'tarfile.ReadError'>
file could not be opened successfully
...

Any help is appreciated!

Recipes in Requirements File

Recipes installed in a requirements file are not immediately available. The following requirements file needs to be ran twice to work.

pfultz2/cget-recipes
xz

Add link_directories to cget.cmake

The generated cget.cmake file does include a include_directories(SYSTEM ${CMAKE_PREFIX_PATH}/include) statement.

However, it would be nice if it included a similar link_directories(${CMAKE_PREFIX_PATH}/lib) statement.

Right now, I have to add this in my own CMakeLists.txt, so this is not a problem, just a suggestion.

`cget init` fails with trying to call isabs() on "None"

OSX 10.11.3, python 2.7.10 (from homebrew)

$ cget init --prefix ~/Documents/testcget
Traceback (most recent call last):
  File "/usr/local/bin/cget", line 9, in <module>
    load_entry_point('cget==0.0.5', 'console_scripts', 'cget')()
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/cget-0.0.5-py2.7.egg/cget/cli.py", line 32, in w
    f(CGetPrefix(prefix, verbose), *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/cget-0.0.5-py2.7.egg/cget/cli.py", line 43, in init_command
    prefix.write_cmake(always_write=True, toolchain=os.path.abspath(toolchain), cxxflags=cxxflags, ldflags=ldflags, std=std)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 360, in abspath
    if not isabs(path):
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 54, in isabs
    return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'

Add a way to override recipes

Currently, there is no way to override a recipe. That is, if you install recipes from A and then later want to install recipes from B that overrides some recipes in A that is not possible as cget doesn't allow an installation to override a file from another package.

Being able to override a recipe can help make sets of recipes more "composable".

Usage for System Admins

I'm trying to figure out a sane way to allow sys admins to install just the library dependencies of an executable into the build tree, link to the libs statically and then install just the executable into a system path. In this scenario the install prefix for the dependencies is different than the install prefix for the executable. The following does the trick but is a little verbose.

mkdir build
cd build
cget install --file ../requirements.txt --prefix .
cmake -DCMAKE_PREFIX_PATH=`pwd` ..
make
sudo make install # Installs executable to /usr/local

Is there a better way of doing this or are there any ideas on how cget could support this in the future?

Also, is setting CMAKE_PREFIX_PATH to the cget prefix path the recommended way of using cget with IDEs like CLion?

Support setting CMake variables

This tool is really awesome, in order to use it for my libraries, I need a way to set CMake variables (especially CMAKE_BUILD_MODE).

For example like: cget install -DVARIABLE

Your tool don't need to worry about handling different configurations for me, my library does it when installing.

Document common installation errors

On Ubuntu, users could see this:

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c _posixsubprocess.c -o build/temp.linux-x86_64-2.7/_posixsubprocess.o
    _posixsubprocess.c:3:20: fatal error: Python.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Which needs the python-dev package installed.

Add info command

This should display info about package such as dependencies, pkg-config, and cmake find_package.

Support for other version control systems.

Hi,

I like the syntactic sugar you have for packages from github. Would you accept a PR for something similar for bitbucket and gitlab? Maybe something like...

  • cget install jgm/cmark --github which would be the same as cget install jgm/cmark
  • cget install jgm/cmark --bitbucket
  • cget install jgm/cmark --gitlab

Let me know and I can take a peek at it.

Install local directory

So cget install . should work, however, this can can cause infinite copying because the cget directory is located in the same directory its trying to install from.

Set cmake variables

Add a -D or --define to specify cmake variables when building an installing a package.

AttributeError: 'unicode' object has no attribute 'to_fname' (OSX 10.11.3, python 2.7.10)

$ cget install simbody/simbody
Failed to build package simbody/simbody
Traceback (most recent call last):
  File "/usr/local/bin/cget", line 9, in <module>
    load_entry_point('cget==0.0.7', 'console_scripts', 'cget')()
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/cget-0.0.7-py2.7.egg/cget/cli.py", line 32, in w
    f(CGetPrefix(prefix, verbose), *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/cget-0.0.7-py2.7.egg/cget/cli.py", line 60, in install_command
    prefix.remove(pb)
  File "/usr/local/lib/python2.7/site-packages/cget-0.0.7-py2.7.egg/cget/prefix.py", line 120, in remove
    pkg_dir = self.get_package_directory(pkg.to_fname())
AttributeError: 'unicode' object has no attribute 'to_fname'

Click 5.1.

Recursive GitHub clones on packages?

Hi,

I'm trying to create/install a package from a GitHub repo (that I do not own). The repo already uses CMake as its build system, so that's a positive start at least.

However, it seems the repo also uses git submodules, and therefore expects to have been cloned using the --recursive flag so that its submodule dependencies are also cloned.

Is there any way of telling cget to do a full recursive clone of the repo, instead of (I believe) downloading the zip archive (which does not include any submodules)?

If not, do you have any suggestions on an alternative approach I could try?

Thanks!

build command on non-local source always fail

Running v0.1.2 (the pip version at the time of writing) on Windows 10.

I'd like to fetch and run cmake-gui on a simple CMake-based project, like the one below. However, the following command fails:

> cget build -c https://github.com/ruslo/sugar
Unexpected error: <class 'TypeError'>

Failed to build package https://github.com/ruslo/sugar

It seems that not only the github sources, but every non-local sources will result in failing.

Add recipe flag to requirements.txt file

Add the ability to install distro-style recipes with -r <recipes> without a package name, and the ability to install package-level recipes with <pkg> -r <recipe>.

Creating recipe for non-CMake library?

Hi,

Is there any advice/examples available of best practices for creating a cget recipe for a library that does not already use CMake?

Is there perhaps a way I can "inject" a custom CMakeLists.txt file as part of the recipe? (Or is that thinking about things in the wrong way?)

Thanks!

requirements not installed on windows

First, this project looks awesome.

I ran cget install google/googletest. Everything went fine.

But then I tried to start an empty folder and I wrote a requirements.txt containing only the line google/googletest. Then I ran cget install on the command line and nothing happened.

I am on Windows 10. Am I missing something?

Ignore list

Be able to have a list of packages which should be ignored.

Cannot install with pip on OSX 10.11.3

I get the following error:

$ pip install cget
Collecting cget
  Could not find a version that satisfies the requirement cget (from versions: )
No matching distribution found for cget

Null package

Support a null package source, this will allow meta-package recipes which combine multiple requirements. The question is what should this package be called. It should be something that cannot interfere with another package. Perhaps using a special character like @ or ~ or -.

Use a recipes.txt to install recipes

Ideally, its not a good idea to add recipes in a requirements.txt, but users may want a single auto-deployment for a project.

So we could have a deploy command which is like install but will install the recipes.txt file first. Also, we could update build so it reads the recipes.txt as well.

Additionally, a --no-recipes flag can be added to disable this behavior.

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.