Skip to content

Commit

Permalink
Add builder for whereami (#9473)
Browse files Browse the repository at this point in the history
* Add builder for whereami

Cross-platform library for identifying where on the filesystem the
current executable lives.

* mkdir -p

* [whereami] Windows doesn't like -ldl

* [whereami] Only -ldl with glibc, + how did I forget the input to cc

* Update W/WhereAmI/build_tarballs.jl
  • Loading branch information
ararslan authored Sep 24, 2024
1 parent 77b27d6 commit ae07d56
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions W/WhereAmI/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using BinaryBuilder

name = "WhereAmI"
version = v"1.0.0" # no proper versions/releases, this is made up

sources = [
GitSource("https://github.com/gpakosz/whereami",
"dcb52a058dc14530ba9ae05e4339bd3ddfae0e0e"),
]

script = raw"""
cd ${WORKSPACE}/srcdir/whereami/
mkdir -p "${libdir}"
FLAGS=(-Isrc -O2 -std=c99 -fPIC)
if [[ "${target}" == *-gnu* ]]; then
FLAGS+=(-ldl)
fi
cc src/whereami.c ${FLAGS[@]} -shared -o "${libdir}/libwai.${dlext}"
install -Dvm 644 src/whereami.h "${includedir}/whereami.h"
install_license LICENSE.MIT
"""

platforms = supported_platforms()

products = [
LibraryProduct("libwai", :libwai),
]

dependencies = Dependency[]

build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
julia_compat="1.6")

0 comments on commit ae07d56

Please sign in to comment.