Bug 242235 - cad/openvsp: fix build on non-x86
Summary: cad/openvsp: fix build on non-x86
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Fernando Apesteguía
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-25 20:41 UTC by Piotr Kubaj
Modified: 2019-11-27 19:59 UTC (History)
2 users (show)

See Also:
fernape: maintainer-feedback+


Attachments
patch (2.04 KB, patch)
2019-11-25 20:41 UTC, Piotr Kubaj
pkubaj: maintainer-approval? (fernape)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 2019-11-25 20:41:49 UTC
Created attachment 209426 [details]
patch

Don't use amd64 code on all 64-bit architectures.
Include sys/param.h because of:
/usr/local/poudriere/ports/default/cad/openvsp/work/OpenVSP-OpenVSP_3.19.0/src/util/FileUtil.cpp:118:18: error: 'PATH_MAX' was not declared in this scope
  118 |     char exepath[PATH_MAX];
      |                  ^~~~~~~~
Comment 1 Fernando Apesteguía freebsd_committer 2019-11-26 16:54:36 UTC
(In reply to Piotr Kubaj from comment #0)

Thanks for the patch Piotr,

What architectures are you referring to? I can only test i386 and amd64.

In addition, please note that the port is marked as BROKEN basically everywhere (it is barely alive in 12.1) so maybe we should rework the conditions under which this port is BROKEN.

buildtesting...
Comment 2 Piotr Kubaj freebsd_committer 2019-11-26 17:37:24 UTC
I was testing on powerpc64.

The port seems to work on stable/12 (excluding aarch64). I suppose it will work on head sometime as well.
Comment 3 Fernando Apesteguía freebsd_committer 2019-11-26 22:15:40 UTC
Fails to patch:

fernape@beastie:~/FreeBSD-repos/ports/head/cad/openvsp$ svn st 
A       files/patch-src_external_angelscript_sdk_angelscript_source_as__config.h
A       files/patch-src_util_FileUtil.cpp
fernape@beastie:~/FreeBSD-repos/ports/head/cad/openvsp$ make patch
===>  License NOSA13 accepted by the user
===>   openvsp-3.19.1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by openvsp-3.19.1 for building
===>  Extracting for openvsp-3.19.1
=> SHA256 Checksum OK for OpenVSP-OpenVSP-OpenVSP_3.19.1_GH0.tar.gz.
===>  Patching for openvsp-3.19.1
===>  Applying FreeBSD patches for openvsp-3.19.1
Ignoring previously applied (or reversed) patch.
1 out of 1 hunks ignored--saving rejects to src/external/angelscript/sdk/angelscript/source/as_config.h.rej
=> FreeBSD patch patch-src_external_angelscript_sdk_angelscript_source_as__config.h failed to apply cleanly.
=> Patch(es)  patch-src_external_angelscript_sdk_CMakeLists.txt patch-src_external_angelscript_sdk_angelscript_source_as__callfunc__x86.cpp applied cleanly.
*** Error code 1

Stop.
make: stopped in /usr/home/fernape/FreeBSD-repos/ports/head/cad/openvsp

Any ideas?
Comment 4 Piotr Kubaj freebsd_committer 2019-11-27 11:11:37 UTC
(In reply to Fernando Apesteguía from comment #3)
Any out-of-tree patches?
It works for me.
BTW, I can also compile it on head when using powerpc64 (didn't try on amd64/head).
Comment 5 Fernando Apesteguía freebsd_committer 2019-11-27 18:10:41 UTC
(In reply to Piotr Kubaj from comment #4)
It applies cleanly now, I had some changes in my working copy. Please, feel free to commit this.

Thanks!
Comment 6 commit-hook freebsd_committer 2019-11-27 19:56:39 UTC
A commit references this bug:

Author: pkubaj
Date: Wed Nov 27 19:56:27 UTC 2019
New revision: 518530
URL: https://svnweb.freebsd.org/changeset/ports/518530

Log:
  cad/openvsp: fix build on non-x86

  Don't use amd64 code on all 64-bit architectures.
  Include sys/param.h because of:
  /usr/local/poudriere/ports/default/cad/openvsp/work/OpenVSP-OpenVSP_3.19.0/src/util/FileUtil.cpp:118:18: error: 'PATH_MAX' was not declared in this scope
    118 |     char exepath[PATH_MAX];
        |                  ^~~~~~~~

  PR:		242235
  Approved by:	fernape (maintainer), tcberner (mentor)
  Differential Revision:	https://reviews.freebsd.org/D22576

Changes:
  head/cad/openvsp/files/patch-src_external_angelscript_sdk_angelscript_source_as__config.h
  head/cad/openvsp/files/patch-src_util_FileUtil.cpp