aboutsummaryrefslogtreecommitdiff
path: root/graphics/qcad
diff options
context:
space:
mode:
authorNiels Horn <niels.horn@gmail.com>2010-06-13 16:59:24 -0500
committerRobby Workman <rworkman@slackbuilds.org>2010-06-13 16:59:24 -0500
commitb71cf2bad495af4767db5e3e9613f87bf4fbb60e (patch)
tree68d0f1551f507fe00ef7436847cdd456bba221a9 /graphics/qcad
parent64a8aaf1ba0439a86d46bf89a092159c43a68ede (diff)
graphics/qcad: Added (CAD application)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'graphics/qcad')
-rw-r--r--graphics/qcad/README18
-rw-r--r--graphics/qcad/doinst.sh4
-rw-r--r--graphics/qcad/gcc4x.patch30
-rw-r--r--graphics/qcad/help.patch11
-rw-r--r--graphics/qcad/libpng.patch10
-rw-r--r--graphics/qcad/qcad.SlackBuild141
-rw-r--r--graphics/qcad/qcad.desktop10
-rw-r--r--graphics/qcad/qcad.info12
-rw-r--r--graphics/qcad/slack-desc19
-rw-r--r--graphics/qcad/slack64.patch22
10 files changed, 277 insertions, 0 deletions
diff --git a/graphics/qcad/README b/graphics/qcad/README
new file mode 100644
index 000000000000..7a48f454b291
--- /dev/null
+++ b/graphics/qcad/README
@@ -0,0 +1,18 @@
+QCAD is an application for computer aided drafting in two dimensions (2d).
+With QCAD you can create technical drawings such as plans for buildings,
+interiors, mechanical parts or schemas and diagrams.
+The source code of the QCAD community edition is released under the GPL (Open
+Source).
+
+This script installs the manual in English ("en"), version 2.1.0.0
+Other manuals are available on the QCAD site in Czech, German and Hungarian.
+To install with these manuals, start the script with:
+
+ MANLANG=xx MANVERSION=a.b.c.d ./qcad.SlackBuild
+
+where xx = "cs", "de" or "hu" and a.b.c.d is the corresponding version.
+
+This requires qt3 from the /extra/kde3-compat/ packages.
+
+An optional parts library can be built using the qcad-partlibrary package,
+available here on SlackBuilds.org
diff --git a/graphics/qcad/doinst.sh b/graphics/qcad/doinst.sh
new file mode 100644
index 000000000000..4e8ba7071dea
--- /dev/null
+++ b/graphics/qcad/doinst.sh
@@ -0,0 +1,4 @@
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
diff --git a/graphics/qcad/gcc4x.patch b/graphics/qcad/gcc4x.patch
new file mode 100644
index 000000000000..5d6abd9290d8
--- /dev/null
+++ b/graphics/qcad/gcc4x.patch
@@ -0,0 +1,30 @@
+--- qcad-2.0.5.0-1-community.src/dxflib/src/dl_writer_ascii.cpp 2005-11-22 09:46:57.000000000 -0200
++++ qcad-2.0.5.0-1-community.src_patched/dxflib/src/dl_writer_ascii.cpp 2010-05-04 22:54:14.000000000 -0300
+@@ -29,6 +29,7 @@
+ #pragma once
+ #endif // _MSC_VER > 1000
+
++#include <string.h>
+ #include <stdio.h>
+
+ #include "dl_writer_ascii.h"
+--- qcad-2.0.5.0-1-community.src/qcadlib/src/information/rs_information.cpp 2005-11-22 09:52:39.000000000 -0200
++++ qcad-2.0.5.0-1-community.src_patched/qcadlib/src/information/rs_information.cpp 2010-05-04 23:31:33.000000000 -0300
+@@ -24,6 +24,7 @@
+ **
+ **********************************************************************/
+
++#include <algorithm>
+ #include "rs_information.h"
+
+ #include "rs_constructionline.h"
+--- qcad-2.0.5.0-1-community.src/qcadactions/src/rs_actionzoompan.cpp 2005-11-22 09:51:46.000000000 -0200
++++ qcad-2.0.5.0-1-community.src_patched/qcadactions/src/rs_actionzoompan.cpp 2010-05-04 23:34:19.000000000 -0300
+@@ -24,6 +24,7 @@
+ **
+ **********************************************************************/
+
++#include <algorithm>
+ #include "rs_actionzoompan.h"
+ #include "rs_snapper.h"
+ #include "rs_point.h"
diff --git a/graphics/qcad/help.patch b/graphics/qcad/help.patch
new file mode 100644
index 000000000000..054a1caa1774
--- /dev/null
+++ b/graphics/qcad/help.patch
@@ -0,0 +1,11 @@
+--- qcad-2.0.5.0-1-community.src/qcad/src/qc_applicationwindow.cpp 2005-11-22 09:49:33.000000000 -0200
++++ qcad-2.0.5.0-1-community.src_patched/qcad/src/qc_applicationwindow.cpp 2010-05-09 13:48:20.000000000 -0300
+@@ -2943,7 +2943,7 @@
+ RS_SYSTEM->getAppDir().latin1());
+ RS_DEBUG->print("QC_ApplicationWindow::slotHelpManual(): appdir: %s",
+ RS_SYSTEM->getAppDir().latin1());
+- assistant = new QAssistantClient(RS_SYSTEM->getAppDir()+"/bin", this);
++ assistant = new QAssistantClient("@QTDIR@/bin", this);
+ connect(assistant, SIGNAL(error(const QString&)),
+ this, SLOT(slotError(const QString&)));
+ QStringList args;
diff --git a/graphics/qcad/libpng.patch b/graphics/qcad/libpng.patch
new file mode 100644
index 000000000000..d5b23fcf9072
--- /dev/null
+++ b/graphics/qcad/libpng.patch
@@ -0,0 +1,10 @@
+--- qcad-2.0.5.0-1-community.src/scripts/build_qcad.sh 2005-11-22 09:27:33.000000000 -0200
++++ qcad-2.0.5.0-1-community.src_patched/scripts/build_qcad.sh 2010-06-01 18:10:34.000000000 -0300
+@@ -238,6 +238,7 @@
+ sed "s/\/\"\"/\\\\\"\"/g" tmp2 > tmp3
+ mv tmp3 Makefile
+ fi
++sed -i "s/lpng/lpng12/g" Makefile
+ cd ..
+
+
diff --git a/graphics/qcad/qcad.SlackBuild b/graphics/qcad/qcad.SlackBuild
new file mode 100644
index 000000000000..25fec1014f6e
--- /dev/null
+++ b/graphics/qcad/qcad.SlackBuild
@@ -0,0 +1,141 @@
+#!/bin/sh
+
+# Slackware build script for qcad
+# (2D Computer Aided Drafting)
+
+# Written by Niels Horn <niels.horn@gmail.com>
+# Revision date: 2010/06/01
+
+PRGNAM=qcad
+VERSION=${VERSION:-2.0.5.0}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+# Version of source is a bit different:
+SRCVERSION=${VERSION}-1-community.src
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+# Language & Version of manual
+# When writing this Slackbuild, manuals were avaliable in cs/en/de/hu
+MANLANG=${MANLANG:-en}
+MANVERSION=${MANVERSION:-2.1.0.0}
+SRCMAN=$MANLANG-$MANVERSION-1.html
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$SRCVERSION
+tar xvf $CWD/$PRGNAM-$SRCVERSION.tar.gz
+cd $PRGNAM-$SRCVERSION
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+### We'll do quite some patching here, but the sources are from 2005 and a lot has
+### changed since then...
+
+# Apply patch for gcc-4x
+patch -p1 < $CWD/gcc4x.patch
+
+# If 64-bits, apply patch needed for Slackware64
+[ "$ARCH" = "x86_64" ] && patch -p1 < $CWD/slack64.patch
+
+# Apply patch to show on-line help
+# (it needs to find the "assistant" from QT3)
+patch -p1 < $CWD/help.patch
+sed -i "s|@QTDIR@|$QTDIR|g" qcad/src/qc_applicationwindow.cpp
+
+# And this is an ugly patch to force the compiler to use libpng12
+# This is needed as Slackware 13.1 uses libpng14 as the default, but Qt3
+# from extra/kde3-compat was still compiled with libpng12.
+# The *correct* solution would be to rebuild Qt3 against the new version
+# of libpng, but that might me a bit to steep for some users...
+patch -p1 < $CWD/libpng.patch
+
+# Make sure we'll use the qt3 tools to build qcad
+sed -i "s|qmake|/opt/kde3/bin/qmake|g" scripts/build_qcad.sh
+
+### End of patching ###
+
+# Start the one-in-all build-script
+( cd scripts
+ CFLAGS="$SLKCFLAGS" \
+ ./build_qcad.sh
+)
+
+# "Compile" all .ts files to .qm
+find -name *.ts | while read FILE; do
+ lrelease $FILE
+done
+
+# "Install" program
+mkdir -p $PKG/opt/$PRGNAM
+cp -a qcad/qcad $PKG/opt/$PRGNAM/
+
+# "Install" data & translations
+mkdir -p $PKG/opt/$PRGNAM/qm
+cp -a qcad/data qcad/doc qcad/fonts qcad/library qcad/machines qcad/patterns \
+ $PKG/opt/$PRGNAM/
+find -name *.qm | while read FILE; do
+ cp $FILE $PKG/opt/$PRGNAM/qm/
+done
+
+# "Install" manual
+( cd $TMP
+ rm -rf $PRGNAM-manual-$SRCMAN
+ unzip $CWD/$PRGNAM-manual-$SRCMAN.zip
+ cd $PRGNAM-manual-$SRCMAN
+ cp -a * $PKG/opt/$PRGNAM/doc/
+)
+
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+ qcad/README \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/usr/share/{applications,pixmaps}
+cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
+cp qcad/src/xpm/qcad.xpm $PKG/usr/share/pixmaps/
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-${VERSION}_$MANLANG-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/graphics/qcad/qcad.desktop b/graphics/qcad/qcad.desktop
new file mode 100644
index 000000000000..d421a7816ada
--- /dev/null
+++ b/graphics/qcad/qcad.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=QCAD
+Comment=2D CAD program
+Categories=Graphics;
+Exec=/opt/qcad/qcad
+Icon=/usr/share/pixmaps/qcad.xpm
+StartupNotify=false
+
diff --git a/graphics/qcad/qcad.info b/graphics/qcad/qcad.info
new file mode 100644
index 000000000000..a1ce245f99f1
--- /dev/null
+++ b/graphics/qcad/qcad.info
@@ -0,0 +1,12 @@
+PRGNAM="qcad"
+VERSION="2.0.5.0"
+HOMEPAGE="http://www.ribbonsoft.com/qcad.html"
+DOWNLOAD="ftp://ribbonsoft.com/archives/qcad/qcad-2.0.5.0-1-community.src.tar.gz \
+ ftp://ribbonsoft.com/archives/qcad/qcad-manual-en-2.1.0.0-1.html.zip"
+MD5SUM="96b6a56027782aec953c9c4e64c5998c \
+ 55e45aa39ea37acf7770222bc3db03c0"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+MAINTAINER="Niels Horn"
+EMAIL="niels.horn@gmail.com"
+APPROVED="rworkman"
diff --git a/graphics/qcad/slack-desc b/graphics/qcad/slack-desc
new file mode 100644
index 000000000000..5cd173174172
--- /dev/null
+++ b/graphics/qcad/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+qcad: qcad (2D CAD program)
+qcad:
+qcad: QCAD is an application for computer aided drafting in two dimensions
+qcad: (2d). With QCAD you can create technical drawings such as plans for
+qcad: buildings, interiors, mechanical parts or schemas and diagrams.
+qcad: The source code of the QCAD community edition is released under the
+qcad: GPL (Open Source).
+qcad:
+qcad: Homepage: http://www.ribbonsoft.com/qcad.html
+qcad:
+qcad:
diff --git a/graphics/qcad/slack64.patch b/graphics/qcad/slack64.patch
new file mode 100644
index 000000000000..d81b0ea153ca
--- /dev/null
+++ b/graphics/qcad/slack64.patch
@@ -0,0 +1,22 @@
+--- qcad-2.0.5.0-1-community.src/qcadlib/src/engine/rs_entity.cpp 2005-11-22 09:52:32.000000000 -0200
++++ qcad-2.0.5.0-1-community.src_patched/qcadlib/src/engine/rs_entity.cpp 2010-05-04 23:23:53.000000000 -0300
+@@ -861,7 +861,7 @@
+ os << " layer: NULL ";
+ } else {
+ os << " layer: " << e.layer->getName().latin1() << " ";
+- os << " layer address: " << (int)(e.layer) << " ";
++ os << " layer address: " << (e.layer) << " ";
+ }
+
+ os << e.pen << "\n";
+--- qcad-2.0.5.0-1-community.src/qcadlib/src/engine/rs_layer.cpp 2005-11-22 09:52:38.000000000 -0200
++++ qcad-2.0.5.0-1-community.src_patched/qcadlib/src/engine/rs_layer.cpp 2010-05-04 23:27:39.000000000 -0300
+@@ -55,7 +55,7 @@
+ os << " name: " << l.getName().latin1()
+ << " pen: " << l.getPen()
+ << " frozen: " << (int)l.isFrozen()
+- << " address: " << (int)(&l)
++ << " address: " << (&l)
+ << std::endl;
+ return os;
+ }