initial commit

This commit is contained in:
2026-05-05 21:58:43 +03:00
commit 862b7abbac
79 changed files with 4132 additions and 0 deletions
+113
View File
@@ -0,0 +1,113 @@
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;35m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
#alias grep='grep --color=auto'
#alias fgrep='fgrep --color=auto'
#alias egrep='egrep --color=auto'
fi
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases
#alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
+140
View File
@@ -0,0 +1,140 @@
ARG image_from
FROM ${image_from}
ARG image_prepare_script
ARG JOBS_COUNT=4
ARG JOBS_QT_COUNT=2
ARG QT_FROM_SOURCE=1
ARG VERSION_ID=
# versions and environment
ENV CUR_CMAKE_VERSION=3.20.0
ENV CUR_SODIUM_VERSION=1.0.21
ENV CUR_FFTW_VERSION=3.3.10
ENV CUR_ASSIMP_VERSION=4.1.0
ENV CUR_DISCOUNT_VERSION=2.2.6
ENV CUR_MICROHTTPD_VERSION=1.0.2
ENV CUR_QT_VERSION_MAJOR=5.15
ENV CUR_QT_VERSION=5.15.9
ENV CUR_GOOGLETEST=v1.13.x
ENV QT_SELECT=5
ENV LANG=en_US.utf8
# configs
COPY .bashrc /root/.bashrc
COPY inputrc /etc/inputrc
RUN echo 'root:12345' | chpasswd
# prepare current distributive
COPY *.sh /soft/
RUN if [ -n "${VERSION_ID}" ]; then \
echo "VERSION_ID=\"${VERSION_ID}\"" >> /usr/lib/os-release; \
fi
RUN if [ -n "${image_prepare_script}" ]; then \
bash /soft/${image_prepare_script} ${QT_FROM_SOURCE}; \
fi
RUN rm /soft/*.sh -v
# last cmake from sources, into /opt
WORKDIR /soft
RUN wget -nv https://github.com/Kitware/CMake/releases/download/v${CUR_CMAKE_VERSION}/cmake-${CUR_CMAKE_VERSION}-Linux-x86_64.sh \
&& mkdir -p /opt/cmake \
&& bash ./cmake-${CUR_CMAKE_VERSION}-Linux-x86_64.sh --skip-license --prefix=/opt/cmake \
&& rm -rf /soft/cmake-${CUR_CMAKE_VERSION}-Linux-x86_64.sh
ENV PATH=/opt/cmake/bin:$PATH
# Remove invalid FindGtest.cmake
RUN cd "$(find /opt/cmake/share -name FindGTest.cmake -type f -printf '%h' -quit)" && rm FindGTest.cmake
# GTest
WORKDIR /soft
RUN git clone -b ${CUR_GOOGLETEST} https://github.com/google/googletest.git \
&& mkdir googletest/build && cd googletest/build \
&& cmake .. \
&& make -j${JOBS_COUNT} && make install && cd /soft && rm -rf googletest
# sodium
WORKDIR /soft
RUN curl -s https://download.libsodium.org/libsodium/releases/libsodium-${CUR_SODIUM_VERSION}.tar.gz \
-o libsodium-${CUR_SODIUM_VERSION}.tar.gz \
&& tar -xf libsodium-${CUR_SODIUM_VERSION}.tar.gz -C /soft \
&& rm -f libsodium-${CUR_SODIUM_VERSION}.tar.gz \
&& mkdir -p /soft/build/sodium && cd /soft/build/sodium \
&& sh -c 'CFLAGS="-O3 -fPIC" LDFLAGS="-O3 -fPIC" /soft/libsodium-*/configure --prefix=/usr/local/ && make install -j${JOBS_COUNT}' \
&& cd /soft && rm -rf /soft/build/sodium && rm -rf /soft/libsodium-*
# fftw3
WORKDIR /soft
RUN wget -nv http://www.fftw.org/fftw-${CUR_FFTW_VERSION}.tar.gz \
&& tar -xf fftw-${CUR_FFTW_VERSION}.tar.gz -C /soft \
&& rm -f fftw-${CUR_FFTW_VERSION}.tar.gz \
&& mkdir -p /soft/build/fftw3 && cd /soft/build/fftw3 \
&& cmake -DCMAKE_INSTALL_PREFIX=/usr/local/ -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_FLOAT=0 -DENABLE_LONG_DOUBLE=0 -DENABLE_QUAD_PRECISION=0 -DENABLE_THREADS=1 -DWITH_COMBINED_THREADS=1 /soft/fftw-* \
&& make install -j${JOBS_COUNT} && rm -rf ./* \
&& cmake -DCMAKE_INSTALL_PREFIX=/usr/local/ -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_FLOAT=1 -DENABLE_LONG_DOUBLE=0 -DENABLE_QUAD_PRECISION=0 -DENABLE_THREADS=1 -DWITH_COMBINED_THREADS=1 /soft/fftw-* \
&& make install -j${JOBS_COUNT} && rm -rf ./* \
&& cmake -DCMAKE_INSTALL_PREFIX=/usr/local/ -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_FLOAT=0 -DENABLE_LONG_DOUBLE=1 -DENABLE_QUAD_PRECISION=0 -DENABLE_THREADS=1 -DWITH_COMBINED_THREADS=1 /soft/fftw-* \
&& make install -j${JOBS_COUNT} && rm -rf ./* \
&& rm -rf /soft/fftw-*
# assimp
WORKDIR /soft
RUN wget -nv https://github.com/assimp/assimp/archive/v${CUR_ASSIMP_VERSION}.tar.gz \
&& tar -xf v${CUR_ASSIMP_VERSION}.tar.gz -C /soft \
&& rm -f v${CUR_ASSIMP_VERSION}.tar.gz pax_global_header \
&& mkdir -p /soft/build/assimp && cd /soft/build/assimp \
&& cmake -DCMAKE_INSTALL_PREFIX=/usr/local/ -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DASSIMP_BUILD_ASSIMP_TOOLS=0 -DASSIMP_BUILD_TESTS=0 -DBUILD_FRAMEWORK=0 /soft/assimp-* \
&& make install -j${JOBS_COUNT} && rm -rf ./* && rm -rf /soft/assimp-*
# markdown
WORKDIR /soft
RUN wget -nv https://github.com/Orc/discount/archive/v${CUR_DISCOUNT_VERSION}.tar.gz \
&& tar -xf v${CUR_DISCOUNT_VERSION}.tar.gz -C /soft \
&& rm -f v${CUR_DISCOUNT_VERSION}.tar.gz
RUN sed -i 's/DESTRUCTOR/ /' /soft/discount-${CUR_DISCOUNT_VERSION}/setup.c
WORKDIR /soft/discount-${CUR_DISCOUNT_VERSION}/cmake
COPY discount.cmake.patch /soft/discount-${CUR_DISCOUNT_VERSION}/cmake/cmake.patch
RUN patch < cmake.patch
WORKDIR /soft/linux/build/discount
RUN cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DDISCOUNT_ONLY_LIBRARY=1 /soft/discount-${CUR_DISCOUNT_VERSION}/cmake && make -j2 && mv mktags .. && rm -rf ./* \
&& mkdir -p /soft/build/discount && mv /soft/linux/build/mktags /soft/build/discount/mktags
WORKDIR /soft/build/discount
RUN cmake -DCMAKE_INSTALL_PREFIX=/usr/local/ -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DDISCOUNT_ONLY_LIBRARY=1 /soft/discount-*/cmake \
&& make install -j${JOBS_COUNT} && rm -rf ./* && rm -rf /soft/discount-*
# microhttpd
WORKDIR /soft/
RUN wget -nv https://mirror.tochlab.net/pub/gnu/libmicrohttpd/libmicrohttpd-${CUR_MICROHTTPD_VERSION}.tar.gz \
&& tar -xf /soft/libmicrohttpd-${CUR_MICROHTTPD_VERSION}.tar.gz -C /soft/ \
&& rm /soft/libmicrohttpd-${CUR_MICROHTTPD_VERSION}.tar.gz \
&& mkdir -p /soft/build/microhttpd && cd /soft/build/microhttpd \
&& sh -c 'CFLAGS="-O3 -fPIC" LDFLAGS="-O3 -fPIC" /soft/libmicrohttpd-${CUR_MICROHTTPD_VERSION}/configure --prefix=/usr/local/ --enable-shared=no --enable-static=yes && make install -j${JOBS_COUNT}' \
&& cd /soft && rm -rf /soft/build/microhttpd && rm -rf /soft/libmicrohttpd-*
# Qt
WORKDIR /soft
RUN if [ "${QT_FROM_SOURCE}" = "1" ]; then \
wget -nv http://qt-mirror.dannhauer.de/archive/qt/${CUR_QT_VERSION_MAJOR}/${CUR_QT_VERSION}/single/qt-everywhere-opensource-src-${CUR_QT_VERSION}.tar.xz \
&& tar xf qt-everywhere-opensource-src-${CUR_QT_VERSION}.tar.xz -C /soft \
&& rm -f qt-everywhere-opensource-src-${CUR_QT_VERSION}.tar.xz \
&& mkdir -p /soft/build/qt && cd /soft/build/qt \
&& /soft/qt-everywhere-src-${CUR_QT_VERSION}/configure -opensource -confirm-license -release -shared -no-pch -extprefix "/usr/local" \
-opengl desktop -qt-libpng -system-zlib -qt-pcre -make tools -nomake tests -nomake examples -no-compile-examples -skip qtwebengine \
-skip qtwebglplugin -skip doc -skip qt3d -skip qtactiveqt -skip qtquick3d -openssl-linked -xcb \
&& make -j${JOBS_QT_COUNT} && make install && rm -rf ./* && rm -rf /soft/qt-everywhere-src-*; \
fi
ENV BUILD_TYPE=Release
WORKDIR /soft
+38
View File
@@ -0,0 +1,38 @@
--- CMakeLists.txt 2019-04-15 18:28:20.000000000 +0300
+++ CMakeLists_new.txt 2020-03-16 10:46:52.288128600 +0300
@@ -20,6 +20,9 @@
set(${PROJECT_NAME}_ONLY_LIBRARY OFF CACHE BOOL
"Set to ON to only build markdown library (default is OFF)")
+set(${PROJECT_NAME}_CXX_BINDING OFF CACHE BOOL
+ "Set to ON to install header files with c++ wrappers (default is OFF)")
+
# Check headers
include(CheckIncludeFile)
check_include_file(libgen.h HAVE_LIBGEN_H)
@@ -110,6 +113,13 @@
configure_file("${_ROOT}/mkdio.h.in"
"${_ROOT}/mkdio.h"
@ONLY)
+if(${PROJECT_NAME}_CXX_BINDING)
+ message(STATUS "Applying c++ glue to mkdio.h")
+ file(READ "${_ROOT}/mkdio.h" _ROOT_MKDIO_H)
+ file(WRITE "${_ROOT}/mkdio.h" "#ifdef __cplusplus\nextern \"C\" {\n#endif\n")
+ file(APPEND "${_ROOT}/mkdio.h" "${_ROOT_MKDIO_H}")
+ file(APPEND "${_ROOT}/mkdio.h" "#ifdef __cplusplus\n}\n#endif\n")
+endif()
include_directories("${_ROOT}")
@@ -182,7 +192,10 @@
target_include_directories(libmarkdown INTERFACE
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
- set(_TARGETS libmarkdown markdown)
+ set(_TARGETS libmarkdown)
+ if(NOT ${PROJECT_NAME}_ONLY_LIBRARY)
+ list(APPEND _TARGETS markdown)
+ endif()
if(${PROJECT_NAME}_INSTALL_SAMPLES)
list(APPEND _TARGETS mkd2html makepage)
endif()
+67
View File
@@ -0,0 +1,67 @@
# /etc/inputrc - global inputrc for libreadline
# See readline(3readline) and `info rluserman' for more information.
# Be 8 bit clean.
set input-meta on
set output-meta on
# To allow the use of 8bit-characters like the german umlauts, uncomment
# the line below. However this makes the meta key not work as a meta key,
# which is annoying to those which don't need to type in 8-bit characters.
# set convert-meta off
# try to enable the application keypad when it is called. Some systems
# need this to enable the arrow keys.
# set enable-keypad on
# see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys
# do not bell on tab-completion
# set bell-style none
# set bell-style visible
# some defaults / modifications for the emacs mode
$if mode=emacs
# allow the use of the Home/End keys
"\e[1~": beginning-of-line
"\e[4~": end-of-line
# allow the use of the Delete/Insert keys
"\e[3~": delete-char
"\e[2~": quoted-insert
# mappings for "page up" and "page down" to step to the beginning/end
# of the history
# "\e[5~": beginning-of-history
# "\e[6~": end-of-history
# alternate mappings for "page up" and "page down" to search the history
"\e[5~": history-search-backward
"\e[6~": history-search-forward
# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word
$if term=rxvt
"\e[7~": beginning-of-line
"\e[8~": end-of-line
"\eOc": forward-word
"\eOd": backward-word
$endif
# for non RH/Debian xterm, can't hurt for RH/Debian xterm
# "\eOH": beginning-of-line
# "\eOF": end-of-line
# for freebsd console
# "\e[H": beginning-of-line
# "\e[F": end-of-line
$endif
+120
View File
@@ -0,0 +1,120 @@
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
find "/etc/apt/sources.list.d/" -type f -exec sed -i "s|http://[a-zA-Z0-9_.]\+/|http://mirror.yandex.ru/|g" {} \;
apt-get update
# locales
apt-get install -y locales
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
TZ=Europe/Moscow
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
echo $TZ > /etc/timezone
# base soft
apt-get install -y \
"^libxcb.*" \
bison \
ccache \
cpio \
curl \
debconf \
debhelper \
default-libmysqlclient-dev \
doxygen \
dpkg \
flex \
g++ \
git \
gperf \
graphviz \
htop \
iputils-ping \
libbz2-dev \
libffi-dev \
libfontconfig1-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libglew-dev \
libglu1-mesa-dev \
libgmp-dev \
libicu-dev \
libmpc-dev \
libmpfr-dev \
libncurses-dev \
libpkgconfig-perl \
libpq-dev \
libreadline-dev \
libssl-dev \
libusb-1.0-0-dev \
libwayland-dev \
libx11-dev \
libx11-xcb-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libxml2-dev \
libxrender-dev \
lsb-release \
mc \
md5deep \
nano \
net-tools \
ninja-build \
ocl-icd-opencl-dev \
p7zip-full \
patchelf \
python3 \
screen \
subversion \
unzip \
wget \
zip \
zlib1g-dev \
libhdf5-dev \
libcurl4-openssl-dev \
libpcsclite-dev
# install qt if not build it from source
if [[ -n "$1" && "$1" != "1" ]]; then
apt-get install -y \
qtbase5-dev-tools \
qtbase5-dev \
qttools5-dev \
qtscript5-dev \
qtdeclarative5-dev \
qtpositioning5-dev \
qtmultimedia5-dev \
libqt5datavisualization5-dev \
libqt5networkauth5-dev \
libqt5opengl5-dev \
qtscript5-dev \
libqt5serialport5-dev \
libqt5sensors5-dev \
libqt5svg5-dev \
libqt5websockets5-dev \
libqt5x11extras5-dev \
libqt5xmlpatterns5-dev \
libqt5charts5-dev \
qtbase5-private-dev \
qttools5-private-dev
fi
apt-get install -y qtconnectivity5-dev || true
apt-get install -y libqt5serialbus5-dev || true
apt-get install -y lzma-dev || true
apt-get install -y python3-future || true
apt-get install -y python3-click || true
apt-get install -y python3-cryptography || true
apt-get install -y python3-pip || true
apt-get install -y python3-pyelftools || true
apt-get install -y python3-pyparsing || true
apt-get install -y python3-serial || true
apt-get install -y python3-setuptools || true
apt-get install -y libopencv-dev
# cleanup
rm -rf /var/cache/apt/archives/*
+106
View File
@@ -0,0 +1,106 @@
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
find "/etc/apt/sources.list.d/" -type f -exec sed -i "s|http://[a-zA-Z0-9_.]\+/|http://mirror.yandex.ru/|g" {} \;
apt-get update
# locales
apt-get install -y locales
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
TZ=Europe/Moscow
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
echo $TZ > /etc/timezone
# base soft
apt-get install -y \
"^libxcb.*" \
bison \
ccache \
cpio \
curl \
debconf \
debhelper \
default-libmysqlclient-dev \
doxygen \
dpkg \
flex \
g++ \
git \
gperf \
graphviz \
htop \
iputils-ping \
libbz2-dev \
libffi-dev \
libfontconfig1-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libglew-dev \
libglu1-mesa-dev \
libgmp-dev \
libicu-dev \
libmpc-dev \
libmpfr-dev \
libncurses-dev \
libpkgconfig-perl \
libpq-dev \
libreadline-dev \
libssl-dev \
libusb-1.0-0-dev \
libwayland-dev \
libx11-dev \
libx11-xcb-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libxml2-dev \
libxrender-dev \
lsb-release \
mc \
md5deep \
nano \
net-tools \
ninja-build \
ocl-icd-opencl-dev \
p7zip-full \
patchelf \
python3 \
screen \
subversion \
unzip \
wget \
zip \
zlib1g-dev \
libhdf5-dev \
libcurl4-openssl-dev \
libpcsclite-dev
# install qt if not build it from source
if [[ -n "$1" && "$1" != "1" ]]; then
apt-get install -y \
qt6-tools-dev \
qt6-tools-private-dev \
qt6-declarative-dev \
qt6-positioning-dev \
qt6-datavisualization-dev \
qt6-serialport-dev \
qt6-serialbus-dev \
qt6-charts-dev
fi
apt-get install -y lzma-dev || true
apt-get install -y python3-future || true
apt-get install -y python3-click || true
apt-get install -y python3-cryptography || true
apt-get install -y python3-pip || true
apt-get install -y python3-pyelftools || true
apt-get install -y python3-pyparsing || true
apt-get install -y python3-serial || true
apt-get install -y python3-setuptools || true
apt-get install -y libopencv-dev
# cleanup
rm -rf /var/cache/apt/archives/*