Skip to content

Commit e3d4712

Browse files
authored
feat(libvpx): add package (#1469)
* feat(libvpx): add package Signed-off-by: Jérémy Audiger <[email protected]> * fix(libvpx): add nasm as build dependency Signed-off-by: Jérémy Audiger <[email protected]> --------- Signed-off-by: Jérémy Audiger <[email protected]>
1 parent b6204dd commit e3d4712

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

packages/libvpx/brioche.lock

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/libvpx/project.bri

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import * as std from "std";
2+
import nasm from "nasm";
3+
4+
export const project = {
5+
name: "libvpx",
6+
version: "1.15.2",
7+
repository: "https://github.com/webmproject/libvpx",
8+
};
9+
10+
const source = Brioche.download(
11+
`${project.repository}/archive/refs/tags/v${project.version}.tar.gz`,
12+
)
13+
.unarchive("tar", "gzip")
14+
.peel();
15+
16+
export default function libvpx(): std.Recipe<std.Directory> {
17+
// Set `prefix` to '//', otherwise we get a configure error
18+
// Since the script strips the first '/'
19+
return std.runBash`
20+
./configure \
21+
--prefix=// \
22+
--disable-examples \
23+
--disable-unit-tests \
24+
--enable-pic \
25+
--enable-runtime-cpu-detect \
26+
--enable-shared \
27+
--enable-vp9-highbitdepth
28+
make -j "$(nproc)"
29+
make install DESTDIR="$BRIOCHE_OUTPUT"
30+
`
31+
.workDir(source)
32+
.dependencies(std.toolchain, nasm)
33+
.toDirectory()
34+
.pipe(std.pkgConfigMakePathsRelative, (recipe) =>
35+
std.setEnv(recipe, {
36+
CPATH: { append: [{ path: "include" }] },
37+
LIBRARY_PATH: { append: [{ path: "lib" }] },
38+
PKG_CONFIG_PATH: { append: [{ path: "lib/pkgconfig" }] },
39+
}),
40+
);
41+
}
42+
43+
export async function test(): Promise<std.Recipe<std.File>> {
44+
const script = std.runBash`
45+
pkg-config --modversion vpx | tee "$BRIOCHE_OUTPUT"
46+
`
47+
.dependencies(std.toolchain, libvpx)
48+
.toFile();
49+
50+
const result = (await script.read()).trim();
51+
52+
// Check that the result contains the expected version
53+
const expected = project.version;
54+
std.assert(result === expected, `expected '${expected}', got '${result}'`);
55+
56+
return script;
57+
}
58+
59+
export function liveUpdate(): std.Recipe<std.Directory> {
60+
return std.liveUpdateFromGithubTags({
61+
project,
62+
matchTag: /^v(?<version>([\d]+)\.([\d]+)\.([\d]+))$/,
63+
});
64+
}

0 commit comments

Comments
 (0)