diff --git a/.gitignore b/.gitignore index 9e8fef6c896e26021f1eeb4b109b6bc0e7ae9e2d..220942fa6c64690e5c133591ea9d6e4abe638088 100644 --- a/.gitignore +++ b/.gitignore @@ -1,22 +1,22 @@ -*.lock +# Folders target/ .build/ -.cache/ .build.*/ -bin/ -pkg/ -tmp/ -fake/ +.cache/ +.vscode/ +.ccls*/ + +# Files +.ccls +*.ccls +*.ycm_extra_conf.py +*.vimrc *.out *.o -config.log +*.log *\~ *.AppImage *.pro.user -!*.inc -!Cargo.lock -.vscode/ - *.sqlt *.zst *.ign @@ -27,13 +27,7 @@ config.log *.xz *.tar *.gz - -.ccls*/ .ycm_extra_conf.py -.ccls -*.ccls -*.ycm_extra_conf.py -*.vimrc cscope.files cscope.out tags diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ecb0685fb1b0b85cb911d3b79fe4beeeaf13419f..ec26849d03756a200d4aaba8addfedda20fe4fee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,22 +2,20 @@ Clone the [git repository](https://git.iiens.net/martin2018/lektor). Create a branch from master with the `git checkout -b dev-${pseudal}` command. Please, rebase regularly your branch on `master`. - Please, add your name in the workspace's [Cargo.toml](Cargo.toml) file. The format is -`First name 'Pseudal' FAMILY NAME <email>`. - -## License +`First-name 'Pseudal' FAMILY-NAME <email>`. -See [LICENSE]. +The lektor project uses [the MIT LICENSE](/LICENSE). ## Style and the code ### Rust -- Prefer to not use unsafe code. +- Prefer to not use unsafe code, but some times it should be done, try to test the thing! - Always place the used crates in the workspace's [Cargo.toml](Cargo.toml) file, or for platform specific things in the [lektor_utils](Lektor) crate and create a wrapper. All other crates must reuse crates defined in the workspace's file. +- Use clippy which helps a lot to find problems in your code, even if rustc didn't raise a warning. ### C/C++ code and style @@ -27,7 +25,7 @@ developping things in Rust. ### Scripts -Scripts goes to the [utils/scripts] folder. They must be written to be launched from the root of the +Scripts goes to the [script](/utils/scripts) folder. They must be written to be launched from the root of the project. Include the language used in the name of the script, for example: - `astyle.bash`: written in bash (bourn shell again) @@ -36,9 +34,9 @@ project. Include the language used in the name of the script, for example: Please, do not write scripts in too many different languages to reduce the number of dependencies. If you are using binaries in your scripts (like astyle or bc), include them in the binary -dependencies in the [README.md] file. Also note that `bash` and `sh` are two different shells and -things that work in `bash` might not work with `sh`. As `bash` usually provide `sh`, it is fine to -use the two shells in different scripts without increasing the dependency number. +dependencies in the [README](/README.md) file. Also note that `bash` and `sh` are two different +shells and things that work in `bash` might not work with `sh`. As `bash` usually provide `sh`, it +is fine to use the two shells in different scripts without increasing the dependency number. There is a strong possibility that your script will do similar things to what a script already in this repo do. In that case, please work on the existing script and enhance it with your changes. No @@ -46,8 +44,8 @@ need to duplicate things. ### Utilities -You can place utilities in the [utils] folder. When downloading or building tools not dirrectly -distributed with lektor this folder will be used. +You can place utilities in the [utils](/utils) folder. When downloading or building tools not +dirrectly distributed with lektor this folder will be used. See if we use [fontello](https://fontello.com/) to generate fonts with only the needed icons or if we continue to use the thing from `iced_aw`. Also, see if we can steel some ideas from @@ -65,5 +63,5 @@ the target OS if possible. (i.e., each commit should compile and pass tests) - Add tests relevant to the fixed bug or new feature. In general, add a way to test lektor -When adding new fetures or solving issues / bugs, please edit the [CHANGELOG.md] file at the -`# Next` section. This will help people know what has been done since the last version. +When adding new fetures or solving issues / bugs, please edit the [CHANGELOG](/CHANGELOG.md) file at +the `# Next` section. This will help people know what has been done since the last version. diff --git a/README.md b/README.md index 326de5f5033f0beff1de63f9de81be6805e590e1..9690eb9afbac541e716a1ad58738b0b4437bebbe 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@ A Karaoke player made to replace the old bash scripts on Sakura. +The lektord and related binaries and source code are under the MIT license. Please, refer to the +[CONTRIBUTING](/CONTRIBUTING.md) file for any contributions. + ## Table of content - [Building the player](#building-the-player) @@ -17,7 +20,6 @@ A Karaoke player made to replace the old bash scripts on Sakura. - [How to update the lektord database](#how-to-update-the-lektord-database) - [How to send commands to lektor](#how-to-send-commands-to-lektor) - [How to configure lektor](#how-to-configure-lektor) -- [Misc](#misc) ## Building the player @@ -30,17 +32,19 @@ A Karaoke player made to replace the old bash scripts on Sakura. - [Qt6](https://www.qt.io/) development library: QtCore, QtWidgets, QtOpenGL, QtOpenGLWidgets. To visualize dependencies of the rust part of lektor, you can call the script -`utils/scripts/print-cargo-deps.bash` from the workspaces. You will also need to have `dot` utility -from the `graphviz` package to be installed for that script to work. +[print-cargo-deps.bash](/utils/scripts/print-cargo-deps.bash) from the workspaces. You will also +need to have `dot` utility from the `graphviz` package to be installed for that script to work. ### Building instructions The manual way of installing and setting up lektor. We will suppose that cargo will place all the binaries inside the `target` folder and that you have all the libraries installed correctly. - cargo build --release - install -CD -m 0755 utils/scripts/kagary.py $HOME/.local/bin/kagary - cp target/release/{lektord,liblektor_c.so,lkt,amadeus} $HOME/.local/bin/ +```bash +cargo build --release +install -CD -m 0755 utils/scripts/kagary.py $HOME/.local/bin/kagary +cp target/release/{lektord,liblektor_c.so,lkt,amadeus} $HOME/.local/bin/ +``` To develop, you can use `cargo run --bin $BINARY` to run the desired binary without installing it. @@ -53,26 +57,32 @@ You can use podman (must be configured) or docker, with podman you don't need a privileges, it will run as your current user. In the former case your container registry config file `/etc/containers/registries.conf` must contains the following content: - [registries.search] - registries = ['docker.io'] +```ini +[registries.search] +registries = ['docker.io'] +``` When everything is configured you can run the following commands, using either docker or podman: - # AppImage build - podman build -t lektor_appimage -f Dockerfile.appimage - podman run -v $PWD/build:/build -v $PWD:/src lektor_appimage +```bash +# AppImage build +podman build -t lektor_appimage -f Dockerfile.appimage +podman run -v $PWD/build:/build -v $PWD:/src lektor_appimage - # Windows build - podman build -t lektor_windows -f Dockerfile.windows - podman run -v $PWD/build:/build -v $PWD:/src lektor_windows +# Windows build +podman build -t lektor_windows -f Dockerfile.windows +podman run -v $PWD/build:/build -v $PWD:/src lektor_windows +``` -> Note that the generated AppImages won't be signed, you can signed them by extracting them, and -> repacking them with you gpg key, here with Amadeus as an example. You will need to have downloaded -> the appimage utility. -> -> ./Amadeus-x86_64.AppImage --appimage-extract -> mv squashfs-root Amadeus -> appimagetool --comp xz --sign --sign-key $YOUR_SIGN_KEY Amadeus +Note that the generated AppImages won't be signed, you can signed them by extracting them, and +repacking them with you gpg key, here with Amadeus as an example. You will need to have downloaded +the appimage utility. + +```bash +./Amadeus-x86_64.AppImage --appimage-extract +mv squashfs-root Amadeus +appimagetool --comp xz --sign --sign-key $YOUR_SIGN_KEY Amadeus +``` ## How to use lektor @@ -120,13 +130,3 @@ configuration folder the lektord program will store its configuration in `lektor For `amadeus`, you can edit its configuration file in the settings section. -## Misc - -The lektord and related binaries and source code are under the MIT license. Please, refer to the -[CONTRIBUTING.md] file for any contributions. - -# TODO List - -- Finish Amadeus. - - Query state from lektord in a sensible way. -- Implements a kurisu server in lektord to be able to synchronize with other lektord instances.