diff --git a/.gitignore b/.gitignore index 2a64eee33..803d9375b 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,7 @@ debian/files *.debhelper obj-x86_64-linux-gnu + +# Docker build +/build +/build-output diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..1503d41d4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +FROM linuxmintd/mint21-amd64 + +WORKDIR /src + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update + +RUN apt-get install -y --no-install-recommends \ + build-essential \ + meson ninja-build pkg-config \ + python3 python3-gi \ + gobject-introspection \ + gtk-doc-tools \ + intltool itstool \ + libatk1.0-dev \ + libcinnamon-desktop-dev \ + libexempi-dev \ + libexif-dev \ + libgail-3-dev \ + libgirepository1.0-dev \ + libglib2.0-dev \ + libgsf-1-dev \ + libgtk-3-dev \ + libgtk-layer-shell-dev \ + libjson-glib-dev \ + libpango1.0-dev \ + libx11-dev \ + libxapp-dev \ + libxext-dev \ + libxrender-dev \ + libwayland-dev \ + && rm -rf /var/lib/apt/lists/* diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..fcec21203 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +.PHONY: build + +# Variables +# ============================================================================= +VAR_DOCKER_EXE := docker compose +VAR_COMPOSE_FILE := docker-compose.yml +# ============================================================================= + + +# Helpers +# ============================================================================= +ARGS ?= $(filter-out $@,$(MAKECMDGOALS)) +DOCKER := $(VAR_DOCKER_EXE) -f $(VAR_COMPOSE_FILE) +# ============================================================================= + + +# Core Commands +# ============================================================================= + +build: + $(DOCKER) run --rm build + +fix_permissions: + sudo chown -R $(USER) ./build + sudo chown -R $(USER) ./build-output + +install: + sudo killall nemo-desktop nemo 2>/dev/null || true + sleep 1 + sudo cp -rf build-output/nemo /usr/bin/nemo + sudo cp -rf build-output/nemo-desktop /usr/bin/nemo-desktop + sudo cp -rf build-output/nemo-autorun-software /usr/bin/nemo-autorun-software + sudo cp -rf build-output/nemo-connect-server /usr/bin/nemo-connect-server + sudo cp -rf build-output/nemo-open-with /usr/bin/nemo-open-with + sudo cp -rf build-output/nemo-extensions-list /usr/lib/x86_64-linux-gnu/nemo/nemo-extensions-list + sudo cp -rf libnemo-private/org.nemo.gschema.xml /usr/share/glib-2.0/schemas/ + sudo glib-compile-schemas /usr/share/glib-2.0/schemas/ + +run_build: + pkill nemo; sleep 1; build-output/nemo + +# ============================================================================= diff --git a/README.md b/README.md index 6cbdc97ca..19db2911c 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,24 @@ Nemo v1.0.0 had the following features as described by the developers: 9. Full navigation options (back, forward, up, refresh) 10. Ability to toggle between the path entry and the path breadcrumb widgets 11. Many more configuration options + +Build from source +==== +The easiest way to build Nemo is with +[Docker](https://docs.docker.com/get-docker/) +and +[Docker Compose](https://docs.docker.com/compose/install/). + +```bash +make build +``` + +Compiled output is written to `./build-output/`. + +> **Note:** Because the build runs inside a Docker container, +the `./build-output/` and `./build/` directories and their +contents will be owned by `root`. To restore ownership to your +user, run: +> ```bash +> make fix_permissions +> ``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..a9f2404c6 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +services: + build: + build: + dockerfile: Dockerfile + context: . + volumes: + - .:/src + - ./build-output:/src/build/src + command: bash -c "rm -rf /src/build/src/* && meson setup build --prefix=/usr && ninja -C build"