Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add libxslt package #132

Merged
merged 1 commit into from
Oct 19, 2024
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/libxslt/brioche.lock

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

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

export const project = {
name: "libxslt",
version: "1.1.42",
};

const source = Brioche.download(
`https://download.gnome.org/sources/libxslt/1.1/libxslt-${project.version}.tar.xz`,
)
.unarchive("tar", "xz")
.peel();

export default function (): std.Recipe<std.Directory> {
let libxslt = std.runBash`
./configure --prefix=/
make
make install DESTDIR="$BRIOCHE_OUTPUT"
`
.workDir(source)
.dependencies(std.toolchain(), python(), libxml2())
.toDirectory();

libxslt = makePkgConfigPathsRelative(libxslt);

libxslt = std.setEnv(libxslt, {
CPATH: { append: [{ path: "include" }] },
LIBRARY_PATH: { append: [{ path: "lib" }] },
PKG_CONFIG_PATH: { append: [{ path: "lib/pkgconfig" }] },
});

return libxslt;
}

// TODO: Figure out where to move this, this is copied from `std`
function makePkgConfigPathsRelative(
recipe: std.AsyncRecipe<std.Directory>,
): std.Recipe<std.Directory> {
// Replaces things that look like absolute paths in pkg-config files with
// relative paths (using the `${pcfiledir}` variable)
return std.runBash`
find "$BRIOCHE_OUTPUT"/lib/pkgconfig -name '*.pc' -type f -print0 \
| while IFS= read -r -d $'\\0' file; do
sed -i 's|=/|=\${pcfiledir}/../../|' "$file"
done
`
.outputScaffold(recipe)
.toDirectory();
}