Skip to content

Commit

Permalink
Issue #84 - add conan recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
greg7mdp committed Nov 29, 2019
1 parent 5fd14b5 commit b0f244f
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from conans import ConanFile, tools
import os

class SparseppConan(ConanFile):
name = "sparsepp"
version = "1.22"
description = "A fast, memory efficient hash map for C++"

# Indicates License type of the packaged library
license = "https://github.com/greg7mdp/sparsepp/blob/master/LICENSE"

# Packages the license for the conanfile.py
exports = ["LICENSE.md"]

# Custom attributes for Bincrafters recipe conventions
source_subfolder = "source_subfolder"

def source(self):
source_url = "https://github.com/greg7mdp/sparsepp"
tools.get("{0}/archive/{1}.tar.gz".format(source_url, self.version))
extracted_dir = self.name + "-" + self.version

#Rename to "source_folder" is a convention to simplify later steps
os.rename(extracted_dir, self.source_subfolder)


def package(self):
include_folder = os.path.join(self.source_subfolder, "sparsepp")
self.copy(pattern="LICENSE")
self.copy(pattern="*", dst="include/sparsepp", src=include_folder)

def package_id(self):
self.info.header_only()

0 comments on commit b0f244f

Please sign in to comment.