diff --git a/.gitignore b/.gitignore index 88cfbc6966ca5b745ac29414192dca6821c1d4d2..83990fd22bbb1a3c742c5d7258a95492387b18e6 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ fake/ config.log *\~ *.AppImage +appimage/ *.pro.user !*.inc !Cargo.lock diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..eba6d5f632354c966eb35aee27650aabf8ecf347 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM rust:1.73-bookworm +WORKDIR /usr/src/lektor +COPY . . +RUN apt update && apt -y install make libmpv-dev cmake clang clang-format manpages man-db qt6-base-dev qt6-declarative-dev qt6-multimedia-dev \ + && wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool && chmod +x appimagetool && mv appimagetool /bin/ \ + && wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-static-x86_64.AppImage -O linuxdeploy && chmod +x linuxdeploy && mv linuxdeploy /bin/ \ + && CXX=clang++ cargo build --release \ + && linuxdeploy --appdir appimage/Lkt --executable lkt --icon-file utils/desktop/lektor.png --desktop-file utils/desktop/lkt.desktop \ + && linuxdeploy --appdir appimage/Lektord --executable lektord --icon-file utils/desktop/lektor.png --desktop-file utils/desktop/lektord.desktop \ + && linuxdeploy --appdir appimage/Amadeus --executable lektord --icon-file utils/desktop/amadeus.png --desktop-file utils/desktop/amadeus.desktop \ + && appimagetool --comp xz appimage/Lkt && appimagetool --comp xz appimage/Lektord && appimagetool --comp xz appimage/Amadeus diff --git a/README.md b/README.md index 2ba6e9bae7cd9a6c9553d58198d117980bad844c..2fa6e51d7f6d4a1ff3bfa1f4c6287acb92dbe4be 100644 --- a/README.md +++ b/README.md @@ -139,10 +139,15 @@ To produce the zip file for windows users, from the target folder run the follow ## Building a lektord distribution for linux (AppImage) Note that it is preferable to build AppImages from the older system that you want to support, see -the [official website](https://appimage.org/). First you need the LinuxDeploy and AppImageTool -binaries. We will assume you are using an *x86_64* system. You can download it their repositories: +the [official website](https://appimage.org/). + +### Build on host system (ArchLinux) + +First you need the LinuxDeploy and AppImageTool binaries. We will assume you are using an *x86_64* +system. You can download it their repositories: - https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous - https://github.com/AppImage/AppImageKit/releases/tag/continuous + As an alternative you can use the following commands and add the `$HOME/.local/bin` folder to you path. wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage @@ -177,6 +182,30 @@ lektord repository as `$ROOT`. linuxdeploy --appdir Amadeus --executable lektord --icon-file $ROOT/utils/desktop/amadeus.png --desktop-file $ROOT/utils/desktop/amadeus.desktop appimagetool --comp xz --sign --sign-key $YOUR_SIGN_KEY Amadeus +### Build in a container (Docker/Podman) + +As an alternative you can run the docker which will use debian 12 (bookworm) to try to build an +AppImage which is compatible with as many systems as possible, note that with Qt6 we won't be able +to support systems that are too old. + +You can use docker (must be configured) or podman, with podman you don't need a root daemon and +privileges, it will run as your current user. In the latter case your container registry config file +`/etc/containers/registries.conf` must contains the following content: + + [registries.search] + registries = ['docker.io'] + +When everything is configured you can run the following commands, using either docker or podman: + + # Be sure that we have the target folder where the AppImages will be copied + mkdir -p appimage + + # Run Podman/Docker, "lbc" stands for Lektor Build Container + podman build --rm -v "$PWD/appimage":/usr/src/lektor/target/appimage -t lbc . + + # To clean up all the things left behind + podman system reset + --- # TODO List