diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..567609b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..87d0dac --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM quay.io/fedora/fedora-minimal +WORKDIR /usr/local/app + +RUN dnf install -y unzip cmake clang ninja-build libxcb-devel libX11-devel libXcursor-devel libXi-devel libXrandr-devel libjpeg-turbo mesa-libGL-devel fontconfig-devel && dnf clean all +# Suboptimal libs: +# - 'GL/glx.h' file not found: mesa-libGL-devel +# - 'fontconfig/fontconfig.h' file not found: fontconfig-dev + +RUN curl -o aseprite.zip -L https://github.com/aseprite/aseprite/releases/download/v1.3.16/Aseprite-v1.3.16.1-Source.zip \ + && mkdir aseprite \ + && unzip aseprite.zip -d aseprite \ + && rm aseprite.zip +RUN curl -o Skia-Linux-Release-x64.zip -L https://github.com/aseprite/skia/releases/download/m124-08a5439a6b/Skia-Linux-Release-x64.zip \ + && mkdir skia \ + && unzip Skia-Linux-Release-x64.zip -d skia \ + && rm Skia-Linux-Release-x64.zip + +COPY ./src/build.sh ./ + +ENTRYPOINT ["/usr/bin/bash","./build.sh"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..297ec4b --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# Aseprite-Docker + +Dockerfile & composer to build aseprite in a container + +## Building + +```bash +docker build -t aseprite-docker/linux-x86:dev . +``` + +## Running & building + +```bash +docker compose up +``` + +Build output is written to `./build/bin` on the host or `/usr/local/app/aseprite/build/bin` on the container + +## Running without building + +```bash +docker run --rm -it --entrypoint /usr/bin/bash -v ./build:/usr/local/app/aseprite/build aseprite-docker/linux-x64:dev +# you can still start the build by running './build.sh' +``` + +## Troubleshooting + +- If the files are not written to the host after / during the build, try deleting `./build` diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..0eba45a --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,8 @@ +services: + aseprite-docker: + image: aseprite-docker/linux-x64:dev + restart: no + build: + context: . + volumes: + - ./build:/usr/local/app/aseprite/build diff --git a/src/build.sh b/src/build.sh new file mode 100755 index 0000000..e7a97f4 --- /dev/null +++ b/src/build.sh @@ -0,0 +1,24 @@ +# Instructions from https://github.com/aseprite/aseprite/blob/main/INSTALL.md +# Changes: +# - replaced ninja with $NINJA_PATH +# - replaced $HOME with $SKIA_HOME + +cd aseprite +mkdir build +cd build +export CC=clang +export CXX=clang++ +export SKIA_HOME=/usr/local/app/skia +export NINJA_PATH=/usr/lib/ninja-build/bin/ninja +export CMAKE_PREFIX_PATH=/usr/include; +cmake \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_CXX_FLAGS:STRING=-stdlib=libstdc++ \ + -DCMAKE_EXE_LINKER_FLAGS:STRING=-stdlib=libstdc++ \ + -DLAF_BACKEND=skia \ + -DSKIA_DIR=$SKIA_HOME/ \ + -DSKIA_LIBRARY_DIR=$SKIA_HOME/out/Release-x64 \ + -DSKIA_LIBRARY=$SKIA_HOME/out/Release-x64/libskia.a \ + -G Ninja \ + .. +ninja aseprite