Giter Site home page Giter Site logo

libmagic_rs's Introduction

libmagic_rs

rust binding for libmagic https://github.com/file/file

fork from: https://github.com/robo9k/rust-magic-sys

support cross-compile

host target --target
linux-x64 windows-x64 --target x86_64-pc-windows-gnu
linux-x64 linux-arm64-musl --target aarch64-unknown-linux-musl
linux-x64 linux-x64-musl --target x86_64-unknown-linux-musl

1. requirements

1-1. rust target

rustup target add aarch64-unknown-linux-musl
rustup target add x86_64-unknown-linux-musl
rustup target add x86_64-pc-windows-gnu

1-2. debian

# x86_64-w64-mingw32-gcc
apt-get install -y autoconf wget gcc-mingw-w64 g++-mingw-w64 mingw-w64-common musl musl-dev musl-tools

# x86_64-linux-musl-gcc
wget https://musl.cc/x86_64-linux-musl-cross.tgz
tar -xf x86_64-linux-musl-cross.tgz
mv x86_64-linux-musl-cross /opt/x86_64-linux-musl
export PATH="$PATH:/opt/x86_64-linux-musl/bin"

# aarch64-linux-musl-gcc
wget https://musl.cc/aarch64-linux-musl-cross.tgz
tar -xf aarch64-linux-musl-cross.tgz
mv aarch64-linux-musl-cross /opt/aarch64-linux-musl
export PATH="$PATH:/opt/aarch64-linux-musl/bin"

2. Cargo Dependencies

[dependencies]
libmagic_rs = { git = "https://github.com/kulukami/libmagic_rs.git", branch = 'main' }

Ideas from

https://github.com/microsoft/vcpkg/tree/master/ports/libmagic
https://github.com/robo9k/rust-magic-sys
https://github.com/Nemirtingas/windowscross_vcpkg

libmagic_rs's People

Contributors

kulukami avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.