From fc9f714d03a9d018ab9f2474affcf995eb60a4e2 Mon Sep 17 00:00:00 2001
From: stuebinm <stuebinm@disroot.org>
Date: Sun, 19 Dec 2021 13:22:20 +0100
Subject: [PATCH] add install instructions, remove nix/guix

---
 Readme.md    | 60 ++++++++++++++++++++++++++++++++++++++++++++
 build.nix    |  5 ----
 default.nix  | 21 ----------------
 manifest.scm | 71 ----------------------------------------------------
 4 files changed, 60 insertions(+), 97 deletions(-)
 delete mode 100644 build.nix
 delete mode 100644 default.nix
 delete mode 100644 manifest.scm

diff --git a/Readme.md b/Readme.md
index 837af7f..ab10ea1 100644
--- a/Readme.md
+++ b/Readme.md
@@ -10,6 +10,66 @@ copying all needed assets and minifying the map's json. This is used to simulate
 a `bbbRoom` property (via `openWebsite`), collect and remove badge tokens before
 maps are published, and to resolve special-schema URIs (e.g. `world://`).
 
+## Installing
+
+### From the CI pipeline
+
+Gitlab [automatically builds a version](https://git.cccv.de/hub/walint/-/jobs)
+of `walint` each time something is pushed to this repository. The resulting
+binary should work fine on most linux systems, especially if they're vaguely
+debian-like.
+
+In case you get an incomprehensible or confusing error when executing it, try 
+running `ldd walint` and see if anything is marked as not found, then install it.
+
+### Build using stack
+
+This uses a lockfile to pin versions of dependencies (as well as `ghc`, the haskell
+compiler). You will need [stack](https://docs.haskellstack.org/en/stable/README/).
+
+Then just run
+
+```
+stack build
+```
+
+If you lack `ghc` in the correct version and don't know how to install it, you can
+pass it `--install-ghc` to take care of that for you (note that on Nix, `stack` may
+automatically use a fitting `ghc` derivation if it finds one).
+
+To install into your `$PATH`, use
+
+```
+stack install
+```
+
+Alternatively, run `walint` via stack:
+
+```
+stack run -- walint [options as normal]
+```
+
+However, in this case stack will re-check files every time to ensure your build
+is up to date with the sources, which will make it slower to start.
+
+### Build using cabal
+
+Note that this does not pin dependencies, and `walint` currently does not even
+define semver ranges to ensure it compiles at all! Even so, you can use 
+[cabal](https://www.haskell.org/cabal/) if for some reason you absolutely must,
+as long as your package list is sufficiently recent.
+
+Run:
+
+```
+cabal update
+cabal build
+```
+
+Note that `cabal` might decide to pull in an older version of Aeson which is
+still vulnerable to hash flooding; in that case `walint` will print a warning
+on startup.
+
 ## Usage
 ``` sh
 walint --config-file config.json --repository path \
diff --git a/build.nix b/build.nix
deleted file mode 100644
index 50d9a3c..0000000
--- a/build.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-let
-  sources = import ./nix/sources.nix {};
-  nixpkgs = import sources.nixpkgs {};
-in
-  nixpkgs.haskellPackages.callPackage ./default.nix {}
diff --git a/default.nix b/default.nix
deleted file mode 100644
index 541c913..0000000
--- a/default.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{ mkDerivation, aeson, aeson-pretty, base, bytestring
-, bytestring-encoding, containers, either, extra, filepath
-, getopt-generics, lib, mtl, regex-tdfa, text, transformers, vector
-}:
-mkDerivation {
-  pname = "walint";
-  version = "0.1.0.0";
-  src = ./.;
-  isLibrary = true;
-  isExecutable = true;
-  libraryHaskellDepends = [
-    aeson base bytestring containers either extra filepath
-    getopt-generics mtl regex-tdfa text transformers vector
-  ];
-  executableHaskellDepends = [
-    aeson aeson-pretty base bytestring bytestring-encoding
-    getopt-generics text
-  ];
-  license = "unknown";
-  hydraPlatforms = lib.platforms.none;
-}
diff --git a/manifest.scm b/manifest.scm
deleted file mode 100644
index a939482..0000000
--- a/manifest.scm
+++ /dev/null
@@ -1,71 +0,0 @@
-(define-module (guix walint)
-  #:use-module (guix download)
-  #:use-module (guix gexp)
-  #:use-module (guix profiles)
-  #:use-module (gnu packages haskell)
-  #:use-module (gnu packages haskell-web)
-  #:use-module (gnu packages haskell-xyz)
-  #:use-module (guix packages)
-  #:use-module (guix git-download)
-  #:use-module (guix build-system haskell)
-  #:use-module (guix licenses)
-  #:use-module (srfi srfi-1))
-
-;; the regex packages provided by current guix are a little too old,
-;; and would result in a missing typeclass instance
-(define ghc-regex-base-newer
-  (package
-    (inherit ghc-regex-base)
-    (version "0.94.0.1")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append
-             "https://hackage.haskell.org/package/regex-base/regex-base-"
-             version
-             ".tar.gz"))
-       (sha256
-        (base32
-         "1ngdmmrxs1rhvib052c6shfa40yad82jylylikz327r0zxpxkcbi"))))))
-
-(define ghc-regex-tdfa-newer
-  (package
-    (inherit ghc-regex-tdfa)
-    (version "1.3.1.1")
-    (inputs `(("ghc-regex-base" ,ghc-regex-base-newer)
-              ("ghc-utf8-string" ,ghc-utf8-string)))
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append
-             "https://hackage.haskell.org/package/regex-tdfa/regex-tdfa-"
-             version ".tar.gz"))
-       (sha256
-        (base32
-         "1msrq31k4jmn2lmrdzn87jqarqhw265ca69rfg5jpa5adrzm3gmi"))))))
-
-(define-public walint
-  (package
-    (name "walint")
-    (version "0.1")
-    (source
-      (local-file "" #:recursive? #t))
-    (build-system haskell-build-system)
-    (arguments '())
-    (inputs
-     `(("ghc" ,ghc)
-       ("ghc-aeson" ,ghc-aeson)
-       ("ghc-regex-tdfa" ,ghc-regex-tdfa-newer)
-       ("ghc-getopt-generics" ,ghc-getopt-generics)
-       ("ghc-aeson-pretty" ,ghc-aeson-pretty)
-       ("ghc-either" ,ghc-either)
-       ("ghc-extra" ,ghc-extra)
-       ("ghc-bytestring-builder" ,ghc-bytestring-builder)))
-    (home-page "https://stuebinm.eu/git/walint")
-    (synopsis "linter for workadventure maps")
-    (description
-     "linter for workadventure maps")
-    (license "undecided")))
-
-(packages->manifest
- `(,walint))
-- 
GitLab