Topics

Mac install issues #resolved #mac


Sean Adair
 

Any mac users here?  I see Johan isn’t so familiar with it.  I’m on current OS Catalina, and do some basic operations in the terminal regularly.
I’m really attracted to the lean easy to write and edit form of chordpro script, for both pdf on my mac and print, as well as hopefully an iPad app that does the basics.
I’m a jazz guitarist with decent chord chops (don’t need pics), but an awful memory for lyrics, and significant challenges singing and playing same time lol.

Here’s what transpired trying to install:

Adairs-iMac:~ adair$ sudo cpan chordpro
Password:
Reading '/Users/adair/.cpan/Metadata'
  Database was generated on Tue, 16 Jul 2019 22:41:03 GMT
Fetching with LWP:
Reading '/Users/adair/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Fetching with LWP:
Reading '/Users/adair/.cpan/sources/modules/02packages.details.txt.gz'
  Database was generated on Sat, 07 Mar 2020 20:41:02 GMT
.............
  New CPAN.pm version (v2.27) available.
  [Currently running version is v2.00]
  You might want to try
    install CPAN
    reload cpan
  to both upgrade CPAN.pm and run the new version without leaving
  the current session.


...............................................................DONE
Fetching with LWP:
Reading '/Users/adair/.cpan/sources/modules/03modlist.data.gz'
DONE
Writing /Users/adair/.cpan/Metadata
Running install for module 'chordpro'
Running make for J/JV/JV/App-Music-ChordPro-0.974.tar.gz
Fetching with LWP:
Fetching with LWP:
Checksum for /Users/adair/.cpan/sources/authors/id/J/JV/JV/App-Music-ChordPro-0.974.tar.gz ok
sh: /sw/bin/tar: No such file or directory
sh: /sw/bin/gzip: No such file or directory
Uncompressed /Users/adair/.cpan/sources/authors/id/J/JV/JV/App-Music-ChordPro-0.974.tar.gz successfully
Using Tar:/sw/bin/tar xf "App-Music-ChordPro-0.974.tar":
sh: /sw/bin/tar: No such file or directory
Couldn't untar App-Music-ChordPro-0.974.tar: child exited with value 127
Package seems to come without Makefile.PL.
  (The test -f "/Users/adair/.cpan/build/JV-QtjWLH/Makefile.PL" returned false.)
  Writing one on our own (setting NAME to chordpro)
  Had problems unarchiving. Please build manually
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install

________
Hmmm. Tried to update CPAN using those commands but got instructions which seem should have been fine:

Adairs-iMac:~ adair$ install CPAN
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 file2
       install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 ... fileN directory
       install -d [-v] [-g group] [-m mode] [-o owner] directory ...

So, that didn’t work Also tried the alternate for system perl: sudo /usr/bin/cpan chordpro with same result and a few other random experiments.

Sean



Johan Vromans
 

On Sun, Mar 8, 2020 at 09:58 AM, Sean Adair wrote:

sh: /sw/bin/tar: No such file or directory sh: /sw/bin/gzip: No such file or directory

It seems to miss essential tools like tar, gzip. Are these installed?


Sean Adair
 

Yes - both installed. Tried both commands in terminal and got appropriate response. 
Also, this line shows gzip worked:
Uncompressed /Users/adair/.cpan/sources/authors/id/J/JV/JV/App-Music-ChordPro-0.974.tar.gz successfully

But the resulting tar file had issues:
Using Tar:/sw/bin/tar xf "App-Music-ChordPro-0.974.tar":
sh: /sw/bin/tar: No such file or directory
Couldn't untar App-Music-ChordPro-0.974.tar: child exited with value 127

Is “value 127” an error code? or is it because these destination directories don’t appear to exist or get created?

Sean Adair


On Mar 8, 2020, at 8:33 AM, Johan Vromans <jvromans+gio@...> wrote:

On Sun, Mar 8, 2020 at 09:58 AM, Sean Adair wrote:

sh: /sw/bin/tar: No such file or directory sh: /sw/bin/gzip: No such file or directory

It seems to miss essential tools like tar, gzip. Are these installed?



Johan Vromans
 

/sw/bin/tar is the program that unpacks the downloaded sources. It is a system program that should be available on your system. Are there any programs in your /sw/ and /sw/bin/ directories?

Someone mentioned Xcode, is it installed?


Sean Adair
 

Hi Johann, Sorry - my UNIX is even worse than my vocals lol.
xcode is installed and up to date.
I know latest Mac OS 10.15, Catalina has some deep system changes, but it is still BSD UNIX at its heart. 

My tar is in this directory structure: usr/bin/tar
I don’t know of the sw directory, or how to direct the system to the correct place. 

I’ve been googling, and tried a few things, but a bit cautious about messing something up.  
Feels like I’m scat singing without knowing the changes...

Sean Adair

On Mar 9, 2020, at 3:04 AM, Johan Vromans <jvromans+gio@...> wrote:

/sw/bin/tar is the program that unpacks the downloaded sources. It is a system program that should be available on your system. Are there any programs in your /sw/ and /sw/bin/ directories?

Someone mentioned Xcode, is it installed?



Sean Adair
 

Sorry for the 2nd email, but I found a bit more info…

In my Users directory I have CPAN, and in that an uncompressed directory for chordpro:
  /Users/adair/.cpan/build/App-Music-ChordPro-0.973-3YQtqe

I also had 3 directories starting with JV- all containing the tar file WITH a Makefile.PL I guess these can go.
Also PDF-API2-*** and String-Interpolate*** which I think are associated from what I’ve been following.

Can I just use ChordPro from here?  Is there another install step?
Sorry to be so backward...

Sean Adair

On Mar 9, 2020, at 3:04 AM, Johan Vromans <jvromans+gio@...> wrote:

/sw/bin/tar is the program that unpacks the downloaded sources. It is a system program that should be available on your system. Are there any programs in your /sw/ and /sw/bin/ directories?

Someone mentioned Xcode, is it installed?



Johan Vromans
 

Well, it may be worth the experiment. Better still, try to run from git.

See https://github.com/ChordPro/chordpro/wiki/ChordPro-run-from-Git to get started.

You will probably miss some dependencies, like PDF::API2, Font::TTF. You can download these from metacpan and unpack using tar. After unpacking, move the content of the lib directory to a directory CPAN under the chordpro directory. So if you cd to the chordpro directory you will end up with (a.o.):

Changes
CPAN/App/Packager.pm
CPAN/Font/TTF.pm
CPAN/Font/TTF/...
CPAN/Image/Info.pm
CPAN/Image/Info/...
CPAN/IO/String.pm
CPAN/JSON/PP.pm
CPAN/JSON/PP/...
CPAN/PDF/API2.pm
CPAN/PDF/API2/...
CPAN/...
lib/App/Music/ChordPro.pm
lib/App/Music/ChordPro/...
Makefile.PL
MANIFEST
...
script/chordpro.pl
...

You can see how the missing dependencies are put under the CPAN directory.

If all goes well, you should be able to run perl script/chordpro.pl.


Tony Mann
 

I am using Catalina with Xcode and my installation of chordpro using cpan went perfectly. When you first configured cpan did you accept all the default choices?


Sean Adair
 

Thanks for chipping in Tony,
I took a break from this. I’m in NYC, so alternately stressed with issues, and stir crazy in front of my computer….
I don’t have a firm grasp of UNIX commands, so most of my terminal activity is copying from sources.  I drag things from the finder for locations, and reveal invisible files in the finder to ascertain locations…
I didn’t “configure” cpan - I just tried installing with the commands noted on the web and in my original posts. 
It was by revealing invisible files that I saw where install attempts were ending up as noted in my previous post. 

I’m afraid I need very specific sequences of commands to cut and paste to proceed much further.  Would be great if you can help with these.
If this is too much bandwidth for the user group, I’d be happy to take it in direct email too...


Sean Adair



On Mar 22, 2020, at 5:37 PM, Tony Mann <thephatmann@...> wrote:

I am using Catalina with Xcode and my installation of chordpro using cpan went perfectly. When you first configured cpan did you accept all the default choices?


Johan Vromans
 

Please continue here. Other Mac users can benefit as well.


Tony Mann
 

Sean,

The very first time you run cpan it asks a bunch of configuration changes. I wonder if that caused any issues for you. You can run the config steps again by running "cpan" and then typing in "o conf init".


Sean Adair
 

Hi Tony,
It seems to be a directory issue. As I mentioned before I found install files in this location below - my user directory.  The error says this is “recommended”, but permission denied.
Should I change permissions for this directory, or should I be changing it to a top level directory?  I’m the only user on this computer, so don’t need access to others. 
If changing directory, 

adair@Adairs-iMac ~ % cpan
Terminal does not support AddHistory.


Your configuration suggests that CPAN.pm should use a working
directory of
    /Users/adair/.cpan
Unfortunately we could not create the lock file
    /Users/adair/.cpan/.lock
due to 'Permission denied'.

Please make sure that the configuration variable
    $CPAN::Config->{cpan_home}
points to a directory where you can write a .lock file. You can set
this variable in either a CPAN/MyConfig.pm or a CPAN/Config.pm in your
@INC path;

cpan shell -- CPAN exploration and modules installation (v2.00)
Enter 'h' for help.

nolock_cpan[1]> ^C


Sean Adair
Adair Productions

Mobile: 917.701.3595
VM: 212.686.3777
405 E 13th Street, #5
New York, NY, 10009-3498

HD Video Production & Digital Media

On Mar 24, 2020, at 3:09 PM, Tony Mann <thephatmann@...> wrote:

Sean,

The very first time you run cpan it asks a bunch of configuration changes. I wonder if that caused any issues for you. You can run the config steps again by running "cpan" and then typing in "o conf init".



Tony Mann
 

Sean,

I forgot to mention: you need to run “sudo cpan”.


On Mar 24, 2020, at 12:20 PM, Sean Adair <sean@...> wrote:

Hi Tony,
It seems to be a directory issue. As I mentioned before I found install files in this location below - my user directory.  The error says this is “recommended”, but permission denied.
Should I change permissions for this directory, or should I be changing it to a top level directory?  I’m the only user on this computer, so don’t need access to others. 
If changing directory, 

adair@Adairs-iMac ~ % cpan
Terminal does not support AddHistory.


Your configuration suggests that CPAN.pm should use a working
directory of
    /Users/adair/.cpan
Unfortunately we could not create the lock file
    /Users/adair/.cpan/.lock
due to 'Permission denied'.

Please make sure that the configuration variable
    $CPAN::Config->{cpan_home}
points to a directory where you can write a .lock file. You can set
this variable in either a CPAN/MyConfig.pm or a CPAN/Config.pm in your
@INC path;

cpan shell -- CPAN exploration and modules installation (v2.00)
Enter 'h' for help.

nolock_cpan[1]> ^C


Sean Adair
Adair Productions

Mobile: 917.701.3595
VM: 212.686.3777
405 E 13th Street, #5
New York, NY, 10009-3498

HD Video Production & Digital Media

On Mar 24, 2020, at 3:09 PM, Tony Mann <thephatmann@...> wrote:

Sean,

The very first time you run cpan it asks a bunch of configuration changes. I wonder if that caused any issues for you. You can run the config steps again by running "cpan" and then typing in "o conf init".




Tony Mann
 

I have not had time to work on a true Mac installer lately. I researched using homebrew to install Perl and the Perl scripts, but it seemed way too problematic. A better approach is one I mentioned earlier, which is to compile the Perl scripts into Mac binary. After I do that I can see if there are external dependencies, and will use Homebrew if needed.

On a related note, I still can’t get the Wx GUI app to work on my Mac, so my initial installer will just be for the CLI. Once that is done I can move on to GUI, maybe with GUI installer.

If anyone is familiar with compiling Perl binaries and/or has time or interest, feel free to jump in.


Johan Vromans
 

I also tried an alternative route: Citrus Perl.

Citrus Perl is officially deceased but you can still find some kits on the net. I used https://osdn.net/projects/sfnet_citrusperl/downloads/Perl5.24.1/citrusperl-standard-52401-osx-i64-031.dmg/

The procedure I followed was:

Mount the dmg (this gives /Volumes/Citrus Perl).

Create a local folder, e.g. lib/citrusperl.

Copy the dmg contents to this folder:

rsync -avHi "/Volumes/Citrus Perl/perl/" lib/citrusperl/

Patch lib/citrusperl/vendor/lib/Citrus/Dist/Relocate.pm, line 118, change 'croak' to 'warn'.

Run

lib/citrusperl/bin/relocateperl

You'll get a warning due to the patch above, and some other warnings that seem harmless:

Use of uninitialized value $osxsdk in -d at /Users/jv/lib/citrusperl/vendor/lib/Citrus/Dist/Relocate.pm line 117.
The necessary SDK is not installed. Install XCode from your MacOSX CDs or the App Store at /Users/jv/lib/citrusperl/vendor/lib/Citrus/Dist/Relocate.pm line 118.
... some more ...

Assuming the login shell is zsh (seems to be standard on Mac OSX), issue

. lib/citrusperl/bin/citrusvars.sh

(note the '.' in front)

Verify Citrus context, e.g. which cpan should now yield /Users/xxx/lib/citrusperl/bin/cpan instead of /usr/bin/cpan.

Install wxchordpro:

cpan wxchordpro

This should be a flawless process.

Note when running wxchordpro:

  1. The initial dialog to open a file when wxchordpro is run without a filename argument does not appear.
  2. After starting wxchordpro the menus are not responsive. Just click on another window (e.g. the terminal window) and back to the wxchordpro window and they will work.

I have no idea why. For the time being I'm quite satisfied that it runs at all. It even seems reliable.


Tony Mann
 

Great news. I wonder if we can use Citrix Perl to make a stand-alone Mac app?

Tony

On Sep 17, 2020, at 11:50 AM, Johan Vromans <jvromans+gio@...> wrote:



I also tried an alternative route: Citrus Perl.

Citrus Perl is officially deceased but you can still find some kits on the net. I used https://osdn.net/projects/sfnet_citrusperl/downloads/Perl5.24.1/citrusperl-standard-52401-osx-i64-031.dmg/

The procedure I followed was:

Mount the dmg (this gives /Volumes/Citrus Perl).

Create a local folder, e.g. lib/citrusperl.

Copy the dmg contents to this folder:

rsync -avHi "/Volumes/Citrus Perl/perl/" lib/citrusperl/

Patch lib/citrusperl/vendor/lib/Citrus/Dist/Relocate.pm, line 118, change 'croak' to 'warn'.

Run

lib/citrusperl/bin/relocateperl

You'll get a warning due to the patch above, and some other warnings that seem harmless:

Use of uninitialized value $osxsdk in -d at /Users/jv/lib/citrusperl/vendor/lib/Citrus/Dist/Relocate.pm line 117.
The necessary SDK is not installed. Install XCode from your MacOSX CDs or the App Store at /Users/jv/lib/citrusperl/vendor/lib/Citrus/Dist/Relocate.pm line 118.
... some more ...

Assuming the login shell is zsh (seems to be standard on Mac OSX), issue

. lib/citrusperl/bin/citrusvars.sh

(note the '.' in front)

Verify Citrus context, e.g. which cpan should now yield /Users/xxx/lib/citrusperl/bin/cpan instead of /usr/bin/cpan.

Install wxchordpro:

cpan wxchordpro

This should be a flawless process.

Note when running wxchordpro:

  1. The initial dialog to open a file when wxchordpro is run without a filename argument does not appear.
  2. After starting wxchordpro the menus are not responsive. Just click on another window (e.g. the terminal window) and back to the wxchordpro window and they will work.

I have no idea why. For the time being I'm quite satisfied that it runs at all. It even seems reliable.


Johan Vromans
 

I've done so many years ago. Citrus (not Citrix) Perl came with a very nice packager system called Cava Packager. With Cava I could make identical install kits for Linux, Windows and Mac. But the products are discontinued (for unknown reasons) and the CitrusPerl and CavaPackager sites are offline. You can download an old version from https://macdownload.informer.com/cava-packager/download/ but I have no idea whether it is still usable.

In the mean time I have switched to a method based on the Portable Perl Loader originally invented by Oliver Betz, inspired by "runperl.c". It works great on Linux and Windows. Basically I build a folder that contains all (yes, all) files needed. This includes the perl lib, all the modules, system libraries and wxWindows libraries. To gather all files I use PAR::Packer. A small C program is compiled to invoke the perl lib with the application startup script. To the user this C program is the application. For Windows the folder is neatly packaged using the InnoSetup installer compiler.

I'm confident a similar approach is possible for MacOS. Gather all files in a folder and then add a loader program. I'm also confident that you have more MacOS knowledge than I have.

You can find the files in the pp directory of the ChordPro git (and kit). Let me know if this sound useful and whether I can help.


Johan Vromans
 

There is an experimental MacOS 'kit' that you can download from https://www.chordpro.org/dl/ChordPro-0.977-macos.tar.gz .

You can unpack the tar.gz in any convenient place. This will give a ChordPro-0.977 folder. In this folder there are two binaries: chordpro and wxchordpro. You can create aliases and put them on the desktop for convenience.

Note when running wxchordpro:

  • The initial dialog to open a file when wxchordpro is run without a filename argument does not appear.
  • After starting wxchordpro the menus are not responsive. Just click on another window (e.g. the terminal window) and back to the wxchordpro window and they will work.

I have no idea why. For the time being I'm quite satisfied that it runs at all. It even seems reliable.


Tony Mann
 

Johan,

This is awesome that you are working on Mac binaries!

I tried it out. First of all, you need to right click and then choose Open command to avoid the “unknown developer” dialog. Once IU did that, I unfortunately ran into this dialog:



I then did the same right-click Open on libperl.dylib. I know its not an executable, but this convinced the OS that file was safe. Trying again with wxchordpro I got this:



Similar “.bundle" errors occur when trying to run the chordpro exe. The workaround for these is to go to System Preferences/Security and allow the blocked bundle file. However, you need to do this one and by one, and I got tired of the process and gave up.

There is a way to allow all apps to run. First you need to show the “Anywhere” option in the Security prefs by running this command in a Terminal:

    sudo spctl --master-disable


Then go to Prefs and choose Anywhere:


Once I did that I was able to run chordpro exe. However, when I try to run wxchordpro I get: 

Segmentation fault: 11

Here is the backtrace:

0   Wx.bundle                     0x00000001091d9e5c XS_Wx__load_plugin(interpreter*, cv*) + 428
1   libperl.dylib                 0x00000001090668b9 Perl_pp_entersub + 2585
2   libperl.dylib                 0x000000010905d3e6 Perl_runops_standard + 22
3   libperl.dylib                 0x0000000108fd017e Perl_call_sv + 926
4   libperl.dylib                 0x0000000108fcc8e4 Perl_call_list + 468
5   libperl.dylib                 0x0000000108fbd34c S_process_special_blocks + 428
6   libperl.dylib                 0x0000000108fb5f60 Perl_newATTRSUB_x + 5824
7   libperl.dylib                 0x0000000108fb6eaa Perl_utilize + 1562
8   libperl.dylib                 0x0000000109007279 Perl_yyparse + 2569
9   libperl.dylib                 0x00000001090b01b5 S_doeval_compile + 1317
10  libperl.dylib                 0x00000001090b0f2f Perl_pp_entereval + 1919
11  libperl.dylib                 0x000000010905d3e6 Perl_runops_standard + 22
12  libperl.dylib                 0x0000000108fd017e Perl_call_sv + 926
13  libperl.dylib                 0x0000000108fcc8e4 Perl_call_list + 468
14  libperl.dylib                 0x0000000108fbd34c S_process_special_blocks + 428
15  libperl.dylib                 0x0000000108fb5f60 Perl_newATTRSUB_x + 5824
16  libperl.dylib                 0x0000000108fb6eaa Perl_utilize + 1562
17  libperl.dylib                 0x0000000109007279 Perl_yyparse + 2569
18  libperl.dylib                 0x0000000108fcea57 perl_parse + 7527
19  wxchordpro                     0x0000000108fa0a64 main + 1268
20  wxchordpro                     0x0000000108fa0564 start + 52


Anything else I can do to help, let me know.


On Sep 19, 2020, at 1:30 PM, Johan Vromans <jvromans+gio@...> wrote:

There is an experimental MacOS 'kit' that you can download from https://www.chordpro.org/dl/ChordPro-0.977-macos.tar.gz .

You can unpack the tar.gz in any convenient place. This will give a ChordPro-0.977 folder. In this folder there are two binaries: chordpro and wxchordpro. You can create aliases and put them on the desktop for convenience.

Note when running wxchordpro:

  • The initial dialog to open a file when wxchordpro is run without a filename argument does not appear.
  • After starting wxchordpro the menus are not responsive. Just click on another window (e.g. the terminal window) and back to the wxchordpro window and they will work.

I have no idea why. For the time being I'm quite satisfied that it runs at all. It even seems reliable.



Johan Vromans
 

Thanks for trying, I'll investigate.

As an alternative, can you download https://www.squirrel.nl/pub/xfer/uploads/3Cu4TljasJ7t8-bLF2Byt1Vg.zip and unpack it? It contains a single binary version of wxchordpro. Does it run?