Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/libvpx/brioche.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions packages/libvpx/project.bri
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import * as std from "std";
import nasm from "nasm";

export const project = {
name: "libvpx",
version: "1.15.2",
repository: "https://github.com/webmproject/libvpx",
};

const source = Brioche.download(
`${project.repository}/archive/refs/tags/v${project.version}.tar.gz`,
)
.unarchive("tar", "gzip")
.peel();

export default function libvpx(): std.Recipe<std.Directory> {
// Set `prefix` to '//', otherwise we get a configure error
// Since the script strips the first '/'
return std.runBash`
./configure \
--prefix=// \
--disable-examples \
--disable-unit-tests \
--enable-pic \
--enable-runtime-cpu-detect \
--enable-shared \
--enable-vp9-highbitdepth
make -j "$(nproc)"
make install DESTDIR="$BRIOCHE_OUTPUT"
`
.workDir(source)
.dependencies(std.toolchain, nasm)
.toDirectory()
.pipe(std.pkgConfigMakePathsRelative, (recipe) =>
std.setEnv(recipe, {
CPATH: { append: [{ path: "include" }] },
LIBRARY_PATH: { append: [{ path: "lib" }] },
PKG_CONFIG_PATH: { append: [{ path: "lib/pkgconfig" }] },
}),
);
}

export async function test(): Promise<std.Recipe<std.File>> {
const script = std.runBash`
pkg-config --modversion vpx | tee "$BRIOCHE_OUTPUT"
`
.dependencies(std.toolchain, libvpx)
.toFile();

const result = (await script.read()).trim();

// Check that the result contains the expected version
const expected = project.version;
std.assert(result === expected, `expected '${expected}', got '${result}'`);

return script;
}

export function liveUpdate(): std.Recipe<std.Directory> {
return std.liveUpdateFromGithubTags({
project,
matchTag: /^v(?<version>([\d]+)\.([\d]+)\.([\d]+))$/,
});
}