<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.tagtraum</groupId>
        <artifactId>ffsampledsp</artifactId>
        <version>0.9.28</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <artifactId>ffsampledsp-i386-macos</artifactId>
    <packaging>dylib</packaging>
    <name>FFSampledSP Native Library macOS (32bit)</name>
    <description>Darwin 32bit binary library for FFSampledSP.</description>

    <dependencies>
        <dependency>
            <groupId>com.tagtraum</groupId>
            <artifactId>ffsampledsp-java</artifactId>
        </dependency>
        <dependency>
            <groupId>com.tagtraum</groupId>
            <artifactId>ffmpeg-${arch}-${host}</artifactId>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.tagtraum</groupId>
            <artifactId>ffmpeg</artifactId>
            <type>tar.bz2</type>
            <classifier>sources-${arch}-${host}</classifier>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <properties>
        <arch>i386</arch>
        <host>macos</host>
    </properties>

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.tagtraum</groupId>
                                    <artifactId>ffmpeg</artifactId>
                                    <version>${ffmpeg.version}</version>
                                    <type>tar.bz2</type>
                                    <classifier>sources-${arch}-${host}</classifier>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}/native/include</outputDirectory>
                                    <includes>**/*.h</includes>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>com.tagtraum</groupId>
                                    <artifactId>ffsampledsp-java</artifactId>
                                    <version>${project.version}</version>
                                    <type>jar</type>
                                    <classifier>sources</classifier>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}/native</outputDirectory>
                                    <includes>**/*.h</includes>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>native-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>

                    <compilerProvider>generic</compilerProvider>

                    <compilerStartOptions>
                        <compilerStartOption>${darwin.compiler.startoptions}</compilerStartOption>
                    </compilerStartOptions>

                    <javahOS>darwin</javahOS>
                    <jdkIncludePath>${darwin.headers.jni}</jdkIncludePath>

                    <sources>
                        <source>
                            <directory>../ffsampledsp-x86_64-macos/src/main/c</directory>
                            <includes>
                                <include>*.c</include>
                            </includes>
                        </source>
                        <!-- additional include path -->
                        <source>
                            <!-- FFmpeg headers -->
                            <directory>${project.build.directory}/native/include</directory>
                        </source>
                    </sources>

                    <linkerStartOptions>
                        <linkerStartOption>${darwin.linker.startoptions}</linkerStartOption>
                    </linkerStartOptions>

                    <linkerEndOptions>
                        <linkerEndOption>${darwin.linker.endoptions}</linkerEndOption>
                    </linkerEndOptions>
                </configuration>

            </plugin>
        </plugins>
    </build>
</project>