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 soil2 #6860

Closed
wants to merge 6 commits into from
Closed

Add soil2 #6860

wants to merge 6 commits into from

Conversation

FernandoVelcic
Copy link
Contributor

@FernandoVelcic FernandoVelcic commented Aug 15, 2021

Specify library name and version: soil2/1.20

I want to add soil2 library because it's so useful for game development


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

Failure in build 5 (0ec8c0ae705f844466606180a7229a56e9ccfa89):

  • soil2/1.20@:
    CI failed to create some packages (All logs)

    Logs for packageID c0059683f10e1f9ccd34130934eeacf593c58e6a:
    [settings]
    arch=x86_64
    arch_build=x86_64
    build_type=Release
    compiler=apple-clang
    compiler.libcxx=libc++
    compiler.version=11.0
    os=Macos
    os_build=Macos
    
    [...]
    [settings]
    arch=x86_64
    arch_build=x86_64
    build_type=Release
    compiler=apple-clang
    compiler.libcxx=libc++
    compiler.version=11.0
    os=Macos
    os_build=Macos
    [options]
    [build_requires]
    [env]
    
    soil2/1.20: Forced build from source
    Installing package: soil2/1.20
    Requirements
        opengl/system from 'conan-center' - Cache
        soil2/1.20 from local cache - Cache
    Packages
        opengl/system:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
        soil2/1.20:c0059683f10e1f9ccd34130934eeacf593c58e6a - Build
    Build requirements
        premake/5.0.0-alpha14 from 'conan-center' - Cache
    Build requirements packages
        premake/5.0.0-alpha14:103f6067a947f366ef91fc1b7da351c588d1827f - Cache
    
    Installing (downloading, building) binaries...
    opengl/system: Already installed!
    [HOOK - conan-center.py] post_package_info(): [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] OK
    [HOOK - conan-center.py] post_package_info(): [LIBRARY DOES NOT EXIST (KB-H054)] OK
    premake/5.0.0-alpha14: Already installed!
    premake/5.0.0-alpha14: Appending PATH environment variable: /Users/jenkins/w/BuildSingleReference/.conan/data/premake/5.0.0-alpha14/_/_/package/103f6067a947f366ef91fc1b7da351c588d1827f/bin
    [HOOK - conan-center.py] post_package_info(): [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] OK
    [HOOK - conan-center.py] post_package_info(): [LIBRARY DOES NOT EXIST (KB-H054)] OK
    soil2/1.20: Applying build-requirement: premake/5.0.0-alpha14
    
    ----Running------
    > brew install xquartz
    -----------------
    Error: /usr/local/Cellar is not writable. You should change the
    ownership and permissions of /usr/local/Cellar back to your
    user account:
      sudo chown -R $(whoami) /usr/local/Cellar
    Error: No available formula with the name "xquartz" 
    Found a cask named "xquartz" instead. Try
      brew cask install xquartz
    
    premake/5.0.0-alpha14: WARN: Lib folder doesn't exist, can't collect libraries: /Users/jenkins/w/BuildSingleReference/.conan/data/premake/5.0.0-alpha14/_/_/package/103f6067a947f366ef91fc1b7da351c588d1827f/lib
    soil2/1.20: ERROR: while executing system_requirements(): Error 1 while executing brew install xquartz
    ERROR: Error in system requirements
    

Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.

Comment on lines +18 to +19
# Visual Studio users: SOIL2 will need to be compiled as C++ source ( at least the file etc1_utils.c ), since VC compiler doesn't support C99
del self.settings.compiler.libcxx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The libcxx is there for the c++ runtime library.
gcc has libstdc++ and libstdc++11.
clang has libstdc++, libstdc++11 and clang++.
MSVC has no specific c++ runtime, only its general runtime (MT/MD/MTd/MDd)

Comment on lines +23 to +24
if not tools.which("premake"):
self.build_requires("premake/5.0.0-alpha14")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't depend on a locally installed version. It might be bugged and out-of-date.

Suggested change
if not tools.which("premake"):
self.build_requires("premake/5.0.0-alpha14")
self.build_requires("premake/5.0.0-alpha14")

Comment on lines +30 to +32
tools.get(**self.conan_data["sources"][self.version])
extracted_dir = "SOIL2-release-" + self.version
os.rename(extracted_dir, self._source_subfolder)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conan learned to do this in one method.

Suggested change
tools.get(**self.conan_data["sources"][self.version])
extracted_dir = "SOIL2-release-" + self.version
os.rename(extracted_dir, self._source_subfolder)
tools.get(**self.conan_data["sources"][self.version],
destinations=self._source_subfolder, strip_root=True)


def system_requirements(self):
if self.settings.os == "Macos":
self.run("brew install xquartz")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a big no-no.
As a package manager ourselves, we don't want to depend as little as possible on other package manager.
So please create a xquartz recipe which can be added as a requirement here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and why does it need xquartz?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested bincrafters recipe without xquartz and CI passed on macos, so this method can probably be simply removed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess for opengl, but it doesn't make sense.

build_type = "debug"

msbuild = MSBuild(self)
msbuild.build("SOIL2.sln", targets=["soil2-static-lib"], platforms={"x86": "Win32"}, build_type=build_type)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The premake script also provides a soil2-shared-lib target


def build(self):
config = "debug" if self.settings.build_type == "Debug" else "release"
architecture = "x86" if self.settings.arch == "x86" else "x86_64"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also armv8 for Apple, raspberry pi, ...
If only intel architectures are supported, please add a check in a validate method.

Comment on lines +18 to +20
bin_path = os.path.join("bin", "test_package")
img_path = os.path.join(self.source_folder, "img_test.png")
self.run("%s %s" % (bin_path, img_path), run_environment=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bin_path = os.path.join("bin", "test_package")
img_path = os.path.join(self.source_folder, "img_test.png")
self.run("%s %s" % (bin_path, img_path), run_environment=True)
if not tools.cross_building(self):
bin_path = os.path.join("bin", "test_package")
img_path = os.path.join(self.source_folder, "img_test.png")
self.run("%s %s" % (bin_path, img_path), run_environment=True)

glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);

GLFWwindow* window = glfwCreateWindow(800, 600, "OpenGL", NULL, NULL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't this this will work on headless build machines.

Comment on lines +2 to +5
import os


class soil2Conan(ConanFile):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my tools.get suggestion.

Suggested change
import os
class soil2Conan(ConanFile):
import os
required_conan_version = ">=1.33.0"
class Soil2Conan(ConanFile):

@ericLemanissier
Copy link
Contributor

This recipe looks like bincrafters recipe. If it is based on it, then please mention that it is a port of https://github.com/bincrafters/conan-soil2 in the PR description.

@stale
Copy link

stale bot commented Sep 18, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 18, 2021
@stale
Copy link

stale bot commented Oct 19, 2021

This pull request has been automatically closed because it has not had recent activity. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants