C++ package retrieval

Overview

cget

Cmake package retrieval. This can be used to download and install cmake packages. The advantages of using cget are:

  • Non-intrusive: There is no need to write special hooks in cmake to use cget. One cmake file is written and can be used to install a package with cget or standalone.
  • Works out of the box: Since it uses the standard build and install of cmake, it already works with almost all cmake packages. There is no need to wait for packages to convert over to support cget. Standard cmake packages can be already installed immediately.
  • Decentralized: Packages can be installed from anywhere, from github, urls, or local files.

Getting cget

cget can be simply installed using pip(you can get pip from here):

pip install cget

Or installed directly with python:

python setup.py install

On windows, you may want to install pkgconfig-lite to support packages that use pkgconfig. This can be installed with cget as well:

cget install pfultz2/pkgconfig

Quickstart

We can also install cmake packages directly from source files, for example zlib:

cget install http://zlib.net/zlib-1.2.11.tar.gz

However, its much easier to install recipes so we don't have to remember urls:

cget install pfultz2/cget-recipes

Then we can install packages such as boost:

cget install boost

Or curl:

cget install curl

Documentation

See here for the latest documentation.

Supported platforms

This is supported on python 2.7, 3.4, and 3.5.

Comments
  • Recursive GitHub clones on packages?

    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!

    opened by thoughton 7
  • Consider adding --debug and --release flags to the build command

    Consider adding --debug and --release flags to the build command

    Hi,

    Would it be possible to consider adding --debug and --release flags to the build command, similar to those that already exist for install?

    It's of course possible that I'm trying to use cget wrong, but my use-case is that I'm using cget to build my local project (in addition to installing and building its dependencies), and I'd like to optionally build it with debug symbols occasionally.

    I was a bit surprised there was no --debug flag for the build command, so as a workaround I tried passing in a custom --define CMAKE_BUILD_TYPE=Debug to the command instead, however that also didn't work due to the issue I've detailed in #55.

    So for now I've resorted to simply adding a set(CMAKE_BUILD_TYPE Debug) line to my local package's CMakeLists.txt file. However this is not ideal as I would prefer to be able to toggle it within the cget command line rather than having to edit a file.

    Thanks!

    opened by thoughton 6
  • Allow specifying cmake flags to pass onto the requirements

    Allow specifying cmake flags to pass onto the requirements

    First of all, awesome idea! It'd be nice if the requirements file allowed specifying cmake flags to pass onto the dependencies, e.g., -DCMAKE_CXX_FLAGS=..., etc.

    opened by chrisdembia 6
  • Broken links give subtle error.

    Broken links give subtle error.

    Moving the cget directory after an install results in broken links which make the project unable to compile. This is a somewhat difficult to spot error for a first time user (maybe it's just me). Is there a way to avoid this by relative paths? Could be a nice feature for the project.

    opened by somedadaism 5
  • cget with cmake v3.14.0

    cget with cmake v3.14.0

    Has cget been tested with cmake v3.14.0? All of my cget installs fail with this version of cmake, but not with earlier versions like v3.5.1 and v3.8.1. The problem is that the cget/include directory is not being set as an include directory for the project being built.

    opened by jonathonl 4
  • BUILD_TESTING incorrectly set by default (build and install)

    BUILD_TESTING incorrectly set by default (build and install)

    Hi,

    Given the following simple CMakeLists.txt with an added check that aborts if BUILD_TESTING is set:

    $ cat CMakeLists.txt 
    
    cmake_minimum_required(VERSION 3.12)
    project(SimpleTest)
    
    set(CMAKE_CXX_STANDARD 14)
    
    if(BUILD_TESTING)
    	message(FATAL_ERROR "BUILD_TESTING is set. Aborting.")
    endif()
    
    add_executable(SimpleTest main.cpp)
    

    When building manually it works successfully:

    $ mkdir build
    $ cd build
    $ cmake ..
    -- The C compiler identification is GNU 7.3.0
    -- The CXX compiler identification is GNU 7.3.0
    -- Check for working C compiler: /usr/bin/gcc-7
    -- Check for working C compiler: /usr/bin/gcc-7 -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/g++-7
    -- Check for working CXX compiler: /usr/bin/g++-7 -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /SimpleTest/build
    $
    $ make
    Scanning dependencies of target SimpleTest
    [ 50%] Building CXX object CMakeFiles/SimpleTest.dir/main.cpp.o
    [100%] Linking CXX executable SimpleTest
    [100%] Built target SimpleTest
    

    However, if building using cget build (or cget install), the BUILD_TESTING flag seems to somehow have been set, causing the command to abort:

    $ cd ..
    $ rm build -r
    $ cget build
    -- The C compiler identification is GNU 7.3.0
    -- The CXX compiler identification is GNU 7.3.0
    -- Check for working C compiler: /usr/bin/gcc-7
    -- Check for working C compiler: /usr/bin/gcc-7 -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/g++-7
    -- Check for working CXX compiler: /usr/bin/g++-7 -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    CMake Error at CMakeLists.txt:7 (message):
      BUILD_TESTING is set.  Aborting.
    
    
    -- Configuring incomplete, errors occurred!
    See also "/SimpleTest/cget/cget/build/_url_L2hvbWUvdGhvdWdodG9uL0RvY3VtZW50cy9Db2RpbmcvQ2dldFByb2plY3RzL1NpbXBsZVRlc3Q_/build/CMakeFiles/CMakeOutput.log".
    Command failed: ['/home/linuxbrew/.linuxbrew/bin/cmake', '-DCMAKE_TOOLCHAIN_FILE=/SimpleTest/cget/cget/cget.cmake', u'/SimpleTest', '-DCGET_CMAKE_DIR=/.local/lib/python2.7/site-packages/cget/cmake', '-DCGET_CMAKE_ORIGINAL_SOURCE_FILE=/SimpleTest/__cget_original_cmake_file__.cmake', '-DBUILD_TESTING=On', '-DCMAKE_BUILD_TYPE=Release']
    Failed to build package .
    $ 
    

    (It can also be clearly seen in the echo of the failed command above that -DBUILD_TESTING is explicitly being set in the command arguments being executed.)

    Is there a way to configure this default? Or is it simply a bug?

    (For the record, it currently makes it quite tricky to setup a project with optional tests.)

    Thanks!

    opened by thoughton 4
  • Usage for System Admins

    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?

    opened by jonathonl 4
  • Cannot install with pip on OSX 10.11.3

    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
    
    opened by chrisdembia 4
  • remove uuid

    remove uuid

    cget uses a unique ID for every package download. This results in the file path being different for each build of the same package, resulting in a cache miss in ccache when cget is asked to build a package with ccache enabled.

    This PR replaces the UUID with a hash of the package source for reproducibility.

    opened by JehandadKhan 3
  • Fix

    Fix "cget install --debug"

    When installing packages, the --debug command-line flag was not always obeyed. It always worked correctly for "cget install --debug <pkg_name>", and also always worked correctly when installing packages as part of "cget build --debug". But for "cget install --debug" using the requirements.txt file, the --debug command-line flag was not used. This commit fixes it.

    opened by EricBackus 3
  • Automatically generated CMakeLists.txt ends in error for --cmake autotools

    Automatically generated CMakeLists.txt ends in error for --cmake autotools

    I am currently using cget 0.1.7 and cmake 3.5.1 on ubuntu 16.04 lts

    I have tried to install libffi v3.2.1 via requirements.txt file, with the following line libffi,libffi/[email protected] --cmake autotools, but the automatically generated CMakeLists.txt ends execution with the error shown below. Using the command cget install libffi,libffi/[email protected] --cmake autotools results in the same error.

    Downloading https://github.com/libffi/libffi/archive/v3.2.1.tar.gz
      [######################################################################]  100%
    Extracting archive /home/igor/foo/cget/cget/build/tmp-98ba454730bf43a3bc7acf6ed231570e/v3.2.1.tar.gz ...
    -- The C compiler identification is GNU 5.4.0
    -- The CXX compiler identification is GNU 5.4.0
    -- Check for working C compiler using: Ninja
    -- Check for working C compiler using: Ninja -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler using: Ninja
    -- Check for working CXX compiler using: Ninja -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    No such file or directory
    CMake Error at CMakeLists.txt:33 (message):
      Process failed:
      COMMAND;/usr/bin/cmake;-E;env;PATH=/home/igor/foo/cget/bin:/usr/local/bin:/usr/bin://bin:/usr/bin:/home/igor/foo/cget/cget/pkg/libffi/install/bin:/home/igor/foo/cget/bin:/toolchain/mips-4.3-51/mips-4.3/bin:/toolchain/arm-2014.05/bin:/usr/lib/ccache:/home/igor/bin:/usr/local/bin:/toolchain/mips-4.3-51/mips-4.3/bin:/toolchain/arm-2014.05/bin:/usr/lib/ccache:/home/igor/bin:/usr/local/bin:/home/igor/.cargo/bin:/home/igor/.cargo/bin:/home/igor/bin:/home/igor/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin;PKG_CONFIG_PATH=/home/igor/foo/cget/lib/pkgconfig:/home/igor/foo/cget/lib64/pkgconfig:/home/igor/foo/cget/share/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig://lib/pkgconfig://lib64/pkgconfig://share/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:/home/igor/foo/cget/cget/pkg/libffi/install/lib/pkgconfig:/home/igor/foo/cget/cget/pkg/libffi/install/lib64/pkgconfig:/home/igor/foo/cget/cget/pkg/libffi/install/share/pkgconfig;CC=/usr/lib/ccache/cc;CXX=/usr/lib/ccache/c++;CFLAGS=-isystem
      /home/igor/foo/cget/include -isystem
      /home/igor/foo/cget/include;CXXFLAGS=-isystem
      /home/igor/foo/cget/include -isystem
      /home/igor/foo/cget/include;LDFLAGS=;/home/igor/foo/cget/cget/build/tmp-98ba454730bf43a3bc7acf6ed231570e/libffi-3.2.1/configure;--prefix=/home/igor/foo/cget/cget/pkg/libffi/install;WORKING_DIRECTORY;/home/igor/foo/cget/cget/build/tmp-98ba454730bf43a3bc7acf6ed231570e/build/build
    Call Stack (most recent call first):
      CMakeLists.txt:147 (exec)
    
    
    -- Configuring incomplete, errors occurred!
    See also "/home/igor/foo/cget/cget/build/tmp-98ba454730bf43a3bc7acf6ed231570e/build/CMakeFiles/CMakeOutput.log".
    Command failed: ['/usr/bin/cmake', '-DCMAKE_TOOLCHAIN_FILE=/home/igor/foo/cget/cget/cget.cmake', '-G', u'Ninja', '/home/igor/foo/cget/cget/build/tmp-98ba454730bf43a3bc7acf6ed231570e/libffi-3.2.1', '-DCGET_CMAKE_DIR=/usr/local/lib/python2.7/dist-packages/cget/cmake', '-DCGET_CMAKE_ORIGINAL_SOURCE_FILE=/home/igor/foo/cget/cget/build/tmp-98ba454730bf43a3bc7acf6ed231570e/libffi-3.2.1/__cget_original_cmake_file__.cmake', '-DBUILD_TESTING=Off', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_INSTALL_PREFIX=/home/igor/foo/cget/cget/pkg/libffi/install']
    Failed to build package libffi```
    opened by igormacedo 3
  • CVE-2007-4559 Patch

    CVE-2007-4559 Patch

    Patching CVE-2007-4559

    Hi, we are security researchers from the Advanced Research Center at Trellix. We have began a campaign to patch a widespread bug named CVE-2007-4559. CVE-2007-4559 is a 15 year old bug in the Python tarfile package. By using extract() or extractall() on a tarfile object without sanitizing input, a maliciously crafted .tar file could perform a directory path traversal attack. We found at least one unsantized extractall() in your codebase and are providing a patch for you via pull request. The patch essentially checks to see if all tarfile members will be extracted safely and throws an exception otherwise. We encourage you to use this patch or your own solution to secure against CVE-2007-4559. Further technical information about the vulnerability can be found in this blog.

    If you have further questions you may contact us through this projects lead researcher Kasimir Schulz.

    opened by TrellixVulnTeam 0
  • Replace CGetURLOpener with urlretrieve

    Replace CGetURLOpener with urlretrieve

    For reasons I have not entirely traced, URLopener (and thus FancyURLopener) does not work with some proxies. I can see that instead of setting up a tunnel with a CONNECT request, it makes a GET request to the proxy, which in my case induces a 502-bad-gateway response. Even though it recognises the proxy settings, it doesn't quite do the right thing.

    However, urlopen uses ProxyHandler to accommodate the situation, and does work through this troublesome proxy. urllib.request.urlretrieve has the same interface as URLopener.retrieve, and seems like a drop-in replacement. I added a try/except around the urlretrieve to get the BuildError for responses of 400 or greater, since there is no longer a custom http_error_default or a good place to hang it.

    This change addresses my internal build problem and probably also issues #52 and #77. Plus, no more deprecation warnings.

    opened by pcf000 0
  • Bump numpy from 1.20.3 to 1.22.0 in /test/simpleapp-pyreq

    Bump numpy from 1.20.3 to 1.22.0 in /test/simpleapp-pyreq

    Bumps numpy from 1.20.3 to 1.22.0.

    Release notes

    Sourced from numpy's releases.

    v1.22.0

    NumPy 1.22.0 Release Notes

    NumPy 1.22.0 is a big release featuring the work of 153 contributors spread over 609 pull requests. There have been many improvements, highlights are:

    • Annotations of the main namespace are essentially complete. Upstream is a moving target, so there will likely be further improvements, but the major work is done. This is probably the most user visible enhancement in this release.
    • A preliminary version of the proposed Array-API is provided. This is a step in creating a standard collection of functions that can be used across application such as CuPy and JAX.
    • NumPy now has a DLPack backend. DLPack provides a common interchange format for array (tensor) data.
    • New methods for quantile, percentile, and related functions. The new methods provide a complete set of the methods commonly found in the literature.
    • A new configurable allocator for use by downstream projects.

    These are in addition to the ongoing work to provide SIMD support for commonly used functions, improvements to F2PY, and better documentation.

    The Python versions supported in this release are 3.8-3.10, Python 3.7 has been dropped. Note that 32 bit wheels are only provided for Python 3.8 and 3.9 on Windows, all other wheels are 64 bits on account of Ubuntu, Fedora, and other Linux distributions dropping 32 bit support. All 64 bit wheels are also linked with 64 bit integer OpenBLAS, which should fix the occasional problems encountered by folks using truly huge arrays.

    Expired deprecations

    Deprecated numeric style dtype strings have been removed

    Using the strings "Bytes0", "Datetime64", "Str0", "Uint32", and "Uint64" as a dtype will now raise a TypeError.

    (gh-19539)

    Expired deprecations for loads, ndfromtxt, and mafromtxt in npyio

    numpy.loads was deprecated in v1.15, with the recommendation that users use pickle.loads instead. ndfromtxt and mafromtxt were both deprecated in v1.17 - users should use numpy.genfromtxt instead with the appropriate value for the usemask parameter.

    (gh-19615)

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • cget install with nonexistent file fails silently

    cget install with nonexistent file fails silently

    Currently issuing the following command fails silently:

    cget install -f /path/does/not/exist
    

    completes successfully.

    This should be an error with the exit code reflecting an error

    opened by JehandadKhan 0
BakePKG is a package archive that can install itself without without a package manager.

BakePKG A bad way of packaging applications. Introduction BakePKG is a package archive that can install itself without without a package manager. The

bread 3 Sep 3, 2022
The decentralized package manager for C++ and friends 🏝️

Buckaroo The decentralized package manager for C++ and friends. Why Buckaroo? Package managers like Yarn and Cargo have shown how productive developer

LoopPerfect 903 Jan 6, 2023
📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.

Setup-free CMake dependency management CPM.cmake is a CMake script that adds dependency management capabilities to CMake. It's built as a thin wrapper

CPM.cmake 1.6k Jan 9, 2023
CMake driven cross-platform package manager for C/C++.

Hunter CMake driven cross-platform package manager for C/C++. Linux, Windows, macOS, iOS, Android, Raspberry Pi, etc. Documentation: https://hunter.re

null 497 Jan 3, 2023
PMM - The C++ Package Manager Manager

PMM - The Package Manager Manager PMM is a module for CMake that manages... package managers. Wha- Why? People hate installing new software. Especiall

Edgar 13 Dec 14, 2022
Conan - The open-source C/C++ package manager

Conan Decentralized, open-source (MIT), C/C++ package manager.

Conan.io 6.5k Jan 6, 2023
C++ package retrieval

cget Cmake package retrieval. This can be used to download and install cmake packages. The advantages of using cget are: Non-intrusive: There is no ne

Paul Fultz II 420 Jan 3, 2023
libvot - A C++11 multi-thread library for image retrieval

libvot is a fast implementation of vocabulary tree, which is an algorithm widely used in image retrieval and computer vision. It usually comprises three components to build a image retrieval system using vocabulary tree: build a k-means tree using sift descriptors from images, register images into the database, query images against the database. I

Tianwei Shen 174 Dec 22, 2022
Learning embeddings for classification, retrieval and ranking.

StarSpace StarSpace is a general-purpose neural model for efficient learning of entity embeddings for solving a wide variety of problems: Learning wor

Facebook Research 3.8k Dec 22, 2022
Just a repository convenient for reviewing and retrieval practice.

The-art-of-multiprocessor-programming Purpose Just a repository convenient for reviewing and retrieval practice. The architecture of this repository(H

null 1 Nov 9, 2021
Spack is a package manager, and package managers should be trivial to install.

?? Spack with batteries included (linux/x86_64) Spack is a package manager, and package managers should be trivial to install. This repo offers a sing

Harmen Stoppels 22 Dec 1, 2022
BakePKG is a package archive that can install itself without without a package manager.

BakePKG A bad way of packaging applications. Introduction BakePKG is a package archive that can install itself without without a package manager. The

bread 3 Sep 3, 2022
Public development project of the LAMMPS MD software package

This is the LAMMPS software package. LAMMPS stands for Large-scale Atomic/Molecular Massively Parallel Simulator. Copyright (2003) Sandia Corporatio

LAMMPS Developers 1.6k Dec 30, 2022
C package manager-ish

clib(1) Package manager for the C programming language. Installation Expects libcurl to be installed and linkable. With homebrew: $ brew install clib

clibs 4.5k Jan 6, 2023
C++ Package Manager

CPM Note CPM is not being actively maintained. I plan on keeping the website active but don't plan on making further modifications to the codebase. If

James 720 Dec 18, 2022
C package that solves convex cone problems via operator splitting

SCS SCS (splitting conic solver) is a numerical optimization package for solving large-scale convex cone problems, based on our paper Conic Optimizati

Stanford University Convex Optimization Group 441 Dec 31, 2022
image_projection is a ROS package to create various projections from multiple calibrated cameras.

image_projection Overview image_projection is a ROS package to create various projections from multiple calibrated cameras. Use cases involve: Rectify

Technische Universität Darmstadt ROS Packages 118 Dec 22, 2022
fast javascript bundler :package:

Fast JavaScript Bundler https://fjbundler.com What? It is what it says it is. However, this bundler aims to be a monolithic does-it-all type of bundle

Sebastian Karlsson 103 Oct 27, 2022
This repo contains Direct3D 9, Direct3D 10, a few Direct3D 11, and DirectSound C++ samples from the legacy DirectX SDK updated to build using the Windows 10 SDK and the Microsoft.DXSDK.D3DX NuGet package

DirectX SDK Legacy Samples This repo contains Direct3D 9, Direct3D 10, a few Direct3D 11, and DirectSound samples that originally shipped in the legac

Chuck Walbourn 44 Jan 2, 2023
The decentralized package manager for C++ and friends 🏝️

Buckaroo The decentralized package manager for C++ and friends. Why Buckaroo? Package managers like Yarn and Cargo have shown how productive developer

LoopPerfect 903 Jan 6, 2023