Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
50 changes: 23 additions & 27 deletions development/pcb2gcode/pcb2gcode.SlackBuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# Slackware build script for pcb2gcode

# Copyright 2024-2026 Heiko Rosemann, Germany
# All rights reserved.
#
# Re-write to use cmake instead of autotools
# Copyright 2026 Heiko Rosemann, Germany
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
Expand All @@ -25,10 +28,10 @@
cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=pcb2gcode
VERSION=${VERSION:-2.5.0}
BUILD=${BUILD:-2}
VERSION=${VERSION:-3.0.3}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
PKGTYPE=${PKGTYPE:-tgz}

if [ -z "$ARCH" ]; then
case "$( uname -m )" in
Expand All @@ -48,16 +51,16 @@ PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
SLKCFLAGS="-O2 -march=i586 -mtune=i686 -pthread"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
SLKCFLAGS="-O2 -march=i686 -mtune=i686 -pthread"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
SLKCFLAGS="-O2 -fPIC -pthread"
LIBDIRSUFFIX="64"
elif [ "$ARCH" = "aarch64" ]; then
SLKCFLAGS="-O2 -fPIC"
SLKCFLAGS="-O2 -fPIC -pthread"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
Expand All @@ -79,25 +82,18 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

# Fix to also build with boost>1.76 on -current
# See https://github.com/pcb2gcode/pcb2gcode/issues/587
sed -i "s|isystem ,\$(BOOST|idirafter ,\$(BOOST|" configure.ac

/usr/bin/autoreconf -fvi
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--disable-static \
--build=$ARCH-slackware-linux

make
make install-strip DESTDIR=$PKG
mkdir -p build
cd build
cmake \
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_MANDIR=man \
-DCMAKE_BUILD_TYPE=Release \
-S .. -B .
cmake --build . -j$(nproc)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should not hard code job counts - MAKEFLAGS will be picked up by cmake

cmake --install . --strip --prefix $PKG/usr
cd ..

find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
Expand Down
6 changes: 3 additions & 3 deletions development/pcb2gcode/pcb2gcode.info
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PRGNAM="pcb2gcode"
VERSION="2.5.0"
VERSION="3.0.3"
HOMEPAGE="https://github.com/pcb2gcode/pcb2gcode"
DOWNLOAD="https://github.com/pcb2gcode/pcb2gcode/archive/v2.5.0/pcb2gcode-2.5.0.tar.gz"
MD5SUM="926c2841e490d9393d416ad185a3bedf"
DOWNLOAD="https://github.com/pcb2gcode/pcb2gcode/archive/v3.0.3/pcb2gcode-3.0.3.tar.gz"
MD5SUM="cb37f526107e1567350959f769da0712"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="gerbv"
Expand Down
Loading