Skip to content

Commit

Permalink
Split skylighting (GPL) into skylighting-core (BSD3) and skylighting …
Browse files Browse the repository at this point in the history
…(GPL) (#37)

The package is split into two parts: skylighting-core (BSD3 licensed), which includes
the core library functionality and the source of the XML syntax, but not the compiled
Syntax modules, and skylighting (GPL2 licensed), which includes Syntax modules
compiled from the XML syntax files.

skylighting itself must be GPL-licensed, because some of the Syntax modules are derived
from xml syntax descriptions that are GPL-licensed.  This change makes most of
the library's functionality available under a more liberal license.

We discontinue support for GHC before 7.10 (because we need to support the
reexport-modules Cabal directive.)
  • Loading branch information
jtdaugherty authored and jgm committed Mar 3, 2018
1 parent fdf966e commit 0e8a93c
Show file tree
Hide file tree
Showing 229 changed files with 466 additions and 332 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
dist-newstyle
dist
.stack-work
src/Skylighting/Syntax.hs
src/Skylighting/Syntax/*.hs
skylighting.cabal.orig
.*.swp
syntax-highlighting
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ matrix:
include:
# We grab the appropriate GHC and cabal-install versions from hvr's PPA. See:
# https://github.com/hvr/multi-ghc-travis
- env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18
compiler: ": #GHC 7.8.4"
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,happy-1.19.5], sources: [hvr-ghc]}}
- env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.24
compiler: ": #GHC 7.10.3"
addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.3,happy-1.19.5], sources: [hvr-ghc]}}
Expand Down
35 changes: 22 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#XMLS=haskell.xml cmake.xml diff.xml hamlet.xml alert.xml modelines.xml c.xml doxygen.xml
XMLS=$(wildcard xml/*.xml)

quick:
stack install --test --flag "skylighting:executable" --test-arguments '--hide-successes $(TESTARGS)'

Expand All @@ -10,26 +7,38 @@ test:
bench:
stack bench --flag 'skylighting:executable'

format:
format: skylighting-format skylighting-core-format

skylighting-core-format:
stylish-haskell -i -c .stylish-haskell \
skylighting-core/bin/*.hs \
skylighting-core/test/test-skylighting.hs \
skylighting-core/benchmark/benchmark.hs \
skylighting-core/Setup.hs \
skylighting-core/src/Skylighting/*.hs \
skylighting-core/src/Skylighting/Format/*.hs

skylighting-format:
stylish-haskell -i -c .stylish-haskell \
bin/*.hs test/test-skylighting.hs benchmark/benchmark.hs \
prelude/Prelude.hs Setup.hs \
src/Skylighting/*.hs src/Skylighting/Format/*.hs src/Skylighting.hs
skylighting/bin/*.hs \
skylighting/Setup.hs \
skylighting/src/Skylighting.hs

XMLS=$(wildcard skylighting-core/xml/*.xml)
bootstrap: $(XMLS)
-rm -rf src/Skylighting/Syntax src/Skylighting/Syntax.hs
stack install --flag "skylighting:bootstrap" --fast --no-test --no-bench
skylighting-extract $(XMLS)
stack install --flag "skylighting:-bootstrap" --flag "skylighting:executable" --test --test-arguments '--hide-successes $(TESTARGS)' --fast
-rm -rf skylighting/src/Skylighting/Syntax skylighting/src/Skylighting/Syntax.hs
cd skylighting && skylighting-extract ../skylighting-core/xml/*.xml
stack install --flag "skylighting:executable" --test --test-arguments \
'--hide-successes $(TESTARGS)' --fast

syntax-highlighting:
git clone https://github.com/KDE/syntax-highlighting

update-xml: syntax-highlighting
cd syntax-highlighting; \
git pull; \
cd ../xml; \
for x in *.xml; do cp ../syntax-highlighting/data/syntax/$$x ./; done ; \
cd ../skylighting-core/xml; \
for x in *.xml; do cp ../../syntax-highlighting/data/syntax/$$x ./; done ; \
for x in *.xml.patch; do patch < $$x; done

clean:
Expand Down
98 changes: 0 additions & 98 deletions README.md

This file was deleted.

1 change: 1 addition & 0 deletions README.md
12 changes: 0 additions & 12 deletions TODO

This file was deleted.

26 changes: 0 additions & 26 deletions prelude/Prelude.hs

This file was deleted.

30 changes: 30 additions & 0 deletions skylighting-core/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Copyright (c) 2016-2018, John MacFarlane.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

* The names of the contributors may not be used to endorse or
promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17 changes: 17 additions & 0 deletions skylighting-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
skylighting-core
================

[![license](https://img.shields.io/badge/license-BSD3-brightgreen.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![skylighting-core build status](https://img.shields.io/travis/jgm/skylighting-core.svg)](https://travis-ci.org/jgm/skylighting-core)

This package provides the core functionality of the Skylighting project,
a Haskell syntax highlighting library with support for KDE XML syntax
highlighting descriptions.

For details on how to use this package, see the Haddock documentation and
the [Skylighting README](https://github.com/jgm/skylighting/blob/master/skylighting/README.md).

The Haskell code and related files in this package are licensed under
the BSD3 license. This package also includes KDE XML syntax definitions
which are provided under various licenses; see the XML files for
details.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 0e8a93c

Please sign in to comment.