update for crates.io

This commit is contained in:
andelf
2014-11-26 18:04:07 +08:00
parent 30328d8aaa
commit 256bf8a45b
4 changed files with 31 additions and 790 deletions
+8 -4
View File
@@ -1,8 +1,12 @@
[package]
name = "sdl2_mixer"
version = "0.0.1"
authors = ["ShuYu Wang<andelf@gmail.com>"]
description = "SDL2_mixer bindings for Rust"
repository = "https://github.com/andelf/rust-sdl2_mixer"
version = "0.0.3"
license = "MIT"
authors = [ "ShuYu Wang <andelf@gmail.com>" ]
keywords = ["SDL", "windowing", "graphics", "music", "sound"]
[lib]
@@ -14,6 +18,6 @@ path = "src/sdl2_mixer/lib.rs"
name = "demo"
path = "src/demo/main.rs"
[dependencies.sdl2]
[dependencies]
git = "https://github.com/AngryLawyer/rust-sdl2"
sdl2 = "~0.0.3"
-700
View File
File diff suppressed because it is too large Load Diff
+23 -8
View File
@@ -1,19 +1,21 @@
Rust-SDL2_mixer
===============
# Rust-SDL2_mixer
[![Build Status](https://travis-ci.org/andelf/rust-sdl2_mixer.svg?branch=master)](https://travis-ci.org/andelf/rust-sdl2_mixer)
Rust bindings for SDL2_mixer.
## Installation
Requirements
------------
* [Rust-sdl2](https://github.com/AngryLawyer/rust-sdl2)
* sdl_mixer 2.0 development libraries
* Rust master
* Rust nightly
* Cargo nightly
Installation
------------
### normal
```
git clone https://github.com/andelf/rust-sdl2_mixer
@@ -22,8 +24,21 @@ cargo build
rustc --cfg mac_framework src/sdl2_mixer/lib.rs
```
Demo
----
### cargo
```
[dependencies]
sdl2_mixer = "$version-here$"
```
or
```
[dependencies.sdl2_mixer]
git = "https://github.com/andelf/rust-sdl2_mixer"
```
## Demo
```
cargo run /path/to/wav_file.wav
-78
View File
@@ -1,78 +0,0 @@
#!/bin/bash
# written by bvssvni
# Modify the setting to do conditional compilation.
# For example "--cfg my_feature"
SETTINGS=""
# ================================================
MAKE=make
if [ "$OS" == "Windows_NT" ]; then
MAKE=mingw32-make
fi
# Checks if an item exists in an array.
# Copied from http://stackoverflow.com/questions/3685970/check-if-an-array-contains-a-value
function contains() {
local n=$#
local value=${!n}
for ((i=1;i < $#;i++)) {
if [ "${!i}" == "${value}" ]; then
echo "y"
return 0
fi
}
echo "n"
return 1
}
# This is a counter used to insert dependencies.
# It is global because we need an array of all the
# visited dependencies.
i=0
function build_deps {
local current=$(pwd)
for symlib in $(find target/deps/ -type l) ; do
cd $current
echo $symlib
local original_file=$(readlink $symlib)
local original_dir=$(dirname $original_file)
cd $original_dir
# Go to the git root directory.
local current_git_dir=$(git rev-parse --show-toplevel)
echo "--- Parent $current"
echo "--- Child $current_git_dir"
cd $current_git_dir
# Skip building if it is already built.
if [ $(contains "${git_dir[@]}" $current_git_dir) == "y" ]; then
echo "--- Visited $current_git_dir"
continue
fi
# Remember git directory to not build it twice
git_dir[i]=$current_git_dir
let i+=1
# Visit the symlinks and build the dependencies
build_deps
# First check for a 'build.sh' script with default settings.
# Check for additional 'rust-empty.mk' file. # Compile with the settings flags. # If no other options, build with make.
( test -e build.sh && ./build.sh ) || ( test -e rust-empty.mk && $MAKE -f rust-empty.mk clean && $MAKE -f rust-empty.mk ) || ( echo "--- Building $current_git_dir" && $MAKE clean && $MAKE )
done
cd $current
}
# Mark main project as visited to avoid infinite loop.
git_dir[i]=$(pwd)
let i+=1
if [ "$1" == "deps" ]; then
build_deps
fi
echo "--- Building $(pwd)"
( test -e rust-empty.mk && $MAKE -f rust-empty.mk clean && $MAKE -f rust-empty.mk COMPILER_FLAGS+="$SETTINGS" ) || ( $MAKE clean
$MAKE COMPILER_FLAGS+="$SETTINGS"
)