aboutsummaryrefslogtreecommitdiff
path: root/cad/libopencad
diff options
context:
space:
mode:
authorDmitry Marakasov <amdmi3@FreeBSD.org>2016-12-26 14:29:06 +0000
committerDmitry Marakasov <amdmi3@FreeBSD.org>2016-12-26 14:29:06 +0000
commit7219fadffaa37b0587837c9a084bbfb0979b8fc2 (patch)
tree4f48a88658d76a5ec396724347b5ff78d2946a1f /cad/libopencad
parent23c582ea81f47f7bf335785b085feb61d1a86f19 (diff)
downloadports-7219fadffaa37b0587837c9a084bbfb0979b8fc2.tar.gz
ports-7219fadffaa37b0587837c9a084bbfb0979b8fc2.zip
Libopencad is a library written in C++11, which provides a way to
read/write CAD (DWG/DXF/DXFB) files. It was designed to have a uniformal API to work with any CAD files. It has a base class - CADFile. Inheriting this class it's possible to create a driver for any CAD format, all you need to do - is to overwrite interface functions like GetGeometry(index), and others. Now it has an implementation for DWG2000 (R15), but only for read. Library comes with cadinfo utility, which prints out everything library can get from file - header variables, CAD custom classes, presented layers and geometries with their attributes. WWW: https://trac.osgeo.org/gdal/wiki/DWG_driver PR: 212129 Submitted by: lbartoletti@tuxfamily.org
Notes
Notes: svn path=/head/; revision=429524
Diffstat (limited to 'cad/libopencad')
-rw-r--r--cad/libopencad/Makefile22
-rw-r--r--cad/libopencad/distinfo3
-rw-r--r--cad/libopencad/files/patch-lib_cadheader.cpp29
-rw-r--r--cad/libopencad/files/patch-lib_cadheader.h25
-rw-r--r--cad/libopencad/files/patch-tests_CMakeLists.txt14
-rw-r--r--cad/libopencad/pkg-descr17
-rw-r--r--cad/libopencad/pkg-plist14
7 files changed, 124 insertions, 0 deletions
diff --git a/cad/libopencad/Makefile b/cad/libopencad/Makefile
new file mode 100644
index 000000000000..0afeb12ae72e
--- /dev/null
+++ b/cad/libopencad/Makefile
@@ -0,0 +1,22 @@
+# Created by: lbartoletti <lbartoletti@tuxfamily.org>
+# $FreeBSD$
+
+PORTNAME= libopencad
+PORTVERSION= 0.2.0
+CATEGORIES= cad graphics geography
+
+MAINTAINER= lbartoletti@tuxfamily.org
+COMMENT= Library which provides a way to read/write CAD (DWG/DXF/DXFB) files
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BROKEN_FreeBSD_9= does not build (lack of c++11 support)
+
+USE_GITHUB= yes
+GH_ACCOUNT= sandyre
+
+USES= cmake compiler:c++11-lib
+USE_LDCONFIG= yes
+
+.include <bsd.port.mk>
diff --git a/cad/libopencad/distinfo b/cad/libopencad/distinfo
new file mode 100644
index 000000000000..54ce0a77e979
--- /dev/null
+++ b/cad/libopencad/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1472070376
+SHA256 (sandyre-libopencad-0.2.0_GH0.tar.gz) = 181a33fd8bc6046366c9d5d3a22590817d8f4ab7b87efdeac9fecdc34fe94019
+SIZE (sandyre-libopencad-0.2.0_GH0.tar.gz) = 4245877
diff --git a/cad/libopencad/files/patch-lib_cadheader.cpp b/cad/libopencad/files/patch-lib_cadheader.cpp
new file mode 100644
index 000000000000..0397708ca5fe
--- /dev/null
+++ b/cad/libopencad/files/patch-lib_cadheader.cpp
@@ -0,0 +1,29 @@
+--- lib/cadheader.cpp.orig 2016-08-24 13:25:41 UTC
++++ lib/cadheader.cpp
+@@ -243,6 +243,17 @@ CADVariant::CADVariant( const char * val
+ dateTimeVal = 0;
+ }
+
++CADVariant::CADVariant( long val )
++{
++ type = DataType ::DECIMAL;
++ decimalVal = val;
++ stringVal = to_string( decimalVal );
++ xVal = 0;
++ yVal = 0;
++ zVal = 0;
++ dateTimeVal = 0;
++}
++
+ CADVariant::CADVariant( int val )
+ {
+ type = DataType::DECIMAL;
+@@ -303,7 +314,7 @@ CADVariant::CADVariant( const string& va
+ dateTimeVal = 0;
+ }
+
+-CADVariant::CADVariant( time_t val )
++CADVariant::CADVariant( time_t val, bool bIsTime )
+ {
+ type = DataType::DATETIME;
+ dateTimeVal = val;
diff --git a/cad/libopencad/files/patch-lib_cadheader.h b/cad/libopencad/files/patch-lib_cadheader.h
new file mode 100644
index 000000000000..3ed0dc431d7b
--- /dev/null
+++ b/cad/libopencad/files/patch-lib_cadheader.h
@@ -0,0 +1,25 @@
+--- lib/cadheader.h.orig 2016-08-24 13:25:41 UTC
++++ lib/cadheader.h
+@@ -35,6 +35,7 @@
+ #include <map>
+ #include <string>
+ #include <vector>
++#include <ctime>
+
+ class OCAD_EXTERN CADHandle final
+ {
+@@ -64,12 +65,13 @@ public:
+ CADVariant();
+ CADVariant( const char * val );
+ CADVariant( int val );
++ CADVariant( long val );
+ CADVariant( short val );
+ CADVariant( double val );
+ CADVariant( double x, double y, double z = 0 );
+ CADVariant( const CADHandle& val );
+ CADVariant( const std::string& val );
+- CADVariant( time_t val );
++ CADVariant( time_t val, bool bIsTime );
+ public:
+ CADVariant( const CADVariant& orig );
+ CADVariant& operator=( const CADVariant& orig );
diff --git a/cad/libopencad/files/patch-tests_CMakeLists.txt b/cad/libopencad/files/patch-tests_CMakeLists.txt
new file mode 100644
index 000000000000..b4377765384c
--- /dev/null
+++ b/cad/libopencad/files/patch-tests_CMakeLists.txt
@@ -0,0 +1,14 @@
+--- tests/CMakeLists.txt.orig 2016-08-24 13:25:41 UTC
++++ tests/CMakeLists.txt
+@@ -41,10 +41,8 @@ if(BUILD_TESTS)
+
+
+ find_package(Threads)
+- set(TARGET_LINK_LIB ${TARGET_LINK_LIB} ${CMAKE_THREAD_LIBS_INIT} ${TARGET_LINK})
++ set(TARGET_LINK_LIB ${TARGET_LINK_LIB} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} ${TARGET_LINK})
+
+- find_library(DL_LIB dl)
+- set(TARGET_LINK_LIB ${TARGET_LINK_LIB} ${DL_LIB})
+ find_library(M_LIB m)
+ set(TARGET_LINK_LIB ${TARGET_LINK_LIB} ${M_LIB})
+
diff --git a/cad/libopencad/pkg-descr b/cad/libopencad/pkg-descr
new file mode 100644
index 000000000000..d1db4a360da9
--- /dev/null
+++ b/cad/libopencad/pkg-descr
@@ -0,0 +1,17 @@
+Libopencad is a library written in C++11, which provides a way to
+read/write CAD (DWG/DXF/DXFB) files. It was designed to have a
+uniformal API to work with any CAD files.
+
+It has a base class - CADFile.
+
+Inheriting this class it's possible to create a driver for any CAD
+format, all you need to do - is to overwrite interface functions
+like GetGeometry(index), and others.
+
+Now it has an implementation for DWG2000 (R15), but only for read.
+
+Library comes with cadinfo utility, which prints out everything
+library can get from file - header variables, CAD custom classes,
+presented layers and geometries with their attributes.
+
+WWW: https://trac.osgeo.org/gdal/wiki/DWG_driver
diff --git a/cad/libopencad/pkg-plist b/cad/libopencad/pkg-plist
new file mode 100644
index 000000000000..b04740fdabe4
--- /dev/null
+++ b/cad/libopencad/pkg-plist
@@ -0,0 +1,14 @@
+bin/cadinfo
+include/opencad/cadclasses.h
+include/opencad/cadcolors.h
+include/opencad/caddictionary.h
+include/opencad/cadfile.h
+include/opencad/cadfileio.h
+include/opencad/cadgeometry.h
+include/opencad/cadheader.h
+include/opencad/cadlayer.h
+include/opencad/cadobjects.h
+include/opencad/cadtables.h
+include/opencad/opencad.h
+include/opencad/opencad_api.h
+lib/libopencadstatic.a