From 7fb157733b06f532068fd9f0d0edf38d2265013e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nade=C5=ADka?= Date: Sun, 1 May 2022 18:34:24 +0300 Subject: [PATCH] New package: klfc-1.5.7 --- .../klfc/patches/0001-Fix-some-warnings.patch | 32 ++++++++++++++ ...0002-Fix-compilation-with-GHC-9.0-40.patch | 44 +++++++++++++++++++ .../patches/0003-More-fixes-for-GHC-9.0.patch | 25 +++++++++++ srcpkgs/klfc/template | 23 ++++++++++ 4 files changed, 124 insertions(+) create mode 100644 srcpkgs/klfc/patches/0001-Fix-some-warnings.patch create mode 100644 srcpkgs/klfc/patches/0002-Fix-compilation-with-GHC-9.0-40.patch create mode 100644 srcpkgs/klfc/patches/0003-More-fixes-for-GHC-9.0.patch create mode 100644 srcpkgs/klfc/template diff --git a/srcpkgs/klfc/patches/0001-Fix-some-warnings.patch b/srcpkgs/klfc/patches/0001-Fix-some-warnings.patch new file mode 100644 index 000000000000..9d405dbf92c8 --- /dev/null +++ b/srcpkgs/klfc/patches/0001-Fix-some-warnings.patch @@ -0,0 +1,32 @@ +From 725bf5bf6c7177c538bcd6bab73a8ce1bd179c42 Mon Sep 17 00:00:00 2001 +From: Aldo Gunsing +Date: Thu, 16 Dec 2021 22:38:03 +0100 +Subject: [PATCH 1/6] Fix some warnings + +--- + src/KlcParse.hs | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/KlcParse.hs b/src/KlcParse.hs +index 7cc76ac..de90301 100644 +--- a/src/KlcParse.hs ++++ b/src/KlcParse.hs +@@ -196,13 +196,13 @@ keyName = do + descriptions ∷ (Parser m, MonadFail m) ⇒ m () + descriptions = do + ["DESCRIPTIONS"] ← readLine +- many (some hexDigitChar *> spacing *> endLine) ++ void $ many (some hexDigitChar *> spacing *> endLine) + pure () + + languageNames ∷ (Parser m, MonadFail m) ⇒ m () + languageNames = do + ["LANGUAGENAMES"] ← readLine +- many (some hexDigitChar *> spacing *> endLine) ++ void $ many (some hexDigitChar *> spacing *> endLine) + pure () + + endKbd ∷ (Parser m, MonadFail m) ⇒ m () +-- +2.36.0 + diff --git a/srcpkgs/klfc/patches/0002-Fix-compilation-with-GHC-9.0-40.patch b/srcpkgs/klfc/patches/0002-Fix-compilation-with-GHC-9.0-40.patch new file mode 100644 index 000000000000..c4743120f49e --- /dev/null +++ b/srcpkgs/klfc/patches/0002-Fix-compilation-with-GHC-9.0-40.patch @@ -0,0 +1,44 @@ +From fee9bdeb76cc1f9e9e36b91764aff665c9164164 Mon Sep 17 00:00:00 2001 +From: Aldo Gunsing +Date: Thu, 16 Dec 2021 22:38:09 +0100 +Subject: [PATCH 2/6] Fix compilation with GHC 9.0 (#40) + +See https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.0#simplified-subsumption +for the required eta-expansion in lensWithDefault' + +Hiding singleton from BasePrelude gives a warning for previous GHC versions, +but this is a minor issue +--- + src/Util.hs | 2 +- + src/WithPlus.hs | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/Util.hs b/src/Util.hs +index 0dc0884..dc096db 100644 +--- a/src/Util.hs ++++ b/src/Util.hs +@@ -80,7 +80,7 @@ lensWithDefault guess setter getter f x = + (\y → setter (Just y) x) <$> f (fromMaybe (guess x) (getter x)) + + lensWithDefault' ∷ α → (Maybe α → σ → σ) → (σ → Maybe α) → Lens' σ α +-lensWithDefault' = lensWithDefault ∘ const ++lensWithDefault' x = lensWithDefault (const x) + + (!?) ∷ [α] → Int → Maybe α + (!?) xs i = +diff --git a/src/WithPlus.hs b/src/WithPlus.hs +index 1a46faf..558591d 100644 +--- a/src/WithPlus.hs ++++ b/src/WithPlus.hs +@@ -9,7 +9,7 @@ module WithPlus + , parseString + ) where + +-import BasePrelude hiding (toList, fromList) ++import BasePrelude hiding (toList, fromList, singleton) + import Prelude.Unicode + import Data.Monoid.Unicode ((∅)) + import Util (HumanReadable, split) +-- +2.36.0 + diff --git a/srcpkgs/klfc/patches/0003-More-fixes-for-GHC-9.0.patch b/srcpkgs/klfc/patches/0003-More-fixes-for-GHC-9.0.patch new file mode 100644 index 000000000000..e7a3d29979ff --- /dev/null +++ b/srcpkgs/klfc/patches/0003-More-fixes-for-GHC-9.0.patch @@ -0,0 +1,25 @@ +From ad4a431513470f8386dd7a8c28aeef35187193fe Mon Sep 17 00:00:00 2001 +From: Aldo Gunsing +Date: Fri, 17 Dec 2021 00:11:58 +0100 +Subject: [PATCH 3/6] More fixes for GHC 9.0 + +--- + src/Layout/Modifier.hs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Layout/Modifier.hs b/src/Layout/Modifier.hs +index 1fe456e..0d5e44c 100644 +--- a/src/Layout/Modifier.hs ++++ b/src/Layout/Modifier.hs +@@ -22,7 +22,7 @@ module Layout.Modifier + , activatedBy + ) where + +-import BasePrelude hiding (Alt, Control, empty, fromList) ++import BasePrelude hiding (Alt, Control, empty, fromList, singleton) + import Prelude.Unicode hiding ((∈)) + import Data.Foldable.Unicode ((∈)) + import Data.Monoid.Unicode ((∅), (⊕)) +-- +2.36.0 + diff --git a/srcpkgs/klfc/template b/srcpkgs/klfc/template new file mode 100644 index 000000000000..ab3de6761a41 --- /dev/null +++ b/srcpkgs/klfc/template @@ -0,0 +1,23 @@ +# Template file for 'klfc' +pkgname=klfc +version=1.5.7 +revision=1 +build_style=haskell-stack +stackage=nightly-2021-10-07 +short_desc="Keyboard layout files creator" +maintainer="Nadeŭka " +license=GPL-3.0-or-later +homepage=https://github.com/39aldo39/klfc +distfiles=https://github.com/39aldo39/klfc/archive/refs/tags/v$version.tar.gz +checksum=5a052c6f59917e99593e507e460e37b6633a388a43ef9ed0401b297c723c1eba +python_version=3 +nopie_files=/usr/bin/klfc +nocross="Cannot yet cross compile with Haskell" + +pre_install() { + vdoc README.md + vlicense LICENSE.txt + for i in doc/* examples; do + vcopy "$i" usr/share/doc/$pkgname + done +}