# Build a package deps/build.jl

**URL:** https://discourse.julialang.org/t/build-a-package-deps-build-jl/56771
**Category:** General Usage
**Tags:** package, documentation
**Created:** [March 8, 2021, 11:23pm UTC](https://discourse.julialang.org/t/build-a-package-deps-build-jl/56771 "2021-03-08T23:23:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Paht\_J](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paht_j/32/22697_2.png) [@Paht\_J](https://discourse.julialang.org/u/Paht_J)
#### Post date: [March 8, 2021, 11:23pm UTC](https://discourse.julialang.org/t/build-a-package-deps-build-jl/56771/1 "2021-03-08T23:23:40Z")

</div>

Does anyone know how to build a package? The documentation is not helpful It says that I should use dep/build.jl but never describes or shows an example of what is in that file. What would be a good reference?

[Pkg · The Julia Language](https://docs.julialang.org/en/v1.0/stdlib/Pkg/#Creating-your-own-packages-1)

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [March 9, 2021, 6:58am UTC](https://discourse.julialang.org/t/build-a-package-deps-build-jl/56771/2 "2021-03-09T06:58:09Z")

</div>

The short answer is that normally you don’t need a `dep/build.jl` at all and when it’s needed it’s usually for building a binary dependency, e.g. if you want to call into a C library. For Julia 1.3+ this is increasingly rare though since pre-built binary dependencies from [GitHub - JuliaPackaging/Yggdrasil: Collection of builder repositories for BinaryBuilder.jl](https://github.com/JuliaPackaging/Yggdrasil) is a much better solution.

For a better answer you need to provide more context of what you are trying to accomplish.

---

<div class="post-metadata">

### Author: ![hros](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@hros](https://discourse.julialang.org/u/hros)
#### Post date: [August 13, 2021, 10:07am UTC](https://discourse.julialang.org/t/build-a-package-deps-build-jl/56771/3 "2021-08-13T10:07:04Z")

</div>

I am trying to build a library which is not supported by [BinaryBuilder](https://github.com/JuliaPackaging/BinaryBuilder.jl), as it depends on a more recent version of [glibc](https://github.com/bminor/glibc) (\>[v2.14](https://github.com/bminor/glibc/releases/tag/glibc-2.14), from 2011).

How would I go about using a build script in `build.jl`, so that the C library would be built on the machine using the package using the local (surely more recent the 2.14) version of glibc?

Is there a project with a reference `build.jl` script that downloads and build a library which can be later used by the Julia package
