aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-01-12 21:18:17 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2021-01-12 21:18:17 -0800
commit91fbea29ddf961654b1c09efaba70d92bfd65cc0 (patch)
tree9a3fc77c7c0c5d451d65472bdbb917eba38ba8ad
parent387d3e76ee81138588195ebe8dad7720f2623b02 (diff)
downloadpandoc-91fbea29ddf961654b1c09efaba70d92bfd65cc0.tar.gz
Add files for using nix-shell.
'make nix-shell' enters a nix shell with pandoc dependencies installed.
-rw-r--r--Makefile8
-rw-r--r--default.nix55
-rw-r--r--release.nix4
3 files changed, 66 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index f27272b08..e9607f198 100644
--- a/Makefile
+++ b/Makefile
@@ -91,6 +91,12 @@ README.md: README.template MANUAL.txt tools/update-readme.lua
pandoc --lua-filter tools/update-readme.lua \
--reference-location=section -t gfm $< -o $@
+default.nix: pandoc.cabal
+ nix-shell --pure -p cabal2nix --run "cabal2nix ." > $@
+
+nix-shell:
+ nix-shell --attr env release.nix
+
download_stats:
curl https://api.github.com/repos/jgm/pandoc/releases | \
jq -r '.[] | .assets | .[] | "\(.download_count)\t\(.name)"'
@@ -124,4 +130,4 @@ sdist-files.txt: .FORCE
git-files.txt: .FORCE
git ls-tree -r --name-only HEAD | grep '^\(test\|data\)\/' | sort > $@
-.PHONY: .FORCE deps quick full haddock install clean test bench changes_github dist prof download_stats reformat lint weigh doc/lua-filters.md pandoc-templates trypandoc update-website debpkg checkdocs ghcid ghci fix_spacing hlint check check-cabal
+.PHONY: .FORCE deps quick full haddock install clean test bench changes_github dist prof download_stats reformat lint weigh doc/lua-filters.md pandoc-templates trypandoc update-website debpkg checkdocs ghcid ghci fix_spacing hlint check check-cabal nix-shell
diff --git a/default.nix b/default.nix
new file mode 100644
index 000000000..a18be1fa8
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,55 @@
+{ mkDerivation, aeson, aeson-pretty, attoparsec, base
+, base64-bytestring, binary, blaze-html, blaze-markup, bytestring
+, case-insensitive, citeproc, commonmark, commonmark-extensions
+, commonmark-pandoc, connection, containers, criterion
+, data-default, deepseq, Diff, directory, doclayout, doctemplates
+, emojis, exceptions, executable-path, file-embed, filepath, Glob
+, haddock-library, hslua, hslua-module-system, hslua-module-text
+, HsYAML, HTTP, http-client, http-client-tls, http-types, ipynb
+, jira-wiki-markup, JuicyPixels, mtl, network, network-uri
+, pandoc-types, parsec, process, QuickCheck, random, safe
+, scientific, SHA, skylighting, skylighting-core, split, stdenv
+, syb, tagsoup, tasty, tasty-golden, tasty-hunit, tasty-lua
+, tasty-quickcheck, temporary, texmath, text, text-conversions
+, time, unicode-transforms, unix, unordered-containers, weigh, xml
+, zip-archive, zlib
+}:
+mkDerivation {
+ pname = "pandoc";
+ version = "2.11.4";
+ src = ./.;
+ configureFlags = [ "-fhttps" "-f-trypandoc" ];
+ isLibrary = true;
+ isExecutable = true;
+ enableSeparateDataOutput = true;
+ libraryHaskellDepends = [
+ aeson aeson-pretty attoparsec base base64-bytestring binary
+ blaze-html blaze-markup bytestring case-insensitive citeproc
+ commonmark commonmark-extensions commonmark-pandoc connection
+ containers data-default deepseq directory doclayout doctemplates
+ emojis exceptions file-embed filepath Glob haddock-library hslua
+ hslua-module-system hslua-module-text HsYAML HTTP http-client
+ http-client-tls http-types ipynb jira-wiki-markup JuicyPixels mtl
+ network network-uri pandoc-types parsec process random safe
+ scientific SHA skylighting skylighting-core split syb tagsoup
+ temporary texmath text text-conversions time unicode-transforms
+ unix unordered-containers xml zip-archive zlib
+ ];
+ executableHaskellDepends = [ base ];
+ testHaskellDepends = [
+ base base64-bytestring bytestring containers Diff directory
+ doctemplates exceptions executable-path filepath Glob hslua mtl
+ pandoc-types process QuickCheck tasty tasty-golden tasty-hunit
+ tasty-lua tasty-quickcheck temporary text time xml zip-archive
+ ];
+ benchmarkHaskellDepends = [
+ base bytestring containers criterion mtl text time weigh
+ ];
+ postInstall = ''
+ mkdir -p $out/share/man/man1
+ mv "man/"*.1 $out/share/man/man1/
+ '';
+ homepage = "https://pandoc.org";
+ description = "Conversion between markup formats";
+ license = stdenv.lib.licenses.gpl2Plus;
+}
diff --git a/release.nix b/release.nix
new file mode 100644
index 000000000..e28be9ac3
--- /dev/null
+++ b/release.nix
@@ -0,0 +1,4 @@
+let
+ pkgs = import <nixpkgs> { };
+in
+ pkgs.haskellPackages.callPackage ./default.nix { }