From 48390f18b6b5690f015291af83fafefd10c70f57 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 14 Jan 2016 22:14:49 +0000 Subject: bbcode is orthogonal to thermoprint --- bbcode/bbcode.cabal | 44 +++++++++++++++++++++++++++++++++++++++++ bbcode/bbcode.nix | 17 ++++++++++++++++ bbcode/thermoprint-bbcode.cabal | 44 ----------------------------------------- bbcode/thermoprint-bbcode.nix | 17 ---------------- default.nix | 6 ++++-- spec/thermoprint-spec.cabal | 2 ++ spec/thermoprint-spec.nix | 12 +++++------ 7 files changed, 73 insertions(+), 69 deletions(-) create mode 100644 bbcode/bbcode.cabal create mode 100644 bbcode/bbcode.nix delete mode 100644 bbcode/thermoprint-bbcode.cabal delete mode 100644 bbcode/thermoprint-bbcode.nix diff --git a/bbcode/bbcode.cabal b/bbcode/bbcode.cabal new file mode 100644 index 0000000..d2f4932 --- /dev/null +++ b/bbcode/bbcode.cabal @@ -0,0 +1,44 @@ +-- Initial thermoprint-bbcode.cabal generated by cabal init. For further +-- documentation, see http://haskell.org/cabal/users-guide/ + +name: bbcode +version: 0.0.0 +synopsis: A parser for bbcode +-- description: +homepage: http://dirty-haskell.org/tags/thermoprint.html +license: PublicDomain +license-file: LICENSE +author: Gregor Kleen +maintainer: aethoago@141.li +-- copyright: +category: Text +build-type: Simple +-- extra-source-files: +cabal-version: >=1.10 + +library + exposed-modules: Text.BBCode + , Text.BBCode.Lexer + -- other-modules: + -- other-extensions: + build-depends: base >=4.8 && <4.9 + , attoparsec >=0.13.0 && <1 + , text >=1.2.1 && <2 + , containers >=0.4.0 && <1 + , rosezipper >=0.2 && <1 + , case-insensitive >=1.2.0 && <2 + hs-source-dirs: src + default-language: Haskell2010 + +Test-Suite tests + type: exitcode-stdio-1.0 + hs-source-dirs: test + main-is: Spec.hs + ghc-options: -threaded -with-rtsopts=-N + build-depends: base >=4.8.1 && <5 + , bbcode -any + , hspec >=2.2.1 && <3 + , QuickCheck >=2.8.1 && <3 + , quickcheck-instances >=0.3.11 && <1 + , attoparsec >=0.13.0 && <1 + , text >=1.2.1 && <2 \ No newline at end of file diff --git a/bbcode/bbcode.nix b/bbcode/bbcode.nix new file mode 100644 index 0000000..82ba2f4 --- /dev/null +++ b/bbcode/bbcode.nix @@ -0,0 +1,17 @@ +{ mkDerivation, attoparsec, base, case-insensitive, containers +, hspec, QuickCheck, quickcheck-instances, rosezipper, stdenv, text +}: +mkDerivation { + pname = "bbcode"; + version = "0.0.0"; + src = ./.; + libraryHaskellDepends = [ + attoparsec base case-insensitive containers rosezipper text + ]; + testHaskellDepends = [ + attoparsec base hspec QuickCheck quickcheck-instances text + ]; + homepage = "http://dirty-haskell.org/tags/thermoprint.html"; + description = "A parser for bbcode"; + license = stdenv.lib.licenses.publicDomain; +} diff --git a/bbcode/thermoprint-bbcode.cabal b/bbcode/thermoprint-bbcode.cabal deleted file mode 100644 index f25ffdf..0000000 --- a/bbcode/thermoprint-bbcode.cabal +++ /dev/null @@ -1,44 +0,0 @@ --- Initial thermoprint-bbcode.cabal generated by cabal init. For further --- documentation, see http://haskell.org/cabal/users-guide/ - -name: thermoprint-bbcode -version: 0.0.0 -synopsis: A parser for a subset of bbcode compatible with thermoprint-spec --- description: -homepage: http://dirty-haskell.org/tags/thermoprint.html -license: PublicDomain -license-file: LICENSE -author: Gregor Kleen -maintainer: aethoago@141.li --- copyright: -category: Text -build-type: Simple --- extra-source-files: -cabal-version: >=1.10 - -library - exposed-modules: Text.BBCode - , Text.BBCode.Lexer - -- other-modules: - -- other-extensions: - build-depends: base >=4.8 && <4.9 - , attoparsec >=0.13.0 && <1 - , text >=1.2.1 && <2 - , containers >=0.4.0 && <1 - , rosezipper >=0.2 && <1 - , case-insensitive >=1.2.0 && <2 - hs-source-dirs: src - default-language: Haskell2010 - -Test-Suite tests - type: exitcode-stdio-1.0 - hs-source-dirs: test - main-is: Spec.hs - ghc-options: -threaded -with-rtsopts=-N - build-depends: base >=4.8.1 && <5 - , thermoprint-bbcode -any - , hspec >=2.2.1 && <3 - , QuickCheck >=2.8.1 && <3 - , quickcheck-instances >=0.3.11 && <1 - , attoparsec >=0.13.0 && <1 - , text >=1.2.1 && <2 \ No newline at end of file diff --git a/bbcode/thermoprint-bbcode.nix b/bbcode/thermoprint-bbcode.nix deleted file mode 100644 index 896bb04..0000000 --- a/bbcode/thermoprint-bbcode.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ mkDerivation, attoparsec, base, case-insensitive, containers -, hspec, QuickCheck, quickcheck-instances, rosezipper, stdenv, text -}: -mkDerivation { - pname = "thermoprint-bbcode"; - version = "0.0.0"; - src = ./.; - libraryHaskellDepends = [ - attoparsec base case-insensitive containers rosezipper text - ]; - testHaskellDepends = [ - attoparsec base hspec QuickCheck quickcheck-instances text - ]; - homepage = "http://dirty-haskell.org/tags/thermoprint.html"; - description = "A parser for a subset of bbcode compatible with thermoprint-spec"; - license = stdenv.lib.licenses.publicDomain; -} diff --git a/default.nix b/default.nix index 40034c6..867ac5b 100644 --- a/default.nix +++ b/default.nix @@ -2,6 +2,8 @@ }: rec { - thermoprint-spec = pkgs.haskellPackages.callPackage ./spec/thermoprint-spec.nix {}; - thermoprint-bbcode = pkgs.haskellPackages.callPackage ./bbcode/thermoprint-bbcode.nix {}; + thermoprint-spec = pkgs.haskellPackages.callPackage ./spec/thermoprint-spec.nix { + inherit bbcode; + }; + bbcode = pkgs.haskellPackages.callPackage ./bbcode/bbcode.nix {}; } diff --git a/spec/thermoprint-spec.cabal b/spec/thermoprint-spec.cabal index b9f7fd6..40978c3 100644 --- a/spec/thermoprint-spec.cabal +++ b/spec/thermoprint-spec.cabal @@ -19,6 +19,7 @@ cabal-version: >=1.10 library hs-source-dirs: src exposed-modules: Thermoprint.Printout + , Thermoprint.Printout.BBCode , Thermoprint.Identifiers , Thermoprint.API -- other-modules: @@ -27,6 +28,7 @@ library , DeriveAnyClass , OverloadedStrings build-depends: base >=4.8.1 && <5 + , bbcode -any , containers >=0.5.6 && <1 , text >=1.2.1 && <2 , bytestring >=0.10.6 && <1 diff --git a/spec/thermoprint-spec.nix b/spec/thermoprint-spec.nix index 2da5d86..368f3a9 100644 --- a/spec/thermoprint-spec.nix +++ b/spec/thermoprint-spec.nix @@ -1,15 +1,15 @@ -{ mkDerivation, aeson, base, base64-bytestring, bytestring, Cabal -, cabal-test-quickcheck, containers, deepseq, encoding, hspec -, QuickCheck, quickcheck-instances, servant, stdenv, text +{ mkDerivation, aeson, base, base64-bytestring, bbcode, bytestring +, Cabal, cabal-test-quickcheck, containers, deepseq, encoding +, hspec, QuickCheck, quickcheck-instances, servant, stdenv, text }: mkDerivation { pname = "thermoprint-spec"; version = "1.0.0"; src = ./.; libraryHaskellDepends = [ - aeson base base64-bytestring bytestring Cabal cabal-test-quickcheck - containers deepseq encoding QuickCheck quickcheck-instances servant - text + aeson base base64-bytestring bbcode bytestring Cabal + cabal-test-quickcheck containers deepseq encoding QuickCheck + quickcheck-instances servant text ]; testHaskellDepends = [ aeson base hspec QuickCheck quickcheck-instances -- cgit v1.2.3