Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHC 9.2 build by disabling broken poppler and hoodle-publish, handwriting recog using Google API #136

Merged
merged 6 commits into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
# ormolu 0.3.0.1
- uses: mrkkrp/ormolu-action@v4
hlint:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: rwe/actions-hlint-setup@v1
Expand Down
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ packages:
./publish/hoodle-publish.cabal
./core/hoodle-core.cabal
./hoodle/hoodle.cabal
./build-tools/hoodle-build-tools.cabal
-- ./build-tools/hoodle-build-tools.cabal
3 changes: 1 addition & 2 deletions core/hoodle-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Library
network-uri > 2.6,
network-simple >= 0.3,
pango > 0.12,
poppler >= 0.12.2.2,
-- poppler >= 0.12.2.2,
process >= 1.1,
pureMD5,
resourcet,
Expand Down Expand Up @@ -93,7 +93,6 @@ Library
Hoodle.Coroutine.Draw
Hoodle.Coroutine.Eraser
Hoodle.Coroutine.File
Hoodle.Coroutine.HandwritingRecognition
Hoodle.Coroutine.Highlighter
Hoodle.Coroutine.Layer
Hoodle.Coroutine.Link
Expand Down
1 change: 1 addition & 0 deletions core/src/Hoodle/Accessor.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-}

module Hoodle.Accessor where

Expand Down
7 changes: 3 additions & 4 deletions core/src/Hoodle/Coroutine/ContextMenu.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-}

module Hoodle.Coroutine.ContextMenu where

Expand Down Expand Up @@ -83,9 +84,6 @@ import Hoodle.Coroutine.Draw
waitSomeEvent,
)
import Hoodle.Coroutine.File (fileExtensionInvalid)
import Hoodle.Coroutine.HandwritingRecognition
( handwritingRecognitionDialog,
)
import Hoodle.Coroutine.Scroll
( adjustScrollbarWithGeometryCvsId,
)
Expand Down Expand Up @@ -284,7 +282,8 @@ processContextMenu (CMenuLaTeXUpdate (x0, y0) dim key) =
void $ runMaybeT (laTeXInputKeyword (x0, y0) (Just dim) key)
processContextMenu (CMenuCropImage imgbbox) = cropImage imgbbox
processContextMenu (CMenuExportHoodlet itm) = do
res <- handwritingRecognitionDialog
-- res <- handwritingRecognitionDialog
let res = Nothing
forM_ res $ \(b, txt) -> do
unless b $
liftIO $ do
Expand Down
7 changes: 2 additions & 5 deletions core/src/Hoodle/Coroutine/Default/Menu.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-incomplete-record-updates #-}

module Hoodle.Coroutine.Default.Menu where

import Control.Lens (set, view, (.~), _1)
import Control.Monad.IO.Class ()
import Control.Monad.State (get, gets, liftIO, modify, void, when)
import Control.Monad.State (get, gets, liftIO, modify, void)
import Data.Foldable (mapM_)
import Data.Hoodle.Generic (gbackground, gpages)
import Data.Hoodle.Select (gselAll)
import qualified Data.IntMap as M
import Data.Monoid ()
import qualified Data.Text as T
import Graphics.Hoodle.Render.Type
( RBackground (..),
isRBkgSmpl,
Expand Down Expand Up @@ -49,7 +49,6 @@ import Hoodle.Coroutine.File
fileShowUUID,
fileVersionSave,
)
import Hoodle.Coroutine.HandwritingRecognition (handwritingRecognitionDialog)
import Hoodle.Coroutine.LaTeX (laTeXFooter, laTeXHeader)
import Hoodle.Coroutine.Layer
( deleteCurrentLayer,
Expand Down Expand Up @@ -246,8 +245,6 @@ menuEventProcess MenuTogglePanZoomWidget = togglePanZoom . view (unitHoodles . c
menuEventProcess MenuToggleLayerWidget = toggleLayer . view (unitHoodles . currentUnit . currentCanvas . _1) =<< get
menuEventProcess MenuToggleClockWidget = toggleClock . view (unitHoodles . currentUnit . currentCanvas . _1) =<< get
menuEventProcess MenuToggleScrollWidget = toggleScroll . view (unitHoodles . currentUnit . currentCanvas . _1) =<< get
menuEventProcess MenuHandwritingRecognitionDialog =
handwritingRecognitionDialog >>= mapM_ (\(b, txt) -> when b $ embedHoodlet (T.unpack txt))
menuEventProcess MenuAddTab = addTab (LocalDir Nothing)
menuEventProcess MenuCloseTab = closeTab
menuEventProcess MenuEditNetEmbedTextSource = editNetEmbeddedTextSource
Expand Down
1 change: 1 addition & 0 deletions core/src/Hoodle/Coroutine/Dialog.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE LambdaCase #-}
{-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-}

module Hoodle.Coroutine.Dialog where

Expand Down
11 changes: 8 additions & 3 deletions core/src/Hoodle/Coroutine/File.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-unused-matches -fno-warn-incomplete-uni-patterns #-}

module Hoodle.Coroutine.File where

Expand Down Expand Up @@ -117,7 +118,7 @@ import Hoodle.ModelAction.Page
)
import Hoodle.ModelAction.Select (makePageSelectMode)
import Hoodle.ModelAction.Window (setTitleFromFileName)
import Hoodle.Publish.PDF (renderHoodleToPDF)
-- import Hoodle.Publish.PDF (renderHoodleToPDF)
import qualified Hoodle.Script.Coroutine as S
import Hoodle.Script.Hook
( fileNameSuggestionHook,
Expand Down Expand Up @@ -318,7 +319,8 @@ fileExport = fileChooser Gtk.FileChooserActionSave Nothing >>= maybe (return ())
then fileExtensionInvalid (".pdf", "export") >> fileExport
else do
hdl <- gets (rHoodle2Hoodle . getHoodle . view (unitHoodles . currentUnit))
liftIO (renderHoodleToPDF hdl filename)
-- liftIO (renderHoodleToPDF hdl filename)
liftIO $ putStrLn "renderHoodleToPDF is disabled for now."

-- | need to be merged with ContextMenuEventSVG
exportCurrentPageAsSVG :: MainCoroutine ()
Expand Down Expand Up @@ -645,14 +647,17 @@ mkRevisionHdlFile hdl = do

mkRevisionPdfFile :: Hoodle -> String -> IO ()
mkRevisionPdfFile hdl fname = do
hdir <- getHomeDirectory
putStrLn "mkRevisionPdfFile is disabled for now"

{- hdir <- getHomeDirectory
tempfile <- mkTmpFile "pdf"
renderHoodleToPDF hdl tempfile
let nfilename = fname <.> "pdf"
vcsdir = hdir </> ".hoodle.d" </> "vcs"
b <- doesDirectoryExist vcsdir
unless b $ createDirectory vcsdir
renameFile tempfile (vcsdir </> nfilename)
-}

-- |
fileVersionSave :: MainCoroutine ()
Expand Down
192 changes: 0 additions & 192 deletions core/src/Hoodle/Coroutine/HandwritingRecognition.hs

This file was deleted.

1 change: 1 addition & 0 deletions core/src/Hoodle/Coroutine/Minibuffer.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE LambdaCase #-}
{-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-}

module Hoodle.Coroutine.Minibuffer where

Expand Down
1 change: 1 addition & 0 deletions core/src/Hoodle/Coroutine/Page.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-}

module Hoodle.Coroutine.Page where

Expand Down
1 change: 1 addition & 0 deletions core/src/Hoodle/Coroutine/Pen.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE GADTs #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-}

module Hoodle.Coroutine.Pen where

Expand Down
1 change: 1 addition & 0 deletions core/src/Hoodle/Coroutine/Select.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiWayIf #-}
{-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-}

module Hoodle.Coroutine.Select where

Expand Down
1 change: 1 addition & 0 deletions core/src/Hoodle/Coroutine/Select/Clipboard.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE LambdaCase #-}
{-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-}

module Hoodle.Coroutine.Select.Clipboard where

Expand Down
Loading