Skip to content
Permalink
Browse files

Merge pull request #2455 from athairus/readme-fixes

Fixed build instructions in README.md, updated script help text
  • Loading branch information...
saagarjha committed May 19, 2019
2 parents 6ea359c + 03d1232 commit ab8a369be5696b1d6a4276f20d0640835ebfa45b
Showing with 33 additions and 13 deletions.
  1. +30 −10 README.md
  2. +3 −3 other/change_lib_dependencies.rb
@@ -33,10 +33,6 @@

## Building

IINA ships with pre-compiled dynamic libraries for convenience reasons. If you aren't planning on modifying these libraries, you can follow the instructions below to build IINA; otherwise, skip down to [Building mpv manually](#building-mpv-manually) and then run the steps here:

### Using the pre-compiled libraries

1. IINA uses [CocoaPods](https://cocoapods.org) for managing the installation of third-party libraries. If you don't already have it installed, here's how you can do so:

#### Using RubyGems
@@ -51,15 +47,21 @@ $ brew install cocoapods

2. Run `pod install` in project's root directory.

3. Open iina.xcworkspace in the [latest public version of Xcode](https://itunes.apple.com/us/app/xcode/id497799835). *IINA may not build if you use any other version.*
IINA ships with pre-compiled dynamic libraries for convenience reasons. If you aren't planning on modifying these libraries, you can follow the instructions below to build IINA; otherwise, skip down to [Building mpv manually](#building-mpv-manually):

### Using the pre-compiled libraries

1. Open iina.xcworkspace in the [latest public version of Xcode](https://itunes.apple.com/us/app/xcode/id497799835). *IINA may not build if you use any other version.*

2. Build the project.

### Building mpv manually

1. Build your own copy of mpv. If you're using a package manager to manage dependencies, the steps below outline the process.

#### Homebrew

Use our tap, since passes the correct flags during configuration:
Use our tap as it passes in the correct flags to mpv's configure script:

```console
$ brew tap iina/homebrew-mpv-iina
@@ -68,19 +70,37 @@ $ brew install mpv-iina

#### MacPorts

Pass in the flags when installing:
Pass in these flags when installing:

```console
# port install mpv +uchardet -bundle -rubberband configure.args="--enable-libmpv-shared --enable-lua --enable-libarchive --enable-libbluray --disable-swift --disable-rubberband"
```

2. Copy latest [header files](https://github.com/mpv-player/mpv/tree/master/libmpv) into `libmpv/include/mpv/`.
2. Copy the latest [header files from mpv](https://github.com/mpv-player/mpv/tree/master/libmpv) (\*.h) into `deps/include/mpv/`.

3. Run `other/parse_doc.rb`. This script will fetch the latest mpv documentation and generate `MPVOption.swift`, `MPVCommand.swift` and `MPVProperty.swift`. This is only needed when updating libmpv. Note that if the API changes, the player source code may also need to be changed.

4. Run `other/change_lib_dependencies.rb`. This script will deploy the depended libraries into `libmpv/libs`. Once this is finished, go to Xcode and delete all of the dylibs from the Frameworks group in the sidebar and drag in your own from `libmpv/libs`; do the same in the "Embedded Binaries" section of the iina target.
4. Run `other/change_lib_dependencies.rb`. This script will deploy the dependent libraries into `deps/libs`. If you're using a package manager to manage dependencies, invoke it like so:

#### Homebrew

```console
$ other/change_lib_dependencies.rb "$(brew --prefix)" "$(brew --prefix mpv-iina)/lib/libmpv.dylib"
```

#### MacPorts

```console
$ port contents mpv | grep '\.dylib$' | xargs other/change_lib_dependencies.rb /opt/local
```

5. Open iina.xcworkspace in the [latest public version of Xcode](https://itunes.apple.com/us/app/xcode/id497799835). *IINA may not build if you use any other version.*

6. Remove all of references to .dylib files from the Frameworks group in the sidebar and drag all the .dylib files in `deps/libs` to that group.

7. Drag all the .dylib files in `deps/libs` into the "Embedded Binaries" section of the iina target.

5. Run a fresh build in Xcode.
8. Build the project.

## Contributing

@@ -58,10 +58,10 @@ def change_install_name!(old_name, new_name)
abort <<~END
Usage: change_lib_dependencies.rb prefix libraries...
If you're using Homebrew, your invokation might look like this:
$ ./change_lib_dependencies.rb "$(brew --prefix)" "$(brew --prefix mpv)/lib/*.dylib"
If you're using Homebrew, your invocation might look like this:
$ ./change_lib_dependencies.rb "$(brew --prefix)" "$(brew --prefix mpv-iina)/lib/libmpv.dylib"
If you're using MacPorts, your invokcation might look like this:
If you're using MacPorts, your invocation might look like this:
$ port contents mpv | grep '\.dylib$' | xargs ./change_lib_dependencies.rb /opt/local
END
end

0 comments on commit ab8a369

Please sign in to comment.
You can’t perform that action at this time.