# Setting up a build environment in BinaryBuilder

**URL:** <https://discourse.julialang.org/t/setting-up-a-build-environment-in-binarybuilder/92669>\
**Category:** General Usage\
**Tags:** question, binarybuilder\
**Created:** [January 8, 2023, 12:35pm UTC](https://discourse.julialang.org/t/setting-up-a-build-environment-in-binarybuilder/92669 "2023-01-08T12:35:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rex\_Wang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rex_wang/32/35108_2.png) [@Rex\_Wang](https://discourse.julialang.org/u/Rex_Wang)\
**Post date:** [January 8, 2023, 12:35pm UTC](https://discourse.julialang.org/t/setting-up-a-build-environment-in-binarybuilder/92669/1 "2023-01-08T12:35:09Z")

</div>

Hello! I am writing a wrapper for [zbar](https://github.com/mchehab/zbar.git), but the environment of the container is minimized, so I need to install some additional packages.

More precisely, **I need to install `libmagickwand-dev`** as mentioned in [an issue of zbar](https://github.com/mchehab/zbar/issues/185). However, the command `apk add` is invalid in this case. Is there any other solution? Thanks in advance!!

Here is my build script.

```bash
cd zbar
apk add gettext-dev # install autopoint for generating `configure`
apk add imagemagick
# apk add libmagickwand-dev # invalid way to install
./configure --prefix=${prefix} --build=${MACHTYPE} --host=${target}
make -j${nproc}
make install

```

The last few lines of the command `./configure` are

```bash
=> ...
=> the zbarimg file scanner will *NOT* be built
=> GTK support will *NOT* be built
=> ...

```

Here `zbarimg`, the crucial part of zbar, requires the ImageMagick-tools to be installed.

* * *

I submitted an [issue in the BinaryBuilder repo](https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/1254), which solved part of my question. But it might be appropriate to post in discourse as well, since I’m new to these building things and may encounter more issues.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [January 8, 2023, 1:38pm UTC](https://discourse.julialang.org/t/setting-up-a-build-environment-in-binarybuilder/92669/2 "2023-01-08T13:38:44Z")

</div>

You need to install the package magicwand [for the target system, not the host one](https://docs.binarybuilder.org/stable/build_tips/#Dependencies-for-the-target-system-vs-host-system) (this section of the documentation was [already linked](https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/1254#issuecomment-1374503529) in the issue you mentioned above). You need to add a JLL package for libmagickwand as dependency, not to install it with `apk` in the build environment. However we don’t have yet libmagickwand in Yggdrasil, so you need to build that one first. Please read also the section about [binary dependencies](https://docs.binarybuilder.org/stable/building/#Binary-dependencies) in the documentation.
