Compare commits

...

5 Commits

Author SHA1 Message Date
5c2f7a4c5f feat(piper): added build 2024-06-14 13:31:47 +02:00
eca441355d feat(libratbag): added build 2024-06-14 13:31:42 +02:00
89db2b3155 refactor: using more advanced scripts for more customization 2024-02-12 17:22:57 +01:00
8dc7cad562 feat(i3lock): added build 2024-02-12 13:39:54 +01:00
ec2526068c feat(rio): removed as unused 2024-02-12 13:39:45 +01:00
14 changed files with 205 additions and 56 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
tmp/

View File

@@ -1,23 +0,0 @@
# Rio is a terminal writted in Rust
FROM ubuntu:20.04
WORKDIR /build/rio
ENV PATH="/root/.cargo/bin:${PATH}"
ENV DEBIAN_FRONTEND=noninteractive
# Install deps
RUN apt update -y \
&& apt upgrade -y \
&& apt install -y git curl cmake pkg-config libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev libxkbcommon-dev python3
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN rustup override set stable \
&& rustup update stable
# Clone repo
RUN git clone https://github.com/raphamorim/rio.git /build/rio
# Build
RUN cargo build --release --no-default-features --features=x11
CMD ["sleep", "infinity"]

View File

@@ -1,4 +0,0 @@
docker build -f build-rio.dockerfile --no-cache -t build-rio:latest .
docker run -d --name build-rio build-rio:latest
docker cp build-rio:/build/rio/target/release/rio ~/bin/rio
docker remove -f build-rio

View File

@@ -1,21 +0,0 @@
# step 1: create a container for ugrep named "ugrep"
# docker -D build --no-cache -t ugrep .
#
# step 2: run bash in the container, e.g. to run ugrep from the command line
# docker run -it ugrep bash
#
# step 3: run ugrep in the container, for example:
# ugrep -r -n -tjava Hello ugrep/tests/
FROM ubuntu:20.04
WORKDIR /build/ugrep
RUN apt-get update \
&& apt-get install -y make vim git clang wget unzip libpcre2-dev libz-dev libbz2-dev liblzma-dev liblz4-dev libzstd-dev
RUN git clone https://github.com/Genivia/ugrep /build/ugrep
RUN ./build.sh
CMD ["sleep", "infinity"]

View File

@@ -1,8 +0,0 @@
docker build -f build-ugrep.dockerfile --no-cache -t build-ugrep:latest .
docker run -d --name build-ugrep build-ugrep:latest
docker cp build-ugrep:/build/ugrep/bin/ugrep ~/bin/ugrep
docker cp build-ugrep:/build/ugrep/bin/ug ~/bin/ug
sudo docker cp build-ugrep:/build/ugrep/patterns/. /usr/local/share/ugrep/patterns/
sudo docker cp build-ugrep:/build/ugrep/man/ugrep.1 /tmp/ugrep.1
sudo /usr/bin/install -c -m 644 /tmp/ugrep.1 '/usr/local/share/man/man1'
docker remove -f build-ugrep

View File

@@ -0,0 +1,14 @@
FROM ubuntu:20.04
WORKDIR /build/i3lock-color
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y git autoconf gcc make pkg-config libpam0g-dev libcairo2-dev libfontconfig1-dev libxcb-composite0-dev libev-dev libx11-xcb-dev libxcb-xkb-dev libxcb-xinerama0-dev libxcb-randr0-dev libxcb-image0-dev libxcb-util-dev libxcb-xrm-dev libxkbcommon-dev libxkbcommon-x11-dev libjpeg-dev
RUN git clone --depth=1 https://github.com/Raymo111/i3lock-color.git /build/i3lock-color
RUN ./build.sh
CMD ["sleep", "infinity"]

13
ubuntu20-04/i3lock/build.sh Executable file
View File

@@ -0,0 +1,13 @@
APP=i3lock
CONTAINER="build-${APP}"
ROOT="/build/${APP}-color"
IMAGE="${CONTAINER}:latest"
TARGET="~/bin"
docker build -t "${IMAGE}" "${APP}" || exit 1
docker run -d --name "${CONTAINER}" "${IMAGE}"
docker cp "${CONTAINER}:${ROOT}/build/i3lock" "${TARGET}/i3lock"
docker remove -f "${CONTAINER}"

View File

@@ -0,0 +1,19 @@
FROM ubuntu:20.04
WORKDIR /build/libratbag
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y build-essential git systemd check python3-dev python3-pip libudev-dev libevdev-dev libsystemd-dev libpcre3-dev swig libjson-glib-dev libunistring-dev
RUN pip3 install meson ninja evdev
RUN git clone --depth=1 https://github.com/libratbag/libratbag.git /build/libratbag
RUN meson setup builddir --prefix=/usr \
&& meson configure builddir -Ddocumentation=false
RUN ninja -C builddir
RUN ninja -C builddir install
CMD ["sleep", "infinity"]

25
ubuntu20-04/libratbag/build.sh Executable file
View File

@@ -0,0 +1,25 @@
APP=libratbag
CONTAINER="build-${APP}"
ROOT="/build/${APP}"
IMAGE="${CONTAINER}:latest"
TARGET="~/bin"
docker build -t "${IMAGE}" "${APP}" || exit 1
docker run -d --name "${CONTAINER}" "${IMAGE}"
sudo docker cp "${CONTAINER}:/usr/share/libratbag" "/usr/share/libratbag"
sudo docker cp "${CONTAINER}:${ROOT}/builddir/ratbagd" "/usr/sbin/ratbagd"
sudo docker cp "${CONTAINER}:${ROOT}/builddir/ratbagctl" "/usr/bin/ratbagctl"
sudo docker cp "${CONTAINER}:${ROOT}/ratbagd/ratbagd.8" "/usr/share/man/man8"
sudo docker cp "${CONTAINER}:${ROOT}/builddir/ratbagd.service" "/lib/systemd/system"
sudo docker cp "${CONTAINER}:${ROOT}/builddir/org.freedesktop.ratbag1.service" "/usr/share/dbus-1/system-services"
sudo docker cp "${CONTAINER}:${ROOT}/builddir/org.freedesktop.ratbag1.conf" "/usr/share/dbus-1/system.d"
sudo docker cp "${CONTAINER}:${ROOT}/builddir/ratbagctl.1" "/usr/share/man/man1"
docker remove -f "${CONTAINER}"
sudo systemctl daemon-reload
sudo systemctl reload dbus.service
sudo ln -s /lib/systemd/system/ratbagd.service /etc/systemd/system/ratbagd.service
sudo systemctl enable ratbagd.service

View File

@@ -0,0 +1,18 @@
FROM ubuntu:20.04
WORKDIR /build/piper
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y build-essential git python3-dev python3-pip python-gi-dev gettext libcairo2-dev gtk-update-icon-cache desktop-file-utils
RUN pip3 install meson ninja lxml evdev pycairo
RUN git clone --depth=1 https://github.com/libratbag/piper.git /build/piper
RUN meson setup builddir --prefix=/usr
RUN ninja -C builddir
RUN ninja -C builddir install
CMD ["sleep", "infinity"]

27
ubuntu20-04/piper/build.sh Executable file
View File

@@ -0,0 +1,27 @@
APP=piper
CONTAINER="build-${APP}"
ROOT="/build/${APP}"
IMAGE="${CONTAINER}:latest"
TARGET="~/bin"
docker build -t "${IMAGE}" "${APP}" || exit 1
docker run -d --name "${CONTAINER}" "${IMAGE}"
sudo mkdir -p /usr/lib/python3/dist-packages/piper
sudo docker cp "${CONTAINER}:/build/piper/piper" "/usr/lib/python3/dist-packages"
sudo docker cp "${CONTAINER}:${ROOT}/builddir/data/org.freedesktop.Piper.desktop" "/usr/share/applications"
sudo docker cp "${CONTAINER}:${ROOT}/builddir/data/org.freedesktop.Piper.appdata.xml" "/usr/share/metainfo"
sudo mkdir -p /usr/share/piper
sudo docker cp "${CONTAINER}:${ROOT}/builddir/data/piper.gresource" "/usr/share/piper"
sudo docker cp "${CONTAINER}:${ROOT}/builddir/data/piper.1" "/usr/share/man/man1"
sudo docker cp "${CONTAINER}:/build/piper/data/org.freedesktop.Piper.svg" "/usr/share/icons/hicolor/scalable/apps"
sudo docker cp "${CONTAINER}:/build/piper/data/org.freedesktop.Piper-symbolic.svg" "/usr/share/icons/hicolor/symbolic/apps"
sudo docker cp "${CONTAINER}:/build/piper/builddir/piper" "/usr/bin"
sudo docker cp "${CONTAINER}:${ROOT}/builddir/meson-private/python-3.8-installed.json" "/tmp"
docker remove -f "${CONTAINER}"
sudo gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor
sudo update-desktop-database -q /usr/share/applications
sudo python3 "${APP}/pycompile.py" /tmp/python-3.8-installed.json 0

View File

@@ -0,0 +1,59 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2016 The Meson development team
# ignore all lints for this file, since it is run by python2 as well
# type: ignore
# pylint: disable=deprecated-module
import json, os, subprocess, sys
from compileall import compile_file
custom_env = {
"MESON_INSTALL_DESTDIR_PY_PURELIB": '/usr/lib/python3/dist-packages/piper',
"MESON_INSTALL_PY_PURELIB": '/usr/lib/python3/dist-packages/piper',
}
quiet = int(os.environ.get('MESON_INSTALL_QUIET', 0))
def compileall(files):
for f in files:
# f is prefixed by {py_xxxxlib}, both variants are 12 chars
# the key is the middle 10 chars of the prefix
key = f[1:11].upper()
f = f[12:]
ddir = None
fullpath = absf = custom_env['MESON_INSTALL_DESTDIR_'+key] + f
f = custom_env['MESON_INSTALL_'+key] + f
if absf != f:
ddir = os.path.dirname(f)
if os.path.isdir(absf):
for root, _, files in os.walk(absf):
if ddir is not None:
ddir = root.replace(absf, f, 1)
for dirf in files:
if dirf.endswith('.py'):
fullpath = os.path.join(root, dirf)
compile_file(fullpath, ddir, force=True, quiet=quiet)
else:
compile_file(fullpath, ddir, force=True, quiet=quiet)
def run(manifest):
data_file = os.path.join(os.path.dirname(__file__), manifest)
with open(data_file, 'rb') as f:
dat = json.load(f)
compileall(dat)
if __name__ == '__main__':
manifest = sys.argv[1]
run(manifest)
if len(sys.argv) > 2:
optlevel = int(sys.argv[2])
# python2 only needs one or the other
if optlevel == 1 or (sys.version_info >= (3,) and optlevel > 0):
subprocess.check_call([sys.executable, '-O'] + sys.argv[:2])
if optlevel == 2:
subprocess.check_call([sys.executable, '-OO'] + sys.argv[:2])

View File

@@ -0,0 +1,12 @@
FROM ubuntu:20.04
WORKDIR /build/ugrep
RUN apt-get update \
&& apt-get install -y make vim git clang wget unzip libpcre2-dev libz-dev libbz2-dev liblzma-dev liblz4-dev libzstd-dev
RUN git clone --depth=1 https://github.com/Genivia/ugrep /build/ugrep
RUN ./build.sh
CMD ["sleep", "infinity"]

17
ubuntu20-04/ugrep/build.sh Executable file
View File

@@ -0,0 +1,17 @@
APP=ugrep
CONTAINER="build-${APP}"
ROOT="/build/${APP}"
IMAGE="${CONTAINER}:latest"
TARGET="~/bin"
docker build -t "${IMAGE}" "${APP}" || exit 1
docker run -d --name "${CONTAINER}" "${IMAGE}"
docker cp "${CONTAINER}:${ROOT}/bin/ugrep" "${TARGET}/ugrep"
docker cp "${CONTAINER}:${ROOT}/bin/ug" "${TARGET}/ug"
sudo docker cp "${CONTAINER}:${ROOT}/patterns/." /usr/local/share/ugrep/patterns/
sudo docker cp "${CONTAINER}:${ROOT}/man/ugrep.1" /tmp/ugrep.1
sudo /usr/bin/install -c -m 644 /tmp/ugrep.1 '/usr/local/share/man/man1'
docker remove -f "${CONTAINER}"