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
4 changes: 2 additions & 2 deletions Makefile_gs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ init:


## GHOSTSCRIPT (https://www.ghostscript.com/)
## https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs927/ghostscript-9.27.tar.gz
## https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9561/ghostscript-9.56.1.tar.gz
## -------------------------------------------------------------------------------------------------------
GHOSTSCRIPT_VERSION=9.27
GHOSTSCRIPT_VERSION=9.56.1
GHOSTSCRIPT_VERSION_DIR=gs$(subst .,,$(GHOSTSCRIPT_VERSION))
GHOSTSCRIPT_SRC_FILE=ghostscript-${GHOSTSCRIPT_VERSION}.tar.gz
GHOSTSCRIPT_SRC_DIR=$(subst .tar.gz,,$(GHOSTSCRIPT_SRC_FILE))
Expand Down
2 changes: 1 addition & 1 deletion README-SAR.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ghostscript Lambda Layer for Amazon Linux 2 AMIs

Ghostscript AWS Lambda layer adding PDF files conversion support using ImageMagick.
Bundles Ghostscript 9.27.
Bundles Ghostscript 9.56.1.

As a prerequisite, add the ImageMagick support by deploying the
[image-magick-lambda-layer](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:145266761615:applications~image-magick-lambda-layer)
Expand Down
41 changes: 16 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Scripts to compile Ghostscript (gs) for AWS Lambda instances powered by Amazon Linux 2.x,
such as the `nodejs10.x` runtime, and the updated 2018.03 Amazon Linux 1 runtimes.


## Usage

Absolutely the easiest way of using this is to pull it directly from the AWS Serverless
Expand All @@ -16,48 +15,44 @@ application in the Serverless App Repository.

For manual deployments and custom builds, read below...


## Prerequisites

* Docker desktop
* Unix Make environment
* AWS command line utilities (just for deployment)

- Docker desktop
- Unix Make environment
- AWS command line utilities (just for deployment)

## Compiling the code

* start Docker services
* `make all`
- start Docker services
- `make all`

There are two `make` scripts in this project.

* [`Makefile`](Makefile) is intended to run on the build system, and just starts
a Docker container matching the AWS Linux 2 environment for Lambda runtimes to
compile Ghostscript using the second script.
* [`Makefile_gs`](Makefile_gs) is the script that will run inside the container,
and actually compile binaries.
- [`Makefile`](Makefile) is intended to run on the build system, and just starts
a Docker container matching the AWS Linux 2 environment for Lambda runtimes to
compile Ghostscript using the second script.
- [`Makefile_gs`](Makefile_gs) is the script that will run inside the container,
and actually compile binaries.

The output will be in the `result` dir.

### Configuring the build

By default, this compiles a version expecting to run as a Lambda layer from
`/opt`. You can change the expected location by providing a `TARGET` variable
`/opt`. You can change the expected location by providing a `TARGET` variable
when invoking `make`.

The default Docker image used is `lambci/lambda-base-2:build`. To use a different
base, provide a `DOCKER_IMAGE` variable when invoking `make`.

Modify the versions of libraries or Ghostscript directly in [`Makefile_gs`](Makefile_gs).


### Compiled info

```
ghostscript version 9.27
ghostscript version 9.56.1
```


## Deploying to AWS as a layer

Run the following command to deploy the compiled result as a layer in your AWS account.
Expand All @@ -66,27 +61,23 @@ Run the following command to deploy the compiled result as a layer in your AWS a
make deploy DEPLOYMENT_BUCKET=<YOUR BUCKET NAME> [PROFILE="--profile <YOUR NAMED PROFILE FROM ~/.aws/credentials>"]
```


### Configuring the deployment

By default, this uses `ghostscript-layer` as the stack name. Provide a
`STACK_NAME` variable when calling `make deploy` to use an alternative name.


## Additional Info

For more information, check out:

* https://www.ghostscript.com/

- https://www.ghostscript.com/

## Author

Tomislav Capan


## License

* These scripts: [MIT](https://opensource.org/licenses/MIT)
* Ghostscript: <https://www.ghostscript.com/license.html>
* Contained libraries all have separate licenses, check the respective web sites for more information
- These scripts: [MIT](https://opensource.org/licenses/MIT)
- Ghostscript: <https://www.ghostscript.com/license.html>
- Contained libraries all have separate licenses, check the respective web sites for more information
4 changes: 2 additions & 2 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ Metadata:
Name: ghostscript-lambda-layer
Description: >
Ghostscript AWS Lambda layer adding PDF files conversion support using ImageMagick.
Bundles Ghostscript 9.27.
Bundles Ghostscript 9.56.1.
Author: Tomislav Capan
SpdxLicenseId: MIT
LicenseUrl: LICENSE.txt
ReadmeUrl: README-SAR.md
Labels: ['layer', 'pdf', 'lambda', 'ghostscript', 'gs']
HomePageUrl: https://github.com/zappan/ghostscript-lambda-layer
SemanticVersion: 9.27.0
SemanticVersion: 9.56.1
SourceCodeUrl: https://github.com/zappan/ghostscript-lambda-layer