Skip to content

Commit

Permalink
Add recipe for libwinit (#6007)
Browse files Browse the repository at this point in the history
* Add recipe for libwinit

* Fix typo

* Disable some platforms

Will hopefully enable a lot of these platforms back in future Rust versions
rust-lang/rust#61956
  • Loading branch information
VarLad authored Dec 18, 2022
1 parent ae87417 commit 81b8c85
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions L/libwinit/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder

name = "libwinit"
version = v"0.17.0"

# Collection of sources required to complete build
sources = [
ArchiveSource("https://github.com/feenkcom/libwinit/archive/refs/tags/v$(version).tar.gz",
"dab68ccefaf496d5c3de751a15a0be54a3eb1ee2d4260105ec3343875c54f0e3"),
FileSource("https://github.com/feenkcom/libwinit/releases/download/v$(version)/winit.h",
"d35910a1c54cf093f70e0cafddb72442f453635cc8147f1c61cb9d9b794da313"),
]

# Adapted from the justfile of the repo
script = raw"""
install -Dvm 0755 "winit.h" "${includedir}/winit.h"
cd $WORKSPACE/srcdir/libwinit-*
cargo build --release
install_license LICENSE
if [[ "${target}" == *-mingw* ]]; then
install -Dvm 0755 "target/${rust_target}/release/Winit.${dlext}" "${libdir}/libWinit.${dlext}"
else
install -Dvm 0755 "target/${rust_target}/release/libWinit.${dlext}" "${libdir}/libWinit.${dlext}"
fi
"""

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = supported_platforms(; exclude=p -> (Sys.iswindows(p) && arch(p) == "i686") || (Sys.islinux(p) && (libc(p) == "musl" || arch(p) == "armv6l" || arch(p) == "armv7l" || arch(p) == "i686")) || Sys.isbsd(p))

# The products that we will ensure are always built
products = [
LibraryProduct("libWinit", :libWinit),
FileProduct("include/winit.h", :winit_h),
]

# Dependencies that must be installed before this package can be built
dependencies = Dependency[
Dependency("libboxer_jll")
]

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
julia_compat="1.6", compilers=[:c, :rust])

0 comments on commit 81b8c85

Please sign in to comment.