|
| 1 | +# julec.hook {#julec-hook} |
| 2 | + |
| 3 | +[Jule](https://jule.dev) is an effective programming language designed to build efficient, fast, reliable and safe software while maintaining simplicity. |
| 4 | + |
| 5 | +In Nixpkgs, `jule.hook` overrides the default build, check and install phases. |
| 6 | + |
| 7 | +## Example code snippet {#julec-hook-example-code-snippet} |
| 8 | + |
| 9 | +```nix |
| 10 | +{ |
| 11 | + julec, |
| 12 | + clangStdenv, |
| 13 | +}: |
| 14 | +
|
| 15 | +clangStdenv.mkDerivation (finalAttrs: { |
| 16 | + # ... |
| 17 | +
|
| 18 | + nativeBuildInputs = [ julec.hook ]; |
| 19 | +
|
| 20 | + # Customize filenames if needed |
| 21 | + JULE_SRC_DIR = "./src"; |
| 22 | + JULE_OUT_DIR = "./bin"; |
| 23 | + JULE_OUT_NAME = "hello-jule"; |
| 24 | + JULE_TEST_DIR = "./tests"; |
| 25 | + JULE_TEST_OUT_DIR = "./test-bin"; |
| 26 | + JULE_TEST_OUT_NAME = "hello-jule-test"; |
| 27 | +
|
| 28 | + # ... |
| 29 | +}) |
| 30 | +``` |
| 31 | + |
| 32 | +## Variables controlling julec.hook {#julec-hook-variables} |
| 33 | + |
| 34 | +### `JULE_SRC_DIR` {#julec-hook-variable-jule-src-dir} |
| 35 | + |
| 36 | +Specifies the source directory containing `main.jule`. |
| 37 | +Default is `./src`. |
| 38 | + |
| 39 | +### `JULE_OUT_DIR` {#julec-hook-variable-jule-out-dir} |
| 40 | + |
| 41 | +Specifies the output directory for the compiled binary. |
| 42 | +Default is `./bin`. |
| 43 | + |
| 44 | +### `JULE_OUT_NAME` {#julec-hook-variable-jule-out-name} |
| 45 | + |
| 46 | +Specifies the name of the compiled binary. |
| 47 | +Default is `output`. |
| 48 | + |
| 49 | +### `JULE_TEST_DIR` {#julec-hook-variable-jule-test-dir} |
| 50 | + |
| 51 | +Specifies the directory containing test files. |
| 52 | +Default is the value of [`JULE_SRC_DIR`](#julec-hook-variable-jule-src-dir). |
| 53 | + |
| 54 | +### `JULE_TEST_OUT_DIR` {#julec-hook-variable-jule-test-out-dir} |
| 55 | + |
| 56 | +Specifies the output directory for compiled test binaries. |
| 57 | +Default is the value of [`JULE_OUT_DIR`](#julec-hook-variable-jule-out-dir). |
| 58 | + |
| 59 | +### `JULE_TEST_OUT_NAME` {#julec-hook-variable-jule-test-out-name} |
| 60 | + |
| 61 | +Specifies the name of the compiled test binary. |
| 62 | +Default is the value of [`JULE_OUT_NAME`](#julec-hook-variable-jule-out-name) with `-test` suffix. |
| 63 | + |
| 64 | +### `dontUseJulecBuild` {#julec-hook-variable-dontusejulecbuild} |
| 65 | + |
| 66 | +When set to true, doesn't use the predefined `julecBuildHook`. |
| 67 | +Default is false. |
| 68 | + |
| 69 | +### `dontUseJulecCheck` {#julec-hook-variable-dontusejuleccheck} |
| 70 | + |
| 71 | +When set to true, doesn't use the predefined `julecCheckHook`. |
| 72 | +Default is false. |
| 73 | + |
| 74 | +### `dontUseJulecInstall` {#julec-hook-variable-dontusejulecinstall} |
| 75 | + |
| 76 | +When set to true, doesn't use the predefined `julecInstallHook`. |
| 77 | +Default is false. |
0 commit comments