Install CRexsel on MacOS

Installing on MacOS can be done in two ways. First in identical form to the Linux install described here and second as an XCode install. The latter requires XCode to be installed, but the process is relatively easy.

Load the CRexsel Package from the Git repository. After you open the link click the "..." button and select "Download Repository". This should download the CRexsel folder into your downloads folder.

XCode_Package

Open the Package.swift file. After XCode has loaded the following should be displayed.

XCode_Package

The Package manifest file shows that there are two depndencies: the RexselKernel and the Swift ArgumentParser.

import PackageDescription let package = Package( name: "crexsel", products: [ .executable(name: "crexsel", targets: ["crexsel"]), ], dependencies: [ .package(url: "https://bitbucket.org/hsfr/rexselkernel.git", from: "1.0.28"), .package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"), ], targets: [ .executableTarget( name: "crexsel", dependencies: [ .product( name: "RexselKernel", package: "rexselkernel" ), .product( name: "ArgumentParser", package: "swift-argument-parser" ), ], resources: [ .process("Resources") ] ) ] )

The actual repository address of the RexselKernel package may change in future updates.

Build the Package by pressing Command+Build or the menu item 'Product->Build'. This should produce the executable file crexsel in the build folder. This needs to be put in the /usr/local/bin folder.

Copy thebuild path using the menua item 'Product->Copy Build Folder Path'. This should be a path similar to '/Users/xxxx/Library/Developer/Xcode/DerivedData/CRexsel-xxxxxxxxx/Build'.

In the terminal type the following command:

hsfr@bramley pcms % cp -v [paste the build path here]/Products/Debug/crexsel /usr/local/bin .../Products/Debug/crexsel -> /usr/local/bin/crexsel hsfr@bramley pcms %

If all has gone without errors do the following 9and assuming that the folder '/usr/local/bin' has added to the PATH envoronment variable, a reasonable assumption in caases):

hsfr@bramley pcms % crexsel -h OVERVIEW: Rexsel Compiler V1.0.6 Translates Rexsel files to XSLT and vice versa. USAGE: crexsel *.rxsl --errors --symbols crexsel *.xsl --uncompile ARGUMENTS: <inputs> Set of Rexsel files to compile to XSLT. OPTIONS: --uncompile Transform XSLT file into Rexsel. -s, --symbols Generate symbol table in the code. -e, --errors Show error list in output. -u, --undefined Show undefined errors (ignore external defines). -l, --lineNumbers Insert Rexsel source line numbers in XSL. -n, --noXmlnsPrefix No xsl namespace prefix. -v, --verbose Verbose console messages. -d, --debug Output debug messages. -h, --help Show help information. hsfr@bramley Rexsel % crexsel

This shows that the command is working. There is one more step to be done: copying the uncompiler script into /usr/local/bin. First you need to compile the script from the Rexsel source file into XSLT. First go to the Downloads folder and then to the downloaded repository whiocse name has the for [user name]-crexsel-[hash].

xxxx@bramley Downloads % cd [user name]-crexsel-[hash] xxxx@bramley [user name]-crexsel-[hash] % ls -l total 40 -rw-r--r--@ 1 hsfr staff 677 30 May 18:30 Package.resolved -rw-r--r--@ 1 hsfr staff 852 30 May 18:30 Package.swift -rw-r--r--@ 1 hsfr staff 565 30 May 18:30 README.md drwxr-xr-x@ 4 hsfr staff 128 30 May 18:30 Sources -rwxr-xr-x@ 1 hsfr staff 166 30 May 18:30 build.sh hsfr@bramley Resources %

Next change to the resources folder where

xxxx@bramley [user name]-crexsel-[hash] % cd Sources/Resources xxxx@bramley Resources % ls -l total 120 -rw-r--r--@ 1 hsfr staff 32588 30 May 18:30 xsl2rexsel.rxsl -rw-r--r--@ 1 hsfr staff 27125 30 May 18:30 xsl2rexsel.xsl hsfr@bramley Resources %

The file that you need is xsl2rexsel.rxsl which is the Rexsel source file for the uncompiler. The xsl2rexsel.xsl file is the compiled version in XSLT. The latter needs to be updated to reflect the latest version of the uncompiler, and then transfered to the /usr/local/bin folder.

xxxx@bramley Resources % crexsel xsl2rexsel.rxsl -e xxxx@bramley Resources % cp xsl2rexsel.xsl /usr/local/bin xxxx@bramley Resources %

And that should be sufficient to load Rexsel.

Copyright 2024 Hugh Field-Richards. All Rights Reserved.