package oui
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
A tool that builds standalone installers for your OCaml applications
Install
dune-project
Dependency
Authors
Maintainers
Sources
oui-0.1.0.tbz
sha256=b806a63c9acd581a00729a48f1faf86b294cc82936fc705fc628a20ede33f977
sha512=e61c35a6e08671634c1edabd7b0add926ac6e0c6c43c9e0a095e89efab7696b6ae5cc1ea0844283a80640c19adb36478bdfb2414bbcab5077ceb7fd16ae45e66
doc/src/oui.lib/otool.ml.html
Source file otool.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56(**************************************************************************) (* *) (* Copyright 2025 OCamlPro *) (* *) (* All rights reserved. This file is distributed under the terms of the *) (* GNU Lesser General Public License version 2.1, with the special *) (* exception on linking described in the file LICENSE. *) (* *) (**************************************************************************) let parse_dylib_line line = match String.trim line |> String.split_on_char ' ' with | dylib_path :: _ when dylib_path <> "" -> let name = Filename.basename dylib_path in Some (name, dylib_path) | _ -> None let filter_system_libs path = not (String.starts_with ~prefix:"/usr/lib/" path) && not (String.starts_with ~prefix:"/System/" path) && not (String.starts_with ~prefix:"@" path) let should_embed (name, path) = (* Those are hardcoded for now but we should ultimately make this configurable by the user. *) filter_system_libs path && match String.split_on_char '.' name with | "libSystem"::_ -> false | _ -> true let get_dylib_paths binary = let path = OpamFilename.to_string binary in let output = System.call Otool path in (* Validate output format: first line should be the binary path with colon *) let dylib_lines = match output with | first_line :: rest when OpamStd.String.contains ~sub:path first_line -> rest | [line] when OpamStd.String.contains ~sub:path line -> [] | _ -> raise @@ System.System_error "otool raised an error. You probably chose a file with \ invalid format as your binary." in let dylibs = List.filter_map parse_dylib_line dylib_lines in let to_embed = List.filter should_embed dylibs in List.map snd to_embed let get_dylibs binary = let paths = get_dylib_paths binary in List.filter_map (fun dylib_path -> if Sys.file_exists dylib_path then Some (OpamFilename.of_string dylib_path) else None ) paths
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>