This repository contains a set of patches for particular packages from
Hackage that cannot be built out-of-the-box with etlas. Packages are automatically installed when
you add them as a dependency to your project.
and try the installation again.
These packages are heavy on FFI dependencies and don’t make sense in the context
of the JVM, hence no effort will be made to port them.
These packages have special meaning in the Eta compiler and hence are provided
upon installation.
If you have already forked this repository, then skip to step 3.
-
Fetch the package and navigate to it.
etlas get somepackage-0.1.2.3
cd somepackage-0.1.2.3/
-
If the message “Found patch in eta-hackage for somepackage-0.1.2.3” appeared
in step 1, skip to step 3.
Otherwise, initialize a Git repository and make an initial commit.
git init && git add . && git commit -m "First"
-
Build the package.
etlas build
-
If the previous version of the package has already been patched, try out:
git apply --reject [path-to-patch]
This will work in most cases. If not, resolve the changes.
-
Otherwise, apply the desired changes and go back to step 3 as long as the build fails.
-
Once the build succeeds, make a commit.
rm -rf dist/ && git add . && git commit -m "Patched"
-
Create a patch.
Mac and Linux users can use the following command to patch:
git format-patch HEAD~ --stdout > somepackage-0.1.2.3.patch
Windows users can use the following command to patch:
git format-patch HEAD~ --stdout --ignore-cr-at-eol > somepackage-0.1.2.3.patch
It had been detected that in windows patches created using powershell has not the correct format and can’t be applied so it’s better to do it in the dos console.
-
If you have changed the .cabal file of the package in your patch, make a copy
and rename it from somepackage.cabal to somepackage-0.1.2.3.cabal.
cp somepackage.cabal somepackage-0.1.2.3.cabal
-
Copy the patch file and the cabal file (if changed) to the patches directory
in your local clone of your fork of the eta-hackage repository.
NOTE: $YOUR_FORK_PATH should be replaced with the path to the local clone
of your forked version of eta-hackage.
If the cabal file didn’t change:
cp somepackage-0.1.2.3.patch $YOUR_FORK_PATH/patches/
If the cabal file changes:
cp somepackage-0.1.2.3.cabal somepackage-0.1.2.3.patch $YOUR_FORK_PATH/patches/
-
Update this README.md with the package name (in alphabetical order) in the
Supported Packages section in the same format as the other packages.
If there already exists an entry for an older or newer version of the package,
please consolidate the new versions into the existing entry. You can see the
directory entry as an example.
-
In your eta-hackage repository,
$ git add .
$ git commit -m "Patched somepackage-0.1.2.3"
$ git push origin
-
Submit a pull request to this repository for review.
If you want to apply the patch to an old version of a package to a new version of a package, you can run
评论