IreneKnapp / IreneKnapp/direct-sqlite

ICU extension flag

Open
#96 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
41
Forks
59
PR merge metrics
No merged PRs in 30d

Description

Hey,

I wanted to use SQLite with ICU enabled, so here's a patch to enable it. Perhaps useful to add to Direct-SQLite-proper, too.

diff --git a/direct-sqlite.cabal b/direct-sqlite.cabal
index deb5d30..67bcc4e 100644
--- a/direct-sqlite.cabal
+++ b/direct-sqlite.cabal
@@ -48,6 +48,10 @@ flag json1
   description: Enable json1 extension.
   default: True
 
+flag icu
+  description: Enable the ICU extension.
+  default: False
+
 Library
   exposed-modules:
     Database.SQLite3
@@ -86,6 +90,11 @@ Library
     if flag(json1) {
       cc-options: -DSQLITE_ENABLE_JSON1
     }
+
+    if flag(icu) {
+      cc-options: -DSQLITE_ENABLE_ICU
+      extra-libraries: icui18n icuuc icudata
+    }
   }
 
   include-dirs: .

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in direct-sqlite.cabal near the existing json1 flag and its conditional compiler options. Check how the library declares build flags and external libraries; done means an optional icu flag enables the ICU compiler definition and ICU libraries without changing the default build.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, sqlite
Domain
build-system
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.