Re: html and postscript viewer

2016-04-02 Thread Mark Brethen
After reviewing: https://trac.macports.org/wiki/PortfileRecipes#compiler I 
tried:

compiler.blacklist  *clang* *llvm-gcc-4.2
compiler.whitelist  macports-gcc-4.9

pre-build {
build.args  CC=${configure.cc} \
CXX=${configure.cxx}
}

This builds with gcc 4.9 successfully. 




> On Apr 2, 2016, at 2:04 AM, Mark Brethen  wrote:
> 
> From their installation guide:
> 
> For the compilation of cgx, therefore, the unmodified GCC 4.9 is required 
> because the modified (by Apple) GCC for several reasons is not suitable for 
> the compilation of cgx … The modified GCC includes the individual compilers: 
> gcc (GNU c compiler), g++ and clang. Because the modified GCC has a problem 
> with function overloading it is not suitable for the 2compilation of cgx.
> 
> 2In particular, the compilation of function: #define abs(x) ((x) >= 0 ? (x) : 
> -(x)) in the cgx-routine: “extUtil.h“ causes a compiler error. A bug fix for 
> the compiler was not available at the time the installation of cgx was 
> tested. 
> 
> 
> 
> I have looked at that link but it doesn’t explain how, for example, to set a 
> default compiler. The compilers group gives more instruction, but it’s not 
> completely clear to me. I guess something like
> 
> compilers.choosecc cxx cpp
> configure.cc macports-gcc-4.9
> 
> 
>> On Apr 1, 2016, at 11:59 PM, Ryan Schmidt > > wrote:
>> 
>>> On Apr 1, 2016, at 23:03, Mark Brethen >> > wrote:
>>> 
>>> I’ve run into a snag building calculix. glut and libSNL are libraries that 
>>> calculix uses. I set 
>>> 
>>> "compiler.whitelist  macports-gcc-4.9” 
>>> 
>>> per the developers instructions.
>> 
>> Why? We usually do not want to use FSF GCC. 
>> 
>>> However there isn’t a configure so I’m not sure what else needs to be 
>>> passed.
>>> 
>>> subport ${name}-cgx {
>>>   revision0
>>>   master_siteshttp://www.dhondt.de/ 
>>>   distnamecgx_${version}.all
>>> 
>>>   checksums   rmd160  02302101f16c2b4cdd570e81986cc4d36c2110d8 \
>>>   sha256 
>>> 64810dab1c22152c7946282fac5763cc36b9e31e309f962c23b8bf8238537c7e
>>> 
>>>   depends_run-append  port:openbrowser 
>>> 
>>>   worksrcdir  CalculiX
>>>   build.dir   ${worksrcpath}/cgx_${version}/src
>>>   build.target
>>> 
>>>   compiler.whitelist  macports-gcc-4.9
>>> 
>>>   patchfiles  patch-cgx-build.diff \
>>>   patch-libSNL-build.diff
>>>   patch.dir   ${workpath}
>>> 
>>>   post-patch {
>>>   reinplace "s|@@PREFIX@@|${prefix}|g" \
>>>   ${worksrcpath}/cgx_${version}/src/cgx.h
>>>   }
>>> 
>>>   use_configure   no
>>> 
>>> livecheck.regex {ccx_${version}.all}
>>> }
>> 
>> When you set "use_configure no", you must add code to use the right compiler 
>> and -arch flags and offer a universal variant. See:
>> 
>> https://trac.macports.org/wiki/UsingTheRightCompiler 
>> 

___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-04-02 Thread Mark Brethen
It fails in a similar fashion, which is why I don’t think my first attempt 
actually used gcc 4.9. What are the commands to set a default compiler?


> On Apr 2, 2016, at 4:45 AM, Joshua Root  wrote:
> 
> Sounds like they could use some help with their code. If you want to make 
> your own version of a function like abs that behaves differently to the 
> stdlib one, defining a macro with the same name is not the way to go about 
> it. It's likely to misbehave regardless of which compiler you use, just 
> because of the way C preprocessing works.
> 
> Have you tried just compiling with clang and seeing what happens?
> 
> - Josh
> 
> On 2016-4-2 18:04 , Mark Brethen wrote:
>> From their installation guide:
>> 
>> For the compilation of cgx, therefore, the unmodified GCC 4.9 is
>> required because the modified (by Apple) GCC for several reasons is not
>> suitable for the compilation of cgx … The modified GCC includes the
>> individual compilers: gcc (GNU c compiler), g++ and clang. Because the
>> modified GCC has a problem with function overloading it is not suitable
>> for the 2compilation of cgx.
>> 
>> 2In particular, the compilation of function: #define abs(x) ((x) >= 0 ?
>> (x) : -(x)) in the cgx-routine: “extUtil.h“ causes a compiler error. A
>> bug fix for the compiler was not available at the time the installation
>> of cgx was tested.
>> 
>> 
>> I have looked at that link but it doesn’t explain how, for example, to
>> set a default compiler. The compilers group gives more instruction, but
>> it’s not completely clear to me. I guess something like
>> 
>> compilers.choosecc cxx cpp
>> configure.cc  macports-gcc-4.9
>> 
>> 
>>> On Apr 1, 2016, at 11:59 PM, Ryan Schmidt >> > wrote:
>>> 
 On Apr 1, 2016, at 23:03, Mark Brethen > wrote:
 
 I’ve run into a snag building calculix. glut and libSNL are libraries
 that calculix uses. I set
 
 "compiler.whitelist  macports-gcc-4.9”
 
 per the developers instructions.
>>> 
>>> Why? We usually do not want to use FSF GCC.
>>> 
 However there isn’t a configure so I’m not sure what else needs to be
 passed.
 
 subport ${name}-cgx {
  revision0
  master_sites http://www.dhondt.de/
  distnamecgx_${version}.all
 
  checksums   rmd160
 02302101f16c2b4cdd570e81986cc4d36c2110d8 \
  sha256
 64810dab1c22152c7946282fac5763cc36b9e31e309f962c23b8bf8238537c7e
 
  depends_run-append  port:openbrowser
 
  worksrcdir  CalculiX
  build.dir   ${worksrcpath}/cgx_${version}/src
  build.target
 
  compiler.whitelist  macports-gcc-4.9
 
  patchfiles  patch-cgx-build.diff \
  patch-libSNL-build.diff
  patch.dir   ${workpath}
 
  post-patch {
  reinplace "s|@@PREFIX@@|${prefix}|g" \
  ${worksrcpath}/cgx_${version}/src/cgx.h
  }
 
  use_configure   no
 
 livecheck.regex {ccx_${version}.all}
 }
>>> 
>>> When you set "use_configure no", you must add code to use the right
>>> compiler and -arch flags and offer a universal variant. See:
>>> 
>>> https://trac.macports.org/wiki/UsingTheRightCompiler
>> 
> 

___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-04-02 Thread Joshua Root
BTW, the author of that guide also seems to be under the mistaken 
impression that Xcode includes GCC 5.1...


- Josh

On 2016-4-2 20:45 , Joshua Root wrote:

Sounds like they could use some help with their code. If you want to
make your own version of a function like abs that behaves differently to
the stdlib one, defining a macro with the same name is not the way to go
about it. It's likely to misbehave regardless of which compiler you use,
just because of the way C preprocessing works.

Have you tried just compiling with clang and seeing what happens?

- Josh

On 2016-4-2 18:04 , Mark Brethen wrote:

 From their installation guide:

For the compilation of cgx, therefore, the unmodified GCC 4.9 is
required because the modified (by Apple) GCC for several reasons is not
suitable for the compilation of cgx … The modified GCC includes the
individual compilers: gcc (GNU c compiler), g++ and clang. Because the
modified GCC has a problem with function overloading it is not suitable
for the 2compilation of cgx.

2In particular, the compilation of function: #define abs(x) ((x) >= 0 ?
(x) : -(x)) in the cgx-routine: “extUtil.h“ causes a compiler error. A
bug fix for the compiler was not available at the time the installation
of cgx was tested.


I have looked at that link but it doesn’t explain how, for example, to
set a default compiler. The compilers group gives more instruction, but
it’s not completely clear to me. I guess something like

compilers.choosecc cxx cpp
configure.cc  macports-gcc-4.9



On Apr 1, 2016, at 11:59 PM, Ryan Schmidt > wrote:


On Apr 1, 2016, at 23:03, Mark Brethen > wrote:

I’ve run into a snag building calculix. glut and libSNL are libraries
that calculix uses. I set

"compiler.whitelist  macports-gcc-4.9”

per the developers instructions.


Why? We usually do not want to use FSF GCC.


However there isn’t a configure so I’m not sure what else needs to be
passed.

subport ${name}-cgx {
  revision0
  master_sites http://www.dhondt.de/
  distnamecgx_${version}.all

  checksums   rmd160
 02302101f16c2b4cdd570e81986cc4d36c2110d8 \
  sha256
64810dab1c22152c7946282fac5763cc36b9e31e309f962c23b8bf8238537c7e

  depends_run-append  port:openbrowser

  worksrcdir  CalculiX
  build.dir   ${worksrcpath}/cgx_${version}/src
  build.target

  compiler.whitelist  macports-gcc-4.9

  patchfiles  patch-cgx-build.diff \
  patch-libSNL-build.diff
  patch.dir   ${workpath}

  post-patch {
  reinplace "s|@@PREFIX@@|${prefix}|g" \
  ${worksrcpath}/cgx_${version}/src/cgx.h
  }

  use_configure   no

livecheck.regex {ccx_${version}.all}
}


When you set "use_configure no", you must add code to use the right
compiler and -arch flags and offer a universal variant. See:

https://trac.macports.org/wiki/UsingTheRightCompiler






___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-04-02 Thread Joshua Root
Sounds like they could use some help with their code. If you want to 
make your own version of a function like abs that behaves differently to 
the stdlib one, defining a macro with the same name is not the way to go 
about it. It's likely to misbehave regardless of which compiler you use, 
just because of the way C preprocessing works.


Have you tried just compiling with clang and seeing what happens?

- Josh

On 2016-4-2 18:04 , Mark Brethen wrote:

 From their installation guide:

For the compilation of cgx, therefore, the unmodified GCC 4.9 is
required because the modified (by Apple) GCC for several reasons is not
suitable for the compilation of cgx … The modified GCC includes the
individual compilers: gcc (GNU c compiler), g++ and clang. Because the
modified GCC has a problem with function overloading it is not suitable
for the 2compilation of cgx.

2In particular, the compilation of function: #define abs(x) ((x) >= 0 ?
(x) : -(x)) in the cgx-routine: “extUtil.h“ causes a compiler error. A
bug fix for the compiler was not available at the time the installation
of cgx was tested.


I have looked at that link but it doesn’t explain how, for example, to
set a default compiler. The compilers group gives more instruction, but
it’s not completely clear to me. I guess something like

compilers.choosecc cxx cpp
configure.cc  macports-gcc-4.9



On Apr 1, 2016, at 11:59 PM, Ryan Schmidt > wrote:


On Apr 1, 2016, at 23:03, Mark Brethen > wrote:

I’ve run into a snag building calculix. glut and libSNL are libraries
that calculix uses. I set

"compiler.whitelist  macports-gcc-4.9”

per the developers instructions.


Why? We usually do not want to use FSF GCC.


However there isn’t a configure so I’m not sure what else needs to be
passed.

subport ${name}-cgx {
  revision0
  master_sites http://www.dhondt.de/
  distnamecgx_${version}.all

  checksums   rmd160
 02302101f16c2b4cdd570e81986cc4d36c2110d8 \
  sha256
64810dab1c22152c7946282fac5763cc36b9e31e309f962c23b8bf8238537c7e

  depends_run-append  port:openbrowser

  worksrcdir  CalculiX
  build.dir   ${worksrcpath}/cgx_${version}/src
  build.target

  compiler.whitelist  macports-gcc-4.9

  patchfiles  patch-cgx-build.diff \
  patch-libSNL-build.diff
  patch.dir   ${workpath}

  post-patch {
  reinplace "s|@@PREFIX@@|${prefix}|g" \
  ${worksrcpath}/cgx_${version}/src/cgx.h
  }

  use_configure   no

livecheck.regex {ccx_${version}.all}
}


When you set "use_configure no", you must add code to use the right
compiler and -arch flags and offer a universal variant. See:

https://trac.macports.org/wiki/UsingTheRightCompiler




___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-04-02 Thread Mark Brethen
From their installation guide:

For the compilation of cgx, therefore, the unmodified GCC 4.9 is required 
because the modified (by Apple) GCC for several reasons is not suitable for the 
compilation of cgx … The modified GCC includes the individual compilers: gcc 
(GNU c compiler), g++ and clang. Because the modified GCC has a problem with 
function overloading it is not suitable for the 2compilation of cgx.

2In particular, the compilation of function: #define abs(x) ((x) >= 0 ? (x) : 
-(x)) in the cgx-routine: “extUtil.h“ causes a compiler error. A bug fix for 
the compiler was not available at the time the installation of cgx was tested. 



I have looked at that link but it doesn’t explain how, for example, to set a 
default compiler. The compilers group gives more instruction, but it’s not 
completely clear to me. I guess something like

compilers.choosecc cxx cpp
configure.ccmacports-gcc-4.9


> On Apr 1, 2016, at 11:59 PM, Ryan Schmidt  wrote:
> 
>> On Apr 1, 2016, at 23:03, Mark Brethen > > wrote:
>> 
>> I’ve run into a snag building calculix. glut and libSNL are libraries that 
>> calculix uses. I set 
>> 
>> "compiler.whitelist  macports-gcc-4.9” 
>> 
>> per the developers instructions.
> 
> Why? We usually do not want to use FSF GCC. 
> 
>> However there isn’t a configure so I’m not sure what else needs to be passed.
>> 
>> subport ${name}-cgx {
>>   revision0
>>   master_siteshttp://www.dhondt.de/
>>   distnamecgx_${version}.all
>> 
>>   checksums   rmd160  02302101f16c2b4cdd570e81986cc4d36c2110d8 \
>>   sha256 64810dab1c22152c7946282fac5763cc36b9e31e309f962c23b8bf8238537c7e
>> 
>>   depends_run-append  port:openbrowser 
>> 
>>   worksrcdir  CalculiX
>>   build.dir   ${worksrcpath}/cgx_${version}/src
>>   build.target
>> 
>>   compiler.whitelist  macports-gcc-4.9
>> 
>>   patchfiles  patch-cgx-build.diff \
>>   patch-libSNL-build.diff
>>   patch.dir   ${workpath}
>> 
>>   post-patch {
>>   reinplace "s|@@PREFIX@@|${prefix}|g" \
>>   ${worksrcpath}/cgx_${version}/src/cgx.h
>>   }
>> 
>>   use_configure   no
>> 
>> livecheck.regex {ccx_${version}.all}
>> }
> 
> When you set "use_configure no", you must add code to use the right compiler 
> and -arch flags and offer a universal variant. See:
> 
> https://trac.macports.org/wiki/UsingTheRightCompiler 
> 
___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-04-01 Thread Ryan Schmidt
> On Apr 1, 2016, at 23:03, Mark Brethen  wrote:
> 
> I’ve run into a snag building calculix. glut and libSNL are libraries that 
> calculix uses. I set 
> 
> "compiler.whitelist  macports-gcc-4.9” 
> 
> per the developers instructions.

Why? We usually do not want to use FSF GCC. 

> However there isn’t a configure so I’m not sure what else needs to be passed.
> 
> subport ${name}-cgx {
>revision0
>master_siteshttp://www.dhondt.de/
>distnamecgx_${version}.all
> 
>checksums   rmd160  02302101f16c2b4cdd570e81986cc4d36c2110d8 \
>sha256  
> 64810dab1c22152c7946282fac5763cc36b9e31e309f962c23b8bf8238537c7e
> 
>depends_run-append  port:openbrowser 
> 
>worksrcdir  CalculiX
>build.dir   ${worksrcpath}/cgx_${version}/src
>build.target
> 
>compiler.whitelist  macports-gcc-4.9
> 
>patchfiles  patch-cgx-build.diff \
>patch-libSNL-build.diff
>patch.dir   ${workpath}
> 
>post-patch {
>reinplace "s|@@PREFIX@@|${prefix}|g" \
>${worksrcpath}/cgx_${version}/src/cgx.h
>}
> 
>use_configure   no
> 
> livecheck.regex {ccx_${version}.all}
> }

When you set "use_configure no", you must add code to use the right compiler 
and -arch flags and offer a universal variant. See:

https://trac.macports.org/wiki/UsingTheRightCompiler


___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-04-01 Thread Ryan Schmidt
On Apr 1, 2016, at 19:03, Mark Brethen  wrote:
> 
> Would someone look at the patch file and comment if okay or needs changes.

You should remove -L/usr/X11R6/lib; we don't want to get any libraries from 
there. We want to use the versions installed in ${prefix} by MacPorts. 

You should replace "g++" not with "$(CC)" but with "$(CXX)". 


___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-04-01 Thread Mark Brethen
Would someone look at the patch file and comment if okay or needs changes.

Thanks



patch-cgx-build.diff
Description: Binary data

> On Mar 30, 2016, at 9:39 PM, Ryan Schmidt  wrote:
> 
> On Mar 30, 2016, at 21:17, Mark Brethen wrote:
>> 
>> I suppose these launch scripts will need to be installed in ${prefix}/bin.
> 
> No need for custom scripts. Set PSVIEWER to "open" (part of OS X) and BROWSER 
> to "openbrowser" (and add a dependency on my openbrowser port). 

___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-03-31 Thread Mark Brethen
That's even better. Thanks!

Sent from my iPhone

> On Mar 30, 2016, at 9:39 PM, Ryan Schmidt  wrote:
> 
>> On Mar 30, 2016, at 21:17, Mark Brethen wrote:
>> 
>> I suppose these launch scripts will need to be installed in ${prefix}/bin.
> 
> No need for custom scripts. Set PSVIEWER to "open" (part of OS X) and BROWSER 
> to "openbrowser" (and add a dependency on my openbrowser port). 
___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-03-30 Thread Ryan Schmidt
On Mar 30, 2016, at 21:17, Mark Brethen wrote:
> 
> I suppose these launch scripts will need to be installed in ${prefix}/bin.

No need for custom scripts. Set PSVIEWER to "open" (part of OS X) and BROWSER 
to "openbrowser" (and add a dependency on my openbrowser port). 
___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-03-30 Thread Mark Brethen
I suppose these launch scripts will need to be installed in ${prefix}/bin.

> On Mar 30, 2016, at 8:59 PM, Brandon Allbery  wrote:
> 
> On Wed, Mar 30, 2016 at 9:45 PM, Mark Brethen  > wrote:
> According to the documentation these parameters are actually the names of 
> shell scripts that CGX runs to open the viewers. For example, the instruction 
> for the html viewer are as follows:
> 
> This is because Linux's story for handling this stuff sucks. xdg-open is 
> *still* unreliable, and apparently always will be.
> OS X can, and should, do better.
> 
> -- 
> brandon s allbery kf8nh   sine nomine associates
> allber...@gmail.com   
> ballb...@sinenomine.net 
> unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net 
> 
___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-03-30 Thread Brandon Allbery
On Wed, Mar 30, 2016 at 9:45 PM, Mark Brethen 
wrote:

> According to the documentation these parameters are actually the names of
> shell scripts that CGX runs to open the viewers. For example, the
> instruction for the html viewer are as follows:


This is because Linux's story for handling this stuff sucks. xdg-open is
*still* unreliable, and apparently always will be.
OS X can, and should, do better.

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net
___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-03-30 Thread Kevin Walzer

On 3/30/16 9:28 PM, Ryan Schmidt wrote:

/usr/bin/open is not necessarily suitable. For example, I have configure my 
system so that if I `open` a .html file, it opens into my text editor, because 
I frequently edit html files. However, if another program is trying to open a 
web page, then I want that web page to open in my web browser, not my text 
editor.



You are technically correct, but I suspect your use case is going to be 
applicable only for a small group of users who are also developers.


/usr/bin/open is the command-line interface to the LaunchServices API, 
which is supposed to handle all this. I am not aware of any clean way to 
query Safari's preferences to determine the default browser without 
groveling through plist files, or perhaps AppleScript.


(Looking on the web, I see your openbrowser script does exactly 
that--grinds through plist files via Perl--but that introduces an 
additional dependency. I'd suggest that using a system-bundled tool is 
almost always better. It's certainly simpler.)


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com

___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-03-30 Thread Mark Brethen
According to the documentation these parameters are actually the names of shell 
scripts that CGX runs to open the viewers. For example, the instruction for the 
html viewer are as follows:

Create the shell script, respectively a file with filename “firefox“ (or any 
other file- name) in a directory of your choice: “dir_your_choice“ (for example 
your HOME: /Users/LOGNAME) by using an editor of your choice. Next, insert the 
following two

lines in file: “firefox“, then safe and quit the file: 

#!/bin/bash
open -a Firefox $1

The above shell script “firefox” enables to launch Firefox from a Terminal 
window with command: $ firefox  . In the second line of the 
above script: "open" opens application (-a) Firefox, input is passed via “$1”.



> On Mar 30, 2016, at 8:14 PM, Ryan Schmidt  wrote:
> 
> 
> On Mar 30, 2016, at 8:11 PM, Mark Brethen wrote:
> 
>> Culculix CGX is setting a default html (firefox) and postscript (gv) viewer. 
>> For mac users, they recommend changing ‘gv’ to ‘preview’ but give no 
>> recommendation for a browser. I thought I’d ask here whether to keep it 
>> firefox or change it to something else? Safari?
> 
> OS X lets the user specify their preferred browser. This setting can be 
> changed in Safari's preferences window. You should respect that preference.
> 
> How does Culculix CGX invoke the web browser? If it does so by running a 
> command (such as "firefox" on other platforms), then you can use my 
> openbrowser port and the openbrowser command it provides to accomplish that.
> 
> If they run a command to invoke a the PostScript viewer, then you would 
> probably use "open -a Preview.app" to open Preview.
> 

___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-03-30 Thread Ryan Schmidt

> On Mar 30, 2016, at 8:36 PM, Kevin Walzer  wrote:
> 
> On 3/30/16 9:28 PM, Ryan Schmidt wrote:
>> /usr/bin/open is not necessarily suitable. For example, I have configure my 
>> system so that if I `open` a .html file, it opens into my text editor, 
>> because I frequently edit html files. However, if another program is trying 
>> to open a web page, then I want that web page to open in my web browser, not 
>> my text editor.
>> 
> 
> You are technically correct, but I suspect your use case is going to be 
> applicable only for a small group of users who are also developers.
> 

It applies to any user who has changed the file association for .html files. 
There's no reason to inconvenience that subset of users when a solution exists.


> /usr/bin/open is the command-line interface to the LaunchServices API, which 
> is supposed to handle all this. I am not aware of any clean way to query 
> Safari's preferences to determine the default browser without groveling 
> through plist files, or perhaps AppleScript.
> 
> (Looking on the web, I see your openbrowser script does exactly that--grinds 
> through plist files via Perl--but that introduces an additional dependency. 
> I'd suggest that using a system-bundled tool is almost always better. It's 
> certainly simpler.)


___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-03-30 Thread Ryan Schmidt

On Mar 30, 2016, at 8:21 PM, Kevin Walzer wrote:

> On 3/30/16 9:11 PM, Mark Brethen wrote:
>> Culculix CGX is setting a default html (firefox) and postscript (gv) viewer. 
>> For mac users, they recommend changing ‘gv’ to ‘preview’ but give no 
>> recommendation for a browser. I thought I’d ask here whether to keep it 
>> firefox or change it to something else? Safari?
> 
> /usr/bin/open will launch the user-defined default browser and image viewer 
> for the system, with no further configuration on the developer's part 
> required.

/usr/bin/open is not necessarily suitable. For example, I have configure my 
system so that if I `open` a .html file, it opens into my text editor, because 
I frequently edit html files. However, if another program is trying to open a 
web page, then I want that web page to open in my web browser, not my text 
editor.

My openbrowser program solves this problem by opening the given file in the 
system configured web browser, not the program associated with .html files.

___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-03-30 Thread Mark Brethen

> On Mar 30, 2016, at 8:24 PM, Mark Brethen  wrote:
> 
> I’ll use /opt/local/share/doc/${name} for the default location.

to be more correct, $(prefix}/share/doc/${name} ___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-03-30 Thread Mark Brethen
A header file specifies these parameters:


/* html browser, change if necessary */
/* postscript viewer, change if necessary */
#ifdef MTU
  #define BROWSER {"firefox"}
  #define PSVIEWER {"gv"}
#else
/* #define BROWSER {"netscape"} */
/*   #define BROWSER {"mozilla"} */
  #define BROWSER {"firefox"}
/* #define PSVIEWER {"ghostview"} */
  #define PSVIEWER {"gv”}
#endif


And also the location of the help files:

/* default location of the help files, please insert the actual one */
#ifdef MTU
  #ifdef DEVEL
#define HELPFILE{"/yaprod/yae55/Linux_x86_64/bin/cgx_doc/cgx.h$
 "/yaprod/yae55/Linux_x86_64/bin/ccx_doc/ccx.html"}
  #else
#define HELPFILE{"/yaprod/cae/application/CalculiX/doc/cgx_2.1$
 "/yaprod/cae/application/CalculiX/doc/ccx_2.10/cc$
  #endif
#elif defined AFLIB
  #define HELPFILE{"/usr/local/CalculiX/cgx_2.10/doc/cgx/cgx.html"$
"/usr/local/CalculiX/ccx_2.10/doc/ccx/ccx.html",\
"/usr/local/CalculiX/cgx_2.10/doc/aflib/aflib.pdf"}
#else
  #define HELPFILE{"/usr/local/CalculiX/cgx_2.10/doc/cgx/cgx.html"$
"/usr/local/CalculiX/ccx_2.10/doc/ccx/ccx.html"}
#endif

I’ll use /opt/local/share/doc/${name} for the default location.


> On Mar 30, 2016, at 8:14 PM, Ryan Schmidt  wrote:
> 
> 
> On Mar 30, 2016, at 8:11 PM, Mark Brethen wrote:
> 
>> Culculix CGX is setting a default html (firefox) and postscript (gv) viewer. 
>> For mac users, they recommend changing ‘gv’ to ‘preview’ but give no 
>> recommendation for a browser. I thought I’d ask here whether to keep it 
>> firefox or change it to something else? Safari?
> 
> OS X lets the user specify their preferred browser. This setting can be 
> changed in Safari's preferences window. You should respect that preference.
> 
> How does Culculix CGX invoke the web browser? If it does so by running a 
> command (such as "firefox" on other platforms), then you can use my 
> openbrowser port and the openbrowser command it provides to accomplish that.
> 
> If they run a command to invoke a the PostScript viewer, then you would 
> probably use "open -a Preview.app" to open Preview.
> 

___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-03-30 Thread Kevin Walzer

On 3/30/16 9:11 PM, Mark Brethen wrote:

Culculix CGX is setting a default html (firefox) and postscript (gv) viewer. 
For mac users, they recommend changing ‘gv’ to ‘preview’ but give no 
recommendation for a browser. I thought I’d ask here whether to keep it firefox 
or change it to something else? Safari?
___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev
/usr/bin/open will launch the user-defined default browser and image 
viewer for the system, with no further configuration on the developer's 
part required.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com

___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: html and postscript viewer

2016-03-30 Thread Ryan Schmidt

On Mar 30, 2016, at 8:11 PM, Mark Brethen wrote:

> Culculix CGX is setting a default html (firefox) and postscript (gv) viewer. 
> For mac users, they recommend changing ‘gv’ to ‘preview’ but give no 
> recommendation for a browser. I thought I’d ask here whether to keep it 
> firefox or change it to something else? Safari?

OS X lets the user specify their preferred browser. This setting can be changed 
in Safari's preferences window. You should respect that preference.

How does Culculix CGX invoke the web browser? If it does so by running a 
command (such as "firefox" on other platforms), then you can use my openbrowser 
port and the openbrowser command it provides to accomplish that.

If they run a command to invoke a the PostScript viewer, then you would 
probably use "open -a Preview.app" to open Preview.

___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev