Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add nuklear/4.01.5 #884

Merged
merged 3 commits into from
Feb 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions recipes/nuklear/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"4.01.5":
SpaceIm marked this conversation as resolved.
Show resolved Hide resolved
url: "https://github.com/Immediate-Mode-UI/Nuklear/archive/bb7c2519a3981de793617eeca975ba8edec29971.zip"
sha256: "176c24720f27e06008fcea02ae78389afe3aff314929169900f86cdd2ab4736f"
29 changes: 29 additions & 0 deletions recipes/nuklear/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import os

from conans import ConanFile, tools

class NuklearConan(ConanFile):
name = "nuklear"
description = "A single-header ANSI C immediate mode cross-platform GUI library."
license = ["MIT", "Unlicense"]
topics = ("conan", "nuklear", "gui", "header-only")
homepage = "https://github.com/Immediate-Mode-UI/Nuklear"
url = "https://github.com/conan-io/conan-center-index"
no_copy_source = True

@property
def _source_subfolder(self):
return "source_subfolder"

def source(self):
tools.get(**self.conan_data["sources"][self.version])
url = self.conan_data["sources"][self.version]["url"]
extracted_dir = "Nuklear-" + os.path.splitext(os.path.basename(url))[0]
os.rename(extracted_dir, self._source_subfolder)

def package(self):
self.copy("LICENSE", dst="licenses", src=os.path.join(self._source_subfolder, "src"))
self.copy("nuklear.h", dst="include", src=self._source_subfolder)

def package_id(self):
self.info.header_only()
8 changes: 8 additions & 0 deletions recipes/nuklear/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 2.8.11)
project(test_package C)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

add_executable(${PROJECT_NAME} test_package.c)
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
17 changes: 17 additions & 0 deletions recipes/nuklear/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os

from conans import ConanFile, CMake, tools

class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not tools.cross_building(self.settings):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
10 changes: 10 additions & 0 deletions recipes/nuklear/all/test_package/test_package.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#define NK_IMPLEMENTATION
#define NK_INCLUDE_DEFAULT_ALLOCATOR
#include <nuklear.h>

int main() {
SpaceIm marked this conversation as resolved.
Show resolved Hide resolved
struct nk_context ctx;
nk_init_default(&ctx, NULL);

return 0;
SpaceIm marked this conversation as resolved.
Show resolved Hide resolved
}
3 changes: 3 additions & 0 deletions recipes/nuklear/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"4.01.5":
folder: all