Skip to content

Commit

Permalink
Add rpm spec file and patch files generator
Browse files Browse the repository at this point in the history
Signed-off-by: Damian Wrobel <[email protected]>
  • Loading branch information
dwrobel authored and Damian Wrobel committed Dec 6, 2023
1 parent 76fe252 commit db8eda4
Show file tree
Hide file tree
Showing 4 changed files with 1,046 additions and 0 deletions.
34 changes: 34 additions & 0 deletions fedora/_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash -e

if ! dnf repolist | grep copr:copr.fedorainfracloud.org:dwrobel:python-Yapps2; then
rpm -qv dnf-plugins-core 2>/dev/null || sudo dnf install dnf-plugins-core
sudo dnf copr enable -y dwrobel/python-Yapps2
sudo dnf builddep -y linuxcnc.spec
fi

pushd ../src

export CFLAGS="-Dcflags -O0 -ggdb3 -fno-gnu89-inline -std=gnu17"
export CXXFLAGS="-Dcxxflags -O0 -ggdb3 -std=c++17"
export CPPFLAGS="-Dcppflags -I/usr/include/readline5 $(pkg-config --cflags python${pv}) -O0 -ggdb3 -Wno-cpp"
#export CPPFLAGS="-Dcppflags -I/usr/include/readline5 $(pkg-config --cflags python${pv}) -O0 -ggdb3 -fsanitize=address -fPIE -fno-omit-frame-pointer"
#ASAN_OPTIONS=halt_on_error=false LD_PRELOAD=/usr/lib64/libasan.so.5 linuxcnc
export LDFLAGS="-L/usr/lib64/readline5"

export PYTHON=/usr/bin/python3

autoreconf -fi .

export ac_cv_path_CHECKLINK=/usr/bin/true

./configure \
--enable-non-distributable=no \
--with-realtime=uspace \

# --enable-build-documentation=pdf
# --enable-non-distributable=yes \

make -j$(getconf _NPROCESSORS_ONLN) -O V=1 2>&1 | tee ../fedora/build.log

#echo "(cd ../src && sudo make setuid -n)"
sudo setcap cap_ipc_lock,cap_net_admin,cap_sys_rawio,cap_sys_nice+ep ../bin/rtapi_app
20 changes: 20 additions & 0 deletions fedora/generate-patches.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/bash

set -e

BRANCH=$(git rev-parse --abbrev-ref HEAD)

rm -f *.patch 2>/dev/null

# where upstream/master is https://github.com/LinuxCNC/linuxcnc
git format-patch $(git merge-base upstream/master ${BRANCH})..${BRANCH}

num=1

for f in *.patch; do
[ -f "$f" ] || continue
p=${f#*-};
mv $f linuxcnc-$f;
printf "Patch%s: %%{name}-%s\n" $num $f
num=$((num + 1))
done
Loading

0 comments on commit db8eda4

Please sign in to comment.