unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Garlick <pgarlick@tourbillion-technology.com>
To: "Ludovic Courtès" <ludo@gnu.org>, "Marius Bakke" <mbakke@fastmail.com>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] gnu: Add opencascade-oce
Date: Thu, 26 Jan 2017 16:01:50 +0000	[thread overview]
Message-ID: <1485446510.25569.39.camel@tourbillion-technology.com> (raw)
In-Reply-To: <87pojgla44.fsf@gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 2617 bytes --]

On Sat, 2017-01-21 at 16:13 +0100, Ludovic Courtès wrote:
> Marius Bakke <mbakke@fastmail.com> skribis:
> 
> > 
> > Paul Garlick <pgarlick@tourbillion-technology.com> writes:
> [...]
> 
> > 
> > Libtool and file should likely be native-inputs, not sure about the
> > others. Could you check whether they are required and send an
> > updated
> > patch?
> ‘file’ is already an implicit input, so I’m not why it needs to be
> added
> (perhaps OpenCascade depends on libmagic?).
> 
> As for Libtool, I wonder why it is needed at all, especially given
> that
> OpenCascade is built with CMake.
> 
> Ludo’.
Hi Marius and Ludo,
Thank you for your comments.  I have checked the dependencies and here
are the results:
ftgl: not needed
qt: not needed
libtool: not needed
file: not needed
tcl: required by the DRAW test harness
tk: required by the DRAW test harness
I have amended the patch to remove the extra dependencies.  The public
domain licence information is now included.  
Also, there is an extra configuration flag required to successfully
build the DRAW libraries and executable.  The '-UCMAKE_INSTALL_RPATH'
flag is required for the validate-runpath stage to succeed.  This is to
do with the way the global variable is initialized.  There is a
distinction in CMake between lists and strings, which was new to me so
I will document it here.  
Essentially, if a variable is initialized as a single string it cannot
subsequently be overriden by a list of strings.  The cmake instructions
in OpenCascade (in adm/cmake/BuildToolKit.cmake) attempt to do this at
the install stage.  The DRAW harness needs a RUNPATH including both
.../lib and .../lib/oce-0.17.  With the standard definition of
CMAKE_INSTALL_RPATH (from cmake-build-system.scm) the substitution of
the INSTALL_RPATH property only includes the first string.
 Consequently, the validate-runpath phase fails (error: library ... not
in RUNPATH ...).  The configuration flag -UCMAKE_INSTALL_RPATH unsets
the global variable and allows the opencascade cmake rules to do the
work instead, setting the RUNPATH correctly for each target.
On the subject of the 0.18 version, perhaps this could be the subject
of a separate patch.  There could be an argument to just update in the
normal way (instead of having two packages at once).  The issue is
related to the hardware requirements of recent versions of OpenGL.  It
is useful to start with 0.17 as this imposes the least restriction on
older graphics card.  I can do some testing on the new version, later
on, to determine how important this is.
The amended patch is attached.
Best,
Paul.

[-- Attachment #1.2: Type: text/html, Size: 3233 bytes --]

[-- Attachment #2: 0001-gnu-Add-opencascade-oce.patch --]
[-- Type: text/x-patch, Size: 2885 bytes --]

From a5f64ac9b488249027fc92c46d737d4572e57d02 Mon Sep 17 00:00:00 2001
From: Paul Garlick <pgarlick@tourbillion-technology.com>
Date: Wed, 18 Jan 2017 10:01:36 +0000
Subject: [PATCH] gnu: Add opencascade-oce

* gnu/packages/maths.scm: Add opencascade-oce
---
 gnu/packages/maths.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 313f6ac..c8e280f 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
+;;; Copyright © 2017 Paul Garlick <pgarlick@tourbillion-technology.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -956,6 +957,53 @@ Work may be performed both at the interactive command-line as well as via
 script files.")
     (license license:gpl3+)))
 
+(define-public opencascade-oce
+  (package
+    (name "opencascade-oce")
+    (version "0.17.2")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+               "https://github.com/tpaviot/oce/archive/OCE-"
+               version
+               ".tar.gz"))
+        (sha256
+          (base32
+            "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd"))))
+    (build-system cmake-build-system)
+    (arguments
+     '(#:configure-flags
+        (list "-DOCE_TESTING:BOOL=ON"
+              "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
+              "-DOCE_DRAW:BOOL=ON"
+              (string-append "-DOCE_INSTALL_PREFIX:PATH="
+                        (assoc-ref %outputs "out"))
+              "-UCMAKE_INSTALL_RPATH")))
+    (inputs
+      `(("freetype" ,freetype)
+        ("glu" ,glu)
+        ("libxmu" ,libxmu)
+        ("mesa" ,mesa)
+        ("tcl" ,tcl)
+        ("tk" ,tk)))
+    (native-inputs
+      `(("python" ,python-wrapper)))
+    (home-page "https://github.com/tpaviot/oce")
+    (synopsis
+      "Libraries for 3D modeling and numerical simulation")
+    (description "OCE stands for Open CASCADE Community Edition.  The project
+gathers patches/improvements/experiments contributed by users over the official
+Open CASCADE library.")
+    (license (list license:lgpl2.1; OCE libraries, with an exception for the
+                                  ; use of header files; see
+                                  ; OCCT_LGPL_EXCEPTION.txt
+                   license:public-domain; files
+                                  ; src/Standard/Standard_StdAllocator.hxx and
+                                  ; src/NCollection/NCollection_StdAllocator.hxx
+                   license:expat; file src/OpenGl/OpenGl_glext.h
+                   license:bsd-3)))); test framework gtest
+
 (define-public gmsh
   (package
     (name "gmsh")
-- 
2.7.4


  reply	other threads:[~2017-01-26 16:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-18 11:23 [PATCH] gnu: Add opencascade-oce Paul Garlick
2017-01-18 18:35 ` Marius Bakke
2017-01-19 12:01   ` Paul Garlick
2017-01-21 12:28     ` Marius Bakke
2017-01-21 15:13       ` Ludovic Courtès
2017-01-26 16:01         ` Paul Garlick [this message]
2017-01-30  9:26           ` Ludovic Courtès
2017-01-20 22:21   ` Paul Garlick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1485446510.25569.39.camel@tourbillion-technology.com \
    --to=pgarlick@tourbillion-technology.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    --cc=mbakke@fastmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).