Help in conda-building a simple cpp text-editor

The source code is here.
Here is what I did:

  1. Cloned the text-editor repo
  2. Created a ./text-editor folder where I added a meta.yaml and build.sh files:

meta.yaml

package:
  name: text-editor
  version: "0.1.0"

source:
  - path: ..

build:
  number: 1

requirements:
  build:
    - make
    - {{ compiler('cxx') }}
  run:


about:
  license: MIT
  summary: Test

build.sh

#!/bin/sh
#
make && ./editor
mkdir -p $PREFIX/bin
cp $PKG_NAME $PREFIX/bin
  1. Given that the package has dependency on sfml I have brew install sfml (I don’t know how to include this in the meta.yaml).
  2. I edited the Makefile by correcting a couple of variables:
SFML_LIB := /opt/homebrew/Cellar/sfml/2.6.1/lib
SFML_HEADERS := /opt/homebrew/Cellar/sfml/2.6.1/include

I run conda build ./text-editor and I get the following error:

clang: error: argument unused during compilation: '-L/opt/homebrew/Cellar/sfml/2.6.1/lib' [-Werror,-Wunused-command-line-argument]
make: *** [Makefile:51: build/Editor.o] Error 1
cp: text-editor is a directory (not copied).

How to fix it?

I don’t know anything about sfml but it looks like there is a conda-forge package for it: Sfml :: Anaconda.org . You could try adding that to your requirements.

I brew uninstall sfml and I tried to add it in the requirements section, but it seems that it cannot be found in this way, in-spite I have conda-forge as main channel. In-fact, I get this error:

conda_libmamba_solver.conda_build_exceptions.ExplainedDependencyNeedsBuildingError: Unsatisfiable dependencies for platform osx-arm64: {MatchSpec("sfml")}
    Encountered problems while solving:
      - nothing provides requested sfml

    Could not solve for environment specs
    The following package could not be installed
    └─ sfml does not exist (perhaps a typo or a missing channel).

Maybe you need to specify the channel in the build command, i.e., conda build -c conda-forge ./text-editor?

I tried but still had the same problem :frowning:

Oh, I didn’t notice you are building on osx-arm64. It looks like there’s no conda-forge build for that platform.

I guess you could look at the info here and see if you can trigger a conda-forge build for ARM64. That may be going a bit far afield relative to what you originally wanted to do, though. I’m not even sure your original error would be resolved by this. Anyway I think I’m out of ideas given that I don’t use Macs and have no idea what sfml even is. :slight_smile:

1 Like

No worries! I appreciated your effort anyway! :slight_smile: I will look into the guide you linked me.