Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ $ ls
LICENSE README.md appveyor.yml archetypes ==>>build<<== download.sh scripts src
```

### Notes for Windows
- Depending on git's `autocrlf` setting, the downloaded file build.sh and others might end lines with `CRLF`. Ensure that lines end simply with `LF` for script execution.
- The build.sh script calls the `cygpath` utility.

### 2. Setting up the environment

You can then proceed to install that pillar build where you want.
Expand Down Expand Up @@ -120,7 +124,7 @@ The simplest way to install `LaTeX` on unix is to install texlive-full in your s

#### Installing `LaTeX` on Windows

Install a `LaTeX` distribution such as [MiKTeX](https://miktex.org/) and install the dependencies specified below using the provided package manager. Then, make sure the bin directory is in your PATH environment variable. For example this could be the following value:
Install a `LaTeX` distribution such as [MiKTeX](https://miktex.org/) and install the dependencies specified below using the provided package manager. For `MiKTeX`, a perl script environment (e.g. [Strawberry Perl](https://strawberryperl.com)) must be provided separately. Then, make sure the bin directory is in your PATH environment variable. For example this could be the following value: `C:\Users\username\AppData\Local\Programs\MiKTeX\miktex\bin\x64\`.

#### Tailored installation (for non-full lovers)
Producing pdf documents with Pillar requires a `LaTeX` installation with certain packages.
Expand Down Expand Up @@ -186,13 +190,21 @@ Smalltalk globals
ifPresent: [ :c | c removeFromSystem ].

```

The following script can be useful if you develop using the launcher and want to try to execute the image as from a pillar command

### Executing the image as from a pillar command
The following script can be useful if you develop using the launcher and want to try to execute the image as from a pillar command:
```
/Users/ducasse/Documents/Pharo/vms/100-x64/Pharo.app/Contents/MacOS/Pharo /Users/ducasse/Documents/Pharo/images/P11-PillarRealReference/P10-PillarRealReference.image clap build pdf index.pillar
```

In case of `Windows`, temporary substitute in your image
```
PRTarget >> newProject
^ PRProject on: FileSystem workingDirectory
```
with the adequate reference to your target project, e.g.:
```
PRTarget >> newProject
^ PRProject on: 'C:/cygwin64/home/user/my-book-project' asFileReference
```

## History

Expand Down Expand Up @@ -269,5 +281,5 @@ Introduces new template for slides - microdown-mooc (based on extension <!slide.
## Old and obsolete documentation

Read the documentation at [https://github.com/SquareBracketAssociates/Booklet-PublishingAPillarBooklet](https://github.com/SquareBracketAssociates/Booklet-PublishingAPillarBooklet).
Please note that chapter on "Pharo a web Perspective" is obsolete since it refers to Pharo 60.
Please note that the chapter of the book [Pharo a web Perspective](https://files.pharo.org/books-pdfs/entreprise-pharo/2016-10-06-EnterprisePharo.pdf) dedicated to Pillar is obsolete since it refers to Pharo 60.

20 changes: 3 additions & 17 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,18 @@ function get_platform_identifier() {
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
__builddir="$(pwd)/build"
PHARO_VERSION="${PHARO_VERSION:-130}"
PHARO="./pharo Pharo.image --no-default-preferences"

rm -rf "${__builddir}" && mkdir -p "${__builddir}" && cd "${__builddir}"

#if command -v pharo >/dev/null 2>&1; then
# echo "pharo is in PATH"
# PHARO_VM_BIN="pharo"
# wget -O - get.pharo.org/64/${PHARO_VERSION} | bash
#else
# echo "pharo not found in PATH"
# wget -O - get.pharo.org/64/${PHARO_VERSION}+vm | bash
# PHARO_VM_BIN="./pharo"
#fi

wget -O - get.pharo.org/64/${PHARO_VERSION}+vm | bash
mv ./pharo ./pharoForPillar
mv ./pharo-ui ./pharoForPillar-ui
PHARO_VM_BIN="./pharoForPillar"
PHARO="$PHARO_VM_BIN Pharo.image --no-default-preferences"

REPOSITORY_PATH=${__dir}/../src
OS=$(get_platform_identifier)
if [ "$OS" == "win" ]; then
REPOSITORY_PATH=$(cygpath $REPOSITORY_PATH --windows)
REPOSITORY_PATH=$(cygpath "$REPOSITORY_PATH" --windows)
fi

${PHARO} st --quit --save "${__dir}/unload_md.st"
${PHARO} st --quit --save $(cygpath "${__dir}/unload_md.st" --windows)

${PHARO} eval --save "Iceberg remoteTypeSelector: #httpsUrl. Metacello new baseline: 'Pillar'; repository: 'gitlocal://${REPOSITORY_PATH}'; load"

Expand Down
26 changes: 14 additions & 12 deletions src/BaselineOfPillar/BaselineOfPillar.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ BaselineOfPillar >> baseline: spec [
spec postLoadDoIt: #postload:package:.
spec
package: 'Pillar-Core'
with: [ spec requires: #( 'OSSubprocess' 'Microdown')];
with: [ spec requires: #( 'OSSubprocess' 'OSWinSubprocess' 'Microdown')];

package: 'Pillar-ExporterCore' with: [ spec requires: #( 'Pillar-Core' 'ContainersPropertyEnvironment' ) ];

Expand Down Expand Up @@ -137,8 +137,19 @@ BaselineOfPillar >> mustache: spec [

{ #category : 'dependencies' }
BaselineOfPillar >> osSubProcess: spec [

spec baseline: 'OSSubprocess' with: [ spec repository: 'github://pharo-contributions/OSSubprocess:v2.0.0/repository' ]
"From README in https://github.com/pharo-contributions/OSSubprocess:
It was decided together with Pharo Consortium that as a first step, we should concentrate on making it work on OSX and Unix.
If the tool proves to be good and accepted, we could, at a second step, try to add Windows support.
If you need Windows support, you can take a look at the https://github.com/pharo-contributions/OSWinSubprocess project."

"For Unix and OSX"
spec baseline: 'OSSubprocess' with: [
spec repository:
'github://pharo-contributions/OSSubprocess:v2.0.0/repository' ].
"For Windows"
spec baseline: 'OSWinSubprocess' with: [
spec repository:
'github://pharo-contributions/OSWinSubprocess:master/repository' ]
]

{ #category : 'baselines' }
Expand All @@ -148,12 +159,3 @@ BaselineOfPillar >> postload: loader package: packageSpec [
list := ((Process allInstances select: [ :p | p priority = 70 ]) select: [ :e | '*OSSub*' match: e name ]).
list ifNotEmpty: [ :f | f first terminate ]
]

{ #category : 'dependencies' }
BaselineOfPillar >> processWrapper: spec [

spec configuration: 'ProcessWrapper' with: [
spec
versionString: '1.2';
repository: 'http://smalltalkhub.com/mc/hernan/ProcessWrapper/main' ]
]
26 changes: 8 additions & 18 deletions src/Pillar-ExporterLaTeX/PRPDFDocument.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,17 @@ PRPDFDocument >> executeOnUnixCommand: command arguments: arguments workingDirec

{ #category : 'compiling' }
PRPDFDocument >> executeOnWindowsCommand: command arguments: arguments workingDirectory: aWorkingDirectory [
| process success commandString |
commandString := 'cd "', aWorkingDirectory, '" && ', command, ' ', (' ' join: arguments).

process := ProcessWrapper new.
process useStderr; useStdout.
success := process startWithShellCommand: commandString.
success ifFalse: [
self error: 'command ', commandString ,' failed' ].

success := process waitForExit.
success ifFalse: [
self error: 'command ', commandString ,' failed' ].

Transcript show: process stdoutStream upToEnd.
Transcript show: process stderrStream upToEnd.

process closeStdin.
process closeStderr.
| process commandString |
commandString := 'cd "' , aWorkingDirectory , '" && ' , command , ' '
, (' ' join: arguments).

process := OSWSWinProcess new
shellCommand: commandString;
runAndWait.

process exitCode = 0 ifFalse: [
self error: 'command ', commandString ,' failed' ].
self error: 'command ' , commandString , ' failed' ]
]

{ #category : 'accessing' }
Expand Down