diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2025-01-05 22:18:07 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2025-01-05 22:18:07 -0300 |
| commit | 377751136d817b68b58f5cbfcbe5f29d639d0cb8 (patch) | |
| tree | b6525e861d74c2ad01b9f37b784ace22edbe836a | |
| parent | 885ea63d6471cf62463e33bd9997a7644ec701ed (diff) | |
| download | luarocks-docs-folder.tar.gz luarocks-docs-folder.tar.bz2 luarocks-docs-folder.zip | |
docs: some copyeditingdocs-folder
| -rw-r--r-- | docs/creating_a_rock.md | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/docs/creating_a_rock.md b/docs/creating_a_rock.md index e93505ac..07de5ca5 100644 --- a/docs/creating_a_rock.md +++ b/docs/creating_a_rock.md | |||
| @@ -126,7 +126,7 @@ won't be compiled. | |||
| 126 | 126 | ||
| 127 | You can specify that your code depends on other rocks, so you can use modules | 127 | You can specify that your code depends on other rocks, so you can use modules |
| 128 | from other rocks in your code and have them be automatically downloaded and | 128 | from other rocks in your code and have them be automatically downloaded and |
| 129 | installed when a user installs your rock. | 129 | installed when a user installs your rock. |
| 130 | 130 | ||
| 131 | Suppose we need the modules from the "luaknife" rock, in order to cut our | 131 | Suppose we need the modules from the "luaknife" rock, in order to cut our |
| 132 | fruits. But we need version later than 2.3 of luaknife, because we're using | 132 | fruits. But we need version later than 2.3 of luaknife, because we're using |
| @@ -212,7 +212,7 @@ sources are in the current directory as well. | |||
| 212 | 212 | ||
| 213 | In the build section you can include arbitrary files through the | 213 | In the build section you can include arbitrary files through the |
| 214 | "copy_directories" table. In this table you can list directories in your rock | 214 | "copy_directories" table. In this table you can list directories in your rock |
| 215 | that will be copied to the target rocktree during installation. | 215 | that will be copied to the target rocktree during installation. |
| 216 | 216 | ||
| 217 | ```lua | 217 | ```lua |
| 218 | copy_directories = { "doc", "test" } | 218 | copy_directories = { "doc", "test" } |
| @@ -422,17 +422,18 @@ site](https://luarocks.org/settings/api-keys). | |||
| 422 | 422 | ||
| 423 | ## Conclusion | 423 | ## Conclusion |
| 424 | 424 | ||
| 425 | And we're done -- by writing a simple rules file which simply describes which | 425 | And we're done! By writing a simple rules file which describe which |
| 426 | sources compose the project and which libraries they use, we actually achieved | 426 | sources compose the project and which libraries they use, we actually achieved |
| 427 | a lot behind the scenes: LuaRocks takes care of using the right compiler for | 427 | a lot behind the scenes. LuaRocks takes care of: |
| 428 | your platform (GCC? MSVC?), passing the right flags (-fpic? -shared? -bundle | ||
| 429 | -undefined dynamic_lookup?) and checking external dependencies (/usr/lib? | ||
| 430 | /usr/local/lib? Is it really there?). Getting all these little portability | ||
| 431 | details right is not always easy to do on hand-written Makefiles, so that's | ||
| 432 | why we recommend using LuaRocks's own build system whenever possible. There | ||
| 433 | are many other features of LuaRocks we haven't covered in this tutorial | ||
| 434 | (per-platform overrides, support for command-line scripts, etc.), but this | ||
| 435 | should get you started. | ||
| 436 | 428 | ||
| 429 | * using the right compiler for your platform (GCC? MSVC?) | ||
| 430 | * passing the right flags (`-fpic`? `-shared`? `-bundle -undefined dynamic_lookup`?) | ||
| 431 | * and checking external dependencies (`/usr/lib`? `/usr/local/lib`? Is it really there?). | ||
| 437 | 432 | ||
| 433 | Getting all these little portability details right is not always easy to do on | ||
| 434 | hand-written Makefiles, so that's why we recommend using LuaRocks's own build | ||
| 435 | system whenever possible. | ||
| 438 | 436 | ||
| 437 | There are many other features of LuaRocks we haven't covered in this tutorial | ||
| 438 | ([per-platform overrides](platform_overrides.md), support for command-line | ||
| 439 | scripts, etc.), but this should get you started. | ||
