Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update default spksrc image to Debian12 #6183

Merged
merged 13 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 40 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:bullseye
FROM debian:bookworm
LABEL description="Framework for maintaining and compiling native community packages for Synology devices"
LABEL maintainer="SynoCommunity <https://github.com/SynoCommunity/spksrc/graphs/contributors>"
LABEL url="https://synocommunity.com"
Expand All @@ -17,6 +17,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
automake \
autopoint \
bash \
bash-completion \
bc \
bison \
build-essential \
Expand Down Expand Up @@ -51,44 +52,61 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
libtool \
libunistring-dev \
lzip \
mercurial \
man-db \
manpages-dev \
mlocate \
moreutils \
ninja-build \
nasm \
patchelf \
php \
pkg-config \
python2 \
python3 \
python3-distutils \
rename \
ripgrep \
rsync \
ruby-mustache \
scons \
subversion \
sudo \
swig \
texinfo \
time \
tree \
unzip \
xmlto \
yasm \
zip \
zlib1g-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
adduser --disabled-password --gecos '' user && \
adduser user sudo && \
echo "%user ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/users
zlib1g-dev

# Python based apps
RUN apt-get update && apt-get install --no-install-recommends -y \
th0ma7 marked this conversation as resolved.
Show resolved Hide resolved
httpie \
mercurial \
meson \
ninja-build \
python3 \
python3-distutils \
python3-mako \
python3-pip \
python3-virtualenv \
python3-yaml

# Install setuptools, wheel and pip for Python2
RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py -O - | python2
# Install virtualenv and httpie for Python2
# Use pip2 as default pip -> python3
RUN pip2 install virtualenv httpie
# Install hg github tool
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \
apt update && \
apt install gh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as commented, gh is installable in debian-bookworm without additional prerequisites...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thnx, now fixed and using default debian repository.

But why should we have github command line tool?

I figured, when things goes sideways gh can be quite handy to play with your repository. Totally optionnal, agreed, but as our project entirely sits under github, and its nice to have it around once in a while, it doesn't cost too much, further as now part of default debian repository.

I must admit, that I didn't had to use it in a while as I have a strong preference on git. Although there may be something to do with it for future download options ... Unless you disagree I'd keep it included for now on?


# Install setuptools, wheel and pip for Python3
# Default pip -> python3 aware for native python wheels builds
RUN wget https://bootstrap.pypa.io/get-pip.py -O - | python3
# Install meson cross-platform build system
RUN pip3 install meson==1.0.0
# Clean-up apt db
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Update locate db
RUN updatedb

# Add user
RUN adduser --disabled-password --gecos '' user && \
adduser user sudo && \
echo "%user ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/users

# Volume pointing to spksrc sources
VOLUME /spksrc
Expand Down
70 changes: 20 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,21 @@ docker run -it --platform=linux/amd64 -v $(pwd):/spksrc -w /spksrc -e TAR_CMD="f


### Virtual machine
A virtual machine based on an 64-bit version of Debian 11 stable OS is recommended. Non-x86 architectures are not supported.
A virtual machine based on an 64-bit version of Debian 12 stable OS is recommended. Non-x86 architectures are not supported.

Install the requirements (in sync with `Dockerfile`):
```bash
sudo dpkg --add-architecture i386 && sudo apt-get update
sudo apt update
sudo apt install autoconf-archive autogen automake autopoint bash bc bison \
sudo apt install autoconf-archive autogen automake autopoint bash bash-completion bc bison \
build-essential check cmake curl cython3 debootstrap ed expect fakeroot flex \
g++-multilib gawk gettext git gperf imagemagick intltool jq libbz2-dev libc6-i386 \
libcppunit-dev libffi-dev libgc-dev libgmp3-dev libltdl-dev libmount-dev libncurses-dev \
libpcre3-dev libssl-dev libtool libunistring-dev lzip mercurial moreutils ninja-build \
patchelf php pkg-config python2 python3 python3-distutils rename ruby-mustache rsync scons subversion \
swig texinfo unzip xmlto zip zlib1g-dev
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py -O - | sudo python2
sudo pip2 install wheel httpie
wget https://bootstrap.pypa.io/get-pip.py -O - | sudo python3
sudo pip3 install meson==1.0.0
g++-multilib gawk gettext git gperf httpie imagemagick intltool jq libbz2-dev \
libc6-i386 libcppunit-dev libffi-dev libgc-dev libgmp3-dev libltdl-dev \
libmount-dev libncurses-dev libpcre3-dev libssl-dev libtool libunistring-dev \
lzip man-db manpages-dev mercurial meson mlocate moreutils nasm ninja-build \
patchelf php pkg-config python3 python3-distutils python3-mako python3-pip python3-virtualenv \
rename ripgrep ruby-mustache rsync scons subversion \
swig texinfo time tree unzip xmlto yasm zip zlib1g-dev
```
From there, follow the instructions in the [Developers HOW TO].

Expand All @@ -73,35 +71,23 @@ From there, follow the instructions in the [Developers HOW TO].


### LXC
A container based on 64-bit version of Debian 11 stable OS is recommended. Non-x86 architectures are not supported. The following assumes your LXD/LXC environment is already initiated (e.g. `lxc init`) and you have minimal LXD/LXC basic knowledge :
1. Create a new container (will use x86_64/amd64 arch by default): `lxc launch images:debian/11 spksrc`
A container based on 64-bit version of Debian 12 stable OS is recommended. Non-x86 architectures are not supported. The following assumes your LXD/LXC environment is already initiated (e.g. `lxc init`) and you have minimal LXD/LXC basic knowledge :
1. Create a new container (will use x86_64/amd64 arch by default): `lxc launch images:debian/12 spksrc`
2. Enable i386 arch: `lxc exec spksrc -- /usr/bin/dpkg --add-architecture i386`
3. Update apt channels: `lxc exec spksrc -- /usr/bin/apt update`
4. Install all required packages:
```bash
lxc exec spksrc -- /usr/bin/apt install autoconf-archive autogen automake autopoint bash bc bison \
build-essential check cmake curl cython3 debootstrap ed expect fakeroot flex \
g++-multilib gawk gettext git gperf imagemagick intltool jq libbz2-dev libc6-i386 \
libcppunit-dev libffi-dev libgc-dev libgmp3-dev libltdl-dev libmount-dev libncurses-dev \
libpcre3-dev libssl-dev libtool libunistring-dev lzip mercurial moreutils ninja-build \
patchelf php pkg-config python2 python3 python3-distutils rename rsync ruby-mustache scons subversion \
swig texinfo unzip xmlto zip zlib1g-dev
```
5. Install `python2` wheels:
```bash
lxc exec spksrc -- /bin/bash -c "wget https://bootstrap.pypa.io/pip/2.7/get-pip.py -O - | python2"
lxc exec spksrc -- /bin/bash -c "pip2 install virtualenv httpie"
```
6. Install `python3` `pip`:
```bash
lxc exec spksrc -- /bin/bash -c "wget https://bootstrap.pypa.io/get-pip.py -O - | python3"
```
7. Install `meson`:
```bash
lxc exec spksrc -- /bin/bash -c "pip3 install meson==1.0.0"
lxc exec spksrc -- /usr/bin/apt install autoconf-archive autogen automake autopoint bash bash-completion bc bison \
build-essential check cmake curl cython3 debootstrap ed expect fakeroot flex \
g++-multilib gawk gettext git gperf httpie imagemagick intltool jq libbz2-dev \
libc6-i386 libcppunit-dev libffi-dev libgc-dev libgmp3-dev libltdl-dev \
libmount-dev libncurses-dev libpcre3-dev libssl-dev libtool libunistring-dev \
lzip man-db manpages-dev mercurial meson mlocate moreutils nasm ninja-build \
patchelf php pkg-config python3 python3-distutils python3-mako python3-pip python3-virtualenv \
rename ripgrep ruby-mustache rsync scons subversion \
swig texinfo time tree unzip xmlto yasm zip zlib1g-dev
```


#### LXC: `spksrc` user
8. By default it is assumed that you will be running as `spksrc` user into the LXC container. Such user needs to be created into the default container image:
```bash
Expand All @@ -118,22 +104,6 @@ lxc exec spksrc -- su --login spksrc
spksrc@spksrc:~$
```

#### (OPTIONAL) Install misc base tools:
```bash
lxc exec spksrc -- /usr/bin/apt install bash-completion man-db manpages-dev \
mlocate ripgrep rsync tree time
lxc exec spksrc -- /usr/bin/updatedb
```
Install github client:
```
$ lxc exec spksrc -- su --login root
# curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
# echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
# sudo apt update
# sudo apt install gh
# exit
```

#### (OPTIONAL) LXC: Shared `spksrc` user
You can create a shared user between your Debian/Ubuntu host and the LXC Debian container which simplifies greatly file management between the two. The following assumes you already created a user `spksrc` with uid 1001 in your Debian/Ubuntu host environment and that you which to share its `/home` userspace.
1. Create a mapping rule between the hosts and the LXC image:
Expand Down
2 changes: 1 addition & 1 deletion cross/ffmpeg4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ CONFIGURE_ARGS += --arch=arm64 --enable-neon --enable-thumb
endif

ifeq ($(findstring $(ARCH),$(PPC_ARCHS)),$(ARCH))
CONFIGURE_ARGS += --extra-libs=-latomic
CONFIGURE_ARGS += --arch=ppc
ifeq ($(findstring $(ARCH),qoriq),$(ARCH))
CONFIGURE_ARGS += --cpu=e500v2
CONFIGURE_ARGS += --extra-libs=-latomic
else
CONFIGURE_ARGS += --cpu=e500 --disable-altivec
endif
Expand Down
2 changes: 1 addition & 1 deletion cross/ffmpeg5/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ CONFIGURE_ARGS += --arch=arm64 --enable-neon --enable-thumb
endif

ifeq ($(findstring $(ARCH),$(PPC_ARCHS)),$(ARCH))
CONFIGURE_ARGS += --extra-libs=-latomic
CONFIGURE_ARGS += --arch=ppc
ifeq ($(findstring $(ARCH),qoriq),$(ARCH))
CONFIGURE_ARGS += --cpu=e500v2
CONFIGURE_ARGS += --extra-libs=-latomic
else
CONFIGURE_ARGS += --cpu=e500 --disable-altivec
endif
Expand Down
2 changes: 1 addition & 1 deletion cross/ffmpeg6/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ CONFIGURE_ARGS += --arch=arm64 --enable-neon --enable-thumb
endif

ifeq ($(findstring $(ARCH),$(PPC_ARCHS)),$(ARCH))
CONFIGURE_ARGS += --extra-libs=-latomic
CONFIGURE_ARGS += --arch=ppc
ifeq ($(findstring $(ARCH),qoriq),$(ARCH))
CONFIGURE_ARGS += --cpu=e500v2
CONFIGURE_ARGS += --extra-libs=-latomic
else
CONFIGURE_ARGS += --cpu=e500 --disable-altivec
endif
Expand Down